additions to Data.Map

Ross Paterson ross at soi.city.ac.uk
Fri Aug 11 09:34:47 EDT 2006


On Fri, Aug 11, 2006 at 03:24:18PM +0200, Henning Thielemann wrote:
> 
> On Fri, 11 Aug 2006, Ross Paterson wrote:
> 
> > -- | /O(n)/. Map values and separate the 'Left' and 'Right' results.
> > mapEither :: Ord k => (a -> Either b c) -> Map k a -> (Map k b, Map k c)
> 
> Looks more like 'partition' than 'map'.

It's a bit of both, in the same way as mapMaybe (from Data.Maybe)
combines map and filter.



More information about the Libraries mailing list