Created
May 27, 2020 08:08
-
-
Save MarcelineVQ/57d1efaaa95a13120722076499d3425e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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