X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=sem.icl;h=6c788545afd143990f050128583df1806b8bd4c8;hb=a5e0570125597dc2ecd76ff7435acd92c6b7adef;hp=4a3fbe59ec8dadf8f15878f924406bccede18e6c;hpb=ae679fa9a2d32f0d4037f689398bad77d5dd1b78;p=cc1516.git diff --git a/sem.icl b/sem.icl index 4a3fbe5..6c78854 100644 --- a/sem.icl +++ b/sem.icl @@ -29,11 +29,11 @@ instance Applicative Env where (<*>) f g = ap f g pure a = Env $ pure $ Right a -instance Alternative Env where - empty = Env $ pure $ Left (Error "Undefined error") - (<|>) f g = f >>= \ef -> g >>= \eg -> Env $ pure $ (ef <|> eg) //case ef of - //Left e = eg - //Right r = Right r +//instance Alternative Env where +// empty = Env $ pure $ Left (Error "Undefined error") +// (<|>) f g = f >>= \ef -> g >>= \eg -> Env $ pure $ case ef of +// Left e = eg +// Right r = Right r instance Monad Env where bind e f = e >>= \ee -> Env $ pure $ case ee of