unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Codebase.Editor.HandleInput.Load

Synopsis

Documentation

evalUnisonFile :: EvalMode -> PrettyPrintEnv -> TypecheckedUnisonFile Symbol Ann -> [String] -> Cli ([(Symbol, Term Symbol ())], Map Symbol (Ann, WatchKind, Id, Term Symbol (), Term Symbol (), Bool)) Source #

Evaluate all watched expressions in a UnisonFile and return their results, keyed by the name of the watch variable. The tuple returned has the form: (hash, (ann, sourceTerm, evaluatedTerm, isCacheHit))

where hash is the hash of the original watch expression definition ann gives the location of the watch expression sourceTerm is a closed term (no free vars) for the watch expression evaluatedTerm is the result of evaluating that sourceTerm isCacheHit is True if the result was computed by just looking up in a cache

It's expected that the user of this action might add the `(hash, evaluatedTerm)` mapping to a cache to make future evaluations of the same watches instantaneous.