From a PureScript user perspective, one thing I find to be inconsistent is how class constraints are written differently in functions and class instance definitions. For example, for functions it’s:
someFunction :: forall a b. Monad a => SomeClass b => b -> a Something
Whereas for instance definitions it’s:
instance instanceName :: (Monad a, SomeClass b) => Class Something a b where
I don’t know if there’s a particular reason for this syntax difference.
Another thing I actively avoid using are where bindings in functions for two reasons:
-
let exists.
- I like having code read top-down and left to right.
where bindings invert this and I find them to be one of the causes of the mythical Haskell unreadability (along with abuse of <<< and $).
As for the original post, I did find the “re-defining a function” syntax confusing at first, but after reading up on it, it makes sense to me. The new syntax however feels wrong. The Dog Dogfood = true doesn’t look related to f Cat Catfood = true at first glance. There’s also the question of how to handle guards if the first syntax is gone.
Having said all this, PureScript is still one of the prettier languages I’ve worked with.