From a5e0570125597dc2ecd76ff7435acd92c6b7adef Mon Sep 17 00:00:00 2001 From: pimjager Date: Tue, 12 Apr 2016 22:00:26 +0200 Subject: [PATCH] Meer falende monads --- sem.icl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.20.1