mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-21 22:17:19 +03:00
43127b17a7
They can be imported from the modules Data.Fin, Data.Vect, and Data.So respectively. The general thinking here is that not every program is going to need these, and they are often used especially by newcomers in place of something more appropriate. Also, all of them are useful for teaching, which means it is instructive for tutorials to introduce them and have people implement them themselves.
17 lines
338 B
Idris
17 lines
338 B
Idris
module Test
|
|
|
|
import Data.So
|
|
|
|
X : Nat -> Type
|
|
X t = (c : Nat ** So (c < 5))
|
|
|
|
column : X t -> Nat
|
|
column = getWitness
|
|
|
|
data Action = Left | Ahead | Right
|
|
|
|
admissible : X t -> Action -> Bool
|
|
admissible {t} x Ahead = column {t} x == 0 || column {t} x == 4
|
|
admissible {t} x Left = column {t} x <= 2
|
|
admissible {t} x Right = column {t} x >= 2
|