List Machine
ListMachine.run : (State a -> b) -> List a -> List b
ListMachine.run outputFunction inputList =
run (makeReducer outputFunction) inputListtype alias State a = {before: Maybe a, current: Maybe a, after: Maybe a, inputList: List a}Example
-- File : Example.elm
module MiniLatex.Example exposing(..)
import MiniLatex.ListMachine exposing(State)
sumState : State Int -> Int
sumState internalState =
let
a = internalState.before |> Maybe.withDefault 0
b = internalState.current |> Maybe.withDefault 0
c = internalState.after |> Maybe.withDefault 0
in
a + b + cThe internals of ListMachine
addSpace
Last updated