Skip to content

Instantly share code, notes, and snippets.

@petercommand
Created September 15, 2016 11:43
Show Gist options
  • Save petercommand/955480cf4c182b7161edcbf5ba88f0ce to your computer and use it in GitHub Desktop.
Save petercommand/955480cf4c182b7161edcbf5ba88f0ce to your computer and use it in GitHub Desktop.
data W (S : Set) (P : S -> Set) : Set where
sup : (s : S) (f : P s -> W S P) -> W S P
data ⊥ : Set where
record ⊤ : Set where
data Bool : Set where
tt : Bool
ff : Bool
Nat : Set
Nat = W Bool (λ { tt -> ⊤
; ff -> ⊥ })
zero : Nat
zero = sup ff (λ ())
suc : Nat -> Nat
suc n = sup tt (λ _ -> n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment