Created
April 13, 2015 19:30
-
-
Save davidpeklak/1ed85966e70906b04d9e to your computer and use it in GitHub Desktop.
'return' in idris effects
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
module Main | |
import Effects | |
import Effect.StdIO | |
FOO : Type -> EFFECT | |
FOO t = ?FOO | |
------------- This works ----------- | |
baz : { [FOO ()] } Eff Bool | |
baz = ?baz | |
bazAndTell : { [FOO (), STDIO] } Eff Bool | |
bazAndTell = do r <- baz | |
putStrLn (show r) | |
return r | |
------------- This doesnt' ----------- | |
data FooType : Bool -> Type where | |
TrueType : FooType True | |
FalseType : FooType False | |
bar : { [FOO ()] ==> {rslt} [FOO (FooType rslt)] } Eff Bool | |
bar = ?bar | |
barAndPrint : { [FOO (), STDIO] ==> {rslt} [FOO (FooType rslt), STDIO] } Eff Bool | |
barAndPrint = do r <- bar | |
putStrLn (show r) | |
return r -- does not compile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment