Answers for "get first element of a liste haskell"

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

Browse Popular Code Answers by Language