Letzte Element der Liste Haskell
list = [1, 2, 3, 4]
last [a] -> a
last [x] = x
last (_:xs) = last xs
last list -- 4
Hippo_error
list = [1, 2, 3, 4]
last [a] -> a
last [x] = x
last (_:xs) = last xs
last list -- 4
list = [1,2,3,4,5]
last list -- returns 5