Skip to content

Instantly share code, notes, and snippets.

@snoyberg
Created May 19, 2017 16:01
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 snoyberg/0042a6653367366e5b789e70abf7d673 to your computer and use it in GitHub Desktop.
Save snoyberg/0042a6653367366e5b789e70abf7d673 to your computer and use it in GitHub Desktop.
==================== Tidy Core ====================
2017-05-19 16:00:28.603891 UTC
Result size of Tidy Core = {terms: 112, types: 77, coercions: 9}
-- RHS size: {terms: 11, types: 6, coercions: 0}
Main.$WState [InlPrag=INLINE] :: Int -> Int -> State
[GblId[DataConWrapper],
Arity=2,
Caf=NoCafRefs,
Str=DmdType <S,U><S,U>m,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=False,boring_ok=False)
Tmpl= \ (dt_a16G [Occ=Once!] :: Int)
(dt_a16H [Occ=Once!] :: Int) ->
case dt_a16G of _ [Occ=Dead] { GHC.Types.I# dt_a16I [Occ=Once] ->
case dt_a16H of _ [Occ=Dead] { GHC.Types.I# dt_a16J [Occ=Once] ->
Main.State dt_a16I dt_a16J
}
}}]
Main.$WState =
\ (dt_a16G [Occ=Once!] :: Int) (dt_a16H [Occ=Once!] :: Int) ->
case dt_a16G of _ [Occ=Dead] { GHC.Types.I# dt_a16I [Occ=Once] ->
case dt_a16H of _ [Occ=Dead] { GHC.Types.I# dt_a16J [Occ=Once] ->
Main.State dt_a16I dt_a16J
}
}
-- RHS size: {terms: 6, types: 4, coercions: 0}
stateLen :: State -> Int
[GblId[[RecSel]],
Arity=1,
Caf=NoCafRefs,
Str=DmdType <S(LS),1*U(A,U)>m,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (ds_d4im [Occ=Once!] :: State) ->
case ds_d4im
of _ [Occ=Dead] { State _ [Occ=Dead] dt1_d4ix [Occ=Once] ->
GHC.Types.I# dt1_d4ix
}}]
stateLen =
\ (ds_d4im :: State) ->
case ds_d4im of _ [Occ=Dead] { State dt_d4iw dt1_d4ix ->
GHC.Types.I# dt1_d4ix
}
-- RHS size: {terms: 6, types: 4, coercions: 0}
stateSum :: State -> Int
[GblId[[RecSel]],
Arity=1,
Caf=NoCafRefs,
Str=DmdType <S(SL),1*U(U,A)>m,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (ds_d4ii [Occ=Once!] :: State) ->
case ds_d4ii
of _ [Occ=Dead] { State dt_d4iu [Occ=Once] _ [Occ=Dead] ->
GHC.Types.I# dt_d4iu
}}]
stateSum =
\ (ds_d4ii :: State) ->
case ds_d4ii of _ [Occ=Dead] { State dt_d4iu dt1_d4iv ->
GHC.Types.I# dt_d4iu
}
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$trModule2 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=DmdType m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
Main.$trModule2 = GHC.Types.TrNameS "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$trModule1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=DmdType m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
Main.$trModule1 = GHC.Types.TrNameS "Main"#
-- RHS size: {terms: 3, types: 0, coercions: 0}
Main.$trModule :: GHC.Types.Module
[GblId,
Caf=NoCafRefs,
Str=DmdType m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
Main.$trModule = GHC.Types.Module Main.$trModule2 Main.$trModule1
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$tc'State1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=DmdType m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}]
Main.$tc'State1 = GHC.Types.TrNameS "'State"#
-- RHS size: {terms: 5, types: 0, coercions: 0}
Main.$tc'State :: GHC.Types.TyCon
[GblId,
Caf=NoCafRefs,
Str=DmdType m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
Main.$tc'State =
GHC.Types.TyCon
5865727074706985857##
7529931243514310794##
Main.$trModule
Main.$tc'State1
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$tcState1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=DmdType m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}]
Main.$tcState1 = GHC.Types.TrNameS "State"#
-- RHS size: {terms: 5, types: 0, coercions: 0}
Main.$tcState :: GHC.Types.TyCon
[GblId,
Caf=NoCafRefs,
Str=DmdType m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
Main.$tcState =
GHC.Types.TyCon
5905770718391460737##
3851935663103286392##
Main.$trModule
Main.$tcState1
Rec {
-- RHS size: {terms: 24, types: 8, coercions: 0}
Main.$wgo [InlPrag=[0], Occ=LoopBreaker]
:: GHC.Prim.Int#
-> GHC.Prim.Int#
-> GHC.Prim.Int#
-> (# GHC.Prim.Int#, GHC.Prim.Int# #)
[GblId, Arity=3, Caf=NoCafRefs, Str=DmdType <S,1*U><S,U><S,U>]
Main.$wgo =
\ (w_s6Sp :: GHC.Prim.Int#)
(ww_s6St [OS=OneShot] :: GHC.Prim.Int#)
(ww1_s6Su [OS=OneShot] :: GHC.Prim.Int#) ->
case w_s6Sp of wild_XC {
__DEFAULT ->
Main.$wgo
(GHC.Prim.+# wild_XC 1#)
(GHC.Prim.+# ww_s6St wild_XC)
(GHC.Prim.+# ww1_s6Su 1#);
10000000# ->
(# GHC.Prim.+# ww_s6St 10000000#, GHC.Prim.+# ww1_s6Su 1# #)
}
end Rec }
-- RHS size: {terms: 18, types: 9, coercions: 0}
Main.main2 :: String
[GblId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 103 0}]
Main.main2 =
case Main.$wgo 1# 0# 0#
of _ [Occ=Dead] { (# ww1_s6SB, ww2_s6SC #) ->
case GHC.Prim./##
(GHC.Prim.int2Double# ww1_s6SB) (GHC.Prim.int2Double# ww2_s6SC)
of wild2_a4qy { __DEFAULT ->
GHC.Float.$w$sshowSignedFloat
GHC.Float.$fShowDouble_$sshowFloat
GHC.Show.shows22
wild2_a4qy
(GHC.Types.[] @ Char)
}
}
-- RHS size: {terms: 6, types: 2, coercions: 0}
Main.main1
:: GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)
[GblId,
Arity=1,
Str=DmdType <S,U>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 40 0}]
Main.main1 =
\ (eta_a4qD [OS=OneShot] :: GHC.Prim.State# GHC.Prim.RealWorld) ->
GHC.IO.Handle.Text.hPutStr2
GHC.IO.Handle.FD.stdout Main.main2 GHC.Types.True eta_a4qD
-- RHS size: {terms: 1, types: 0, coercions: 3}
main :: IO ()
[GblId,
Arity=1,
Str=DmdType <S,U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)
Tmpl= Main.main1
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *))}]
main =
Main.main1
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *))
-- RHS size: {terms: 2, types: 1, coercions: 3}
Main.main3
:: GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)
[GblId,
Arity=1,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
Main.main3 =
GHC.TopHandler.runMainIO1
@ ()
(Main.main1
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *)))
-- RHS size: {terms: 1, types: 0, coercions: 3}
:Main.main :: IO ()
[GblId,
Arity=1,
Str=DmdType,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)
Tmpl= Main.main3
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *))}]
:Main.main =
Main.main3
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment