Discussion:
Diagonally in Data.Bimap
Joachim Breitner
2018-07-05 15:10:19 UTC
Permalink
Hi
Hi!
Just searched for a `bimap` variant that simultaneously transforms
``` haskell
diag :: Bifunctor p => (a -> b) -> p a a -> p b b
diag f = bimap f f
```
I did not find any. Would it make sense to add it?
possibly, I have wanted it too before.

Bikeshedding:
I’d have expected the name “both”. It also has precedence here:
http://hackage.haskell.org/package/extra/docs/Data-Tuple-Extra.html#v:both
http://hackage.haskell.org/package/concatenative/docs/Control-Concatenative.html#v:both
http://hackage.haskell.org/package/MissingK/docs/Control-Arrow-Extra.html#v:both
http://hackage.haskell.org/package/lens-family/docs/Lens-Family2-Stock.html#v:both
http://hackage.haskell.org/package/lens/docs/Control-Lens-Traversal.html#v:both

Diagonally sounds more like something of type `a -> (a,a)` or similar.
closed group.
It should not. Maybe only open to subscribers? (A common crude anti-
spam measurement.)

Cheers,
Joachim
--
Joachim Breitner
***@joachim-breitner.de
http://www.joachim-breitner.de/
pedro neves
2018-07-05 23:39:12 UTC
Permalink
Hello All,

Can you please remove me from this e-mail string ...

I don't know how I got added ... Thank you.
Post by Joachim Breitner
Hi
Hi!
Just searched for a `bimap` variant that simultaneously transforms
``` haskell
diag :: Bifunctor p => (a -> b) -> p a a -> p b b
diag f = bimap f f
```
I did not find any. Would it make sense to add it?
possibly, I have wanted it too before.
http://hackage.haskell.org/package/extra/docs/Data-Tuple-Extra.html#v:both
http://hackage.haskell.org/package/concatenative/docs/Control-Concatenative.html#v:both
http://hackage.haskell.org/package/MissingK/docs/Control-Arrow-Extra.html#v:both
http://hackage.haskell.org/package/lens-family/docs/Lens-Family2-Stock.html#v:both
http://hackage.haskell.org/package/lens/docs/Control-Lens-Traversal.html#v:both
Diagonally sounds more like something of type `a -> (a,a)` or similar.
closed group.
It should not. Maybe only open to subscribers? (A common crude anti-
spam measurement.)
Cheers,
Joachim
--
Joachim Breitner
http://www.joachim-breitner.de/
_______________________________________________
Libraries mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
John Wiegley
2018-07-05 23:41:14 UTC
Permalink
You've been unsubscribed from the libraries list.

John
Post by pedro neves
Hello All,
Can you please remove me from this e-mail string ...
I don't know how I got added ... Thank you.
breitner.de> wrote:>> Hi
Post by Joachim Breitner
Hi!
``` haskell
diag :: Bifunctor p => (a -> b) -> p a a -> p b b
diag f = bimap f f
```
I did not find any. Would it make sense to add it?
possibly, I have wanted it too before.
http://hackage.haskell.org/package/extra/docs/Data-Tuple-Extra.html#v:both>> http://hackage.haskell.org/package/concatenative/docs/Control-Concatenative.html#v:both>> http://hackage.haskell.org/package/MissingK/docs/Control-Arrow-Extra.html#v:both>> http://hackage.haskell.org/package/lens-family/docs/Lens-Family2-Stock.html#v:both>> http://hackage.haskell.org/package/lens/docs/Control-Lens-Traversal.html#v:both>>
Diagonally sounds more like something of type `a -> (a,a)` or
similar.>>
to be>> > closed group.
It should not. Maybe only open to subscribers? (A common crude anti->> spam measurement.)
Cheers,
Joachim
--
Joachim Breitner
http://www.joachim-breitner.de/
_______________________________________________
Libraries mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_________________________________________________
Libraries mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Loading...