Module ContingentClaims.Core.Claim

Data Types

type T

= Claim

Type synonym for Claim.

Functions

zero

: Claim t x a o

Smart constructor for Zero.

one

: a -> Claim t x a o

Smart constructor for One.

give

: Claim t x a o -> Claim t x a o

Smart constructor for Give.

and

: Claim t x a o -> Claim t x a o -> Claim t x a o

Smart constructor for And. Because of the explicit representation of the first two arguments of an And, it can be cumbersome to write And c c' []. With this constructor, you can write c \\``and\\ c’`` instead. Flattens nested And``s and applies additive monoid identity eagerly\. Note this is an ``O(n) operation. For a more efficient alternative, consider mconcat.

or

: Claim t x a o -> Claim t x a o -> Claim t x a o

Smart constructor for Or. Because of the explicit representation of the first two arguments of an Or, it can be cumbersome to write Or c c' []. With this constructor, you can write c \\``or\\ c’`` instead. Flattens nested Or``s\. Unlike ``and, this does not apply a monoid identity. Note this is an O(n) operation.

cond

: Inequality t x o -> Claim t x a o -> Claim t x a o -> Claim t x a o

Smart constructor for Cond.

scale

: Observation t x o -> Claim t x a o -> Claim t x a o

Smart constructor for Scale.

when

: Inequality t x o -> Claim t x a o -> Claim t x a o

Smart constructor for When.

anytime

: Inequality t x o -> Claim t x a o -> Claim t x a o

Smart constructor for Anytime.

until

: Inequality t x o -> Claim t x a o -> Claim t x a o

Smart constructor for Until.

mapParams

: (t -> i) -> (i -> t) -> (a -> a’) -> (o -> o’) -> (x -> x’) -> Claim i x a o -> Claim t x’ a’ o’

Replace parameters in an Claim with actual values.

at

: t -> Inequality t x o

Smart constructor for TimeGte. This boolean predicate is True for time ≥ t, False otherwise.

upTo

: t -> Inequality t x a

Observable that is true for time ≤ t. This boolean predicate is True for time ≤ t, False otherwise.

(<=)

: Observation t x o -> Observation t x o -> Inequality t x o

Smart constructor for Lte. import Prelude hiding ((<=)) in order to use this.

compare

: (Ord t, Ord x, Number x, Divisible x, Action m) => (o -> t -> m x) -> Inequality t x o -> t -> m Bool

Reify the Inequality into an observation function. This function is used to convert an abstract inequalityvation, e.g. S 50.0 to the actual observation function t -> m Bool. The function is only total when the first argument is too (typically it will fail on t > today).