Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This extension (together with the type-level built-in literals, described in section 8.3 of the paper) looks like it will address the major remaining wart I've observed in Haskell: the widespread use of complex type-level programming to make up for deficiencies in the type system. Many packages on Hackage have deep type-level hackery under the surface, and that hackery often creates subtle differences and incompatibilities.


Could you give a specific example?


Sure.

The paper mentions HList, the "heterogeneous list" package, which often gets used for extensible records and static duck typing; HList uses type-level numbers and lists, and extensive type-level computation. I've wanted to use HList in the past, but the sheer pain of the types involved made it not worth the trouble. It also includes several (incompatible) variations of internal implementations with different tradeoffs.

Several packages exist for "session typing", which allows specification of a communication protocol between functions by using complementary types. Those involve heavy type-level computation on families of related types; this extension would help greatly.

I've personally encountered multiple cases where I'd like to operate on an arbitrary function or type regardless of its arity (how many arguments it takes), but doing so typically requires writing a family of handlers for various argument lengths. This extension would allow handling all of the cases generically.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: