[Haskell-cafe] getting last char of String

Felipe Almeida Lessa felipe.lessa at gmail.com
Fri Dec 31 22:54:30 CET 2010


On Fri, Dec 31, 2010 at 6:43 PM, aditya siram <aditya.siram at gmail.com> wrote:
> -- untested and won't work on an infinite list
> last :: [a] -> a
> last = head . reverse

No definition for last works with infinite lists =).

Cheers,

-- 
Felipe.



More information about the Haskell-Cafe mailing list