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 >
let TxOpts =
let TxOpts_ =
{- Additional metadata to use when parsing a statement -}
\(re : Type) ->
{ Type =
@ -325,6 +325,8 @@ let TxOpts =
}
}
let TxOpts = TxOpts_ Text
let Field =
{-
General key-value type
@ -732,6 +734,8 @@ let HistTransfer =
-}
Transfer TaggedAcnt.Type CurID DatePat TransferValue.Type
let TransferAmount = Amount DatePat TransferValue.Type
let Statement =
{-
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)
-}
: Natural
, stmtTxOpts : (TxOpts Text).Type
, stmtTxOpts : TxOpts.Type
, stmtSkipLines
{-
how many lines to skip before parsing statement
@ -874,6 +878,8 @@ let SingleAllocation =
-}
Allocation {}
let SingleAlloAmount = \(v : Type) -> Amount {} v
let MultiAllocation =
{-
An allocation specialized to capturing multiple income streams within a given
@ -882,6 +888,8 @@ let MultiAllocation =
-}
Allocation Interval
let MultiAlloAmount = \(v : Type) -> Amount Interval v
let HourlyPeriod =
{-
Definition for a pay period denominated in hours
@ -1120,6 +1128,7 @@ in { CurID
, CronPat
, DatePat
, TxOpts
, TxOpts_
, StatementParser
, StatementParser_
, ValMatcher
@ -1171,4 +1180,7 @@ in { CurID
, HourlyPeriod
, Period
, PeriodType
, TransferAmount
, MultiAlloAmount
, SingleAlloAmount
}

View File

@ -9,14 +9,6 @@ let nullEntry =
\(v : T.EntryNumGetter) ->
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 =
\(by : Natural) ->
\(u : T.TimeUnit) ->
@ -27,18 +19,17 @@ let cron1 =
\(m : Natural) ->
\(d : Natural) ->
T.DatePat.Cron
( nullCron
// { cpYear = Some (T.MDYPat.Single y)
T.CronPat::{
, cpYear = Some (T.MDYPat.Single y)
, cpMonth = Some (T.MDYPat.Single m)
, 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 =
\(n : Natural) ->
@ -120,13 +111,13 @@ let addDay =
\(d : Natural) ->
{ 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 }
@ -136,13 +127,7 @@ let mvDenP = \(x : Natural) -> mvP // { vmDen = Some x }
let mvDenN = \(x : Natural) -> mvN // { vmDen = Some x }
in { nullEntry
, nullMatch
, nullVal
, nullOpts
, nullCron
, nullMod
, cron1
in { cron1
, mY
, mYM
, mYMD

View File

@ -55,7 +55,7 @@ makeHaskellTypesWith
, SingleConstructor
"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 "TransferMatcher" "TransferMatcher" "(./dhall/Types.dhall).TransferMatcher.Type"
, SingleConstructor "ShadowTransfer" "ShadowTransfer" "(./dhall/Types.dhall).ShadowTransfer"