bburdette/schelme/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Run

Some functions for compiling and running schelme scripts.

compile : String -> Result String (List (Term a))

parse a string, emitting a series of Terms, which will hopefully be a valid schelme program.

run :
NameSpace a
-> a
-> List (Term a)
-> Result String ( NameSpace a, a, Term a )

given a namespace (for instance Prelude.prelude) and a state (see examples), and a schelme program, run the program to completion, emitting an updated namespace, state, and final Term

The way to go for incremental execution. Given an EvalBodyStep (the normal top level of a running schelme program), execute it up to /count/ evals, returning the last EvalBodyStep state.

runBody : EvalBodyStep a -> Result String ( NameSpace a, a, Term a )

starting with an EvalBodyStep, run to completion

-> Int
-> Result String ( NameSpace a, a, ( Int, Term a ) )

continue execution of an EvalBodyStep, returning the final Term and number of evals used.

-> Int
-> Result String ( NameSpace a, a, ( Int, Term a ) )

run a schelme EvalBodyStep with a max number of evals, erroring out if the max is reached.

NameSpace a
-> a
-> List (Term a)
-> Result String ( NameSpace a, a, ( Int, Term a ) )

run a schelme program, emitting the usual products but also the number of evals taken

NameSpace a
-> a
-> Int
-> List (Term a)
-> Result String ( NameSpace a, a, ( Int, Term a ) )

run a schelme program with a max number of evals, erroring out if the max is reached.