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
Question : get tail of list haskell
Answered by : perfect-peafowl-a8wvmgo5bxef
list = [1, 2, 3, 4]
tail :: [a] -> [a]
tail [] = []
tail (_:xs) = xs
Source : | Last Update : Thu, 10 Dec 20