Skip to content

Instantly share code, notes, and snippets.

Avatar

www.getcontented.com.au GetContented

View GitHub Profile
View gist:733a4fdd837c8058fe6f8ac1e3c5e36a
elementAt :: Integral b => [a] -> b -> Maybe a
elementAt (x:_) 1 = Just x
elementAt (_:xs) k = elementAt xs (k - 1)
elementAt _ _ = Nothing