Reputation: 171369
Where could I find the definition/documentation of the [a..b]
syntax for creating Lists in Elm?
Upvotes: 3
Views: 117
Reputation: 6366
This syntax was removed in Elm 0.18. Use List.range
instead. Some examples from elm-repl
:
> List.range 1 5
[1,2,3,4,5] : List Int
> List.range 1 1
[1] : List Int
> List.range 1 0
[] : List Int
> List.range 1 5 |> List.map (\x -> x*2)
[2,4,6,8,10] : List Int
> List.range 1 5 |> List.map (\x -> x*2 - 1)
[1,3,5,7,9] : List Int
> let b = 5 in b |> List.range 1
[1,2,3,4,5] : List Int
Note: I have completely removed my previous answer because it was made obsolete by Elm 0.18.
Upvotes: 3
Reputation: 2655
Currently the only official documentation is the brief mention in the "Lists" section of the syntax reference: http://elm-lang.org/docs/syntax#lists
Upvotes: 3