buchhaltung-0.0.7: Automates most of your plain text accounting data entry in ledger format.

Safe HaskellNone
LanguageHaskell2010

Buchhaltung.Types

Contents

Synopsis

Documentation

Monad used for most of the funtionality

type CommonM env = RWST (FullOptions env) () () (ErrorT IO) #

The Source of an imported transaction

type Version = Text #

data SFormat a #

Constructors

SFormat 

Fields

Instances

Functor SFormat # 

Methods

fmap :: (a -> b) -> SFormat a -> SFormat b #

(<$) :: a -> SFormat b -> SFormat a #

Eq a => Eq (SFormat a) # 

Methods

(==) :: SFormat a -> SFormat a -> Bool #

(/=) :: SFormat a -> SFormat a -> Bool #

Ord a => Ord (SFormat a) # 

Methods

compare :: SFormat a -> SFormat a -> Ordering #

(<) :: SFormat a -> SFormat a -> Bool #

(<=) :: SFormat a -> SFormat a -> Bool #

(>) :: SFormat a -> SFormat a -> Bool #

(>=) :: SFormat a -> SFormat a -> Bool #

max :: SFormat a -> SFormat a -> SFormat a #

min :: SFormat a -> SFormat a -> SFormat a #

Read a => Read (SFormat a) # 
Show a => Show (SFormat a) # 

Methods

showsPrec :: Int -> SFormat a -> ShowS #

show :: SFormat a -> String #

showList :: [SFormat a] -> ShowS #

Generic (SFormat a) # 

Associated Types

type Rep (SFormat a) :: * -> * #

Methods

from :: SFormat a -> Rep (SFormat a) x #

to :: Rep (SFormat a) x -> SFormat a #

Hashable a => Hashable (SFormat a) # 

Methods

hashWithSalt :: Int -> SFormat a -> Int #

hash :: SFormat a -> Int #

type Rep (SFormat a) # 
type Rep (SFormat a) = D1 * (MetaData "SFormat" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) (C1 * (MetaCons "SFormat" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "fName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "fVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a))))

data Source #

represents a key value store and a protocol

Constructors

Source 

fromMapToSource :: SFormat Version -> HashMap Text Text -> Source #

Creates a Source from non null values of a HashMap (e.g. from MyRecord)

sourceToMap :: Source -> Map Text Text #

produces a map that includes sFormat under the keys "formatName" and "formatVersion"

Import Tag

newtype ImportTag #

Constructors

ImportTag 

Fields

Instances

Show ImportTag # 
IsString ImportTag # 
Generic ImportTag # 

Associated Types

type Rep ImportTag :: * -> * #

Default ImportTag # 

Methods

def :: ImportTag #

type Rep ImportTag # 
type Rep ImportTag = D1 * (MetaData "ImportTag" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" True) (C1 * (MetaCons "ImportTag" PrefixI True) (S1 * (MetaSel (Just Symbol "fromImportTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Text)))

Error handling

type Msg = Text #

type Error = Either Msg #

throwFormat :: MonadError Msg m => Format Text t -> (t -> Msg) -> m b #

maybeThrow :: MonadError Msg m => Format Text t -> (t -> Msg) -> (a1 -> m b) -> Maybe a1 -> m b #

lookupErrD #

Arguments

:: Show t 
=> [Char]

additional description

-> (t -> t1 -> Maybe a)

lookup function

-> t

lookup arg2

-> t1

lookup arg2

-> a 

lookupErrM :: (MonadError Msg m, Show a) => String -> (a -> t -> Maybe b) -> a -> t -> m b #

fromListUnique :: (MonadError Msg m, Show k, Ord k) => [(k, a)] -> m (Map k a) #

Options

data Options user config env #

Constructors

Options 

Fields

Instances

(Show env, Show config, Show user) => Show (Options user config env) # 

Methods

showsPrec :: Int -> Options user config env -> ShowS #

show :: Options user config env -> String #

showList :: [Options user config env] -> ShowS #

Generic (Options user config env) # 

Associated Types

type Rep (Options user config env) :: * -> * #

Methods

from :: Options user config env -> Rep (Options user config env) x #

to :: Rep (Options user config env) x -> Options user config env #

(NFData env, NFData config, NFData user) => NFData (Options user config env) # 

Methods

rnf :: Options user config env -> () #

type Rep (Options user config env) # 

toFull :: MonadError Msg m => RawOptions env -> Config -> m (FullOptions env) #

Reading options

readConfig :: MonadReader (Options user config env) m => (config -> a) -> m a #

readUser :: MonadReader (Options user config env) m => (user -> a) -> m a #

user :: MonadReader (Options user config env) m => m user #

readLedger :: MonadReader (Options User config env) m => (Ledgers -> a) -> m a #

absolute :: MonadReader (Options user config env) m => FilePath -> m FilePath #

get absolute paths in profile dir

Config

data Config #

User

data User #

Constructors

User 

Fields

Instances

Eq User # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

Generic User # 

Associated Types

type Rep User :: * -> * #

Methods

from :: User -> Rep User x #

to :: Rep User x -> User #

FromJSON User # 
type Rep User # 

Reading User settings

lookupUser :: (MonadError Msg m, MonadReader (Options user Config e) m) => Username -> m User #

Looks up a user and throws an error if they do not exist.

defaultUser #

Arguments

:: (MonadError Msg m, MonadReader (Options user Config e) m) 
=> Int

default position in user list

-> m User 

A User's ledger files

data Ledgers #

Constructors

Ledgers 

Fields

Instances

Eq Ledgers # 

Methods

(==) :: Ledgers -> Ledgers -> Bool #

(/=) :: Ledgers -> Ledgers -> Bool #

Ord Ledgers # 
Show Ledgers # 
Generic Ledgers # 

Associated Types

type Rep Ledgers :: * -> * #

Methods

from :: Ledgers -> Rep Ledgers x #

to :: Rep Ledgers x -> Ledgers #

FromJSON Ledgers # 
Default Ledgers # 

Methods

def :: Ledgers #

type Rep Ledgers # 

receivablePayable #

Arguments

:: (MonadError Msg m, MonadReader (FullOptions env) m) 
=> Bool

TRUE | FALSE = for (this | the other) user's ledger

-> User

the other user

-> m Text 

generates the receiable/payable account for between two users (suffixed by the current, the recording, user)

A user's bank accounts

newtype BankAccounts #

Constructors

BankAccounts 

Instances

data Regex #

Constructors

Regex 

Fields

AQBanking

data AQBankingConf #

Instances

Eq AQBankingConf # 
Ord AQBankingConf # 
Show AQBankingConf # 
Generic AQBankingConf # 

Associated Types

type Rep AQBankingConf :: * -> * #

FromJSON AQBankingConf # 
Default AQBankingConf # 

Methods

def :: AQBankingConf #

type Rep AQBankingConf # 
type Rep AQBankingConf = D1 * (MetaData "AQBankingConf" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) (C1 * (MetaCons "AQBankingConf" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "connections") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [AQConnection])) (S1 * (MetaSel (Just Symbol "configDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FilePath))) ((:*:) * (S1 * (MetaSel (Just Symbol "aqBankingExecutable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe FilePath))) (S1 * (MetaSel (Just Symbol "aqhbciToolExecutable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe FilePath))))))

data AQConnection #

Constructors

AQConnection 

Instances

Eq AQConnection # 
Ord AQConnection # 
Show AQConnection # 
Generic AQConnection # 

Associated Types

type Rep AQConnection :: * -> * #

ToJSON AQConnection # 
FromJSON AQConnection # 
type Rep AQConnection # 

data AQType #

other modes have to be setup manually. Refer to the AQBanking manual. Use the '-C' to point to the configured configDir.

Constructors

PinTan 
Other 

Instances

Eq AQType # 

Methods

(==) :: AQType -> AQType -> Bool #

(/=) :: AQType -> AQType -> Bool #

Ord AQType # 
Show AQType # 
Generic AQType # 

Associated Types

type Rep AQType :: * -> * #

Methods

from :: AQType -> Rep AQType x #

to :: Rep AQType x -> AQType #

ToJSON AQType # 
FromJSON AQType # 
type Rep AQType # 
type Rep AQType = D1 * (MetaData "AQType" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) ((:+:) * (C1 * (MetaCons "PinTan" PrefixI False) (U1 *)) (C1 * (MetaCons "Other" PrefixI False) (U1 *)))

data HBCIv #

Constructors

HBCI201 
HBCI210 
HBCI220 
HBCI300 

Instances

Eq HBCIv # 

Methods

(==) :: HBCIv -> HBCIv -> Bool #

(/=) :: HBCIv -> HBCIv -> Bool #

Ord HBCIv # 

Methods

compare :: HBCIv -> HBCIv -> Ordering #

(<) :: HBCIv -> HBCIv -> Bool #

(<=) :: HBCIv -> HBCIv -> Bool #

(>) :: HBCIv -> HBCIv -> Bool #

(>=) :: HBCIv -> HBCIv -> Bool #

max :: HBCIv -> HBCIv -> HBCIv #

min :: HBCIv -> HBCIv -> HBCIv #

Show HBCIv # 

Methods

showsPrec :: Int -> HBCIv -> ShowS #

show :: HBCIv -> String #

showList :: [HBCIv] -> ShowS #

Generic HBCIv # 

Associated Types

type Rep HBCIv :: * -> * #

Methods

from :: HBCIv -> Rep HBCIv x #

to :: Rep HBCIv x -> HBCIv #

ToJSON HBCIv # 
FromJSON HBCIv # 
type Rep HBCIv # 
type Rep HBCIv = D1 * (MetaData "HBCIv" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) ((:+:) * ((:+:) * (C1 * (MetaCons "HBCI201" PrefixI False) (U1 *)) (C1 * (MetaCons "HBCI210" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "HBCI220" PrefixI False) (U1 *)) (C1 * (MetaCons "HBCI300" PrefixI False) (U1 *))))

toArg :: IsString p => HBCIv -> p #

Actions

data Action #

Constructors

Add 

Fields

Match 
Import 
Update 

Fields

Commit 

Fields

ListBalances 
Setup 
Ledger 

Fields

HLedger 

Fields

AQBanking 

Fields

Instances

Show Action # 
Generic Action # 

Associated Types

type Rep Action :: * -> * #

Methods

from :: Action -> Rep Action x #

to :: Rep Action x -> Action #

NFData Action # 

Methods

rnf :: Action -> () #

type Rep Action # 
type Rep Action = D1 * (MetaData "Action" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Add" PrefixI True) (S1 * (MetaSel (Just Symbol "aPartners") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [Username]))) (C1 * (MetaCons "Match" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "Import" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "iVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Version))) ((:*:) * (S1 * (MetaSel (Just Symbol "iPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FilePath)) (S1 * (MetaSel (Just Symbol "iAction") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ImportAction))))) ((:+:) * (C1 * (MetaCons "Update" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "aqVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Version))) ((:*:) * (S1 * (MetaSel (Just Symbol "aqMatch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "aqRequest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))))) (C1 * (MetaCons "Commit" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "hledger") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "cArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String]))))))) ((:+:) * ((:+:) * (C1 * (MetaCons "ListBalances" PrefixI False) (U1 *)) (C1 * (MetaCons "Setup" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "Ledger" PrefixI True) (S1 * (MetaSel (Just Symbol "lArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String]))) ((:+:) * (C1 * (MetaCons "HLedger" PrefixI True) (S1 * (MetaSel (Just Symbol "hlArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String]))) (C1 * (MetaCons "AQBanking" PrefixI True) (S1 * (MetaSel (Just Symbol "aqArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [String])))))))

data ImportAction #

Instances

Show ImportAction # 
Generic ImportAction # 

Associated Types

type Rep ImportAction :: * -> * #

NFData ImportAction # 

Methods

rnf :: ImportAction -> () #

type Rep ImportAction # 

data MonefySettings #

Instances

Show MonefySettings # 
Generic MonefySettings # 

Associated Types

type Rep MonefySettings :: * -> * #

NFData MonefySettings # 

Methods

rnf :: MonefySettings -> () #

type Rep MonefySettings # 
type Rep MonefySettings = D1 * (MetaData "MonefySettings" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) (C1 * (MetaCons "MonefySettings" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "monefyInstallation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "monefyCategorySuffix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool))))

data RevolutSettings a #

Constructors

RevolutSettings 

Instances

Functor RevolutSettings # 

Methods

fmap :: (a -> b) -> RevolutSettings a -> RevolutSettings b #

(<$) :: a -> RevolutSettings b -> RevolutSettings a #

Show a => Show (RevolutSettings a) # 
Generic (RevolutSettings a) # 

Associated Types

type Rep (RevolutSettings a) :: * -> * #

NFData a => NFData (RevolutSettings a) # 

Methods

rnf :: RevolutSettings a -> () #

type Rep (RevolutSettings a) # 
type Rep (RevolutSettings a) = D1 * (MetaData "RevolutSettings" "Buchhaltung.Types" "buchhaltung-0.0.7-Ga2ZCsT2cnD8kr8zZSzqbu" False) (C1 * (MetaCons "RevolutSettings" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "revolutCurrency") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)) (S1 * (MetaSel (Just Symbol "revolutUser") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Text))))

Misc

type Comment = Text #

Orphan instances

(Hashable a, Eq a) => Default (HashMap a b) # 

Methods

def :: HashMap a b #