r/purescript • u/gb__ • Aug 10 '16
Approximating GADTs in PureScript
http://code.slipthrough.net/2016/08/10/approximating-gadts-in-purescript/
20
Upvotes
r/purescript • u/gb__ • Aug 10 '16
1
u/gasche Aug 10 '16
The problem with this encoding with equality is that most encoding of type equalities are bad at reasoning with inequalities or, worse, constructor injectivity. How would you implement, for example
?
2
u/rtpg Aug 11 '16
This is pretty similar to how you solve a lack of existential types: You carry around all the operations you might do on the type inside the data.
1
u/nikita-volkov Aug 10 '16
I just love when the problems get solved without extending the language. This is beautiful!