summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2015-02-05 17:42:36 -0600
committerAustin Seipp <austin@well-typed.com>2015-02-05 17:42:36 -0600
commitae39c5c040f121947e14877c3ceb47bbe80c0ccb (patch)
treeb81d499bb2e4ffffd0b1c2b9774c47f10ccf00b4 /libraries
parentd4f25cb151db1a539aab66b26ccca4d166562b22 (diff)
downloadhaskell-ae39c5c040f121947e14877c3ceb47bbe80c0ccb.tar.gz
Add packageName to GHC.Generics.Datatype
Summary: Added packageName to GHC.Generics.Datatype class definition Reviewers: hvr, dreixel, austin Reviewed By: dreixel, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D631 GHC Trac Issues: #10030
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Generics.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs
index b89d628526..39700051ea 100644
--- a/libraries/base/GHC/Generics.hs
+++ b/libraries/base/GHC/Generics.hs
@@ -648,6 +648,8 @@ class Datatype d where
datatypeName :: t d (f :: * -> *) a -> [Char]
-- | The fully-qualified name of the module where the type is declared
moduleName :: t d (f :: * -> *) a -> [Char]
+ -- | The package name of the module where the type is declared
+ packageName :: t d (f :: * -> *) a -> [Char]
-- | Marks if the datatype is actually a newtype
isNewtype :: t d (f :: * -> *) a -> Bool
isNewtype _ = False
@@ -756,6 +758,7 @@ data C_Int
instance Datatype D_Int where
datatypeName _ = "Int"
moduleName _ = "GHC.Int"
+ packageName _ = "base"
instance Constructor C_Int where
conName _ = "" -- JPM: I'm not sure this is the right implementation...
@@ -773,6 +776,7 @@ data C_Float
instance Datatype D_Float where
datatypeName _ = "Float"
moduleName _ = "GHC.Float"
+ packageName _ = "base"
instance Constructor C_Float where
conName _ = "" -- JPM: I'm not sure this is the right implementation...
@@ -790,6 +794,7 @@ data C_Double
instance Datatype D_Double where
datatypeName _ = "Double"
moduleName _ = "GHC.Float"
+ packageName _ = "base"
instance Constructor C_Double where
conName _ = "" -- JPM: I'm not sure this is the right implementation...
@@ -807,6 +812,7 @@ data C_Char
instance Datatype D_Char where
datatypeName _ = "Char"
moduleName _ = "GHC.Base"
+ packageName _ = "base"
instance Constructor C_Char where
conName _ = "" -- JPM: I'm not sure this is the right implementation...