Skip to content

Instantly share code, notes, and snippets.

@kubukoz
Created August 15, 2020 19:21
Show Gist options
  • Save kubukoz/c6363007f2780b17cd4387ac029ad41a to your computer and use it in GitHub Desktop.
Save kubukoz/c6363007f2780b17cd4387ac029ad41a to your computer and use it in GitHub Desktop.
let Rule
: Type
= ∀(_Rule : Type) →
∀(One : _Rule) →
∀(Two : _Rule) →
∀(Many : List _Rule → _Rule) →
_Rule
let example
: Rule
= λ(_Rule : Type) →
λ(One : _Rule) →
λ(Two : _Rule) →
λ(Many : List _Rule → _Rule) →
Many [ One, Two, Many [ Two, One ] ]
let all
: Rule → Natural
= λ(r : Rule) →
r
Natural
1
2
( λ(many : List Natural) →
List/fold
Natural
many
Natural
(λ(x : Natural) → λ(y : Natural) → x + y)
0
)
in all example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment