ENH clean up types again

This commit is contained in:
Nathan Dwarshuis 2023-07-07 20:42:41 -04:00
parent 00346ff8ee
commit 90b88945c5
3 changed files with 28 additions and 31 deletions

View File

@ -278,7 +278,7 @@ let DatePat =
-} -}
< Cron : CronPat.Type | Mod : ModPat.Type > < Cron : CronPat.Type | Mod : ModPat.Type >
let TxOpts = let TxOpts_ =
{- Additional metadata to use when parsing a statement -} {- Additional metadata to use when parsing a statement -}
\(re : Type) -> \(re : Type) ->
{ Type = { Type =
@ -325,6 +325,8 @@ let TxOpts =
} }
} }
let TxOpts = TxOpts_ Text
let Field = let Field =
{- {-
General key-value type General key-value type
@ -732,6 +734,8 @@ let HistTransfer =
-} -}
Transfer TaggedAcnt.Type CurID DatePat TransferValue.Type Transfer TaggedAcnt.Type CurID DatePat TransferValue.Type
let TransferAmount = Amount DatePat TransferValue.Type
let Statement = let Statement =
{- {-
How to import a statement from local file(s). Statements are assumed to be How to import a statement from local file(s). Statements are assumed to be
@ -752,7 +756,7 @@ let Statement =
file delimiter as a numeric char, usually either tab (9) or comma (44) file delimiter as a numeric char, usually either tab (9) or comma (44)
-} -}
: Natural : Natural
, stmtTxOpts : (TxOpts Text).Type , stmtTxOpts : TxOpts.Type
, stmtSkipLines , stmtSkipLines
{- {-
how many lines to skip before parsing statement how many lines to skip before parsing statement
@ -874,6 +878,8 @@ let SingleAllocation =
-} -}
Allocation {} Allocation {}
let SingleAlloAmount = \(v : Type) -> Amount {} v
let MultiAllocation = let MultiAllocation =
{- {-
An allocation specialized to capturing multiple income streams within a given An allocation specialized to capturing multiple income streams within a given
@ -882,6 +888,8 @@ let MultiAllocation =
-} -}
Allocation Interval Allocation Interval
let MultiAlloAmount = \(v : Type) -> Amount Interval v
let HourlyPeriod = let HourlyPeriod =
{- {-
Definition for a pay period denominated in hours Definition for a pay period denominated in hours
@ -1120,6 +1128,7 @@ in { CurID
, CronPat , CronPat
, DatePat , DatePat
, TxOpts , TxOpts
, TxOpts_
, StatementParser , StatementParser
, StatementParser_ , StatementParser_
, ValMatcher , ValMatcher
@ -1171,4 +1180,7 @@ in { CurID
, HourlyPeriod , HourlyPeriod
, Period , Period
, PeriodType , PeriodType
, TransferAmount
, MultiAlloAmount
, SingleAlloAmount
} }

View File

@ -9,14 +9,6 @@ let nullEntry =
\(v : T.EntryNumGetter) -> \(v : T.EntryNumGetter) ->
T.FromEntryGetter::{ eAcnt = a, eValue = v } T.FromEntryGetter::{ eAcnt = a, eValue = v }
let nullOpts = (T.TxOpts Text)::{=}
let nullVal = T.ValMatcher::{=}
let nullMatch = T.StatementParser::{=}
let nullCron = T.CronPat::{=}
let nullMod = let nullMod =
\(by : Natural) -> \(by : Natural) ->
\(u : T.TimeUnit) -> \(u : T.TimeUnit) ->
@ -27,18 +19,17 @@ let cron1 =
\(m : Natural) -> \(m : Natural) ->
\(d : Natural) -> \(d : Natural) ->
T.DatePat.Cron T.DatePat.Cron
( nullCron T.CronPat::{
// { cpYear = Some (T.MDYPat.Single y) , cpYear = Some (T.MDYPat.Single y)
, cpMonth = Some (T.MDYPat.Single m) , cpMonth = Some (T.MDYPat.Single m)
, cpDay = Some (T.MDYPat.Single d) , cpDay = Some (T.MDYPat.Single d)
} }
)
let matchInf_ = nullMatch let matchInf_ = T.StatementParser::{=}
let matchInf = \(x : T.TxGetter.Type) -> nullMatch // { spTx = Some x } let matchInf = \(x : T.TxGetter.Type) -> T.StatementParser::{ spTx = Some x }
let matchN_ = \(n : Natural) -> nullMatch // { spTimes = Some n } let matchN_ = \(n : Natural) -> T.StatementParser::{ spTimes = Some n }
let matchN = let matchN =
\(n : Natural) -> \(n : Natural) ->
@ -120,13 +111,13 @@ let addDay =
\(d : Natural) -> \(d : Natural) ->
{ gYear = x.gmYear, gMonth = x.gmMonth, gDay = d } { gYear = x.gmYear, gMonth = x.gmMonth, gDay = d }
let mvP = nullVal // { vmSign = Some True } let mvP = T.ValMatcher::{ vmSign = Some True }
let mvN = nullVal // { vmSign = Some False } let mvN = T.ValMatcher::{ vmSign = Some False }
let mvNum = \(x : Natural) -> nullVal // { vmNum = Some x } let mvNum = \(x : Natural) -> T.ValMatcher::{ vmNum = Some x }
let mvDen = \(x : Natural) -> nullVal // { vmDen = Some x } let mvDen = \(x : Natural) -> T.ValMatcher::{ vmDen = Some x }
let mvNumP = \(x : Natural) -> mvP // { vmNum = Some x } let mvNumP = \(x : Natural) -> mvP // { vmNum = Some x }
@ -136,13 +127,7 @@ let mvDenP = \(x : Natural) -> mvP // { vmDen = Some x }
let mvDenN = \(x : Natural) -> mvN // { vmDen = Some x } let mvDenN = \(x : Natural) -> mvN // { vmDen = Some x }
in { nullEntry in { cron1
, nullMatch
, nullVal
, nullOpts
, nullCron
, nullMod
, cron1
, mY , mY
, mYM , mYM
, mYMD , mYMD

View File

@ -55,7 +55,7 @@ makeHaskellTypesWith
, SingleConstructor , SingleConstructor
"TxOpts" "TxOpts"
"TxOpts" "TxOpts"
"\\(re : Type) -> ((./dhall/Types.dhall).TxOpts re).Type" "\\(re : Type) -> ((./dhall/Types.dhall).TxOpts_ re).Type"
, SingleConstructor "AcntSet" "AcntSet" "(./dhall/Types.dhall).AcntSet.Type" , SingleConstructor "AcntSet" "AcntSet" "(./dhall/Types.dhall).AcntSet.Type"
, SingleConstructor "TransferMatcher" "TransferMatcher" "(./dhall/Types.dhall).TransferMatcher.Type" , SingleConstructor "TransferMatcher" "TransferMatcher" "(./dhall/Types.dhall).TransferMatcher.Type"
, SingleConstructor "ShadowTransfer" "ShadowTransfer" "(./dhall/Types.dhall).ShadowTransfer" , SingleConstructor "ShadowTransfer" "ShadowTransfer" "(./dhall/Types.dhall).ShadowTransfer"