How to create custom infix operators

Just a little more on this. Elm is frequently criticised for a perceived kind of closed development model. Basically library authors are mostly not allowed to do special things such as create infix operators, but a few specially anointed libraries/authors are afforded these “powers”. Most such arguments essentially boil down to “we’re all adults, let us do whatever we think is correct and the good stuff will rise to the top and be popular whilst the bad stuff will be allowed to sink to the bottom and eventually become unused/abandoned”. A kind of reddit style for libraries. I think this kind of argument sounds pretty compelling to many developers.

There are many arguments against this (ie. in favour of Elm’s style), however, the one I find most compelling is that this is not really a counter-factual situation, there are many languages that take the opposite approach from Elm. If you want to experience the results of that you can. One obvious alternative is Purescript, in that it’s quite a similar language, has similar goals, but has the development style of “everything goes let’s see what becomes popular”. It is also much less conservative when it comes to including language features than is Elm. Another thing you can do is go look at the Python eco-system. One would be hard-pressed to suggest that Python has not been successful with this model, however, the package eco-system does have problems. This is easily searchable.

So in other words, do not try to look at the Elm style as right/wrong, see it as alternative. Looked at this way, arguments for/against are kind of beside the point. See Elm’s style as experimental.

8 Likes