On Oct 18, 2019, at 09:33, Steven D'Aprano <[email protected]> wrote:
>
> That's certainly true, but only because they will have absolutely no
> clue at all about what |< could possibly mean. "Bitwise-or less-than"
> perhaps, whatever that could mean.
>
> You seem to have come up with a completely unique symbol which has, as
> far as I can tell, never been used before. As far as I can see, neither
> APL nor Perl use it as an operator. I can't see it in Unicode, or as an
> emoticon.
It has multiple meanings in Haskell, and at least one is reasonably common.
I think the main one is for mapping insertion, like this:
newdict = (key, value) |< olddict
There’s also >| to reverse the order of the operands, and also |> and <| to
keep the old value rather than the new if the key already exists. And you can
lift any of these four to do a dict merge.
But it’s also, e.g., the rightwise asymmetric version of >|<, meaning that if
you give it two Either values, it’ll return the right one if it succeeded,
otherwise be left one if it succeeded, otherwise the right error.
See Hoogle (https://hoogle.haskell.org/?hoogle=%7C%3C&scope=set%3Astackage) for
all the meanings in the stdlib, but programs and third-party libs might define
even more.
But I think this all serves as more an argument for you than for the other
side. :)
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/EF3VBMGG7KZ6ZEARRUO5GEKHXCDJDT3Z/
Code of Conduct: http://python.org/psf/codeofconduct/