Orasund / elm-tracery / Tracery.Command

Commands are used to be able to pause the execution of a Grammar.

By modifying the commands in a grammar you can directly change how the program should run.


type Command
    = Print Tracery.Syntax.Expression
    | Define (Dict String Tracery.Syntax.Definition)
    | Delete (List String)
    | Save ({ asConstant : String, replaceWith : List Command })

Defines commands that the algorithm recognizes

simplify : List Command -> List Command

simplifies the commands.

toString : (String -> String) -> List Command -> String

Turns the list of commands into a readable string

fillAll : (String -> Random.Generator (List Command)) -> List Command -> Random.Generator (List Command)

replaces all variables

fromExpressions : List Tracery.Syntax.Expression -> List Command

Convert expressions to commands

variables : List Command -> List String

Returns all variables.

onlyValues : List Command -> Basics.Bool

States if only values are in the list. This essentially means, that all processing has been done.