After you replace all cases of case/of with match/with, it typechecks, but doesn't produce any output. Even a watch expression like > 3 no longer produces output.
It's something to do with:
do : Monad f -> '{Monadic f} a -> f a
do m actions = handle !actions with
pure = Monad.pure m
bind = Monad.bind m
go req = case req of
{a} -> pure a
{Monadic.eval fa -> k} -> bind fa (a -> handle k a with go)
go
If you comment that function out of the file, then watch expressions start working again, even though do is guarded. It also breaks the file if I name it something other than do.
If I pull the let bindings for pure and bind above the handle/with, it works normally. Not sure if they were below for any particular reason (e.g. performance), or why there would be anything wrong with having them as they are.
This .u file reproduces the issue, by producing no output — no errors or anything. It seems to be minimal, anything more I removed would wake up the typechecker.
Check out @pchiusano's gist for converting between algebraic effects and monads.
After you replace all cases of
case
/of
withmatch
/with
, it typechecks, but doesn't produce any output. Even a watch expression like> 3
no longer produces output.It's something to do with:
If you comment that function out of the file, then watch expressions start working again, even though
do
is guarded. It also breaks the file if I name it something other thando
.If I pull the let bindings for
pure
andbind
above thehandle
/with
, it works normally. Not sure if they were below for any particular reason (e.g. performance), or why there would be anything wrong with having them as they are.Anyway, a working version of the gist is here.
Thanks to @byzantic for reporting.