mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-22 03:01:31 +03:00
15 lines
441 B
Idris
15 lines
441 B
Idris
interface Queue (0 q: Type -> Type) where
|
|
empty : q a
|
|
isEmpty : q a -> Bool
|
|
snoc : q a -> a -> q a
|
|
head : q a -> a
|
|
tail : q a -> q a
|
|
|
|
data CatList : (Type -> Type) -> Type -> Type where
|
|
E : CatList q a
|
|
C : {0 q : Type -> Type} -> a -> q (Lazy (CatList q a)) -> CatList q a
|
|
|
|
link : (Queue q) => CatList q a -> Lazy (CatList q a) -> CatList q a
|
|
link E s = s -- Just to satisfy totality for now.
|
|
link (C x xs) s = C x (snoc xs s)
|