Created
March 24, 2010 11:01
-
-
Save spockz/342178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> cat > foo.hs | |
{-# RULES "foo/Integer" foo = intFoo #-} | |
foo :: Num a => a -> a -> a | |
foo = (+) | |
intFoo = (-) | |
main = (putStrLn . show) ((foo (1::Integer) (1::Integer))::Integer) | |
$> ghc --make -O -ddump-rules -ddump-simpl-stats foo.hs | |
[1 of 1] Compiling Main ( foo.hs, foo.o ) | |
==================== Transformation rules ==================== | |
Local rules | |
"foo/Integer" ALWAYS | |
forall {$dNum :: Num Integer} foo @ Integer $dNum = intFoo | |
Imported rules | |
==================== Top-level specialisations ==================== | |
==================== FloatOut stats: ==================== | |
0 Lets floated to top level; 0 Lets floated elsewhere; from 0 Lambda groups | |
==================== FloatOut stats: ==================== | |
1 Lets floated to top level; 0 Lets floated elsewhere; from 1 Lambda groups | |
==================== Grand total simplifier statistics ==================== | |
Total ticks: 75 | |
19 PreInlineUnconditionally | |
22 PostInlineUnconditionally | |
11 UnfoldingDone | |
2 LetFloatFromLet | |
16 BetaReduction | |
5 KnownBranch | |
10 SimplifierDone | |
Linking foo ... | |
. | |
$> ./foo | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment