yi-0.7.2: The Haskell-Scriptable Editor

Safe HaskellNone

Yi.Eval

Contents

Synopsis

Main (generic) evaluation interface

execEditorAction :: String -> YiM ()Source

Runs the action, as written by the user.

The behaviour of this function can be customised by modifying the Evaluator variable.

getAllNamesInScope :: YiM [String]Source

Lists the action names in scope, for use by execEditorAction.

The behaviour of this function can be customised by modifying the Evaluator variable.

data Evaluator Source

Config variable for customising the behaviour of execEditorAction and getAllNamesInScope.

Set this variable using evaluator. See ghciEvaluator and finiteListEvaluator for two implementation.

Constructors

Evaluator 

Standard evaluators

ghciEvaluator :: EvaluatorSource

Evaluator implemented by calling GHCi. This evaluator can run arbitrary expressions in the class YiAction.

The following two imports are always present:

 import Yi
 import qualified Yi.Keymap as Yi.Keymap

Also, if the file

 $HOME/.config/yi/local/Env.hs

exists, it is imported unqualified.

publishedActionsEvaluator :: EvaluatorSource

Evaluator based on a fixed list of published actions. Has a few differences from ghciEvaluator:

  • expressions can't be evaluated
  • all suggested actions are actually valued
  • (related to the above) doesn't contain junk actions from Prelude
  • doesn't require GHCi backend, so uses less memory

publishedActions :: Field (HashMap String Action)Source

Accessor for the published actions. Consider using publishAction.

publishAction :: (YiAction a x, Show x) => String -> a -> ConfigM ()Source

Publish the given action, by the given name. This will overwrite any existing actions by the same name.

Eval/Interpretation

jumpToE :: String -> Int -> Int -> YiM ()Source