Skip to content

Instantly share code, notes, and snippets.

@donovancrichton
Created June 30, 2020 23:11
Show Gist options
  • Save donovancrichton/bb8dfdb3a13b6566d3ed6b04a71415d2 to your computer and use it in GitHub Desktop.
Save donovancrichton/bb8dfdb3a13b6566d3ed6b04a71415d2 to your computer and use it in GitHub Desktop.
Forcing too early results in a failure to solve constraints.
%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 : {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
link (C x xs) s = C x (snoc xs s) -- can't solve constraint between
-- Lazy (CatList q a) and CatList q a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment