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.
Thanks, Aran On Fri, Feb 5, 2010 at 7:24 PM, Luke Palmer <[email protected]> wrote: > On Fri, Feb 5, 2010 at 10:34 AM, Aran Donohue <[email protected]> > wrote: > > 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. > > > http://haskell.org/hoogle/?hoogle=[a]+-%3E+%28a+-%3E+Bool%29+-%3E+%28[a]%2C[a]%29 > > 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. > > Luke >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
