ADD lots of bangs
This commit is contained in:
parent
9197837cce
commit
54342fbe74
|
@ -83,7 +83,7 @@ data DBState = DBState
|
||||||
, kmBudgetInterval :: !MaybeBounds
|
, kmBudgetInterval :: !MaybeBounds
|
||||||
, kmStatementInterval :: !MaybeBounds
|
, kmStatementInterval :: !MaybeBounds
|
||||||
, kmNewCommits :: ![Int]
|
, kmNewCommits :: ![Int]
|
||||||
, kmConfigDir :: FilePath
|
, kmConfigDir :: !FilePath
|
||||||
}
|
}
|
||||||
|
|
||||||
type MappingT m a = ReaderT DBState (SqlPersistT m) a
|
type MappingT m a = ReaderT DBState (SqlPersistT m) a
|
||||||
|
|
|
@ -115,22 +115,22 @@ whenHash t o def f = do
|
||||||
|
|
||||||
-- TODO allow currency conversions here
|
-- TODO allow currency conversions here
|
||||||
data BudgetSplit b = BudgetSplit
|
data BudgetSplit b = BudgetSplit
|
||||||
{ bsAcnt :: AcntID
|
{ bsAcnt :: !AcntID
|
||||||
, bsBucket :: Maybe b
|
, bsBucket :: !(Maybe b)
|
||||||
}
|
}
|
||||||
|
|
||||||
data BudgetMeta = BudgetMeta
|
data BudgetMeta = BudgetMeta
|
||||||
{ bmCommit :: Key CommitR
|
{ bmCommit :: !(Key CommitR)
|
||||||
, bmWhen :: Day
|
, bmWhen :: !Day
|
||||||
, bmCur :: CurID
|
, bmCur :: !CurID
|
||||||
}
|
}
|
||||||
|
|
||||||
data BudgetTx = BudgetTx
|
data BudgetTx = BudgetTx
|
||||||
{ btMeta :: BudgetMeta
|
{ btMeta :: !BudgetMeta
|
||||||
, btFrom :: BudgetSplit IncomeBucket
|
, btFrom :: !(BudgetSplit IncomeBucket)
|
||||||
, btTo :: BudgetSplit ExpenseBucket
|
, btTo :: !(BudgetSplit ExpenseBucket)
|
||||||
, btValue :: Rational
|
, btValue :: !Rational
|
||||||
, btDesc :: T.Text
|
, btDesc :: !T.Text
|
||||||
}
|
}
|
||||||
|
|
||||||
insertIncome :: MonadUnliftIO m => Income -> MappingT m [InsertError]
|
insertIncome :: MonadUnliftIO m => Income -> MappingT m [InsertError]
|
||||||
|
|
|
@ -84,8 +84,8 @@ matchToGroup ms =
|
||||||
|
|
||||||
-- TDOO could use a better struct to flatten the maybe date subtype
|
-- TDOO could use a better struct to flatten the maybe date subtype
|
||||||
data MatchGroup = MatchGroup
|
data MatchGroup = MatchGroup
|
||||||
{ mgDate :: [Match]
|
{ mgDate :: ![Match]
|
||||||
, mgNoDate :: [Match]
|
, mgNoDate :: ![Match]
|
||||||
}
|
}
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
|
|
|
@ -292,8 +292,8 @@ deriving instance Hashable Transfer
|
||||||
-- Statements (data from the past)
|
-- Statements (data from the past)
|
||||||
|
|
||||||
data Statement
|
data Statement
|
||||||
= StmtManual Manual
|
= StmtManual !Manual
|
||||||
| StmtImport Import
|
| StmtImport !Import
|
||||||
deriving (Generic, FromDhall)
|
deriving (Generic, FromDhall)
|
||||||
|
|
||||||
deriving instance Hashable Manual
|
deriving instance Hashable Manual
|
||||||
|
@ -381,8 +381,8 @@ deriving instance Show SplitNum
|
||||||
data SplitText t
|
data SplitText t
|
||||||
= ConstT !t
|
= ConstT !t
|
||||||
| LookupT !T.Text
|
| LookupT !T.Text
|
||||||
| MapT (FieldMap T.Text t)
|
| MapT !(FieldMap T.Text t)
|
||||||
| Map2T (FieldMap (T.Text, T.Text) t)
|
| Map2T !(FieldMap (T.Text, T.Text) t)
|
||||||
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
||||||
|
|
||||||
type SplitCur = SplitText CurID
|
type SplitCur = SplitText CurID
|
||||||
|
@ -398,8 +398,8 @@ data Field k v = Field
|
||||||
type FieldMap k v = Field k (M.Map k v)
|
type FieldMap k v = Field k (M.Map k v)
|
||||||
|
|
||||||
data MatchOther
|
data MatchOther
|
||||||
= Desc (Field T.Text T.Text)
|
= Desc !(Field T.Text T.Text)
|
||||||
| Val (Field T.Text MatchVal)
|
| Val !(Field T.Text MatchVal)
|
||||||
deriving (Show, Eq, Hashable, Generic, FromDhall)
|
deriving (Show, Eq, Hashable, Generic, FromDhall)
|
||||||
|
|
||||||
data ToTx = ToTx
|
data ToTx = ToTx
|
||||||
|
@ -410,12 +410,12 @@ data ToTx = ToTx
|
||||||
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
||||||
|
|
||||||
data Match = Match
|
data Match = Match
|
||||||
{ mDate :: Maybe MatchDate
|
{ mDate :: !(Maybe MatchDate)
|
||||||
, mVal :: MatchVal
|
, mVal :: !MatchVal
|
||||||
, mDesc :: Maybe Text
|
, mDesc :: !(Maybe Text)
|
||||||
, mOther :: ![MatchOther]
|
, mOther :: ![MatchOther]
|
||||||
, mTx :: Maybe ToTx
|
, mTx :: !(Maybe ToTx)
|
||||||
, mTimes :: Maybe Natural
|
, mTimes :: !(Maybe Natural)
|
||||||
, mPriority :: !Integer
|
, mPriority :: !Integer
|
||||||
}
|
}
|
||||||
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
deriving (Eq, Generic, Hashable, Show, FromDhall)
|
||||||
|
@ -487,8 +487,8 @@ data TxRecord = TxRecord
|
||||||
{ trDate :: !Day
|
{ trDate :: !Day
|
||||||
, trAmount :: !Rational
|
, trAmount :: !Rational
|
||||||
, trDesc :: !T.Text
|
, trDesc :: !T.Text
|
||||||
, trOther :: M.Map T.Text T.Text
|
, trOther :: !(M.Map T.Text T.Text)
|
||||||
, trFile :: FilePath
|
, trFile :: !FilePath
|
||||||
}
|
}
|
||||||
deriving (Show, Eq, Ord)
|
deriving (Show, Eq, Ord)
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ type RawTx = Tx RawSplit
|
||||||
|
|
||||||
type BalTx = Tx BalSplit
|
type BalTx = Tx BalSplit
|
||||||
|
|
||||||
data MatchRes a = MatchPass a | MatchFail | MatchSkip
|
data MatchRes a = MatchPass !a | MatchFail | MatchSkip
|
||||||
|
|
||||||
data BalanceType = TooFewSplits | NotOneBlank deriving (Show)
|
data BalanceType = TooFewSplits | NotOneBlank deriving (Show)
|
||||||
|
|
||||||
|
@ -535,10 +535,10 @@ data MatchType = MatchNumeric | MatchText deriving (Show)
|
||||||
data SplitIDType = AcntField | CurField deriving (Show)
|
data SplitIDType = AcntField | CurField deriving (Show)
|
||||||
|
|
||||||
data LookupSuberr
|
data LookupSuberr
|
||||||
= SplitIDField SplitIDType
|
= SplitIDField !SplitIDType
|
||||||
| SplitValField
|
| SplitValField
|
||||||
| MatchField MatchType
|
| MatchField !MatchType
|
||||||
| DBKey SplitIDType
|
| DBKey !SplitIDType
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
data AllocationSuberr
|
data AllocationSuberr
|
||||||
|
@ -549,15 +549,15 @@ data AllocationSuberr
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
data InsertError
|
data InsertError
|
||||||
= RegexError T.Text
|
= RegexError !T.Text
|
||||||
| MatchValPrecisionError Natural Natural
|
| MatchValPrecisionError !Natural !Natural
|
||||||
| InsertIOError T.Text
|
| InsertIOError !T.Text
|
||||||
| ParseError T.Text
|
| ParseError !T.Text
|
||||||
| ConversionError T.Text
|
| ConversionError !T.Text
|
||||||
| LookupError LookupSuberr T.Text
|
| LookupError !LookupSuberr !T.Text
|
||||||
| BalanceError BalanceType CurID [RawSplit]
|
| BalanceError !BalanceType !CurID ![RawSplit]
|
||||||
| IncomeError DatePat
|
| IncomeError !DatePat
|
||||||
| StatementError [TxRecord] [Match]
|
| StatementError ![TxRecord] ![Match]
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
newtype InsertException = InsertException [InsertError] deriving (Show)
|
newtype InsertException = InsertException [InsertError] deriving (Show)
|
||||||
|
|
|
@ -56,7 +56,7 @@ gregMTup GregorianM {..} =
|
||||||
, fromIntegral gmMonth
|
, fromIntegral gmMonth
|
||||||
)
|
)
|
||||||
|
|
||||||
data YMD_ = Y_ Integer | YM_ Integer Int | YMD_ Integer Int Int
|
data YMD_ = Y_ !Integer | YM_ !Integer !Int | YMD_ !Integer !Int !Int
|
||||||
|
|
||||||
fromMatchYMD :: MatchYMD -> YMD_
|
fromMatchYMD :: MatchYMD -> YMD_
|
||||||
fromMatchYMD m = case m of
|
fromMatchYMD m = case m of
|
||||||
|
|
Loading…
Reference in New Issue