ContingentClaims.Core.Internal.Claim¶
Data Types¶
data Claim t x a o
Core data type used to model cashflows of instruments. In the reference paper from Peyton-Jones this is called ‘Contract’. We renamed it to avoid ambiguity.
tcorresponds to the time parameter.xcorresponds to theObservationoutput type. An observation is a function fromttox. A common choice is to useTimeandDecimal, respectively.ais the representation of a deliverable asset, e.g. aTextISIN code or anInstrumentKey.ois the representation of an observable, e.g. aText.You should build the
Claimusing the smart constructors (e.g.zero,and) instead of using the data constructors directly (Zero,And).Represents an absence of claims. MonoidAndidentity.One a
The bearer acquires one unit ofaimmediately.The obligations of the bearer and the counterparty are reversed.Gives the bearer the right to the first claim if
predicateis true, else the second claim.
Field Type Description predicate Inequality t x o success Claim t x a o failure Claim t x a o Multiplies the
claimbyk(which can be non-deterministic).
Field Type Description k Observation t x o claim Claim t x a o Defers the acquisition of
claimuntil the first instant thatpredicateis true.
Field Type Description predicate Inequality t x o claim Claim t x a o Gives the bearer the right to enter a claim at any time the predicate is true.
Field Type Description predicate Inequality t x o electable Electable t x a o Expires said claim on the first instant that
predicateis true.
Field Type Description predicate Inequality t x o claim Claim t x a o instance Corecursive (Claim t x a o) (ClaimF t x a o)
instance Recursive (Claim t x a o) (ClaimF t x a o)
instance (Eq a, Eq x, Eq o, Eq t) => Eq (Claim t x a o)
instance (Show t, Show x, Show a, Show o) => Show (Claim t x a o)
- type Electable t x a o
-
Type synonym for sub-trees that can be elected in an
OrorAnytimenode. The textual tag is used to identify each sub-tree when an election is made.
data Inequality t x o
Data type for boolean predicates supported by the library. A boolean predicate is a generic function with signature
t -> Bool. However, a limited set of predicates is currently supported.TimeGte t
Truewhentime ≥ t,Falseotherwise.TimeLte t
Truewhentime ≤ t,Falseotherwise.Lte (Observation t x o, Observation t x o)
Truewheno(t) ≤ o'(t),Falseotherwise, for a pair of observationso,o'.instance (Eq t, Eq x, Eq o) => Eq (Inequality t x o)
instance (Show t, Show x, Show o) => Show (Inequality t x o)