haspara-0.0.0.1: A library providing definitions to work with monetary values.
Safe HaskellNone
LanguageHaskell2010

Haspara.Accounting.Account

Synopsis

Documentation

data Account o Source #

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

Constructors

Account 

Instances

Instances details
Eq o => Eq (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

Methods

(==) :: Account o -> Account o -> Bool #

(/=) :: Account o -> Account o -> Bool #

Ord o => Ord (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

Methods

compare :: Account o -> Account o -> Ordering #

(<) :: Account o -> Account o -> Bool #

(<=) :: Account o -> Account o -> Bool #

(>) :: Account o -> Account o -> Bool #

(>=) :: Account o -> Account o -> Bool #

max :: Account o -> Account o -> Account o #

min :: Account o -> Account o -> Account o #

Show o => Show (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

Methods

showsPrec :: Int -> Account o -> ShowS #

show :: Account o -> String #

showList :: [Account o] -> ShowS #

Generic (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

Associated Types

type Rep (Account o) :: Type -> Type #

Methods

from :: Account o -> Rep (Account o) x #

to :: Rep (Account o) x -> Account o #

Hashable o => Hashable (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

Methods

hashWithSalt :: Int -> Account o -> Int #

hash :: Account o -> Int #

ToJSON o => ToJSON (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

FromJSON o => FromJSON (Account o) Source # 
Instance details

Defined in Haspara.Accounting.Account

type Rep (Account o) Source # 
Instance details

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)))