Skip to content

Commit 66372d6

Browse files
committed
UUID deriving Generic
1 parent 716d80a commit 66372d6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

uuid-types/Data/UUID/Types/Internal.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, CPP #-}
1+
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, CPP, DeriveGeneric #-}
22
{-# OPTIONS_HADDOCK hide #-}
33

44
-- |
@@ -47,6 +47,7 @@ import Data.Bits
4747
import Data.Hashable
4848
import Data.List (elemIndices)
4949
import Foreign.Ptr (Ptr)
50+
import GHC.Generics (Generic)
5051

5152
#if MIN_VERSION_base(4,0,0)
5253
import Data.Data
@@ -81,7 +82,8 @@ data UUID
8182
{-# UNPACK #-} !Word32
8283
{-# UNPACK #-} !Word32
8384
{-# UNPACK #-} !Word32
84-
deriving (Eq, Ord, Typeable)
85+
deriving (Eq, Generic, Ord, Typeable)
86+
8587
{-
8688
Other representations that we tried are:
8789
Mimic V1 structure: !Word32 !Word16 !Word16 !Word16

uuid-types/uuid-types.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Source-Repository head
2929
Subdir: uuid-types
3030

3131
Library
32+
if impl(ghc)
33+
Build-Depends: ghc-prim
3234
Build-Depends: base >= 3 && < 5,
3335
binary >= 0.4 && < 0.9,
3436
bytestring >= 0.9 && < 0.11,

0 commit comments

Comments
 (0)