Open jfmengels opened 3 years ago
This was something I did make an intentional choice about when implementing, thinking that especially for "lift" style functions like (a -> b) -> (Maybe a -> Maybe b)
, leaving the parens might be desirable for the documentation.
But now that it's been around a long time, I think that comes up so infrequently that that use case probably doesn't matter.
One reason why it comes up so infrequently could be because the packages website removes the parens in the documentation. So even if you annotate a function like (a -> b) -> (Maybe a -> Maybe b)
, it will show up as (a -> b) -> Maybe a -> Maybe b
.
Making this change would make the types consistent with that at least :man_shrugging:
I sometimes see functions with the following type annotation:
which is equivalent to
I think the first version feels more complex than the latter, because the parens make me think that what I'm looking at is an argument function of type
c -> d
. Then my brain gets confused because there is nothing after what I thought was an argument.I thought about writing an
elm-review
rule for this, but I feel like this would be better handled byelm-format
.I could imagine some people liking writing something like this
but I don't think that brings value in practice, but YMMV.