Jump to content

99 Elm Problems/Problem 4

From Wikibooks, open books for an open world

Elm provides the function List.length. See if you can implement it.

import Html exposing (text)
import List

myLength: List a -> Int
-- your implementation goes here

main =
  text <| toString <| myLength[1,2,3,4,3,2,1]

Result:

7

Solutions