mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Define a MonadFail instance for Evaluator.
This commit is contained in:
parent
57f478a5ac
commit
b9ac2858ec
@ -8,6 +8,7 @@ import Control.Monad.Effect.NonDetEff
|
||||
import Control.Monad.Effect.Reader
|
||||
import Control.Monad.Effect.State
|
||||
import Data.Abstract.Value
|
||||
import Prelude hiding (fail)
|
||||
|
||||
data Evaluator effects value a
|
||||
= Evaluator
|
||||
@ -37,3 +38,6 @@ instance Monad (Evaluator effects value) where
|
||||
return = pure
|
||||
|
||||
Evaluator runA >>= f = Evaluator (runA >>= runEvaluator . f)
|
||||
|
||||
instance MonadFail (Evaluator effects value) where
|
||||
fail s = Evaluator (fail s)
|
||||
|
Loading…
Reference in New Issue
Block a user