Horje
last element of list haskell Code Example
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




29

Related
quicksort in haskell Code Example quicksort in haskell Code Example
get first char from string haskell Code Example get first char from string haskell Code Example
haskell multiline comment Code Example haskell multiline comment Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9