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
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 =
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