A JSON number, or a numeric string ("1000.0"), to Float.
Equations
- Actus.IO.Parse.jsonToFloat (Lean.Json.num n) = Except.ok n.toFloat
- Actus.IO.Parse.jsonToFloat (Lean.Json.str s) = do let j' ← Lean.Json.parse s let n ← j'.getNum? pure n.toFloat
- Actus.IO.Parse.jsonToFloat j = Except.error (toString "expected number, got " ++ toString j.compress)
Instances For
ISO-8601 date(-time) string "YYYY-MM-DD[THH:MM:SS]" to LocalTime. (The
23:59:59 end-of-day convention extends accrual to the next midnight but the
event is still stamped on the written date, so the date part is taken as-is.)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Is the timestamp end-of-day (…T23:59:59)?
Equations
- Actus.IO.Parse.isEndOfDay s = ((List.drop 1 (s.splitOn "T")).headD "").startsWith "23:59:59"
Instances For
Like parseDate, but a 23:59:59 end-of-day timestamp rolls to the next
midnight (used for event dates so computed and expected events align).
Equations
- Actus.IO.Parse.parseDateRoll s = do let base ← Actus.IO.Parse.parseDate s pure (if Actus.IO.Parse.isEndOfDay s = true then Actus.Util.Date.addDays base 1 else base)
Instances For
ACTUS cycle string, e.g. "P1ML1" (period 1 Month, long stub) or the older
"1M-" form, to Cycle. The leading P and a trailing stub marker
(L0/L1, or a +/- suffix) are both accepted; L1 or + mark a long
stub.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Actus.IO.Parse.eomOf = Actus.IO.Parse.enum✝ "endOfMonthConvention" [("EOM", Actus.Protocol.EndOfMonthConvention.EOMC_EOM), ("SD", Actus.Protocol.EndOfMonthConvention.EOMC_SD)]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode a terms object given as a raw JSON string.
Equations
- Actus.IO.Parse.termsFromString s = do let __do_lift ← Lean.Json.parse s Actus.IO.Parse.termsFromJson __do_lift
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Build a RiskFactorEnv from a test case's dataObserved, wiring the
rate-reset market series (Oʳᶠ(RRMO,·)). Settlement-currency factor is
1 (single-currency reference cases); prepayment/annuity default to none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One expected event from eventsObserved.
- type : Protocol.EventType
- time : Protocol.LocalTime
- payoff : Float
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
One actus-tests entry.
- identifier : String
- terms : Contract.Terms Float
- horizon : Option Protocol.LocalTime
- events : List ObservedEvent
Instances For
Decode a whole actus-tests file: a JSON object keyed by test id.
Equations
- One or more equations did not get rendered due to their size.
- Actus.IO.Parse.testFileFromJson j = Except.error "expected a JSON object keyed by test id"
Instances For
Decode a whole actus-tests file given as a raw JSON string.
Equations
- Actus.IO.Parse.testFileFromString s = do let __do_lift ← Lean.Json.parse s Actus.IO.Parse.testFileFromJson __do_lift
Instances For
Run the lending engine appropriate to the parsed contractType. Returns
[] for contract types outside the implemented lending family.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse a test case and compute its cashflows under its own observed risk factors — the full file → cashflows pipeline.
Equations
- Actus.IO.Parse.cashflowsOfTestCase tc raw = do let rf ← Actus.IO.Parse.riskFactorsFromJson raw tc.terms pure (Actus.IO.Parse.cashflowsOf tc.terms rf)