Answers for "first element in list 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
1

remove first element list haskell

a = [1, 2, 3, 4]
b = tail a
  
-- b == [2, 3, 4]
Posted by: Guest on October-14-2020

Browse Popular Code Answers by Language