aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Convert.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-09-06 18:57:45 +0000
committerDavid Waern <david.waern@gmail.com>2009-09-06 18:57:45 +0000
commitca0fb976d773c8bb1b4710ff1e32bb3363b6c4f0 (patch)
tree27c5e2eab11949785ebf4fcc2ca4a1fb661a7e09 /src/Haddock/Convert.hs
parent6870e6ded2380a9a3749795980631e16e0c1406d (diff)
Move toHsInstHead to Haddock.Convert and call it synifyInstHead
Diffstat (limited to 'src/Haddock/Convert.hs')
-rw-r--r--src/Haddock/Convert.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs
index e1f9493a..277b42a4 100644
--- a/src/Haddock/Convert.hs
+++ b/src/Haddock/Convert.hs
@@ -20,7 +20,7 @@ import BasicTypes
import TysPrim ( alphaTyVars )
import TysWiredIn ( listTyConName )
import Bag ( emptyBag )
-import SrcLoc ( Located, noLoc )
+import SrcLoc ( Located, noLoc, unLoc )
-- the main function here! yay!
tyThingToLHsDecl :: TyThing -> LHsDecl Name
@@ -275,3 +275,10 @@ synifyType s forallty@(ForAllTy _tv _ty) =
in noLoc $
HsForAllTy forallPlicitness sTvs sCtx sTau
+synifyInstHead :: ([TyVar], [PredType], Class, [Type]) ->
+ ([HsPred Name], Name, [HsType Name])
+synifyInstHead (_, preds, cls, ts) =
+ ( map (unLoc . synifyPred) preds
+ , getName cls
+ , map (unLoc . synifyType WithinType) ts
+ )