Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Control.Monad.Except
- type CommonM env = RWST (FullOptions env) () () (ErrorT IO)
- type Version = T.Text
- data SFormat a = SFormat {}
- data Source = Source {}
- fromMapToSource :: SFormat Version -> HM.HashMap T.Text T.Text -> Source
- sourceToMap :: Source -> M.Map T.Text T.Text
- formatToAssoc :: IsString t => SFormat T.Text -> [(t, T.Text)]
- json :: Source -> TL.Text
- stripPrefixOptions :: Int -> A.Options
- newtype ImportTag = ImportTag {}
- type Msg = T.Text
- type Error = Either Msg
- type ErrorT = ExceptT Msg
- throwFormat :: MonadError Msg m => Format T.Text t -> (t -> Msg) -> m b
- maybeThrow :: MonadError Msg m => Format T.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 (M.Map k a)
- data Options user config env = Options {}
- 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 -> FilePath) -> m FilePath
- absolute :: MonadReader (Options user config env) m => FilePath -> m FilePath
- data Config = Config {}
- 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 {}
- type Users = HM.HashMap Username User
- newtype Username = Username T.Text
- fromUsername :: Username -> T.Text
- 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 {}
- receivablePayable :: (MonadError Msg m, MonadReader (FullOptions env) m) => Bool -> User -> m T.Text
- askAccountMap :: MonadReader (Options User config env) m => m AccountMap
- newtype BankAccounts = BankAccounts AccountMap
- fromBankAccounts :: BankAccounts -> AccountMap
- isIgnored :: User -> AccountName -> Bool
- data Regex = Regex {}
- data AccountId = AccountId {}
- type AccountMap = HM.HashMap AccountId AccountName
- parseAccountMap :: A.FromJSON b => (T.Text, A.Value) -> A.Parser [(AccountId, b)]
- data AQBankingConf = AQBankingConf {}
- data AQConnection = AQConnection {}
- data AQType
- data HBCIv
- toArg :: IsString t => HBCIv -> t
- type PaypalUsername = T.Text
- data Action
- data ImportAction
- type Comment = T.Text
Documentation
module Control.Monad.Except
Monad used for most of the funtionality
The Source of an imported transaction
represents a key value store and a protocol
fromMapToSource :: SFormat Version -> HM.HashMap T.Text T.Text -> Source Source #
Creates a Source
from non null values of a HashMap (e.g. from
MyRecord
)
sourceToMap :: Source -> M.Map T.Text T.Text Source #
produces a map that includes sFormat
under the keys "formatName"
and "formatVersion"
stripPrefixOptions :: Int -> A.Options Source #
Import Tag
Error handling
throwFormat :: MonadError Msg m => Format T.Text t -> (t -> Msg) -> m b Source #
maybeThrow :: MonadError Msg m => Format T.Text t -> (t -> Msg) -> (a1 -> m b) -> Maybe a1 -> m b Source #
lookupErrM :: (MonadError Msg m, Show a) => String -> (a -> t -> Maybe b) -> a -> t -> m b Source #
fromListUnique :: (MonadError Msg m, Show k, Ord k) => [(k, a)] -> m (M.Map k a) Source #
Options
toFull :: MonadError Msg m => RawOptions env -> Config -> m (FullOptions env) Source #
Reading options
readConfig :: MonadReader (Options user config env) m => (config -> a) -> m a Source #
readUser :: MonadReader (Options user config env) m => (user -> a) -> m a Source #
user :: MonadReader (Options user config env) m => m user Source #
readLedger :: MonadReader (Options User config env) m => (Ledgers -> FilePath) -> m FilePath Source #
absolute :: MonadReader (Options user config env) m => FilePath -> m FilePath Source #
get absolute paths in profile dir
Config
Config | |
|
askTodoFilter :: MonadReader (Options user Config env) m => m (AccountName -> Bool) Source #
User
User | |
|
fromUsername :: Username -> T.Text Source #
Reading User settings
lookupUser :: (MonadError Msg m, MonadReader (Options user Config e) m) => Username -> m User Source #
Looks up a user and throws an error if they do not exist.
:: (MonadError Msg m, MonadReader (Options user Config e) m) | |
=> Int | default position in user list |
-> m User |
A User's ledger files
Ledgers | |
|
:: (MonadError Msg m, MonadReader (FullOptions env) m) | |
=> Bool | TRUE | FALSE = for (this | the other) user's ledger |
-> User | the other user |
-> m T.Text |
generates the receiable/payable account for between two users (suffixed by the current, the recording, user)
A user's bank accounts
askAccountMap :: MonadReader (Options User config env) m => m AccountMap Source #
newtype BankAccounts Source #
type AccountMap = HM.HashMap AccountId AccountName Source #
parseAccountMap :: A.FromJSON b => (T.Text, A.Value) -> A.Parser [(AccountId, b)] Source #
AQBanking
other modes have to be setup manually. Refer to the AQBanking
manual. Use the '-C' to point to the configured configDir
.
Actions
type PaypalUsername = T.Text Source #
data ImportAction Source #