Answers for "haskell get the first element of list"

2

first element in list haskell

list = [1, 2, 3]

head :: [a] -> a
head (x:_) = x

head list -- 1
Posted by: Guest on October-18-2020

Code answers related to "haskell get the first element of list"

Browse Popular Code Answers by Language