on master help sign in
Data instance.
commitd2562daeef838e5806e158eea7b597d539abd76b authorNick <nick@typeable.io> dateTue 31 Jan 2023, 07:01 (4 years ago) parent4101a20
2 files changed+7−6
bucks.cabal+4−4 src/Data/Money/Internal.hs+3−2
bucks.cabal+4−4
@@ -10,7 +10,7 @@ maintainer: nick@typeable.io
1010category: Data
1111build-type: Simple
1212
13−source-repository: head
13+source-repository head
1414 type: git
1515 location: https://github.com/typeable/bucks.git
1616
@@ -42,15 +42,15 @@ library
4242 if flag(aeson)
4343 other-modules: Data.Money.JSON
4444 build-depends: aeson >= 2.0 && < 3.0
45− ghc-options: -DUSE_AESON
45+ cpp-options: -DUSE_AESON
4646 if flag(openapi)
4747 other-modules: Data.Money.OpenApi
4848 build-depends: openapi3
49− ghc-options: -DUSE_OPENAPI
49+ cpp-options: -DUSE_OPENAPI
5050 if flag(rel8)
5151 other-modules: Data.Money.Rel8
5252 build-depends: rel8 >= 1.4,
5353 scientific
54− ghc-options: -DUSE_REL8
54+ cpp-options: -DUSE_REL8
5555 hs-source-dirs: src
5656 default-language: Haskell2010
src/Data/Money/Internal.hs+3−2
@@ -1,5 +1,6 @@
11{-# LANGUAGE AllowAmbiguousTypes #-}
22{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE DeriveDataTypeable #-}
34{-# LANGUAGE DeriveGeneric #-}
45{-# LANGUAGE KindSignatures #-}
56{-# LANGUAGE ScopedTypeVariables #-}
@@ -11,9 +12,9 @@ module Data.Money.Internal ( Money(..)
1112 , (/%)
1213 ) where
1314
15+import Data.Data
1416import Data.Fixed (Centi)
1517import Data.Group
16−import Data.Proxy
1718import GHC.Generics
1819import GHC.TypeLits
1920import GHC.Stack (HasCallStack)
@@ -22,7 +23,7 @@ import GHC.Stack (HasCallStack)
2223-- The type parameter is phantom, you probably want to use 'Currency' there.
2324-- See also 'Data.Money.Currencies' for currency types.
2425newtype Money curr = Money { getAmount :: Centi }
25− deriving (Eq, Ord, Generic)
26+ deriving (Eq, Ord, Generic, Data)
2627
2728-- | Empty type, used only to carry its type parameter with a currency code around. E.g. 'Currency "USD"', 'Currency "GBP"', et cetera.
2829-- See Data.Money.Currencies for pre-defined currency types.