elm-community/undo-redo/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

UndoList.Random

Random UndoList Submodule.

Provides random undolist and undolist msg generators.

Generators

undolist : Int -> Int -> Generator state -> Generator (UndoList state)

Random UndoList Generator constructor. Given a generator of state, a length for the past, and a length for the future, generate a random undolist of states.

undolist pastLength futureLength generator
msg : Generator msg -> Generator (Msg msg)

Generate random undolist msgs given an msg generator.

Generates msgs with the following probabilities:

  • Reset : 5%
  • Forget : 5%
  • Undo : 30%
  • Redo : 30%
  • New : 30%