mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 10:41:59 +03:00
22 lines
354 B
Idris
22 lines
354 B
Idris
import Data.Fin
|
|
import Data.Maybe
|
|
|
|
data NNat = NZ | NS NNat
|
|
|
|
zsym : (x : NNat) -> x = NZ -> NZ = x
|
|
zsym NZ Refl = Refl
|
|
zsym (NS _) Refl impossible
|
|
|
|
zsym' : (x : NNat) -> x = NZ -> NZ = x
|
|
zsym' NZ Refl = Refl
|
|
|
|
foo : Nat -> String
|
|
foo 0 = "zero"
|
|
foo 1 = "one"
|
|
foo x = "something else"
|
|
|
|
bar : Fin (S (S (S Z))) -> String
|
|
bar 0 = "a"
|
|
bar 1 = "b"
|
|
bar 2 = "c"
|