Re: [Haskell-cafe] Utility functions

2004-12-29 Thread Christian Maeder
Derek Elkins wrote: I find myself writing things like, splitListOn :: Eq a = a - [a] - [[a]] similar stuff was discussed in July 2004 on [EMAIL PROTECTED] under the headding Prelude function suggestions, ie. http://www.haskell.org//pipermail/libraries/2004-July/002366.html Cheers Christian

[Haskell-cafe] Utility functions

2004-12-28 Thread Mark Carroll
I find myself writing things like, splitListOn :: Eq a = a - [a] - [[a]] splitListOn delimiter = unfoldr splitter . (delimiter :) where splitter [] = Nothing splitter xs = Just (span (/= delimiter) (tail xs)) This is a sort of intersperse-opposite, in that... myId delimiter =

[Haskell-cafe] Utility functions

2004-12-28 Thread Derek Elkins
I find myself writing things like, splitListOn :: Eq a = a - [a] - [[a]] splitListOn delimiter = unfoldr splitter . (delimiter :) where splitter [] = Nothing splitter xs = Just (span (/= delimiter) (tail xs)) This is a sort of intersperse-opposite, in that... myId