Last active
September 23, 2016 21:59
-
-
Save CoderPuppy/235a4e543e77238d3f9c6c127345067d to your computer and use it in GitHub Desktop.
Amulet Type AST "Analysis"
This file contains hidden or 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
data Type = TName TypeName -- Foo | |
| TVar TypeVar -- a | |
| TLambda TypeVar Type -- \(a : Type) => b -- not strictly necessary | |
| TForAll TypeVar Type -- \{a : Type) => b | |
| TExists TypeVar Type -- (a : Type ** b) | |
| TFunc Type Type -- a -> b | |
| TArrow Constraint Type -- a => b | |
| TInst Type Type -- a b | |
type Nat f g = forall a. f a -> g a | |
Nat f g {a} = f a -> g a | |
Nat = \(f : Type) => \(g : Type) => \{a : Type} => f a -> g a | |
Nat = TLambda "f" $ TLambda "g" $ TForAll "a" $ TFunc (TInst (TVar "f") (TVar "a")) (TInst (TVar "g") (TVar "a")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment