Syntax Proposal : remove type aliases

Alright. I guess using type alias to re-export an internal type, or to conceal a type within a module, like you do in your examples @xarvh @gampleman is pretty compelling. Those are good points. Thank you.

But I think thats the exact kind of example where I feel it doesnt benefit. Readers arent going to know what an ActorFunction is right away, so they have to go to the definition which is just as long as the long type signature you are avoiding. The only consequence is that readers have to look up the definition; not that the actual definition is any shorter.

Since you’ve mentioned it, while I liked using elm-analyse, I never liked that rule in particular. I love one field records because…

  • One field records have to be constructed, which means the name of the field appears at the call site of the function that uses that record. You get a name where there was no name before.
-- GOOD
    EditView.init { index = 4 }
    --> : EditView.Model

-- LESS GOOD
    EditView.init 4
    --> : EditView.Model, but what was 4 anyway?
  • Its much easier to refactor from a one field record to a two field record than it is to refactor from a value to a two field record.
1 Like