Proposal: Left-Associative Semigroup Operator Alias in "Data.Semigroup"
Joachim Breitner
mail at joachim-breitner.de
Tue Jun 7 08:32:56 UTC 2016
Hi,
Am Montag, den 06.06.2016, 13:30 +0200 schrieb Herbert Valerio Riedel:
> This proposal is an attempt to resolve this unfortunate and confusing
> situation by completing the `Semigroup`/`Monoid` vocabulary with a
> standard left-associative alias. Please see
>
> https://ghc.haskell.org/trac/ghc/wiki/Proposal/LeftAssocSemigroupOp
>
> for more details.
I’m have a few qualms.
* There is no precedent for offering the same operator with different
fixities. Is this not totally confusing to many users? Will they
confuse syntactic fixity with the efficient way? I am fearing
thoughts like “A, I should not use (++) to append lists to long
lists, but luckily there is >< which has the right fixity”?
* Is it worth using up yet another operator name in a commonly
imported module?
With nice things like <*>, <$> and <> taken, I sometimes have
a hard time giving names to my own operators.
It could be put in a usually-not-imported module
(Data.Monoid.LeftAssociative) and re-exported by affected APIs (pretty-
printing libraries), with a proper explanation in their haddock. This
way, both qualms are mitigated and contained.
Greetings,
Joachim
--
Joachim “nomeata” Breitner
mail at joachim-breitner.de • https://www.joachim-breitner.de/
XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160607/e75a6e28/attachment.sig>
More information about the Libraries
mailing list