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
Question : List haskell
Answered by : therealcb
--Haskell Lists' are 0 based
--Let xs be a list from where we want the n-th element
?> xs !! n
--Example
?> [1, 2, 3] !! 1
?> 2
Source : | Last Update : Thu, 10 Mar 22