4 ms·
Record issue is more than just an inconvenience. I consider it a genuine issue. Having to add 2 lines of import (unqualified name of the type and qualified reco
by GreaterFool 10y ago
Record issue is more than just an inconvenience. I consider it a genuine issue. Having to add 2 lines of import (unqualified name of the type and qualified record module to get the accessors) for every record type you use is a pain. When you work with data-heavy code this ends up hundred of lines of import (see amazonka packages for instance where each request has a record type).
- gizmo686 10y agoEven if it doubles the number of import statements, I still don't see how that is more than an inconvenience. Having said that, the record issue alone is not the only reason to need qualified imports (as they are also used to resolve collisions of functions that are not auto generated from records). What would be nice is if Haskell would allow any name collision so long as it could use the type system to disambiguate the function.
- eru 10y ago> What would be nice is if Haskell would allow any name collision so long as it could use the type system to disambiguate the function. That would need very careful design to work well with type inference, I suppose?
- johncolanduoni 10y agoIdris[1] already has a working system for this, and it's type system is more complicated (it has much more support for dependent typing). It allows this principle for regular function names as well. [1]: http://www.idris-lang.org/ http://www.idris-lang.org/
- eru 10y agoThanks! I'm glad we have a working model we can probably copy from.
- chadaustin 10y agoYour argument generalizes to "The lack of any feature that can be worked around is an inconvenience", which, okay, but it's not a very useful statement. By that definition, lots of really important things are inconveniences.