Skip to content

Instantly share code, notes, and snippets.

@kgadek
Last active February 21, 2017 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgadek/1fcc4677f908693fa9401afd58b235c3 to your computer and use it in GitHub Desktop.
Save kgadek/1fcc4677f908693fa9401afd58b235c3 to your computer and use it in GitHub Desktop.
stuff :: Maybe Int
stuff = return (456 :: Int)
main :: IO ()
main = do
let Just x = stuff
print x
[1 of 1] Compiling Main ( core.hs, core.o )
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 27, types: 19, coercions: 0}
-- RHS size: {terms: 2, types: 0, coercions: 0}
$trModule1_r10K :: GHC.Types.TrName
[GblId, Caf=NoCafRefs, Str=DmdType]
$trModule1_r10K = GHC.Types.TrNameS "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0}
$trModule2_r16j :: GHC.Types.TrName
[GblId, Caf=NoCafRefs, Str=DmdType]
$trModule2_r16j = GHC.Types.TrNameS "Main"#
-- RHS size: {terms: 3, types: 0, coercions: 0}
Main.$trModule :: GHC.Types.Module
[GblId, Caf=NoCafRefs, Str=DmdType]
Main.$trModule = GHC.Types.Module $trModule1_r10K $trModule2_r16j
-- RHS size: {terms: 13, types: 11, coercions: 0}
main :: IO ()
[GblId, Str=DmdType]
main =
print
@ Int
GHC.Show.$fShowInt
(case return
@ Maybe GHC.Base.$fMonadMaybe @ Int (GHC.Types.I# 456#)
of _ [Occ=Dead] {
Nothing ->
case Control.Exception.Base.irrefutPatError
@ 'GHC.Types.PtrRepLifted @ (Int) "core.hs:6:7-20|Just x"#
of wild1_00 {
};
Just x_aHV -> x_aHV
})
-- RHS size: {terms: 2, types: 1, coercions: 0}
:Main.main :: IO ()
[GblId, Str=DmdType]
:Main.main = GHC.TopHandler.runMainIO @ () main
Linking core ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment