|
|
|
|
|
by naasking
3689 days ago
|
|
I don't understand what's unclear, lifting values to the type-level and pattern matching on those values to type classes is a standard construction [1]. I only claimed that operations on Maybe can be lifted to type classes, you claimed that all uses of type classes can be monomorphized (barring "fancy types", of which Maybe is presumably not one). Since all pattern matching functions on simple sums like Maybe can be lifted to type classes using the above translation, and given you said all such type classes can be monomorphized, therefore all uses of Maybe can be monomorphized. Alternately, your original claim could be wrong, or you can provide a counter-example to my claim that pattern matching on Maybe can be translated to type class dispatch. [1] http://koerbitz.me/posts/Solving-the-Expression-Problem-in-H... |
|