tfausak / flow

:droplet: Write more understandable Haskell.
https://hackage.haskell.org/package/flow
MIT License
198 stars 10 forks source link

Switch to >> instead of .> #19

Closed nikita-volkov closed 4 years ago

nikita-volkov commented 4 years ago

I understand the motivation of avoiding the conflict with Monad's >>, but then it's already completely replaced by *> since the Monad-Applicative proposal, so it can simply be hidden in the import of Prelude. Also the alternatively chosen .> still goes in conflict with a common idiom from the "semigroupoids" package". This all makes the conflict avoidance argument weaker than it initially might have been.

Using >> for function composition, OTOH, would further support the following argument from the documentation, since it is an idiom in the Elm language:

And by using idioms common in other programming languages, we can allow people who aren't familiar with Haskell to guess at the meaning.

tfausak commented 4 years ago

I wish I could use >>, but one of Flow's design goals is to not conflict with the Prelude. I'm aware that it conflict with other things, like semigroupoids as you point out. Even |> conflicts with containers and lens (and probably lots of others).

Another downside of >> is that it's taken by syntax. If you enable the RebindableSyntax extension, >> is used when desugaring do notation like do { this; that } (which becomes this >> that). This is true even if you also enable ApplicativeDo, even though it seems like it should use *> instead.

nikita-volkov commented 4 years ago

Another downside of >> is that it's taken by syntax. If you enable the RebindableSyntax extension, >> is used when desugaring do notation like do { this; that } (which becomes this >> that). This is true even if you also enable ApplicativeDo, even though it seems like it should use *> instead.

Didn't realise that. That is unfortunate.

Still, I would vote for doing the switch, since I consider RebindableSyntax a misfeature altogether, but then I'm stepping into the dark area of opinions. So I'm only saying that to express a vote for doing the switch. Ideally I'd do a poll across the userbase, but I have no idea on how to arrange it.

tfausak commented 4 years ago

In a vacuum, I think >> is a better choice than .>. But I don't think I'm going to change this. In addition to what I said above, two main reasons: