Question : last element of list haskell
Answered by : hippoerror
list = [1, 2, 3, 4]
last [a] -> a
last [x] = x
last (_:xs) = last xs
last list -- 4
Source : | Last Update : Sun, 25 Oct 20
Question : haskell get last element of list
Answered by : dangerous-dingo-4jj6ajxa22eh
list = [1,2,3,4,5]
last list -- returns 5
Source : | Last Update : Wed, 10 Jun 20