From 66372d622b821d7083d031e4d9081c1671ecde05 Mon Sep 17 00:00:00 2001 From: pmlodawski Date: Tue, 10 Jan 2017 14:38:49 +0100 Subject: [PATCH] UUID deriving Generic --- uuid-types/Data/UUID/Types/Internal.hs | 6 ++++-- uuid-types/uuid-types.cabal | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/uuid-types/Data/UUID/Types/Internal.hs b/uuid-types/Data/UUID/Types/Internal.hs index 2f72d22..994fd68 100644 --- a/uuid-types/Data/UUID/Types/Internal.hs +++ b/uuid-types/Data/UUID/Types/Internal.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, TypeFamilies, CPP #-} +{-# LANGUAGE DeriveDataTypeable, TypeFamilies, CPP, DeriveGeneric #-} {-# OPTIONS_HADDOCK hide #-} -- | @@ -47,6 +47,7 @@ import Data.Bits import Data.Hashable import Data.List (elemIndices) import Foreign.Ptr (Ptr) +import GHC.Generics (Generic) #if MIN_VERSION_base(4,0,0) import Data.Data @@ -81,7 +82,8 @@ data UUID {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 {-# UNPACK #-} !Word32 - deriving (Eq, Ord, Typeable) + deriving (Eq, Generic, Ord, Typeable) + {- Other representations that we tried are: Mimic V1 structure: !Word32 !Word16 !Word16 !Word16 diff --git a/uuid-types/uuid-types.cabal b/uuid-types/uuid-types.cabal index 32c4bea..1584b8f 100644 --- a/uuid-types/uuid-types.cabal +++ b/uuid-types/uuid-types.cabal @@ -29,6 +29,8 @@ Source-Repository head Subdir: uuid-types Library + if impl(ghc) + Build-Depends: ghc-prim Build-Depends: base >= 3 && < 5, binary >= 0.4 && < 0.9, bytestring >= 0.9 && < 0.11,