1
1
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:
Rob Rix 2018-02-28 10:41:28 -05:00
parent 57f478a5ac
commit b9ac2858ec

View File

@ -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)