Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Account o = Account {
- accountKind :: !AccountKind
- accountObject :: !o
Documentation
Account model.
>>>
import Haspara.Accounting.AccountKind (AccountKind(..))
>>>
import qualified Data.Aeson as Aeson
>>>
let acc = Account AccountKindAsset (1 ::Int)
>>>
Aeson.encode acc
"{\"kind\":\"ASSET\",\"object\":1}">>>
Aeson.decode (Aeson.encode acc) :: Maybe (Account Int)
Just (Account {accountKind = AccountKindAsset, accountObject = 1})>>>
Aeson.decode (Aeson.encode acc) == Just acc
True
Account | |
|
Instances
Eq o => Eq (Account o) Source # | |
Ord o => Ord (Account o) Source # | |
Defined in Haspara.Accounting.Account | |
Show o => Show (Account o) Source # | |
Generic (Account o) Source # | |
Hashable o => Hashable (Account o) Source # | |
Defined in Haspara.Accounting.Account | |
ToJSON o => ToJSON (Account o) Source # | |
Defined in Haspara.Accounting.Account | |
FromJSON o => FromJSON (Account o) Source # | |
type Rep (Account o) Source # | |
Defined in Haspara.Accounting.Account type Rep (Account o) = D1 ('MetaData "Account" "Haspara.Accounting.Account" "haspara-0.0.0.1-GIZpgp6So3jGG6B29GnUaf" 'False) (C1 ('MetaCons "Account" 'PrefixI 'True) (S1 ('MetaSel ('Just "accountKind") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AccountKind) :*: S1 ('MetaSel ('Just "accountObject") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 o))) |