15 lines
369 B
Elm
15 lines
369 B
Elm
module FunkyFunktions exposing (..)
|
|
|
|
import Array exposing (get, set)
|
|
|
|
constant a b = a
|
|
flip f a b = f b a
|
|
withCmd cmd model = (model, cmd)
|
|
withoutCmd model = (model, Cmd.none)
|
|
andCmd cmd2 (model, cmd1) = (model, Cmd.batch [cmd1, cmd2])
|
|
curry2 f (a, b) = f a b
|
|
uncurry2 f a b = f (a, b)
|
|
updateArray i f a =
|
|
case get i a of
|
|
Just e -> set i (f e) a
|
|
Nothing -> a |