
1 Jan
2011
1 Jan
'11
4:39 a.m.
On Sat, 1 Jan 2011, Jesse Schalken wrote:
On Sat, Jan 1, 2011 at 8:54 AM, Felipe Almeida Lessa
wrote: No definition for last works with infinite lists =).
Unless you make the result nullable, of course.
maybeLast :: [a] -> Maybe a
maybeLast [] = Nothing
maybeLast [x] = Just x maybeLast (_:xs) = maybeLast xs
How would this work for infinite lists?