The fact that they suppress unused identifier warnings is a more of burden on me the implementor of lens more than on users of lens as the only names we generate with _'s in them are for prisms.
Am 09.08.2013 17:31, schrieb Dan Doel:These generalizations seem to be more natural to me than Control.Arrow.
Here's another smart-ass remark, then: use lens and bifunctors. They
have great abstractions for these.
mapEither and mapPair are just two specializations of bimap. It also
has first and second which generalize mapFst, etc. And by the way,
everyone here (I think) has missed that you can also traverse these
things, but bifunctors also has that covered, with bitraverse.
The individual parts are applications of lenses, too. over _1 and over
_2 are mapFst and mapSnd. _1 and _2 function as traverseFst and
traverseSnd.
(However, identifiers with leading underscore are a bad idea, since they suppress "unused identifier" warnings in GHC. But I think I complained about that before.)
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries