last element of list haskell
list = [1, 2, 3, 4]
last [a] -> a
last [x] = x
last (_:xs) = last xs
last list -- 4
last element of list haskell
list = [1, 2, 3, 4]
last [a] -> a
last [x] = x
last (_:xs) = last xs
last list -- 4
haskell get last element of list
list = [1,2,3,4,5]
last list -- returns 5
get tail of list haskell
list = [1, 2, 3, 4]
tail :: [a] -> [a]
tail [] = []
tail (_:xs) = xs
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us