Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Control.Monad.Except
- type CommonM env = RWST (FullOptions env) () () (ErrorT IO)
- type Version = Text
- data SFormat a = SFormat {}
- data Source = Source {}
- fromMapToSource :: SFormat Version -> HashMap Text Text -> Source
- sourceToMap :: Source -> Map Text Text
- formatToAssoc :: IsString a => SFormat Text -> [(a, Text)]
- json :: Source -> Text
- stripPrefixOptions :: Int -> Options
- newtype ImportTag = ImportTag {}
- 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 {}
- 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
- 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 = HashMap Username User
- newtype Username = Username Text
- fromUsername :: Username -> 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 Text
- askAccountMap :: MonadReader (Options User config env) m => m AccountMap
- newtype BankAccounts = BankAccounts {}
- isIgnored :: Maybe [Regex] -> AccountName -> Bool
- data Regex = Regex {}
- data AccountId = AccountId {}
- type AccountMap = HashMap AccountId AccountName
- parseAccountMap :: FromJSON b => (Text, Value) -> Parser [(AccountId, b)]
- data AQBankingConf = AQBankingConf {}
- data AQConnection = AQConnection {}
- data AQType
- data HBCIv
- toArg :: IsString p => HBCIv -> p
- type PaypalUsername = Text
- data Action
- data ImportAction
- = Paypal PaypalUsername
- | AQBankingImport
- | ComdirectVisa { }
- | BarclaycardUs
- | NatwestIntl
- | BarclaysUk
- | Pncbank { }
- | Monefy MonefySettings
- | Revolut (RevolutSettings ())
- data MonefySettings = MonefySettings {}
- data RevolutSettings a = RevolutSettings {
- revolutCurrency :: a
- revolutUser :: Text
- type Comment = 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 -> HashMap Text Text -> Source Source #
Creates a Source
from non null values of a HashMap (e.g. from
MyRecord
)
sourceToMap :: Source -> Map Text Text Source #
produces a map that includes sFormat
under the keys "formatName"
and "formatVersion"
stripPrefixOptions :: Int -> Options Source #
Import Tag
Error handling
throwFormat :: MonadError Msg m => Format Text t -> (t -> Msg) -> m b Source #
maybeThrow :: MonadError Msg m => Format 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 (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 -> a) -> m a 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 -> 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 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 = HashMap AccountId AccountName 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 = Text Source #
data ImportAction Source #
data MonefySettings Source #
data RevolutSettings a Source #
Functor RevolutSettings Source # | |
Show a => Show (RevolutSettings a) Source # | |
Generic (RevolutSettings a) Source # | |
NFData a => NFData (RevolutSettings a) Source # | |
type Rep (RevolutSettings a) Source # | |