Created
November 26, 2020 02:45
-
-
Save jcaesar/d20d79e706660ccf3b7e3cb7130a318c to your computer and use it in GitHub Desktop.
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
| let Expr | |
| : Type → Type | |
| = λ(A : Type) → | |
| ∀(Expr : Type → Type) → | |
| ∀(If : { cond : Text, thenE : Expr A, elseE : Expr A } → Expr A) → | |
| ∀(Ref : Text → Expr A) → | |
| ∀(Lit : A → Expr A) → | |
| Expr A | |
| let example | |
| : Expr Natural | |
| = λ(Expr : Type → Type) → | |
| λ ( If | |
| : { cond : Text, thenE : Expr Natural, elseE : Expr Natural } → | |
| Expr Natural | |
| ) → | |
| λ(Ref : Text → Expr Natural) → | |
| λ(Lit : Natural → Expr Natural) → | |
| If { cond = "asdf", thenE = Ref "bsdf", elseE = Lit 42 } | |
| let atoms = | |
| λ(A : Type) → | |
| λ(expr : Expr A) → | |
| expr | |
| (λ(ignored : Type) → List Text) | |
| ( λ(If : { cond : Text, thenE : List Text, elseE : List Text }) → | |
| [ If.cond ] # If.thenE # If.elseE | |
| ) | |
| (λ(Ref : Text) → [ Ref ]) | |
| (λ(Lit : A) → [] : List Text) | |
| in atoms Natural example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment