Created
June 30, 2020 03:17
-
-
Save donovancrichton/597d73f22b000278adce85c0af684698 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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