< 99 Elm Problems

Create a list containing all integers within a given range, inclusively.

import Html exposing (text)
import List

range : Int -> Int -> List Int
-- your implementation goes here

main =
  text <| toString <|
    range 4 9

Result:

[4, 5, 6, 7, 8, 9]

Solutions

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.