From 1680145961545a3f2c2e184c2a5a661fb748d5a1 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Wed, 15 Jul 2015 18:42:17 +0200 Subject: Create stub functions for sugaring specialized types. --- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock') diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 2a820531..f54b7c22 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -540,7 +540,7 @@ ppInstanceSigs :: LinksInfo -> Splice -> Unicode -> Qualification ppInstanceSigs links splice unicode qual (InstSpec {..}) (InstHead {..}) = do TypeSig lnames (L sspan typ) _ <- ispecSigs let names = map unLoc lnames - let typ' = specializeTyVarBndrs ispecTyVars ihdTypes typ + let typ' = sugar $ specializeTyVarBndrs ispecTyVars ihdTypes typ return $ ppFunSig False links sspan noDocForDecl names typ' [] splice unicode qual diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs index fa5ba536..c10c7e6e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs @@ -4,6 +4,7 @@ module Haddock.Backends.Xhtml.Specialize ( specialize, specialize' , specializeTyVarBndrs + , sugar ) where @@ -40,3 +41,15 @@ specializeTyVarBndrs bndrs typs = bndrs' = map (bname . unLoc) . hsq_tvs $ bndrs bname (UserTyVar name) = name bname (KindedTyVar (L _ name) _) = name + + +sugar :: HsType name -> HsType name +sugar = sugarTuples . sugarLists + + +sugarLists :: HsType name -> HsType name +sugarLists = id + + +sugarTuples :: HsType name -> HsType name +sugarTuples = id -- cgit v1.2.3