Re: [Haskell-cafe] Is this a useful higher-order function, or should I RTFM?

2004-12-08 Thread Tom Pledger
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?

Re: [Haskell-cafe] Is this a useful higher-order function, or should I RTFM?

2004-12-07 Thread Steven Huwig
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?

Re: [Haskell-cafe] Is this a useful higher-order function, or should I RTFM?

2004-12-06 Thread Tom Pledger
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

[Haskell-cafe] Is this a useful higher-order function, or should I RTFM?

2004-12-03 Thread Steven Huwig
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