Jump to content

99 Elm Problems/Problem 5

From Wikibooks, open books for an open world

Elm provides the function List.reverse to reverse the order of elements in a list. See if you can implement it.

import Html exposing (text)
import List

myReverse: List a -> List a
-- your implementation goes here

main =
  text (toString (myReverse (List.range 1 4)))

Result:

[4, 3, 2, 1]

Solutions