Idris-dev/test/reg026/reg026.idr
Edwin Brady 43127b17a7 Move Fin, Vect and So from prelude to base
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.
2014-12-31 20:18:02 +00:00

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