0
comment
comment
on 10/10/2012 2:43 PM
In the previous post, I discussed designing combinator libraries that compose some property over unions. It is only fitting to throw records in the mix.
type U =
| A of int
| B of float
| C of string
let UFormat =
(
UnionCase A IntFormat <<
UnionCase B FloatFormat <<
UnionCase C StringFormat
)
|> Union (fun a b c x ->
match x with
| A x -> a x
| B x -> b x
| C x -> c x)
type R =
{
A : int
B : float
[...]