-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Automates most of your plain text accounting data entry in ledger format.
--   
--   Automatic import and deduplication (from CSV/FinTS/HBCI/OFX), bayesian
--   account matching, and efficient manual entry of <a>ledger</a>
--   transactions.
--   
--   See <a>Readme</a> on Github.
@package buchhaltung
@version 0.0.7

module Buchhaltung.Utils

-- | apply a funtion to the ith element of a list
modifyNth :: (a -> a) -> Int -> [a] -> [a]
fshow :: (Show a, IsString b) => a -> b
intercalateL :: (ListLike a item, ListLike b a) => a -> b -> a
map2 :: Arrow a => a b' c' -> a (b', b') (c', c')
withFileM :: (MonadIO m, MonadBaseControl IO m) => FilePath -> IOMode -> (Handle -> m r) -> m r
withSystemTempFile :: (MonadBaseControl IO m, MonadIO m) => String -> (FilePath -> Handle -> m b) -> m b
withSystemTempDirectory :: (MonadBaseControl IO m, MonadIO m) => String -> (FilePath -> m b) -> m b
withTempDirectory :: (MonadIO m, MonadBaseControl IO m) => FilePath -> String -> (FilePath -> m c) -> m c
withTempFile :: (MonadIO m, MonadBaseControl IO m) => FilePath -> String -> (FilePath -> Handle -> m c) -> m c
ignoringIOErrors :: MonadBaseControl IO m => m () -> m ()
mconcat' :: Monoid t => [t] -> t
(<&>) :: Functor f => (a -> b) -> f a -> f b
infixr 0 <&>
readProcess' :: FilePath -> [String] -> IO String

module Buchhaltung.Types
type CommonM env = RWST (FullOptions env) () () (ErrorT IO)
type Version = Text
data SFormat a
SFormat :: Text -> a -> SFormat a
[fName] :: SFormat a -> Text
[fVersion] :: SFormat a -> a

-- | represents a key value store and a protocol
data Source
Source :: SFormat Version -> Map Text Text -> Source
[sFormat] :: Source -> SFormat Version
[sStore] :: Source -> Map Text Text

-- | Creates a <a>Source</a> from non null values of a HashMap (e.g. from
--   <tt>MyRecord</tt>)
fromMapToSource :: SFormat Version -> HashMap Text Text -> Source

-- | produces a map that includes <a>sFormat</a> under the keys
--   <tt>"formatName"</tt> and <tt>"formatVersion"</tt>
sourceToMap :: Source -> Map Text Text
formatToAssoc :: IsString a => SFormat Text -> [(a, Text)]
json :: Source -> Text
stripPrefixOptions :: Int -> Options
newtype ImportTag
ImportTag :: Text -> ImportTag
[fromImportTag] :: ImportTag -> Text
type Msg = Text
type Error = Either Msg
type ErrorT = ExceptT 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 :: Show t => [Char] -> (t -> t1 -> Maybe a) -> t -> t1 -> 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)
data Options user config env
Options :: user -> FilePath -> Action -> config -> env -> Options user config env
[oUser] :: Options user config env -> user
[oProfile] :: Options user config env -> FilePath
[oAction] :: Options user config env -> Action
[oConfig] :: Options user config env -> config
[oEnv] :: Options user config env -> env
type FullOptions = Options User Config
type RawOptions = Options (Maybe Username) ()
toFull :: MonadError Msg m => RawOptions env -> Config -> m (FullOptions env)
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

-- | get absolute paths in profile dir
absolute :: MonadReader (Options user config env) m => FilePath -> m FilePath
data Config
Config :: Users -> Vector Username -> ImportTag -> AccountName -> FilePath -> FilePath -> FilePath -> Config
[cUsers] :: Config -> Users
[cUserList] :: Config -> Vector Username
[cImportTag] :: Config -> ImportTag

-- | account for unmatched imported transactions
[cTodoAccount] :: Config -> AccountName
[cDbaclExecutable] :: Config -> FilePath
[cLedgerExecutable] :: Config -> FilePath
[cHledgerExecutable] :: Config -> FilePath
askTag :: MonadReader (Options user Config env) m => m ImportTag
askTodoFilter :: MonadReader (Options user Config env) m => m (AccountName -> Bool)
readConfigFromFile :: FilePath -> IO Config
data User
User :: Username -> Ledgers -> Maybe AccountName -> Maybe AQBankingConf -> Maybe BankAccounts -> Maybe [Regex] -> Maybe [Regex] -> Maybe Int -> Maybe Bool -> User
[name] :: User -> Username
[ledgers] :: User -> Ledgers

-- | the account prefix for accounts receivable or payable (depending on
--   current balance) to other users
[accountPrefixOthers] :: User -> Maybe AccountName
[aqBanking] :: User -> Maybe AQBankingConf
[bankAccounts] :: User -> Maybe BankAccounts
[ignoredAccountsOnAdd] :: User -> Maybe [Regex]
[ignoredAccountsOnMatch] :: User -> Maybe [Regex]
[numSuggestedAccounts] :: User -> Maybe Int
[reverseAccountInput] :: User -> Maybe Bool
type Users = HashMap Username User
newtype Username
Username :: Text -> Username
fromUsername :: Username -> Text

-- | Looks up a user and throws an error if they do not exist.
lookupUser :: (MonadError Msg m, MonadReader (Options user Config e) m) => Username -> m User
defaultUser :: (MonadError Msg m, MonadReader (Options user Config e) m) => Int -> m User
data Ledgers
Ledgers :: FilePath -> FilePath -> Maybe FilePath -> FilePath -> Maybe FilePath -> Ledgers
[imported] :: Ledgers -> FilePath
[addedByThisUser] :: Ledgers -> FilePath
[addedByOthers] :: Ledgers -> Maybe FilePath

-- | ledger file for <tt>ledger</tt> CLI
[mainLedger] :: Ledgers -> FilePath

-- | ledger file for <a>hledger</a> CLI
[mainHledger] :: Ledgers -> Maybe FilePath

-- | generates the receiable/payable account for between two users
--   (suffixed by the current, the recording, user)
receivablePayable :: (MonadError Msg m, MonadReader (FullOptions env) m) => Bool -> User -> m Text
askAccountMap :: MonadReader (Options User config env) m => m AccountMap
newtype BankAccounts
BankAccounts :: AccountMap -> BankAccounts
[fromBankAccounts] :: BankAccounts -> AccountMap
isIgnored :: Maybe [Regex] -> AccountName -> Bool
data Regex
Regex :: Text -> Regex -> Regex
[rShow] :: Regex -> Text
[rRegex] :: Regex -> Regex
data AccountId
AccountId :: Text -> Text -> AccountId
[aBank] :: AccountId -> Text
[aAccount] :: AccountId -> Text
type AccountMap = HashMap AccountId AccountName
parseAccountMap :: FromJSON b => (Text, Value) -> Parser [(AccountId, b)]
data AQBankingConf
AQBankingConf :: [AQConnection] -> FilePath -> Maybe FilePath -> Maybe FilePath -> AQBankingConf
[connections] :: AQBankingConf -> [AQConnection]
[configDir] :: AQBankingConf -> FilePath
[aqBankingExecutable] :: AQBankingConf -> Maybe FilePath
[aqhbciToolExecutable] :: AQBankingConf -> Maybe FilePath
data AQConnection
AQConnection :: String -> String -> String -> HBCIv -> String -> AQType -> AQConnection
[aqUser] :: AQConnection -> String
[aqBlz] :: AQConnection -> String
[aqUrl] :: AQConnection -> String
[aqHbciv] :: AQConnection -> HBCIv
[aqName] :: AQConnection -> String
[aqType] :: AQConnection -> AQType

-- | other modes have to be setup manually. Refer to the AQBanking manual.
--   Use the '-C' to point to the configured <a>configDir</a>.
data AQType
PinTan :: AQType
Other :: AQType
data HBCIv
HBCI201 :: HBCIv
HBCI210 :: HBCIv
HBCI220 :: HBCIv
HBCI300 :: HBCIv
toArg :: IsString p => HBCIv -> p
type PaypalUsername = Text
data Action
Add :: [Username] -> Action
[aPartners] :: Action -> [Username]
Match :: Action
Import :: Maybe Version -> FilePath -> ImportAction -> Action
[iVersion] :: Action -> Maybe Version
[iPath] :: Action -> FilePath
[iAction] :: Action -> ImportAction
Update :: Maybe Version -> Bool -> Bool -> Action
[aqVersion] :: Action -> Maybe Version

-- | run match after import
[aqMatch] :: Action -> Bool

-- | request new transactions
[aqRequest] :: Action -> Bool
Commit :: Bool -> [String] -> Action
[hledger] :: Action -> Bool
[cArgs] :: Action -> [String]
ListBalances :: Action
Setup :: Action
Ledger :: [String] -> Action
[lArgs] :: Action -> [String]
HLedger :: [String] -> Action
[hlArgs] :: Action -> [String]
AQBanking :: [String] -> Action
[aqArgs] :: Action -> [String]
data ImportAction
Paypal :: PaypalUsername -> ImportAction
AQBankingImport :: ImportAction
ComdirectVisa :: Text -> ImportAction
[comdirectVisaBlz] :: ImportAction -> Text
BarclaycardUs :: ImportAction
NatwestIntl :: ImportAction
BarclaysUk :: ImportAction
Pncbank :: Text -> ImportAction
[pncAccountIdentifier] :: ImportAction -> Text
Monefy :: MonefySettings -> ImportAction
Revolut :: (RevolutSettings ()) -> ImportAction
data MonefySettings
MonefySettings :: Text -> Bool -> MonefySettings
[monefyInstallation] :: MonefySettings -> Text
[monefyCategorySuffix] :: MonefySettings -> Bool
data RevolutSettings a
RevolutSettings :: a -> Text -> RevolutSettings a
[revolutCurrency] :: RevolutSettings a -> a
[revolutUser] :: RevolutSettings a -> Text
type Comment = Text
instance (Control.DeepSeq.NFData env, Control.DeepSeq.NFData config, Control.DeepSeq.NFData user) => Control.DeepSeq.NFData (Buchhaltung.Types.Options user config env)
instance GHC.Generics.Generic (Buchhaltung.Types.Options user config env)
instance (GHC.Show.Show env, GHC.Show.Show config, GHC.Show.Show user) => GHC.Show.Show (Buchhaltung.Types.Options user config env)
instance Control.DeepSeq.NFData Buchhaltung.Types.Action
instance GHC.Generics.Generic Buchhaltung.Types.Action
instance GHC.Show.Show Buchhaltung.Types.Action
instance Control.DeepSeq.NFData Buchhaltung.Types.ImportAction
instance GHC.Generics.Generic Buchhaltung.Types.ImportAction
instance GHC.Show.Show Buchhaltung.Types.ImportAction
instance GHC.Base.Functor Buchhaltung.Types.RevolutSettings
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Buchhaltung.Types.RevolutSettings a)
instance GHC.Generics.Generic (Buchhaltung.Types.RevolutSettings a)
instance GHC.Show.Show a => GHC.Show.Show (Buchhaltung.Types.RevolutSettings a)
instance Control.DeepSeq.NFData Buchhaltung.Types.MonefySettings
instance GHC.Generics.Generic Buchhaltung.Types.MonefySettings
instance GHC.Show.Show Buchhaltung.Types.MonefySettings
instance GHC.Show.Show Buchhaltung.Types.Config
instance GHC.Generics.Generic Buchhaltung.Types.Config
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.User
instance GHC.Show.Show Buchhaltung.Types.User
instance GHC.Generics.Generic Buchhaltung.Types.User
instance GHC.Classes.Ord Buchhaltung.Types.AQBankingConf
instance GHC.Classes.Eq Buchhaltung.Types.AQBankingConf
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.AQBankingConf
instance GHC.Show.Show Buchhaltung.Types.AQBankingConf
instance Data.Default.Class.Default Buchhaltung.Types.AQBankingConf
instance GHC.Generics.Generic Buchhaltung.Types.AQBankingConf
instance GHC.Classes.Ord Buchhaltung.Types.AQConnection
instance GHC.Classes.Eq Buchhaltung.Types.AQConnection
instance GHC.Show.Show Buchhaltung.Types.AQConnection
instance GHC.Generics.Generic Buchhaltung.Types.AQConnection
instance GHC.Classes.Ord Buchhaltung.Types.HBCIv
instance GHC.Classes.Eq Buchhaltung.Types.HBCIv
instance Data.Aeson.Types.ToJSON.ToJSON Buchhaltung.Types.HBCIv
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.HBCIv
instance GHC.Show.Show Buchhaltung.Types.HBCIv
instance GHC.Generics.Generic Buchhaltung.Types.HBCIv
instance GHC.Classes.Ord Buchhaltung.Types.AQType
instance GHC.Classes.Eq Buchhaltung.Types.AQType
instance Data.Aeson.Types.ToJSON.ToJSON Buchhaltung.Types.AQType
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.AQType
instance GHC.Show.Show Buchhaltung.Types.AQType
instance GHC.Generics.Generic Buchhaltung.Types.AQType
instance GHC.Classes.Eq Buchhaltung.Types.BankAccounts
instance GHC.Show.Show Buchhaltung.Types.BankAccounts
instance Data.Default.Class.Default Buchhaltung.Types.BankAccounts
instance GHC.Generics.Generic Buchhaltung.Types.BankAccounts
instance GHC.Show.Show Buchhaltung.Types.AccountId
instance Data.Hashable.Class.Hashable Buchhaltung.Types.AccountId
instance GHC.Classes.Ord Buchhaltung.Types.AccountId
instance GHC.Classes.Eq Buchhaltung.Types.AccountId
instance GHC.Generics.Generic Buchhaltung.Types.AccountId
instance GHC.Classes.Ord Buchhaltung.Types.Ledgers
instance GHC.Classes.Eq Buchhaltung.Types.Ledgers
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.Ledgers
instance GHC.Show.Show Buchhaltung.Types.Ledgers
instance Data.Default.Class.Default Buchhaltung.Types.Ledgers
instance GHC.Generics.Generic Buchhaltung.Types.Ledgers
instance GHC.Classes.Ord Buchhaltung.Types.Username
instance Data.Aeson.Types.FromJSON.FromJSONKey Buchhaltung.Types.Username
instance Data.Hashable.Class.Hashable Buchhaltung.Types.Username
instance GHC.Classes.Eq Buchhaltung.Types.Username
instance Control.DeepSeq.NFData Buchhaltung.Types.Username
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.Username
instance GHC.Generics.Generic Buchhaltung.Types.Username
instance GHC.Show.Show Buchhaltung.Types.ImportTag
instance GHC.Generics.Generic Buchhaltung.Types.ImportTag
instance GHC.Read.Read Buchhaltung.Types.Source
instance GHC.Classes.Ord Buchhaltung.Types.Source
instance GHC.Classes.Eq Buchhaltung.Types.Source
instance GHC.Show.Show Buchhaltung.Types.Source
instance GHC.Generics.Generic Buchhaltung.Types.Source
instance GHC.Base.Functor Buchhaltung.Types.SFormat
instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Buchhaltung.Types.SFormat a)
instance GHC.Read.Read a => GHC.Read.Read (Buchhaltung.Types.SFormat a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Buchhaltung.Types.SFormat a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Buchhaltung.Types.SFormat a)
instance GHC.Show.Show a => GHC.Show.Show (Buchhaltung.Types.SFormat a)
instance GHC.Generics.Generic (Buchhaltung.Types.SFormat a)
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.Config
instance GHC.Classes.Eq Buchhaltung.Types.User
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.AQConnection
instance Data.Aeson.Types.ToJSON.ToJSON Buchhaltung.Types.AQConnection
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.BankAccounts
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.Regex
instance GHC.Show.Show Buchhaltung.Types.Regex
instance GHC.Show.Show Buchhaltung.Types.Username
instance Data.Default.Class.Default Buchhaltung.Types.ImportTag
instance Data.String.IsString Buchhaltung.Types.ImportTag
instance Data.Aeson.Types.FromJSON.FromJSON Buchhaltung.Types.Source
instance Data.Aeson.Types.ToJSON.ToJSON Buchhaltung.Types.Source
instance (Data.Hashable.Class.Hashable a, GHC.Classes.Eq a) => Data.Default.Class.Default (Data.HashMap.Base.HashMap a b)

module Buchhaltung.Ask
editLoop :: MonadException m => (Text -> Either String c) -> String -> Maybe (c, Text) -> Maybe [Text] -> Either Text Text -> Maybe Text -> m c
editLoopM :: MonadException m => (Text -> m (Either String c)) -> String -> Maybe (c, Text) -> Maybe [Text] -> Either Text Text -> Maybe Text -> m c
histFile :: [Char] -> Maybe [Char]
newtype CiChar
CiChar :: Char -> CiChar
[ciChar] :: CiChar -> Char
ciSplitOn :: [Char] -> [Char] -> [[Char]]
myGetchar :: IO Char
runInputT2 :: MonadException m => Settings m -> InputT m a -> m a
editHaskeline :: (a -> String) -> (a -> String -> a) -> a -> IO a
askAccount :: (MonadReader (Options User config env) m, MonadIO m) => [AccountName] -> Maybe AccountName -> Maybe String -> Either Text Text -> m AccountName
askReverseAccount :: MonadReader (Options User config env) m => m (Text -> Text)
instance GHC.Classes.Eq Buchhaltung.Ask.CiChar

module Buchhaltung.Common
readcsv :: Char -> Text -> [[Text]]
readcsvrow :: Char -> Text -> [Text]
p_csvrow :: Char -> Parser [Text]
p_csvfield :: Char -> Parser Text
p_csvstring :: Parser String
escapedDoubleQuotes :: IsString p => p
parens :: Parsec Text () Int
testdbacl :: IO ()

-- | parse dbacl output (see testdbacl for the format of dbacl's output)
dbacl_parse :: [AccountName] -> String -> Either ParseError [(AccountName, String)]
dbacl_parser :: [AccountName] -> Parsec String () [(AccountName, [String])]
idx :: (Eq a, Show a) => [a] -> a -> Int

-- | Read the journal file again, before applying Changes (to not overwrite
--   possible changes, that were made in the mean time) saveChanges ::
--   String -- ^ journal path -&gt; (Journal-&gt; (Journal, Integer)) -&gt;
--   IO Journal
saveChanges :: (MonadReader (Options User config env) m, MonadIO m) => Maybe Journal -> (Journal -> (Journal, Integer)) -> m Journal
mixed' :: Amount -> MixedAmount
showTransactions :: Journal -> [Char]
jTrans :: Lens' Journal [Transaction]
tPosts :: Lens' Transaction [Posting]
pAcc :: Lens' Posting AccountName

-- | replaces every matching transaction in the given journal counts the
--   number of changed transactions
changeTransaction :: [(Transaction, Transaction)] -> Journal -> (Journal, Integer)

-- | Update a traversal and count the number of updates
countUpdates :: Traversal' s a -> (a -> Maybe a) -> s -> (s, Integer)
data WithSource a
WithSource :: Transaction -> Int -> Posting -> Source -> a -> WithSource a
[wTx] :: WithSource a -> Transaction

-- | index of the posting with source
[wIdx] :: WithSource a -> Int
[wPosting] :: WithSource a -> Posting
[wSource] :: WithSource a -> Source
[wInfo] :: WithSource a -> a

-- | extracts the source line from a Transaction
extractSource :: ImportTag -> Transaction -> Either String (WithSource ())
injectSource :: ImportTag -> Source -> Transaction -> Transaction
commentPrefix :: ImportTag -> Text
trimnl :: Text -> Text
type MyRecord = HashMap Text Text
stripCsv :: ([Text], [MyRecord]) -> ([Text], [MyRecord])
parseCsv :: Char -> Text -> ([Text], [MyRecord])
getCsvCreditDebit :: Text -> Text -> MyRecord -> Text
getCsvConcat :: [Text] -> MyRecord -> Text
getCsvConcatDescription :: env -> [Description env] -> MyRecord -> Text
getCsv :: Text -> MyRecord -> Text
data ImportedEntry' a s
ImportedEntry :: Transaction -> a -> s -> ImportedEntry' a s

-- | transaction without postings (they will be inserted later)
[ieT] :: ImportedEntry' a s -> Transaction
[iePostings] :: ImportedEntry' a s -> a

-- | source to check for duplicates and for Bayesian matching
[ieSource] :: ImportedEntry' a s -> s
type ImportedEntry = ImportedEntry' [(AccountId, Text, Maybe Text, Bool)] Source  postings of [acount,amount]: only ImportedEntry with one posting is currently implemented in the statists functionality of Add.hs (See PROBLEM1) as well in the duplicates algorithm in 'addNew'
type FilledEntry = ImportedEntry' () Source
fromFilled :: FilledEntry -> Entry
type Entry = ImportedEntry' () (Either String Source)

-- | helper function to create transaction for ImportedEntry
genTrans :: Day -> Maybe Day -> Text -> Transaction
normalizeMixedAmountWith :: (Amount -> Decimal) -> MixedAmount -> MixedAmount
data Importer env
Importer :: Maybe (Handle -> IO ()) -> (Text -> CommonM (env, Maybe Version) [ImportedEntry]) -> Importer env

-- | e.g. <a>windoof</a>
[iModifyHandle] :: Importer env -> Maybe (Handle -> IO ())
[iImport] :: Importer env -> Text -> CommonM (env, Maybe Version) [ImportedEntry]
windoof :: Maybe (Handle -> IO ())
parseDate :: String -> Text -> Day
parseDateM :: Monad m => String -> Text -> m Day
parseDateDE :: Text -> Day
parseDateUS :: Text -> Day

-- | retrieval function
type Getter a = MyRecord -> a
data CsvPostingImport
CsvPosting :: Getter Text -> Getter Text -> Maybe (Getter Text) -> Getter Bool -> CsvPostingImport
[cAccount] :: CsvPostingImport -> Getter Text
[cAmount] :: CsvPostingImport -> Getter Text
[cSuffix] :: CsvPostingImport -> Maybe (Getter Text)

-- | Amount parsable by 'mamoumtp\''
[cNegate] :: CsvPostingImport -> Getter Bool
data CsvImport env
CSV :: (MyRecord -> Bool) -> Getter Day -> Bool -> Getter (Maybe Day) -> (env -> Getter Text) -> [Text] -> [Text] -> [Description env] -> Version -> Char -> [env -> CsvPostingImport] -> CsvImport env

-- | should this csv line be processed?
[cFilter] :: CsvImport env -> MyRecord -> Bool
[cDate] :: CsvImport env -> Getter Day
[cStrip] :: CsvImport env -> Bool
[cVDate] :: CsvImport env -> Getter (Maybe Day)
[cBank] :: CsvImport env -> env -> Getter Text
[cHeader] :: CsvImport env -> [Text]
[cBayes] :: CsvImport env -> [Text]
[cDescription] :: CsvImport env -> [Description env]
[cVersion] :: CsvImport env -> Version
[cSeparator] :: CsvImport env -> Char
[cPostings] :: CsvImport env -> [env -> CsvPostingImport]
data Description env
Field :: Text -> Description env
Const :: Text -> Description env
Read :: (env -> Text) -> Description env
toField :: () => Description env -> Maybe Text
data CheckedCsvImport a
UnsafeCSV :: CsvImport a -> CheckedCsvImport a
[cRaw] :: CheckedCsvImport a -> CsvImport a
toVersionedCSV :: SFormat DefaultVersion -> [CsvImport a] -> VersionedCSV a
type VersionedCSV env = forall m. MonadError Msg m => m (SFormat DefaultVersion, Map Version (CheckedCsvImport env))  (format with default version, _)
data DefaultVersion
DefaultVersion :: Version -> DefaultVersion
[fromDefaultVersion] :: DefaultVersion -> Version
checkRawCSV :: SFormat b -> CsvImport a -> CheckedCsvImport a
table :: [Int] -> [Text] -> [[Text]] -> Box
table1 :: NonEmpty [Box] -> Box
table2 :: [Int] -> [Text] -> [[Text]] -> NonEmpty [Box]
mlen :: ListLike l e => [l] -> Int
text' :: Text -> Box
loadJournal :: (MonadError Msg m, MonadIO m) => [Ledgers -> Maybe FilePath] -> Options User config env -> m Journal

-- | Remove leading and trailing whitespace.
textstrip :: Text -> Text
instance (GHC.Show.Show s, GHC.Show.Show a) => GHC.Show.Show (Buchhaltung.Common.ImportedEntry' a s)
instance GHC.Base.Functor Buchhaltung.Common.WithSource

module Buchhaltung.Uniques

-- | The monad stack
type M r m = ContT r (RWST () () (Map KeyIx (Aged Entry)) m)
data Aged a
Aged :: Age -> a -> Aged a
[getAge] :: Aged a -> Age
[unAged] :: Aged a -> a
data Age
Old :: Age
New :: Age

-- | the key that is used to compare transactions. The Int is a counter, to
--   ensure there are no actual duplicates in the map and to be able to
--   update entries.
--   
--   Duplicates are then found by extraction of a key range using
--   <a>split</a>. See <a>findDuplicates</a>.
type Key = ([(CommoditySymbol, Quantity)], AccountName, Day)
type KeyIx = (Key, Int)

-- | Takes a list of new entries, removes duplicates or updates existing
--   transactions and adds new entries.
addNewEntriesToJournal :: (MonadIO m, MonadReader (Options user Config env) m) => [FilledEntry] -> Journal -> m [Entry]

-- | Derive a key from a transaction and an index
deriveKey :: Transaction -> Key

-- | loop through all existing possible duplicates of a new transaction
loop :: (MonadIO m, MonadReader (Options user Config env) m) => (() -> M r m ()) -> Int -> Int -> FilledEntry -> M r m ()
eitherToMaybe :: Either b a -> Maybe a

-- | Find all duplicates for a given key
findDuplicates :: Monad m => Key -> M r m [(KeyIx, Aged Entry)]
findFuzzy :: Monad m => Transaction -> M r m [(KeyIx, Aged Entry)]

-- | check single new entry against a list of conflict candidates, and
--   insert new entry (if list is empty), or keep old entry (if identical
--   to new one), or ask weither to modify old entry or insert new entry.
checkOrAsk :: (MonadIO m, MonadReader (Options user Config env) m) => (() -> M r m ()) -> FilledEntry -> Text -> [((KeyIx, Aged Entry), Maybe Int)] -> M r m ()
prettyPrint :: Maybe Int -> FilledEntry -> Aged Entry -> Text -> Int -> Text
applyChanges :: ImportTag -> FilledEntry -> Key -> Key -> Aged Entry -> Aged Entry
instance GHC.Show.Show a => GHC.Show.Show (Buchhaltung.Uniques.Aged a)
instance GHC.Classes.Eq Buchhaltung.Uniques.Age
instance GHC.Show.Show Buchhaltung.Uniques.Age

module Buchhaltung.OptionParsers
mainParser :: IO ParserInfo Options Maybe Username () ()
paragraph :: String -> Doc
version :: () => Parser (a -> a)
userP :: Parser (Maybe Username)
envVar :: [Char]

-- | optparse profile folder
profile :: Exception b => [(String, FilePath)] -> Either b FilePath -> Parser FilePath
versionP :: Parser (Maybe Text)

-- | optparse command parser commands :: Parser Action
commands :: Mod CommandFields Action
commitMsg :: [Char] -> Maybe [Char]
passThrough :: ([String] -> Action) -> String -> Maybe String -> Maybe String -> Mod CommandFields Action
command' :: String -> Parser a -> InfoMod a -> Mod CommandFields a
importOpts :: Mod CommandFields ImportAction

module Buchhaltung.Import
assertParseEqual' :: (Either ParseError a) -> String

-- | convert a batch of importedEntries to Ledger Transactions
fillTxn :: (MonadError Msg m, MonadReader (Options User Config env) m) => Text -> ImportedEntry -> m FilledEntry

-- | read entries from handle linewise, process and add to ledger
importCat :: Maybe FilePath -> (Text -> CommonM env [ImportedEntry]) -> Text -> CommonM env Journal
dateAmountSource :: ImportTag -> Transaction -> Transaction -> Ordering
importWrite :: (Text -> CommonM env [ImportedEntry]) -> Text -> CommonM env ()
importHandleWrite :: Importer env -> FullOptions (env, Maybe Version) -> Handle -> ErrorT IO ()
importReadWrite :: Importer env -> FullOptions (env, Maybe Version) -> FilePath -> ErrorT IO ()
writeJournal :: FilePath -> Journal -> IO ()
testRaw :: Show a => p -> FilePath -> (String -> a, Maybe (Handle -> IO ())) -> IO String

module Buchhaltung.Importers
headerInfo :: MonadError Msg m => VersionedCSV a -> Maybe Version -> m (SFormat Version, CsvImport a)

-- | Data type for preprocessing and meta-data extraction of CSV files
type Preprocessor env1 env2 = forall m. MonadError Msg m => (Text, env1) -> m (Text, env2)
processLines :: ([Text] -> [Text]) -> Preprocessor env env
csvImportPreprocessed :: Preprocessor env1 env2 -> VersionedCSV env2 -> Text -> CommonM (env1, Maybe Version) [ImportedEntry]
aqbankingImporter :: Importer env
aqbankingImport :: VersionedCSV env
comdirectToAqbanking :: IO ()
comdirect_header :: [[Char]]
comdirect_header_visa :: [[Char]]
comdirect_mapping_visa :: [([Char], Text -> Text)]
comdirect_mapping :: [([Char], Text -> Text)]
ok :: (IsString b, Eq b, StringLike b) => b -> [b]
p :: ParsecT [Char] u Identity [Char]

-- | Descriptions create the description, by concatenation of all cols
description :: (ListLike c item, StringLike c, Show a, Eq a) => [a] -> [c] -> c
description_list :: (Show a, Eq a) => [a] -> [a] -> [b] -> [b]
pncbankImporter :: Importer Text
pncbank :: VersionedCSV Text
barclaycardusImporter :: Importer ()
barclaycardPreprocessor :: Preprocessor () AccountId
barclaycardus :: VersionedCSV AccountId
revolutImporter :: Importer (RevolutSettings ())
extractCurrency :: Preprocessor (RevolutSettings ()) (RevolutSettings Text)
revolut :: VersionedCSV (RevolutSettings Text)
normalizeCurrency :: Text -> Text
monefyImporter :: Importer MonefySettings

-- | replace the header by one with unique column names (currency2)
unambiguousHeader :: Preprocessor env env
monefy :: VersionedCSV MonefySettings
barclaysUkImporter :: Importer ()
barclaysUk :: VersionedCSV ()
natwestIntlImporter :: Importer ()
natwestIntl :: VersionedCSV ()
comdirectVisaImporter :: Importer Text
comdirectVisa :: VersionedCSV Text
paypalImporter :: Importer Text
paypalImport :: VersionedCSV Text
show2 :: [[Text]] -> [Text]
hibiscusToAqbanking :: IO ()
toAqbankingPure :: (Show a, Eq a) => Char -> [a] -> [a] -> [Text -> Text] -> ([Text] -> Bool) -> Text -> Text
toAqbanking :: (Show a, Eq a) => Char -> IO Text -> [a] -> [a] -> [Text -> Text] -> ([Text] -> Bool) -> IO ()
toAqbanking2Pure :: (Show a, Eq a) => Char -> [a] -> [(a, Text -> Text)] -> ([Text] -> Bool) -> Text -> Text
hibicus_header :: [[Char]]
hibiscus_mapping :: [[Char]]
hibiscus_transf :: [Text -> Text]
comma :: Text -> Text
readdate2 :: Stream t Identity Char => t -> Date2
p_date2 :: Stream t Identity Char => Parsec t () Date2
readdate :: Text -> Day
p_date :: Stream t Identity Char => Parsec t () Day
data Date2
D :: String -> String -> String -> Date2
toBayes :: MonadError Msg m => VersionedCSV a -> m (SFormat DefaultVersion, Map Version [Text])
defaultFields :: MonadError Msg m => m (Map (SFormat ()) (Map Version [Text]))
getBayesFields :: MonadError Msg m => Source -> m [Text]
instance GHC.Classes.Eq Buchhaltung.Importers.Date2
instance GHC.Show.Show Buchhaltung.Importers.Date2

module Buchhaltung.AQBanking
type AQM = CommonM (AQConnection, AQBankingConf)

-- | Runs an AQBanking Action for all connections of the selected user
runAQ :: FullOptions () -> AQM a -> ErrorT IO [a]
runProc :: (FilePath -> [String] -> IO a) -> [String] -> ([FilePath], FilePath) -> AQM a
callAqhbci :: AAQM ()
runAqbanking' :: (FilePath -> [String] -> IO b) -> AAQM b
callAqbanking :: AAQM ()
readAqbanking :: AAQM String
type AAQM a = [String] -> AQM a
aqbankingListtrans :: Bool -> AQM Text
aqbankingSetup :: AQM ()
addContext :: AAQM [FilePath]
withContext :: MonadError Msg m => String -> m Bool
askConfigPath :: AQM FilePath
readConn :: (AQConnection -> AQM a) -> AQM a
readConf :: (AQBankingConf -> AQM a) -> AQM a

-- | Find out executable path and two args selecting the config file
askExec :: (AQBankingConf -> Maybe FilePath) -> FilePath -> String -> AQM ([FilePath], FilePath)

module Buchhaltung.Zipper

-- | Nonemtpy zipper
data Zipper a
LZ :: NonEmpty a -> [a] -> Zipper a
[past] :: Zipper a -> NonEmpty a
[future] :: Zipper a -> [a]
present :: Zipper a -> a

-- | Re-constitute a list from a zipper context.
integrate' :: Zipper a -> NonEmpty a
integrate :: Zipper a -> [a]

-- | Turn a list into a context with the focus on the first element.
differentiate :: NonEmpty a -> Zipper a

-- | Move the focus to the previous element. Do nothing if the focus | is
--   already on the first element.
back :: Zipper a -> Zipper a

-- | Move the focus to the next element. Do nothing if the focus is |
--   already on the last element.
fwd :: Zipper a -> Zipper a

-- | Apply the given function to the currently focused element to | produce
--   a new currently focused element.
modifyPresent :: (a -> a) -> Zipper a -> Zipper a

-- | Apply the given function to all elements preceding the focus.
modifyBack :: ([a] -> [a]) -> Zipper a -> Zipper a

-- | Apply the given function to all elements after the focus.
modifyFwd :: ([a] -> [a]) -> Zipper a -> Zipper a

-- | Delete the currently focused element. If there are no future elements
--   move the focus to the next last element.
delete :: Zipper a -> Zipper a

-- | Insert a new element just before the current focus, then move the |
--   focus to the newly inserted element.
insback :: a -> Zipper a -> Zipper a

-- | Insert a new element just after the current focus, then move the |
--   focus to the newly inserted element.
insfwd :: a -> Zipper a -> Zipper a
instance GHC.Base.Functor Buchhaltung.Zipper.Zipper


-- | A library for creating simple interactive list editors, using a zipper
--   to allow the user to navigate forward and back within the list and
--   edit the list elements.
module Buchhaltung.ZipEdit2

-- | Actions that can be taken by an editor in response to user input.
data Action m a u
Comp :: (Action m a u) -> (Action m a u) -> Action m a u

-- | move forward one item.
Fwd :: Action m a u

-- | move back one item.
Back :: Action m a u

-- | delete the current item.
Delete :: Action m a u

-- | modify the current item by applying the given function.
Modify :: (a -> a) -> Action m a u

-- | modify complete state
ModifyState :: (LState a u -> LState a u) -> Action m a u

-- | modify complete state with IO.
ModifyStateM :: (LState a u -> m (LState a u)) -> Action m a u

-- | modify everything with IO.
ModifyAllM :: (Zipper a -> m (Zipper a)) -> Action m a u

-- | modify everything.
ModifyAll :: (Zipper a -> Zipper a) -> Action m a u

-- | modify the current item by applying the given function, which gives
--   its result in the IO monad.
ModifyM :: (a -> m a) -> Action m a u

-- | modify items following the current item by applying the given
--   function.
ModifyFwd :: ([a] -> [a]) -> Action m a u

-- | modify items before the current item by applying the given function.
ModifyBack :: ([a] -> [a]) -> Action m a u

-- | Using the given string as a prompt, obtain a line of user input, and
--   apply the given function to the user input to obtain a function for
--   modifying the current item.
ModifyWInp :: String -> (String -> a -> a) -> Action m a u

-- | Run the first function on the current item to produce a string, and
--   open an editor (using the $EDITOR environment variable) on that
--   string. After the user is done editing, pass the resulting string to
--   the second function to obtain a function for modifying the current
--   element.
ModifyWEditor :: (a -> String) -> (String -> a -> a) -> Action m a u

-- | Using the given string as a prompt, obtain a line of user input, and
--   apply the given function to the user input to obtain a new item, which
--   should be inserted forward of the current item. The inserted item
--   becomes the new current item.
InsFwd :: String -> (String -> a) -> Action m a u

-- | Similar to InsFwd, except that the new item is inserted before the old
--   current item.
InsBack :: String -> (String -> a) -> Action m a u

-- | output a string which is a function of the current item.
Output :: (a -> String) -> Action m a u

-- | cancel the editing session.
Cancel :: Action m a u

-- | complete the editing session, but if te function evaluates to
--   <a>Just</a> and the suer answers y. In this case return the functions
--   result.
Done :: (LState a u -> m (Maybe (LState a u))) -> Action m a u

-- | perform a sequence of actions.
Seq :: [Action m a u] -> Action m a u

-- | an action annotated with a help string.
Help :: String -> (Action m a u) -> Action m a u

-- | Some standard actions which can be used in constructing editor
--   configurations. The actions are: j - Fwd, k - Back, x - Delete, q -
--   Cancel, d - Done.
stdActions :: Monad m => [(Char, Action m a u)]

-- | Annotate a command with a help string.
(??) :: Action m a u -> String -> Action m a u

-- | A configuration record determining the behavior of the editor.
data EditorConf m a u
EC :: (LState a u -> m Text) -> (Zipper a -> String) -> [(Char, Action m a u)] -> Maybe (IO Char) -> EditorConf m a u

-- | How to display info about the current state.
[display] :: EditorConf m a u -> LState a u -> m Text

-- | How to display info about the all elements.
[ecPrompt] :: EditorConf m a u -> Zipper a -> String

-- | A list specifying the actions to take in response to user inputs.
[actions] :: EditorConf m a u -> [(Char, Action m a u)]

-- | optional different getChar implementation
[getchar] :: EditorConf m a u -> Maybe (IO Char)

-- | Run the given editor on the given list, returning <tt>Nothing</tt> if
--   the user canceled the editing process, or <tt>Just l</tt> if the
--   editing process completed successfully, where <tt>l</tt> is the final
--   state of the list being edited.
edit :: MonadIO m => EditorConf m a u -> u -> NonEmpty a -> (Zipper a -> Zipper a) -> m (Maybe (u, [a]))

-- | A continuation which can compute more of the list, along with (maybe)
--   another continuation.
data LCont a
LC :: (IO ([a], Maybe (LCont a))) -> LCont a

-- | Like <a>edit</a>, but with an additional parameter for a continuation
--   | which can be run to compute additional list elements and |
--   (optionally) another continuation.
editWCont :: MonadIO m => EditorConf m a u -> NonEmpty a -> u -> IO ([a], Maybe (LCont a)) -> (Zipper a -> Zipper a) -> m (Maybe (u, [a]))

-- | Nonemtpy zipper
data Zipper a
LZ :: NonEmpty a -> [a] -> Zipper a
[past] :: Zipper a -> NonEmpty a
[future] :: Zipper a -> [a]
integrate :: Zipper a -> [a]

-- | Turn a list into a context with the focus on the first element.
differentiate :: NonEmpty a -> Zipper a

-- | Move the focus to the next element. Do nothing if the focus is |
--   already on the last element.
fwd :: Zipper a -> Zipper a

-- | Move the focus to the previous element. Do nothing if the focus | is
--   already on the first element.
back :: Zipper a -> Zipper a

-- | The state of the editor consists of a current context, as well as an
--   optional continuation which can compute more list elements.
data LState a b
LS :: Zipper a -> Maybe (LCont a) -> b -> LState a b
[ctx] :: LState a b -> Zipper a
[cont] :: LState a b -> Maybe (LCont a)
[userSt] :: LState a b -> b
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => Control.Monad.RWS.Class.MonadRWS (Buchhaltung.ZipEdit2.EditorConf m e userState) () (Buchhaltung.ZipEdit2.LState e userState) (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader (Buchhaltung.ZipEdit2.EditorConf m e userState) (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => Control.Monad.State.Class.MonadState (Buchhaltung.ZipEdit2.LState e userState) (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => Control.Monad.Writer.Class.MonadWriter () (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Monad m => GHC.Base.Monad (Buchhaltung.ZipEdit2.Editor e userState m)
instance GHC.Base.Functor m => GHC.Base.Functor (Buchhaltung.ZipEdit2.Editor e userState m)
instance Control.Monad.Trans.Class.MonadTrans (Buchhaltung.ZipEdit2.Editor e userState)
instance GHC.Base.Monoid (Buchhaltung.ZipEdit2.Action m a u)

module Buchhaltung.Match
type MatchT m = RWST (FullOptions FilePath) () (Map AccountName Bool, Zipper Update) (ErrorT m)  R: temporaray dbacl path  W: Set of learned accounts  S: Zipper with all transaction that neede to be matched
match :: FullOptions FilePath -> Journal -> ErrorT IO ()

-- | Apply the first matching <tt>Todo</tt>
updateAccountName :: Update -> Maybe (Transaction, Transaction)
printSource :: Source -> String
mainLoop :: String -> MatchT IO ()
histfsuf :: String

-- | Data type describing the suggested or 'default' account when asking
--   the user for account input
data Default
Default :: Text -> AccountName -> Default
[prefixed] :: Default -> Text
[defAcc] :: Default -> AccountName
suggestAccount :: Update -> MatchT IO (Maybe Default)
bayesLine :: Monad m => WithSource a -> MatchT m Text
learn :: [(AccountName, NonEmpty (WithSource a))] -> MatchT IO ()
accountCompletion :: [String] -> CompletionFunc IO
type Update = WithSource (Maybe AccountName)

-- | Group all transactions with source into those that already have an
--   account (ignoring those in <a>ignoredAccountsOnMatch</a>) and those
--   that start with <a>cTodoAccount</a>
--   
--   returns <a>Nothing</a> if there are no todo transactions
groupByAccount :: MonadReader (Options User Config env) m => Journal -> m (Maybe ([(AccountName, NonEmpty (WithSource ()))], NonEmpty Update))
myAskAccount :: Maybe Default -> MatchT IO AccountName
getAccountList :: Monad m => (Bool -> Bool) -> MatchT m [AccountName]
tmp :: Monad m => Text -> MatchT m FilePath

-- | learning
dbaclProc :: String -> [String]

-- | classification
dbaclProcC :: [String] -> [String]

module Buchhaltung.Add
type UserJournals = Map Username Journal
type AddT' env m = RWST (FullOptions env) () UserJournals (ErrorT m)

-- | Monad Transformer used to describe the <a>add</a> program
--   
--   The <a>add</a> specific environment, that can contain a partner user
type AddOptions = FullOptions [Partner]
type AddT m = AddT' [Partner] m
data Partner
Partner :: User -> AccountName -> AccountName -> FilePath -> Partner
[pUser] :: Partner -> User

-- | partner's receivable/payable account in the user's ledger
[partnerAccount] :: Partner -> AccountName

-- | user's receivable/payable account in the partner's ledger
[userAccount] :: Partner -> AccountName

-- | partner's ledger
[partnerLedger] :: Partner -> FilePath

-- | Extract partner information from the env and throw errors if there are
--   any readPartner :: (MonadReader AddOptions m, MonadError Msg m) =&gt;
--   (Partner -&gt; a) -&gt; m (Maybe a) readPartner f = reader $ fmap f .
--   oEnv
partners :: (MonadReader AddOptions m, MonadError Msg m) => m [Partner]
add :: AddT' [Username] IO ()

-- | Convert given <a>Username</a> to <a>Partner</a>.
toPartner :: Monad m => User -> AddT' env m Partner

-- | Welcome message
hello :: Monad m => AddT m String

-- | main user interaction loop
mainLoop :: AddT IO ()

-- | Saves transaction into the designated ledgers files of each user, and
--   clears the transaction tht was matched (conditional on a <a>Bool</a>
--   argument)
saveAndClear :: Maybe Transaction -> Bool -> (Maybe Transaction, [(Partner, Transaction)]) -> AddT IO ()
modifyJournal :: MonadState UserJournals m => User -> (Journal -> Journal) -> m ()
getJournal :: MonadState UserJournals m => User -> m Journal
clearSecondPosting :: Transaction -> (Transaction, Transaction)

-- | Split <a>EditablePosting</a>s in User's Postings and (Partner,
--   Postings, Open Balance)
split :: [EditablePosting] -> ([Posting], [(Partner, NonEmpty Posting, MixedAmount)])

-- | generate the main and possibly the other users' transactions
finishTransaction :: (MonadIO m, MonadReader AddOptions m) => Bool -> Maybe (Transaction, [EditablePosting]) -> m (Maybe Transaction, [(Partner, Transaction)])
iso8601 :: UTCTime -> String

-- | add transaction to ledger file and return new ledger
myJournalAddTransaction :: FilePath -> User -> [Transaction] -> AddT IO ()
clearNthPosting :: Int -> Transaction -> Transaction
data Asserted a
AA :: Comment -> BalanceAssertion -> a -> Asserted a
[aComment] :: Asserted a -> Comment
[aAssertion] :: Asserted a -> BalanceAssertion
[aAmount] :: Asserted a -> a
type AssertedAmount = Asserted MixedAmount
fromPosting :: Posting -> Asserted MixedAmount
showAssertedAmount :: Asserted MixedAmount -> Text

-- | Ask an amount, and return transactions matching the entered amount
sugTrans :: AddT IO (AssertedAmount, Maybe Transaction)
data Choice
Reenter :: Choice
Manual :: Choice
Choose :: Int -> Choice

-- | user input: choose one from a list of choices
choose :: [String] -> IO Choice
menup :: Int -> Parser Choice

-- | combines everything into an <a>EditorConf</a>
myEd :: EditorConf (AddT IO) EditablePosting Transaction
mainPrompt :: (ListLike m item, IsString m) => m
quiet :: Monad m => a -> m (Maybe a)

-- | clear all postings
clearTrans :: Zipper EditablePosting -> Zipper EditablePosting

-- | change user of current posting, but not for the first posting
--   ReferenceA
nextNotFirst :: EditablePosting -> EditablePosting
balanceTransactionIfRequired :: Transaction -> Either String Transaction
data Balancing
B :: Bool -> Bool -> Balancing
[possible] :: Balancing -> Bool
[required] :: Balancing -> Bool

-- | check, if the transaction should be passed through
--   <a>balanceTransaction</a> to infer missing amounts
balanceRequirement :: MonadError String m => [Posting] -> m Balancing

-- | Try to balance the transactions and present the final transactions
checkDone :: LState EditablePosting Transaction -> AddT IO (Maybe (LState EditablePosting Transaction))
askDescription :: Maybe Text -> IO Text

-- | uses <a>dateandcodep</a>
askDate :: Maybe Day -> IO (Day, Text)

-- | HLedger's <a>smartdate</a> and code
dateandcodep :: Parsec Void Text (SmartDate, Text)
myAskAccount :: User -> Maybe AccountName -> Maybe String -> Either Text Text -> AddT IO AccountName
askAmount :: Maybe AssertedAmount -> Text -> Maybe Text -> AddT IO AssertedAmount
parseAmount :: Journal -> Text -> Either (ParseError Char Void) AssertedAmount
nosymbolamountp2 :: Monad m => JournalParser m Amount
getDefaultCommodityAndStyle2 :: Journal -> Maybe (CommoditySymbol, AmountStyle)
askPercent :: IO Decimal

-- | Type holding suggested or temporary postings
data EditablePosting
EditablePosting :: Maybe Posting -> Maybe Int -> AccountName -> Int -> Zipper (Either User Partner) -> EditablePosting
[epPosting] :: EditablePosting -> Maybe Posting
[epFreq] :: EditablePosting -> Maybe Int
[epAccount] :: EditablePosting -> AccountName
[epNumber] :: EditablePosting -> Int

-- | zipper of possible user
[epUser] :: EditablePosting -> Zipper (Either User Partner)
type EditablePostings = Zipper EditablePosting

-- | generate and add new <a>Posting</a> to <a>EditablePosting</a>
addPosting :: AccountName -> Maybe AssertedAmount -> EditablePosting -> EditablePosting
setMissing :: EditablePosting -> EditablePosting
removeAmount :: EditablePosting -> EditablePosting

-- | jump to a certain element in a zipper
jumpTo :: Int -> Zipper a -> Zipper a
editDate :: LState a Transaction -> AddT IO (LState a Transaction)
editDescription :: LState a Transaction -> AddT IO (LState a Transaction)

-- | edit the amount of the selected posting
editCurAmount :: EditablePostings -> AddT IO EditablePostings

-- | modfiy current amount by asking for a new amount, that is combined
--   with the old to get a new amount (e.g. with (+))
modifyCurAmount :: (AssertedAmount -> AssertedAmount -> AssertedAmount) -> Bool -> EditablePostings -> AddT IO EditablePostings
replaceMissing :: MixedAmount -> MixedAmount

-- | Hardcoded default number of suggested accounts
defNumSuggestedAccounts :: Int
suggestedPostingsSingleUser :: Monad m => Text -> Zipper (Either User Partner) -> AddT m [EditablePosting]

-- | retrieve a number of suggested contra postings for a given account,
--   sort frequency of that contra account for the given account.
--   
--   TODO incorporate old behavior: duplicate each posting for both users,
--   but only if the other user's account is present in the suggestions.
suggestedPostings :: MonadIO m => AccountName -> Maybe AssertedAmount -> AddT m (NonEmpty EditablePosting)

-- | change posting's user to the next user
next :: EditablePosting -> EditablePosting
roundP :: EditablePosting -> EditablePosting

-- | assign the <tt>Transaction'</tt>s open balance to an empty
--   <a>EditablePosting</a>
assignOpenBalance :: Decimal -> EditablePostings -> EditablePostings
showEditablePosting :: EditablePostings -> Text
getUser :: Either User Partner -> User
totalBalance :: [EditablePosting] -> MixedAmount
showAmount2 :: Amount -> Text
showMixedAmount2 :: MixedAmount -> Text

-- | ask for new account (display old as default) and use existing posting,
--   if same account without a posting/amount already exists or append.
addNewPosting :: Bool -> EditablePostings -> AddT IO EditablePostings

-- | move the focus to the next empty posting
moveToNextEmpty :: EditablePostings -> EditablePostings
data Align
AlignLeft :: Align
AlignRight :: Align
AlignCenter :: Align
renderTable :: ([Align], [Align], [Text]) -> [[Text]] -> Maybe [Text] -> Text
instance GHC.Show.Show Buchhaltung.Add.Balancing
instance GHC.Show.Show a => GHC.Show.Show (Buchhaltung.Add.Asserted a)
instance GHC.Base.Functor Buchhaltung.Add.Asserted
instance GHC.Classes.Eq Buchhaltung.Add.Partner
instance GHC.Show.Show Buchhaltung.Add.Partner
instance Data.Default.Class.Default Buchhaltung.Add.AssertedAmount

module Buchhaltung.Commandline
runMain :: IO ()
run :: Action -> FullOptions () -> ErrorT IO ()
runLedger :: MonadIO m => (FilePath -> t -> IO a) -> t -> Options User Config env -> m a
runHledger :: MonadIO m => (FilePath -> t -> IO a) -> t -> Options User Config env -> m a
runLedger' :: MonadIO m => (t1 -> t2 -> IO a) -> (config -> t1) -> (Ledgers -> FilePath) -> t2 -> Options User config env -> m a
