Steven Huwig wrote:
On Dec 6, 2004, at 11:05 PM, Tom Pledger wrote:
import Data.Char(isSpace)
import Data.List(groupBy)
(op `on` f) x y = f x `op` f y
wordsAndSpaces = groupBy ((==) `on` isSpace)
`on` is a handy little function in this instance.
Does it have a technical name?
On Dec 6, 2004, at 11:05 PM, Tom Pledger wrote:
import Data.Char(isSpace)
import Data.List(groupBy)
(op `on` f) x y = f x `op` f y
wordsAndSpaces = groupBy ((==) `on` isSpace)
`on` is a handy little function in this instance.
Does it have a technical name?
Have you used it elsewhere?
Steven Huwig wrote:
[...]
1) Did I miss something in the Prelude or standard library that gives
me this functionality, or something close to it?
[...]
3) The 3-tuple output of unravel looks ugly to me, but I can't think
of an alternative. For the case where there is an equal number of
I am basically a newbie at Haskell, and have been experimenting with
it where typically I would use Python. One source of frustration I
had with the standard library is that words . unwords is not an
identity function. I would like to perform per-word transformations
and predicates while