2020-12-11 14:58:26 +03:00
|
|
|
interface Queue (0 q: Type -> Type) where
|
|
|
|
empty : q a
|
2020-07-01 02:40:44 +03:00
|
|
|
isEmpty : q a -> Bool
|
2020-12-11 14:58:26 +03:00
|
|
|
snoc : q a -> a -> q a
|
2020-07-01 02:40:44 +03:00
|
|
|
head : q a -> a
|
|
|
|
tail : q a -> q a
|
|
|
|
|
|
|
|
data CatList : (Type -> Type) -> Type -> Type where
|
2020-12-11 14:58:26 +03:00
|
|
|
E : CatList q a
|
2020-07-01 02:40:44 +03:00
|
|
|
C : {0 q : Type -> Type} -> a -> q (Lazy (CatList q a)) -> CatList q a
|
2020-12-11 14:58:26 +03:00
|
|
|
|
|
|
|
link : (Queue q) => CatList q a -> Lazy (CatList q a) -> CatList q a
|
2020-07-01 02:40:44 +03:00
|
|
|
link E s = s -- Just to satisfy totality for now.
|
2020-07-01 02:43:33 +03:00
|
|
|
link (C x xs) s = C x (snoc xs s)
|