JohnBugner/elm-loop/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Loop

Repeatedly apply a function to a value.

Looping

while : (a -> Bool) -> (a -> a) -> a -> a

Repeatedly apply a function to a value while a predicate holds.

while (\ n -> n < 10) ((+) 5) 2 == 12
for : Int -> (a -> a) -> a -> a

Repeatedly apply a function to a value n times.

for 3 ((+) 5) 2 == 17