on master help sign in
Data instance.
d2562daNick
bucks.cabal+4−4
@@ -10,7 +10,7 @@ maintainer: nick@typeable.io
10category: Data
10category: Data
11build-type: Simple
11build-type: Simple
12
12
13−source-repository: head
13+source-repository head
14 type: git
14 type: git
15 location: https://github.com/typeable/bucks.git
15 location: https://github.com/typeable/bucks.git
16
16
@@ -42,15 +42,15 @@ library
42 if flag(aeson)
42 if flag(aeson)
43 other-modules: Data.Money.JSON
43 other-modules: Data.Money.JSON
44 build-depends: aeson >= 2.0 && < 3.0
44 build-depends: aeson >= 2.0 && < 3.0
45− ghc-options: -DUSE_AESON
45+ cpp-options: -DUSE_AESON
46 if flag(openapi)
46 if flag(openapi)
47 other-modules: Data.Money.OpenApi
47 other-modules: Data.Money.OpenApi
48 build-depends: openapi3
48 build-depends: openapi3
49− ghc-options: -DUSE_OPENAPI
49+ cpp-options: -DUSE_OPENAPI
50 if flag(rel8)
50 if flag(rel8)
51 other-modules: Data.Money.Rel8
51 other-modules: Data.Money.Rel8
52 build-depends: rel8 >= 1.4,
52 build-depends: rel8 >= 1.4,
53 scientific
53 scientific
54− ghc-options: -DUSE_REL8
54+ cpp-options: -DUSE_REL8
55 hs-source-dirs: src
55 hs-source-dirs: src
56 default-language: Haskell2010
56 default-language: Haskell2010
src/Data/Money/Internal.hs+3−2
@@ -1,5 +1,6 @@
1{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE KindSignatures #-}
5{-# LANGUAGE KindSignatures #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE ScopedTypeVariables #-}
@@ -11,9 +12,9 @@ module Data.Money.Internal ( Money(..)
11 , (/%)
12 , (/%)
12 ) where
13 ) where
13
14
15+import Data.Data
14import Data.Fixed (Centi)
16import Data.Fixed (Centi)
15import Data.Group
17import Data.Group
16−import Data.Proxy
17import GHC.Generics
18import GHC.Generics
18import GHC.TypeLits
19import GHC.TypeLits
19import GHC.Stack (HasCallStack)
20import GHC.Stack (HasCallStack)
@@ -22,7 +23,7 @@ import GHC.Stack (HasCallStack)
22-- The type parameter is phantom, you probably want to use 'Currency' there.
23-- The type parameter is phantom, you probably want to use 'Currency' there.
23-- See also 'Data.Money.Currencies' for currency types.
24-- See also 'Data.Money.Currencies' for currency types.
24newtype Money curr = Money { getAmount :: Centi }
25newtype Money curr = Money { getAmount :: Centi }
25− deriving (Eq, Ord, Generic)
26+ deriving (Eq, Ord, Generic, Data)
26
27
27-- | Empty type, used only to carry its type parameter with a currency code around. E.g. 'Currency "USD"', 'Currency "GBP"', et cetera.
28-- | Empty type, used only to carry its type parameter with a currency code around. E.g. 'Currency "USD"', 'Currency "GBP"', et cetera.
28-- See Data.Money.Currencies for pre-defined currency types.
29-- See Data.Money.Currencies for pre-defined currency types.