1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Derive a MonadEvaluator instance for Evaluation.

This commit is contained in:
Rob Rix 2018-03-01 15:32:21 -05:00
parent 788b4f5195
commit 7ceb6d6370

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DataKinds, GeneralizedNewtypeDeriving, ScopedTypeVariables, TypeApplications, TypeFamilies, TypeOperators, MultiParamTypeClasses, UndecidableInstances #-} {-# LANGUAGE DataKinds, GeneralizedNewtypeDeriving, ScopedTypeVariables, StandaloneDeriving, TypeApplications, TypeFamilies, TypeOperators, MultiParamTypeClasses, UndecidableInstances #-}
module Analysis.Abstract.Evaluating where module Analysis.Abstract.Evaluating where
import Prologue import Prologue
@ -105,6 +105,9 @@ evaluates pairs (_, t) = run @(Evaluating term v) (runEvaluator (localModuleTabl
newtype Evaluation term value a = Evaluation { runEvaluation :: Evaluator (Evaluating term value) term value a } newtype Evaluation term value a = Evaluation { runEvaluation :: Evaluator (Evaluating term value) term value a }
deriving (Applicative, Functor, Monad, MonadFail) deriving (Applicative, Functor, Monad, MonadFail)
deriving instance MonadEvaluator term value (Evaluator (Evaluating term value) term value)
=> MonadEvaluator term value (Evaluation term value)
instance ( AbstractValue v instance ( AbstractValue v
, Evaluatable (Base t) , Evaluatable (Base t)
, FreeVariables t , FreeVariables t