on master help sign in
Add some haddock comments.
f895f1bNick
src/Data/Money/Internal.hs+6
@@ -15,11 +15,17 @@ import Data.Proxy
15import GHC.Generics
15import GHC.Generics
16import GHC.TypeLits
16import GHC.TypeLits
17
17
18+-- | Money type. This is actually 'Centi' from 'Data.Fixed' in disguise.
19+-- The type parameter is phantom, you probably want to use 'Currency' there.
20+-- See also 'Data.Money.Currencies' for currency types.
18newtype Money curr = Money { getAmount :: Centi }
21newtype Money curr = Money { getAmount :: Centi }
19 deriving (Eq, Ord, Generic)
22 deriving (Eq, Ord, Generic)
20
23
24+-- | Empty type, used only to carry its type parameter with a currency code around. E.g. 'Currency "USD"', 'Currency "GBP"', et cetera.
25+-- See Data.Money.Currencies for pre-defined currency types.
21data Currency (name :: Symbol)
26data Currency (name :: Symbol)
22
27
28+-- | Statically known currency type class.
23class KnownCurrency c where
29class KnownCurrency c where
24 currencyCode :: String
30 currencyCode :: String
25
31