ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Problems.P03

Description

Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P03.

Synopsis

Documentation

elementAt :: [a] -> Int -> Maybe a Source #

Find the kth element of a list. The first element in the list is number 1.

Examples

>>> elementAt [1,2,3] 2
Just 2
>>> elementAt "haskell" 5
Just 'e'
>>> elementAt [1,2] 3
Nothing