1st elemnt of a list to 1st element of a 2nd list haskell code example
Example 1: first element in list haskell
list = [1, 2, 3]
head :: [a] -> a
head (x:_) = x
head list -- 1
Example 2: haskell append to list
1 : [2, 3]
--return [1, 2, 3]
list = [1, 2, 3]
head :: [a] -> a
head (x:_) = x
head list -- 1
1 : [2, 3]
--return [1, 2, 3]