[Haskell-beginners] Built-in/more elegant version of this function?

Jordan Cooper nefigah at gmail.com
Mon Oct 26 13:49:51 EDT 2009


I was wondering if there is a built-in way to do what this function I
wrote does (or at least a more elegant way, preferably without
explicit recursion).

f xss = map safeHead xss : f (map safeTail xss)

(where safeHead/Tail are versions of head/tail that don't crash on [] input)


More information about the Beginners mailing list