Created
June 30, 2020 23:11
-
-
Save donovancrichton/bb8dfdb3a13b6566d3ed6b04a71415d2 to your computer and use it in GitHub Desktop.
Forcing too early results in a failure to solve constraints.
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 : {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