From ae39c5c040f121947e14877c3ceb47bbe80c0ccb Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 5 Feb 2015 17:42:36 -0600 Subject: 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 --- libraries/base/GHC/Generics.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libraries') 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... -- cgit v1.2.1