Skip to content

Instantly share code, notes, and snippets.

@basile-henry
Created April 2, 2018 15:07
Show Gist options
  • Select an option

  • Save basile-henry/f57217669394636f15c6212073545353 to your computer and use it in GitHub Desktop.

Select an option

Save basile-henry/f57217669394636f15c6212073545353 to your computer and use it in GitHub Desktop.
➜ ghc -ddump-simpl Test.hs
[1 of 1] Compiling Main ( Test.hs, Test.o )
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 23, types: 12, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1_r1Eb :: GHC.Prim.Addr#
[GblId, Caf=NoCafRefs]
$trModule1_r1Eb = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule2_r1El :: GHC.Types.TrName
[GblId, Caf=NoCafRefs]
$trModule2_r1El = GHC.Types.TrNameS $trModule1_r1Eb
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule3_r1Em :: GHC.Prim.Addr#
[GblId, Caf=NoCafRefs]
$trModule3_r1Em = "Main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule4_r1En :: GHC.Types.TrName
[GblId, Caf=NoCafRefs]
$trModule4_r1En = GHC.Types.TrNameS $trModule3_r1Em
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
Main.$trModule :: GHC.Types.Module
[GblId, Caf=NoCafRefs]
Main.$trModule = GHC.Types.Module $trModule2_r1El $trModule4_r1En
-- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0}
main :: IO ()
[GblId]
main
= print
@ Integer
GHC.Show.$fShowInteger
(fromInteger @ Integer GHC.Num.$fNumInteger 5)
-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
:Main.main :: IO ()
[GblId]
:Main.main = GHC.TopHandler.runMainIO @ () main
Linking Test ...
➜ cat Test.hs
main :: IO ()
main = print five
where
five :: Num a => a
five = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment