1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Abstract Evaluatable over the evaluator type.

This commit is contained in:
Rob Rix 2018-03-01 11:31:08 -05:00
parent 4d5969a077
commit 77e79737fe

View File

@ -35,13 +35,14 @@ import qualified Data.Union as U
class Evaluatable constr where class Evaluatable constr where
eval :: ( AbstractValue value eval :: ( AbstractValue value
, FreeVariables term , FreeVariables term
, MonadAddressable (LocationFor value) value (Evaluator effects term value) , MonadAddressable (LocationFor value) value m
, MonadFunctionAbstraction term value (Evaluator effects term value) , MonadEvaluator term value m
, MonadFunctionAbstraction term value m
, Ord (LocationFor value) , Ord (LocationFor value)
, Semigroup (Cell (LocationFor value) value) , Semigroup (Cell (LocationFor value) value)
) )
=> SubtermAlgebra constr term (Evaluator effects term value value) => SubtermAlgebra constr term (m value)
default eval :: (FreeVariables term, Show1 constr) => SubtermAlgebra constr term (Evaluator effects term value value) default eval :: (FreeVariables term, MonadFail m, Show1 constr) => SubtermAlgebra constr term (m value)
eval expr = fail $ "Eval unspecialized for " ++ liftShowsPrec (const (const id)) (const id) 0 expr "" eval expr = fail $ "Eval unspecialized for " ++ liftShowsPrec (const (const id)) (const id) 0 expr ""
-- | If we can evaluate any syntax which can occur in a 'Union', we can evaluate the 'Union'. -- | If we can evaluate any syntax which can occur in a 'Union', we can evaluate the 'Union'.