Hacker News new | ask | show | jobs
by mijoharas 3297 days ago
Can anyone explain the last point to me? How exactly is the example considered "abuse"? What would an attempt to write similar in Haskell look like?
1 comments

The 'abusiveness' is the use of `>>=` as a constructor, instead of its more standard role as member of an interface.

The author is using it to take advantage of syntactic sugar that is now reliant only on names and types, instead of implementation of the relevant interface.

A similar idea is to use `::` and `Nil` as constructors, which let you use the `[a, b, c]` list syntax (desugared to `a :: b :: c :: Nil`) for things that aren't actually lists. It can be convenient, but can also result in confusion.