[Haskell-cafe] a beginner question: decorate-op-undecorate
aran.donohue at gmail.com
Fri Feb 5 21:23:27 EST 2010
Thanks for the helpful thoughts.
I guess I was just reaching for a Haskell version of a programming pattern
from other languages---dealing with baggage if you will.
On Fri, Feb 5, 2010 at 7:24 PM, Luke Palmer <lrpalmer at gmail.com> wrote:
> On Fri, Feb 5, 2010 at 10:34 AM, Aran Donohue <aran.donohue at gmail.com>
> > What would be an idiomatic Haskell way to accomplish this? Currently I've
> > got "liftedPartitionEithers :: [a] -> (a -> Either b c) -> ([a],
> [a])" which
> > is my own version of partitionEithers that calls a selector first.
> Since you are not using b or c anywhere else, the only thing you care
> about in that Either is whether it is Left or Right. Which makes it
> seem much more like a Bool. After this conversion, I can hoogle for
> your signature.
> Which gives, among other things, Data.List.partition :: (a -> Bool) ->
> [a] -> ([a],[a]).
> Without more details about the precise thing you want to accomplish, I
> don't know what else to say. Many idioms are about the details of the
> problem, even down to argument order.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe