Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MarcelineVQ/57d1efaaa95a13120722076499d3425e to your computer and use it in GitHub Desktop.
Save MarcelineVQ/57d1efaaa95a13120722076499d3425e to your computer and use it in GitHub Desktop.
infixr 9 -*
(-*) : Type -> Type -> Type
(-*) a b = (1 _ : a) -> b
Eff : Type
Eff = IO ()
-- Negation,
N : Type -> Type
N a = a -* Eff
NN : Type -> Type
NN a = N (N a)
mutual
data Source : Type -> Type where
Nil : Source a
(::) : a -* N (Sink a) -* Source a
data Sink : Type -> Type where
Full : Sink a
Cont : N (Source a) -* Sink a
infix 9 &|
(&|) : Type -> Type -> Type
a &| b = N (Either (N a) (N b))
await : Source a -* (Eff &| (a -* Source a -* Eff)) -* Eff
await [] r = r (Left (\end => end))
await (x :: xs) r = r (Right (\1 c => ?fsdfsd))
await' : Source a -* (Eff &| (g -* a -* Source a -* Eff)) -* Eff
await' [] r = r (Left (\end => end))
await' (x :: xs) r = r (Right (\1 c => ?fsdfsdd))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment