From a22737bad6b1b867b888f086ac297ab4054292aa Mon Sep 17 00:00:00 2001 From: Lana Black Date: Thu, 3 Aug 2017 00:22:41 +0000 Subject: [PATCH] Replace data with newtype in Value and ValueList. --- src/Database/Esqueleto/Internal/Language.hs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index b3188da..4226170 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -16,7 +16,6 @@ module Database.Esqueleto.Internal.Language Esqueleto(..) , from , Value(..) - , unValue , ValueList(..) , SomeValue(..) , ToSomeValues(..) @@ -624,9 +623,7 @@ else_ = id -- | A single value (as opposed to a whole entity). You may use -- @('^.')@ or @('?.')@ to get a 'Value' from an 'Entity'. -data Value a = Value a deriving (Eq, Ord, Show, Typeable) --- Note: because of GHC bug #6124 we use @data@ instead of @newtype@. --- +newtype Value a = Value { unValue :: a } deriving (Eq, Ord, Show, Typeable) -- | /Since: 1.4.4/ @@ -634,19 +631,10 @@ instance Functor Value where fmap f (Value a) = Value (f a) --- | Unwrap a 'Value'. --- --- /Since: 1.4.1/ -unValue :: Value a -> a -unValue (Value a) = a - - -- | A list of single values. There's a limited set of functions -- able to work with this data type (such as 'subList_select', -- 'valList', 'in_' and 'exists'). -data ValueList a = ValueList a deriving (Eq, Ord, Show, Typeable) --- Note: because of GHC bug #6124 we use @data@ instead of @newtype@. --- +newtype ValueList a = ValueList a deriving (Eq, Ord, Show, Typeable) -- | A wrapper type for for any @expr (Value a)@ for all a.