From a144b9fa3cfbeed97f0bc1fb789f033db766c2fe Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Fri, 16 Jun 2023 23:41:01 -0400 Subject: [PATCH] ENH update dhall interface --- dhall/Types.dhall | 2 +- dhall/common.dhall | 31 +++++++------------------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/dhall/Types.dhall b/dhall/Types.dhall index f6f4b24..f8e4793 100644 --- a/dhall/Types.dhall +++ b/dhall/Types.dhall @@ -476,7 +476,7 @@ let EntryGetter = Means for getting an entry from a given row in a statement -} { Type = Entry EntryAcntGetter EntryNumGetter TagID - , default = { eValue = None EntryNumGetter, eComment = "" } + , default = { eComment = "", eTags = [] : List TagID } } let TxSubGetter = diff --git a/dhall/common.dhall b/dhall/common.dhall index 275d926..dd888bf 100644 --- a/dhall/common.dhall +++ b/dhall/common.dhall @@ -6,8 +6,8 @@ let T = ./Types.dhall let nullEntry = \(a : T.EntryAcntGetter) -> - \(c : T.EntryCurGetter) -> - T.ToEntryGetter::{ eAcnt = a, eCurrency = c, eTags = [] : List T.TagID } + \(v : T.EntryNumGetter) -> + T.EntryGetter::{ eAcnt = a, eValue = v } let nullOpts = T.TxOpts::{=} @@ -89,30 +89,15 @@ let mRngYMD = let PartEntry = { _1 : T.AcntID, _2 : Double, _3 : Text } let partN = - \(c : T.EntryCurGetter) -> - \(a : T.EntryAcntGetter) -> - \(comment : Text) -> \(ss : List PartEntry) -> let toEntry = \(x : PartEntry) -> - nullEntry (T.EntryAcntGetter.ConstT x._1) c - // { eValue = Some (T.ToEntryNumGetter.TConstN x._2) - , eComment = x._3 - } + nullEntry + (T.EntryAcntGetter.ConstT x._1) + (T.EntryNumGetter.ConstN x._2) + // { eComment = x._3 } - in [ nullEntry a c // { eComment = comment } ] - # List/map PartEntry T.ToEntryGetter.Type toEntry ss - -let part1 = - \(c : T.EntryCurGetter) -> - \(a : T.EntryAcntGetter) -> - \(comment : Text) -> - partN c a comment ([] : List PartEntry) - -let part1_ = - \(c : T.EntryCurGetter) -> - \(a : T.EntryAcntGetter) -> - partN c a "" ([] : List PartEntry) + in List/map PartEntry T.EntryGetter.Type toEntry ss let addDay = \(x : T.GregorianM) -> @@ -157,8 +142,6 @@ in { nullEntry , greg , gregM , partN - , part1 - , part1_ , addDay , comma = 44 , tab = 9