Haskell Get Last Element Of List

[Solved] Haskell Get Last Element Of List | Haskell - Code Explorer | yomemimo.com
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

Answers related to haskell get last element of list

Code Explorer Popular Question For Haskell