mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-30 07:02:24 +03:00
a972778eab
They don't all pass yet, for minor reasons. Coming shortly... Unfortunately the startup overhead for chez is really noticeable here!
23 lines
386 B
Plaintext
23 lines
386 B
Plaintext
data Nat : Type where
|
|
Z : Nat
|
|
S : Nat -> Nat
|
|
|
|
simpleAs : Nat -> Nat
|
|
simpleAs z@(_) = z
|
|
|
|
as : Nat -> Nat
|
|
as Z = Z
|
|
as p@(S $k) = p
|
|
|
|
plus : Nat -> Nat -> Nat
|
|
plus Z $y = y
|
|
plus (S $k) $y = S (plus k y)
|
|
|
|
data PairNat : Type where
|
|
MkPair : Nat -> Nat -> PairNat
|
|
|
|
pairPred : Nat -> PairNat
|
|
pairPred Z = MkPair Z Z
|
|
pairPred (S Z) = MkPair Z Z
|
|
pairPred (S p@(S $k)) = MkPair p k
|