Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 574 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 574 Bytes

elm-for

Brief introduction

This package provides for function like that in other languages.

A function f will repeat several times. It can receive the index in the for function so that every time f is repeated, it can output different values.

Example

    For.for
        0
        10
        (\i ( list, added ) ->
            ( (i
                + added
              )
                :: list
            , added
            )
        )
        ( []
        , 10
        )
        == ( [ 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10 ], 10 )