ADD lots of bangs

This commit is contained in:
Nathan Dwarshuis 2023-01-30 22:57:42 -05:00
parent 9197837cce
commit 54342fbe74
5 changed files with 40 additions and 40 deletions

View File

@ -83,7 +83,7 @@ data DBState = DBState
, kmBudgetInterval :: !MaybeBounds
, kmStatementInterval :: !MaybeBounds
, kmNewCommits :: ![Int]
, kmConfigDir :: FilePath
, kmConfigDir :: !FilePath
}
type MappingT m a = ReaderT DBState (SqlPersistT m) a

View File

@ -115,22 +115,22 @@ whenHash t o def f = do
-- TODO allow currency conversions here
data BudgetSplit b = BudgetSplit
{ bsAcnt :: AcntID
, bsBucket :: Maybe b
{ bsAcnt :: !AcntID
, bsBucket :: !(Maybe b)
}
data BudgetMeta = BudgetMeta
{ bmCommit :: Key CommitR
, bmWhen :: Day
, bmCur :: CurID
{ bmCommit :: !(Key CommitR)
, bmWhen :: !Day
, bmCur :: !CurID
}
data BudgetTx = BudgetTx
{ btMeta :: BudgetMeta
, btFrom :: BudgetSplit IncomeBucket
, btTo :: BudgetSplit ExpenseBucket
, btValue :: Rational
, btDesc :: T.Text
{ btMeta :: !BudgetMeta
, btFrom :: !(BudgetSplit IncomeBucket)
, btTo :: !(BudgetSplit ExpenseBucket)
, btValue :: !Rational
, btDesc :: !T.Text
}
insertIncome :: MonadUnliftIO m => Income -> MappingT m [InsertError]

View File

@ -84,8 +84,8 @@ matchToGroup ms =
-- TDOO could use a better struct to flatten the maybe date subtype
data MatchGroup = MatchGroup
{ mgDate :: [Match]
, mgNoDate :: [Match]
{ mgDate :: ![Match]
, mgNoDate :: ![Match]
}
deriving (Show)

View File

@ -292,8 +292,8 @@ deriving instance Hashable Transfer
-- Statements (data from the past)
data Statement
= StmtManual Manual
| StmtImport Import
= StmtManual !Manual
| StmtImport !Import
deriving (Generic, FromDhall)
deriving instance Hashable Manual
@ -381,8 +381,8 @@ deriving instance Show SplitNum
data SplitText t
= ConstT !t
| LookupT !T.Text
| MapT (FieldMap T.Text t)
| Map2T (FieldMap (T.Text, T.Text) t)
| MapT !(FieldMap T.Text t)
| Map2T !(FieldMap (T.Text, T.Text) t)
deriving (Eq, Generic, Hashable, Show, FromDhall)
type SplitCur = SplitText CurID
@ -398,8 +398,8 @@ data Field k v = Field
type FieldMap k v = Field k (M.Map k v)
data MatchOther
= Desc (Field T.Text T.Text)
| Val (Field T.Text MatchVal)
= Desc !(Field T.Text T.Text)
| Val !(Field T.Text MatchVal)
deriving (Show, Eq, Hashable, Generic, FromDhall)
data ToTx = ToTx
@ -410,12 +410,12 @@ data ToTx = ToTx
deriving (Eq, Generic, Hashable, Show, FromDhall)
data Match = Match
{ mDate :: Maybe MatchDate
, mVal :: MatchVal
, mDesc :: Maybe Text
{ mDate :: !(Maybe MatchDate)
, mVal :: !MatchVal
, mDesc :: !(Maybe Text)
, mOther :: ![MatchOther]
, mTx :: Maybe ToTx
, mTimes :: Maybe Natural
, mTx :: !(Maybe ToTx)
, mTimes :: !(Maybe Natural)
, mPriority :: !Integer
}
deriving (Eq, Generic, Hashable, Show, FromDhall)
@ -487,8 +487,8 @@ data TxRecord = TxRecord
{ trDate :: !Day
, trAmount :: !Rational
, trDesc :: !T.Text
, trOther :: M.Map T.Text T.Text
, trFile :: FilePath
, trOther :: !(M.Map T.Text T.Text)
, trFile :: !FilePath
}
deriving (Show, Eq, Ord)
@ -526,7 +526,7 @@ type RawTx = Tx RawSplit
type BalTx = Tx BalSplit
data MatchRes a = MatchPass a | MatchFail | MatchSkip
data MatchRes a = MatchPass !a | MatchFail | MatchSkip
data BalanceType = TooFewSplits | NotOneBlank deriving (Show)
@ -535,10 +535,10 @@ data MatchType = MatchNumeric | MatchText deriving (Show)
data SplitIDType = AcntField | CurField deriving (Show)
data LookupSuberr
= SplitIDField SplitIDType
= SplitIDField !SplitIDType
| SplitValField
| MatchField MatchType
| DBKey SplitIDType
| MatchField !MatchType
| DBKey !SplitIDType
deriving (Show)
data AllocationSuberr
@ -549,15 +549,15 @@ data AllocationSuberr
deriving (Show)
data InsertError
= RegexError T.Text
| MatchValPrecisionError Natural Natural
| InsertIOError T.Text
| ParseError T.Text
| ConversionError T.Text
| LookupError LookupSuberr T.Text
| BalanceError BalanceType CurID [RawSplit]
| IncomeError DatePat
| StatementError [TxRecord] [Match]
= RegexError !T.Text
| MatchValPrecisionError !Natural !Natural
| InsertIOError !T.Text
| ParseError !T.Text
| ConversionError !T.Text
| LookupError !LookupSuberr !T.Text
| BalanceError !BalanceType !CurID ![RawSplit]
| IncomeError !DatePat
| StatementError ![TxRecord] ![Match]
deriving (Show)
newtype InsertException = InsertException [InsertError] deriving (Show)

View File

@ -56,7 +56,7 @@ gregMTup GregorianM {..} =
, 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 m = case m of