Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

99 Elm Problems/Problem 3

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Problem 3: Implement the function nth to return the n-th element of a list. import Html exposing (text) import List exposing (head, length) import Maybe nth: Int -> List a -> Maybe a -- your implementation goes here main = case (nth 2 (List.range 1 4)) of Just a -> text (toString a) Nothing -> text "No element found" Result: 3 Solutions