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

Reformat the context for the AbstractFunction instance for values.

This commit is contained in:
Rob Rix 2018-03-01 10:02:58 -05:00
parent 9192a35b06
commit 8c51acec71

View File

@ -77,7 +77,13 @@ class AbstractValue v => AbstractFunction effects t v | v -> t where
abstract :: [Name] -> Subterm t (Evaluator effects t v v) -> Evaluator effects t v v abstract :: [Name] -> Subterm t (Evaluator effects t v v) -> Evaluator effects t v v
apply :: v -> [Subterm t (Evaluator effects t v v)] -> Evaluator effects t v v apply :: v -> [Subterm t (Evaluator effects t v v)] -> Evaluator effects t v v
instance (Addressable location effects, Semigroup (Cell location (Value location t)), Recursive t, Evaluatable (Base t), FreeVariables t) => AbstractFunction effects t (Value location t) where instance ( Addressable location effects
, Evaluatable (Base t)
, FreeVariables t
, Recursive t
, Semigroup (Cell location (Value location t))
)
=> AbstractFunction effects t (Value location t) where
-- FIXME: Can we store the action evaluating the body in the Value instead of the body term itself -- FIXME: Can we store the action evaluating the body in the Value instead of the body term itself
abstract names (Subterm body _) = inj . Closure names body <$> askLocalEnv abstract names (Subterm body _) = inj . Closure names body <$> askLocalEnv