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

Don't allow evaluating to Type after all

Evaluating to types should always use evalCache rather than evaluate. Using evaluate will infinite loop on recursive programs. - @robrix
This commit is contained in:
Timothy Clem 2017-12-01 10:03:02 -08:00
parent 5862a73334
commit 89dcf0fe61

View File

@ -6,8 +6,6 @@ import Control.Monad.Effect hiding (run)
import Control.Monad.Effect.Address
import Control.Monad.Effect.Env
import Control.Monad.Effect.Fail
import Control.Monad.Effect.Fresh
import Control.Monad.Effect.NonDet
import Control.Monad.Effect.Reader
import Control.Monad.Effect.State
import Control.Monad.Effect.Store
@ -21,16 +19,13 @@ import Data.Functor.Foldable (Base, Recursive(..))
import Data.Semigroup
import Data.Set
type Interpreter v = '[Fail, State (Store (LocationFor v) v), Reader (Set (Address (LocationFor v) v)), NonDetEff, Fresh, Reader (Environment (LocationFor v) v)]
type Interpreter v = '[Fail, State (Store (LocationFor v) v), Reader (Set (Address (LocationFor v) v)), Reader (Environment (LocationFor v) v)]
type MonadInterpreter v m = (MonadEnv v m, MonadStore v m, MonadFail m)
type EvalResult v = Final (Interpreter v) v
-- Evaluate an expression.
-- Example:
-- evaluate @Type <term>
-- evaluate @(Value (Data.Union.Union Language.Python.Assignment2.Syntax) (Record Location) Precise) <term>
-- | Evaluate a term to a value.
evaluate :: forall v term
. ( Ord v
, Ord (Cell (LocationFor v) v)