howl-0.1.0.0: A small Wolfram Language interpreter and symbolic rewriting library
Safe HaskellNone
LanguageGHC2021

Howl.Eval.EvalCache

Description

A weak-pointer cache used to avoid re-evaluating expressions that have already been seen.

Synopsis

Documentation

data EvalCache #

A cache of previously seen expressions.

newEvalCache :: IO EvalCache #

Create a new empty evaluation cache.

lookupEvalCache :: EvalCache -> Expr -> IO Bool #

Check whether the given expression is already present in the cache.

insertEvalCache :: EvalCache -> Expr -> IO () #

Insert an expression into the evaluation cache.