diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2013-06-21 13:54:49 +0100 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2013-06-21 13:54:49 +0100 |
commit | 569b26526403df4d88fe2a6d64c7dade09d003ad (patch) | |
tree | f216a5ceaf5d655248564abefab6765aaa9da37d /ghc | |
parent | 11db9cf82e014de43d8ab04947ef2a2b7fa30f37 (diff) | |
download | haskell-569b26526403df4d88fe2a6d64c7dade09d003ad.tar.gz |
Revise implementation of overlapping type family instances.
This commit changes the syntax and story around overlapping type
family instances. Before, we had "unbranched" instances and
"branched" instances. Now, we have closed type families and
open ones.
The behavior of open families is completely unchanged. In particular,
coincident overlap of open type family instances still works, despite
emails to the contrary.
A closed type family is declared like this:
> type family F a where
> F Int = Bool
> F a = Char
The equations are tried in order, from top to bottom, subject to
certain constraints, as described in the user manual. It is not
allowed to declare an instance of a closed family.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/InteractiveUI.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 7aaa1f1571..4ff822f03b 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1047,7 +1047,7 @@ filterOutChildren get_thing xs Nothing -> False pprInfo :: PrintExplicitForalls - -> (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst GHC.Branched]) -> SDoc + -> (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst]) -> SDoc pprInfo pefas (thing, fixity, cls_insts, fam_insts) = pprTyThingInContextLoc pefas thing $$ show_fixity @@ -2215,7 +2215,7 @@ showBindings = do return $ maybe (text "") (pprTT pefas) mb_stuff pprTT :: PrintExplicitForalls - -> (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst GHC.Branched]) -> SDoc + -> (TyThing, Fixity, [GHC.ClsInst], [GHC.FamInst]) -> SDoc pprTT pefas (thing, fixity, _cls_insts, _fam_insts) = pprTyThing pefas thing $$ show_fixity |