aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs6
-rw-r--r--haddock-api/src/Haddock/Types.hs17
2 files changed, 18 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
index 37632ee7..4e68cb7b 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Specialize.hs
@@ -11,6 +11,7 @@ module Haddock.Backends.Xhtml.Specialize
import Haddock.Syb
+import Haddock.Types
import GHC
import Name
@@ -102,11 +103,6 @@ parseTupleArity ('(':commas) = do
parseTupleArity _ = Nothing
-class NamedThing name => SetName name where
-
- setName :: Name -> name -> name
-
-
setInternalOccName :: SetName name => OccName -> name -> name
setInternalOccName occ name =
setName nname' name
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 76164b5e..c5ca31c0 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -301,6 +301,23 @@ instance NamedThing DocName where
getName (Undocumented name) = name
+class NamedThing name => SetName name where
+
+ setName :: Name -> name -> name
+
+
+instance SetName Name where
+
+ setName name' _ = name'
+
+
+instance SetName DocName where
+
+ setName name' (Documented _ mdl) = Documented name' mdl
+ setName name' (Undocumented _) = Undocumented name'
+
+
+
-----------------------------------------------------------------------------
-- * Instances
-----------------------------------------------------------------------------