Skip to content

Instantly share code, notes, and snippets.

@donovancrichton
Created June 30, 2020 03:17
Show Gist options
  • Save donovancrichton/597d73f22b000278adce85c0af684698 to your computer and use it in GitHub Desktop.
Save donovancrichton/597d73f22b000278adce85c0af684698 to your computer and use it in GitHub Desktop.
%default total
interface Queue (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 -> Lazy (q (CatList q a)) -> CatList q a
link : Queue q => CatList q a -> Lazy (CatList q a) -> CatList q a
link E s = s -- different to original definition.
link (C x xs) s =
let p1 = snoc xs s
in C x p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment