< 99 Elm Problems
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]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.