3 ms·
Some of the slides need explanation. What is the value of -ddump-simpl as shown here? http://dev.stephendiehl.com/hask/#%2816%29 http://dev.stephendiehl.com/ha
by kzrdude 14y ago
Some of the slides need explanation.
What is the value of -ddump-simpl as shown here? http://dev.stephendiehl.com/hask/#%2816%29 http://dev.stephendiehl.com/hask/#%2816%29
- freyrs3 14y agoIt dumps the internal Core representation of expression. It's closer to the lambda calculus ( System F ) and a good way to understand internals.
- ufo 14y agoAs freyrs points out, GHC "desugars" all Haskell code into a very small intermediate language that is similar to the System F lambda calculus. In the slide you linked you can kind of see that: you start with two doubles for 2 and 3 (created wit the `D#` function) and then you add them with the addition operator. Notice that this exposrs the implementation of typeclasses: the overloaded + operator is actually a function of three arguments and the first argument is the "vtable" that has the actual number operations. I don't know why he is doing all of this though. The slides themselves don't give much context...