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