]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Model/Amount/Conversion.hs
WIP : Format.Ledger.Read : Model.Transaction.Posting
[comptalang.git] / lib / Hcompta / Model / Amount / Conversion.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.Model.Amount.Conversion where
3
4 import Data.Data
5 import Data.Typeable ()
6
7 import qualified Hcompta.Model.Amount.Quantity as Quantity
8 import Hcompta.Model.Amount.Quantity (Quantity)
9 import qualified Hcompta.Model.Amount.Style as Style
10 import Hcompta.Model.Amount.Style (Style)
11 import qualified Hcompta.Model.Amount.Unit as Unit
12 import Hcompta.Model.Amount.Unit (Unit)
13 import qualified Hcompta.Model.Date as Date
14 import Hcompta.Model.Date (Date)
15
16 data Conversion
17 = Unit Quantity Unit Style
18 | Total Quantity Unit Style
19 deriving (Data, Eq, Ord, Read, Show, Typeable)
20
21 data Historical
22 = Historical
23 { amount :: (Quantity, Unit, Style)
24 , commodity :: Unit
25 , date :: Date
26 } deriving (Data, Eq, Read, Show, Typeable)
27
28 nil :: Maybe Conversion
29 nil = Nothing