Safe Haskell | None |
---|---|
Language | Haskell2010 |
Co-records are sum types over an extensible set of options.
Documentation
A
is a value Corec
f rsf (r, s)
for exactly one choice of r
and s
such that (r, s)
is an element of rs
.
class ElemOf rs x where Source
The judgement
is satisified when there's an
equality between ElemOf
rs (r, s)(r, s)
and some element of rs
. More than this,
however, we assume that the first match of r
in rs
will work and
then defer matching the s
component until later. This helps inference
so long as the assumption that r
is "index-like" holds