mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
12 lines
243 B
Idris
12 lines
243 B
Idris
|
data Fin : Nat -> Type where
|
||
|
FZ : Fin (S k)
|
||
|
FS : Fin k -> Fin (S k)
|
||
|
|
||
|
%builtin Natural Fin
|
||
|
|
||
|
finToInteger : {k : _} -> Fin k -> Integer
|
||
|
finToInteger FZ = 0
|
||
|
finToInteger (FS k) = 1 + finToInteger k
|
||
|
|
||
|
%builtin NaturalToInteger finToInteger
|