Created
August 9, 2015 00:36
-
-
Save davidgrenier/edd0e0ddc94172901191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Meta = interface end | |
type U<'ty>() = | |
class | |
interface Meta | |
end | |
type K<'ty, 'x>(elem: 'x) = | |
interface Meta | |
member x.Elem = elem | |
type Id<'ty>(elem: 'ty) = | |
interface Meta | |
member x.Elem = elem | |
type Sum<'ty,'a,'b when 'a :> Meta and 'b :> Meta>(elem: Choice<'a,'b>) = | |
interface Meta | |
member x.Elem = elem | |
type Prod<'ty, 'a, 'b when 'a :> Meta and 'b :> Meta>(e1: 'a, e2: 'b) = | |
interface Meta | |
member x.Elem = e1, e2 | |
member x.E1 = e1 | |
member x.E2 = e2 | |
type Elems = | |
| Cons of int * Elems | |
| Val of int | |
| Nil | |
type ElemsRep = | |
Sum<Elems, | |
Sum<Elems, | |
Prod<Elems, K<Elems, int>, Id<Elems>>, | |
K<Elems, int>>, | |
U<Elems>> |
Or this:
type ElemsRep =
Prod<Elems,
Sum<Elems,
Prod<Elems, K<Elems, int>, Prod<Elems, Id<Elems>, U<Elems>>>,
Sum<Elems,
Prod<Elems, K<Elems, int>, U<Elems>>,
U<Elems>>>,
U<Elems>>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perhaps this is what was intended