Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Does bisum inline? Not sure.
module Main (main) where
import Data.Bifoldable
import Data.Monoid ((<>))
data BiList a b = Nil | Cons a b (BiList a b)
deriving Show
instance Bifoldable BiList where
bifoldMap f g Nil = mempty
bifoldMap f g (Cons a b l) = f a <> g b <> bifoldMap f g l
fromList :: [Int] -> BiList Int Int
fromList [] = Nil
fromList (x:xs) = Cons x (x+1) (fromList xs)
main :: IO ()
main = print $ bisum $ fromList [0..10000]
$ ghc/inplace/bin/ghc-stage2 -O2 -fforce-recomp -ddump-simpl Example.hs
[1 of 1] Compiling Main ( Example.hs, Example.o )
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 345, types: 438, coercions: 48}
-- RHS size: {terms: 3, types: 5, coercions: 0}
Main.$fBifoldableBiList1
:: forall c_a4c6.
Monoid (Data.Monoid.Dual (Data.Monoid.Endo c_a4c6))
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=True,
WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
Main.$fBifoldableBiList1 =
\ (@ c_a4c6) ->
Data.Monoid.$fMonoidDual
@ (Data.Monoid.Endo c_a4c6) (Data.Monoid.$fMonoidEndo @ c_a4c6)
Rec {
-- RHS size: {terms: 26, types: 29, coercions: 0}
Main.$fBifoldableBiList_$cbifoldMap [Occ=LoopBreaker]
:: forall m_a1e8 a_a1e9 b_a1ea.
Monoid m_a1e8 =>
(a_a1e9 -> m_a1e8)
-> (b_a1ea -> m_a1e8) -> BiList a_a1e9 b_a1ea -> m_a1e8
[GblId,
Arity=4,
Caf=NoCafRefs,
Str=<S,U(U,C(C1(U)),A)><L,C(U)><L,C(U)><S,1*U>]
Main.$fBifoldableBiList_$cbifoldMap =
\ (@ m_a3Xv)
(@ a_a3Xw)
(@ b_a3Xx)
($dMonoid_a3Xy :: Monoid m_a3Xv)
(f_a116 :: a_a3Xw -> m_a3Xv)
(g_a117 :: b_a3Xx -> m_a3Xv)
(ds_d4bJ :: BiList a_a3Xw b_a3Xx) ->
case ds_d4bJ of {
Nil -> mempty @ m_a3Xv $dMonoid_a3Xy;
Cons a1_a11a b1_a11b l_a11c ->
mappend
@ m_a3Xv
$dMonoid_a3Xy
(f_a116 a1_a11a)
(mappend
@ m_a3Xv
$dMonoid_a3Xy
(g_a117 b1_a11b)
(Main.$fBifoldableBiList_$cbifoldMap
@ m_a3Xv @ a_a3Xw @ b_a3Xx $dMonoid_a3Xy f_a116 g_a117 l_a11c))
}
end Rec }
-- RHS size: {terms: 13, types: 21, coercions: 12}
Main.$fBifoldableBiList_$cbifoldr
:: forall a_a1eb c_a1ec b_a1ed.
(a_a1eb -> c_a1ec -> c_a1ec)
-> (b_a1ed -> c_a1ec -> c_a1ec)
-> c_a1ec
-> BiList a_a1eb b_a1ed
-> c_a1ec
[GblId,
Arity=4,
Caf=NoCafRefs,
Str=<L,C(U)><L,C(U)><L,U><S,1*U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=4,unsat_ok=True,boring_ok=False)
Tmpl= \ (@ a_a4bS)
(@ c_a4bT)
(@ b_a4bU)
(f_a4bV [Occ=Once] :: a_a4bS -> c_a4bT -> c_a4bT)
(g_a4bW [Occ=Once] :: b_a4bU -> c_a4bT -> c_a4bT)
(z_a4bX [Occ=Once] :: c_a4bT)
(t_a4bY [Occ=Once] :: BiList a_a4bS b_a4bU) ->
((Main.$fBifoldableBiList_$cbifoldMap
@ (Data.Monoid.Endo c_a4bT)
@ a_a4bS
@ b_a4bU
(Data.Monoid.$fMonoidEndo @ c_a4bT)
(f_a4bV
`cast` (<a_a4bS>_R -> Sym (Data.Monoid.N:Endo[0] <c_a4bT>_R)
:: ((a_a4bS -> c_a4bT -> c_a4bT) :: *)
~R#
((a_a4bS -> Data.Monoid.Endo c_a4bT) :: *)))
(g_a4bW
`cast` (<b_a4bU>_R -> Sym (Data.Monoid.N:Endo[0] <c_a4bT>_R)
:: ((b_a4bU -> c_a4bT -> c_a4bT) :: *)
~R#
((b_a4bU -> Data.Monoid.Endo c_a4bT) :: *)))
t_a4bY)
`cast` (Data.Monoid.N:Endo[0] <c_a4bT>_R
:: (Data.Monoid.Endo c_a4bT :: *) ~R# ((c_a4bT -> c_a4bT) :: *)))
z_a4bX}]
Main.$fBifoldableBiList_$cbifoldr =
\ (@ a_a4bS)
(@ c_a4bT)
(@ b_a4bU)
(f_a4bV :: a_a4bS -> c_a4bT -> c_a4bT)
(g_a4bW :: b_a4bU -> c_a4bT -> c_a4bT)
(z_a4bX :: c_a4bT)
(t_a4bY :: BiList a_a4bS b_a4bU) ->
((Main.$fBifoldableBiList_$cbifoldMap
@ (Data.Monoid.Endo c_a4bT)
@ a_a4bS
@ b_a4bU
(Data.Monoid.$fMonoidEndo @ c_a4bT)
(f_a4bV
`cast` (<a_a4bS>_R -> Sym (Data.Monoid.N:Endo[0] <c_a4bT>_R)
:: ((a_a4bS -> c_a4bT -> c_a4bT) :: *)
~R#
((a_a4bS -> Data.Monoid.Endo c_a4bT) :: *)))
(g_a4bW
`cast` (<b_a4bU>_R -> Sym (Data.Monoid.N:Endo[0] <c_a4bT>_R)
:: ((b_a4bU -> c_a4bT -> c_a4bT) :: *)
~R#
((b_a4bU -> Data.Monoid.Endo c_a4bT) :: *)))
t_a4bY)
`cast` (Data.Monoid.N:Endo[0] <c_a4bT>_R
:: (Data.Monoid.Endo c_a4bT :: *) ~R# ((c_a4bT -> c_a4bT) :: *)))
z_a4bX
-- RHS size: {terms: 6, types: 9, coercions: 0}
Main.$fBifoldableBiList_$cbifold
:: forall m_a1e7. Monoid m_a1e7 => BiList m_a1e7 m_a1e7 -> m_a1e7
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<L,U(U,C(C1(U)),A)>,
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= \ (@ m_a4cu)
($dMonoid_a4cv [Occ=Once] :: Monoid m_a4cu)
(eta_B1 [Occ=Once] :: BiList m_a4cu m_a4cu) ->
Main.$fBifoldableBiList_$cbifoldMap
@ m_a4cu
@ m_a4cu
@ m_a4cu
$dMonoid_a4cv
(id @ m_a4cu)
(id @ m_a4cu)
eta_B1}]
Main.$fBifoldableBiList_$cbifold =
\ (@ m_a4cu) ($dMonoid_a4cv :: Monoid m_a4cu) ->
Main.$fBifoldableBiList_$cbifoldMap
@ m_a4cu
@ m_a4cu
@ m_a4cu
$dMonoid_a4cv
(id @ m_a4cu)
(id @ m_a4cu)
-- RHS size: {terms: 21, types: 26, coercions: 15}
Main.$fBifoldableBiList_$cbifoldl
:: forall c_a1ee a_a1ef b_a1eg.
(c_a1ee -> a_a1ef -> c_a1ee)
-> (c_a1ee -> b_a1eg -> c_a1ee)
-> c_a1ee
-> BiList a_a1ef b_a1eg
-> c_a1ee
[GblId,
Arity=4,
Str=<L,C(C1(U))><L,C(C1(U))><L,U><S,1*U>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=IF_ARGS [60 60 0 0] 151 0}]
Main.$fBifoldableBiList_$cbifoldl =
\ (@ c_a4c6)
(@ a_a4c7)
(@ b_a4c8)
(f_X4d1 :: c_a4c6 -> a_a4c7 -> c_a4c6)
(g_X4d3 :: c_a4c6 -> b_a4c8 -> c_a4c6)
(z_X4d5 :: c_a4c6)
(t_X4d7 :: BiList a_a4c7 b_a4c8) ->
((Main.$fBifoldableBiList_$cbifoldMap
@ (Data.Monoid.Dual (Data.Monoid.Endo c_a4c6))
@ a_a4c7
@ b_a4c8
(Main.$fBifoldableBiList1 @ c_a4c6)
((\ (x_a4ck :: a_a4c7) (eta_a4cl :: c_a4c6) ->
f_X4d1 eta_a4cl x_a4ck)
`cast` (<a_a4c7>_R
-> Sym (Data.Monoid.N:Dual[0] (Data.Monoid.N:Endo[0] <c_a4c6>_R))
:: ((a_a4c7 -> c_a4c6 -> c_a4c6) :: *)
~R#
((a_a4c7 -> Data.Monoid.Dual (Data.Monoid.Endo c_a4c6)) :: *)))
((\ (x_a4cq :: b_a4c8) (eta_a4cr :: c_a4c6) ->
g_X4d3 eta_a4cr x_a4cq)
`cast` (<b_a4c8>_R
-> Sym (Data.Monoid.N:Dual[0] (Data.Monoid.N:Endo[0] <c_a4c6>_R))
:: ((b_a4c8 -> c_a4c6 -> c_a4c6) :: *)
~R#
((b_a4c8 -> Data.Monoid.Dual (Data.Monoid.Endo c_a4c6)) :: *)))
t_X4d7)
`cast` (Data.Monoid.N:Dual[0] (Data.Monoid.N:Endo[0] <c_a4c6>_R)
:: (Data.Monoid.Dual (Data.Monoid.Endo c_a4c6) :: *)
~R#
((c_a4c6 -> c_a4c6) :: *)))
z_X4d5
-- RHS size: {terms: 5, types: 1, coercions: 0}
Main.$fBifoldableBiList [InlPrag=[ALWAYS] CONLIKE]
:: Bifoldable BiList
[GblId[DFunId],
Str=m,
Unf=DFun: \ ->
Data.Bifoldable.C:Bifoldable TYPE: BiList
Main.$fBifoldableBiList_$cbifold
Main.$fBifoldableBiList_$cbifoldMap
Main.$fBifoldableBiList_$cbifoldr
Main.$fBifoldableBiList_$cbifoldl]
Main.$fBifoldableBiList =
Data.Bifoldable.C:Bifoldable
@ BiList
Main.$fBifoldableBiList_$cbifold
Main.$fBifoldableBiList_$cbifoldMap
Main.$fBifoldableBiList_$cbifoldr
Main.$fBifoldableBiList_$cbifoldl
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$fShowBiList3 :: Int
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Main.$fShowBiList3 = GHC.Types.I# 11#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$fShowBiList2 :: [Char]
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
Main.$fShowBiList2 = GHC.CString.unpackCString# "Cons "#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$fShowBiList5 :: [Char]
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
Main.$fShowBiList5 = GHC.CString.unpackCString# "Nil"#
-- RHS size: {terms: 2, types: 1, coercions: 0}
Main.$fShowBiList4 :: ShowS
[GblId,
Arity=1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
Main.$fShowBiList4 = ++ @ Char Main.$fShowBiList5
Rec {
-- RHS size: {terms: 54, types: 40, coercions: 0}
Main.$fShowBiList_$s$cshowsPrec [Occ=LoopBreaker]
:: forall b_a3Wc a_a3Wb.
BiList a_a3Wb b_a3Wc
-> GHC.Prim.Int# -> (Show a_a3Wb, Show b_a3Wc) => ShowS
[GblId,
Arity=4,
Str=<S,1*U><L,U><L,U(C(C1(U)),A,A)><L,U(C(C1(U)),A,A)>]
Main.$fShowBiList_$s$cshowsPrec =
\ (@ b_a3Wc)
(@ a_a3Wb)
(sc_s6Nc :: BiList a_a3Wb b_a3Wc)
(sc1_s6Nb :: GHC.Prim.Int#)
(sc2_s6Na :: Show a_a3Wb)
(sc3_s6N9 :: Show b_a3Wc) ->
case sc_s6Nc of {
Nil -> Main.$fShowBiList4;
Cons b1_a2RC b2_a2RD b3_a2RE ->
let {
f_X4ex [Dmd=<L,C(U)>] :: String -> String
[LclId]
f_X4ex =
showsPrec @ a_a3Wb sc2_s6Na Main.$fShowBiList3 b1_a2RC } in
let {
f1_X4fW [Dmd=<L,C(U)>] :: String -> String
[LclId]
f1_X4fW =
showsPrec @ b_a3Wc sc3_s6N9 Main.$fShowBiList3 b2_a2RD } in
let {
g_X4eH [Dmd=<L,C(U)>] :: String -> String
[LclId]
g_X4eH =
Main.$fShowBiList_$s$cshowsPrec
@ b_a3Wc @ a_a3Wb b3_a2RE 11# sc2_s6Na sc3_s6N9 } in
let {
p_a4d6 :: ShowS
[LclId, Arity=1, Str=<L,U>]
p_a4d6 =
\ (x_X4eP :: String) ->
++
@ Char
Main.$fShowBiList2
(f_X4ex
(GHC.Types.:
@ Char
GHC.Show.showSpace1
(f1_X4fW
(GHC.Types.: @ Char GHC.Show.showSpace1 (g_X4eH x_X4eP))))) } in
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.>=# sc1_s6Nb 11#) of {
False -> p_a4d6;
True ->
\ (x_a4db :: String) ->
GHC.Types.:
@ Char
GHC.Show.shows6
(p_a4d6 (GHC.Types.: @ Char GHC.Show.shows4 x_a4db))
}
}
end Rec }
-- RHS size: {terms: 57, types: 42, coercions: 0}
Main.$fShowBiList_$cshowsPrec
:: forall a_a3Wb b_a3Wc.
(Show b_a3Wc, Show a_a3Wb) =>
Int -> BiList a_a3Wb b_a3Wc -> ShowS
[GblId,
Arity=4,
Str=<L,U(C(C1(U)),A,A)><L,U(C(C1(U)),A,A)><L,1*U(U)><S,1*U>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=IF_ARGS [30 30 20 30] 392 180}]
Main.$fShowBiList_$cshowsPrec =
\ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd :: Show b_a3Wc)
($dShow1_a3We :: Show a_a3Wb)
(ds_d4bw :: Int)
(ds1_d4bx :: BiList a_a3Wb b_a3Wc) ->
case ds1_d4bx of {
Nil -> Main.$fShowBiList4;
Cons b1_a2RC b2_a2RD b3_a2RE ->
case ds_d4bw of { GHC.Types.I# x_a4dT ->
let {
f_X4ex [Dmd=<L,C(U)>] :: String -> String
[LclId]
f_X4ex =
showsPrec @ a_a3Wb $dShow1_a3We Main.$fShowBiList3 b1_a2RC } in
let {
f1_X4fW [Dmd=<L,C(U)>] :: String -> String
[LclId]
f1_X4fW =
showsPrec @ b_a3Wc $dShow_a3Wd Main.$fShowBiList3 b2_a2RD } in
let {
g_X4eH [Dmd=<L,C(U)>] :: String -> String
[LclId]
g_X4eH =
Main.$fShowBiList_$s$cshowsPrec
@ b_a3Wc @ a_a3Wb b3_a2RE 11# $dShow1_a3We $dShow_a3Wd } in
let {
p_a4d6 :: ShowS
[LclId, Arity=1, Str=<L,U>]
p_a4d6 =
\ (x1_X4eP :: String) ->
++
@ Char
Main.$fShowBiList2
(f_X4ex
(GHC.Types.:
@ Char
GHC.Show.showSpace1
(f1_X4fW
(GHC.Types.: @ Char GHC.Show.showSpace1 (g_X4eH x1_X4eP))))) } in
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.>=# x_a4dT 11#) of {
False -> p_a4d6;
True ->
\ (x1_a4db :: String) ->
GHC.Types.:
@ Char
GHC.Show.shows6
(p_a4d6 (GHC.Types.: @ Char GHC.Show.shows4 x1_a4db))
}
}
}
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$fShowBiList1 :: Int
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Main.$fShowBiList1 = GHC.Types.I# 0#
-- RHS size: {terms: 13, types: 18, coercions: 0}
Main.$fShowBiList_$cshowList
:: forall a_a3Wb b_a3Wc.
(Show b_a3Wc, Show a_a3Wb) =>
[BiList a_a3Wb b_a3Wc] -> ShowS
[GblId,
Arity=4,
Str=<L,U(C(C1(U)),A,A)><L,U(C(C1(U)),A,A)><S,1*U><L,U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=4,unsat_ok=True,boring_ok=False)
Tmpl= \ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd [Occ=Once] :: Show b_a3Wc)
($dShow1_a3We [Occ=Once] :: Show a_a3Wb)
(eta_B2 [Occ=Once] :: [BiList a_a3Wb b_a3Wc])
(eta1_B1 [Occ=Once] :: String) ->
GHC.Show.showList__
@ (BiList a_a3Wb b_a3Wc)
(Main.$fShowBiList_$cshowsPrec
@ a_a3Wb @ b_a3Wc $dShow_a3Wd $dShow1_a3We Main.$fShowBiList1)
eta_B2
eta1_B1}]
Main.$fShowBiList_$cshowList =
\ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd :: Show b_a3Wc)
($dShow1_a3We :: Show a_a3Wb)
(eta_B2 :: [BiList a_a3Wb b_a3Wc])
(eta1_B1 :: String) ->
GHC.Show.showList__
@ (BiList a_a3Wb b_a3Wc)
(Main.$fShowBiList_$cshowsPrec
@ a_a3Wb @ b_a3Wc $dShow_a3Wd $dShow1_a3We Main.$fShowBiList1)
eta_B2
eta1_B1
-- RHS size: {terms: 11, types: 14, coercions: 0}
Main.$fShowBiList_$cshow
:: forall a_a3Wb b_a3Wc.
(Show b_a3Wc, Show a_a3Wb) =>
BiList a_a3Wb b_a3Wc -> String
[GblId,
Arity=3,
Str=<L,U(C(C1(U)),A,A)><L,U(C(C1(U)),A,A)><S,1*U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=3,unsat_ok=True,boring_ok=False)
Tmpl= \ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd [Occ=Once] :: Show b_a3Wc)
($dShow1_a3We [Occ=Once] :: Show a_a3Wb)
(x_a4cD [Occ=Once] :: BiList a_a3Wb b_a3Wc) ->
Main.$fShowBiList_$s$cshowsPrec
@ b_a3Wc
@ a_a3Wb
x_a4cD
0#
$dShow1_a3We
$dShow_a3Wd
(GHC.Types.[] @ Char)}]
Main.$fShowBiList_$cshow =
\ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd :: Show b_a3Wc)
($dShow1_a3We :: Show a_a3Wb)
(x_a4cD :: BiList a_a3Wb b_a3Wc) ->
Main.$fShowBiList_$s$cshowsPrec
@ b_a3Wc
@ a_a3Wb
x_a4cD
0#
$dShow1_a3We
$dShow_a3Wd
(GHC.Types.[] @ Char)
-- RHS size: {terms: 14, types: 17, coercions: 0}
Main.$fShowBiList [InlPrag=[ALWAYS] CONLIKE]
:: forall a_a2Rz b_a2RA.
(Show b_a2RA, Show a_a2Rz) =>
Show (BiList a_a2Rz b_a2RA)
[GblId[DFunId],
Arity=2,
Str=<L,U(C(C1(U)),A,A)><L,U(C(C1(U)),A,A)>m,
Unf=DFun: \ (@ a_a3Wb[ssk])
(@ b_a3Wc[ssk])
($dShow_a3Wd :: Show b_a3Wc[ssk])
($dShow1_a3We :: Show a_a3Wb[ssk]) ->
GHC.Show.C:Show TYPE: BiList a_a3Wb[ssk] b_a3Wc[ssk]
Main.$fShowBiList_$cshowsPrec
@ a_a3Wb[ssk] @ b_a3Wc[ssk] $dShow_a3Wd $dShow1_a3We
Main.$fShowBiList_$cshow
@ a_a3Wb[ssk] @ b_a3Wc[ssk] $dShow_a3Wd $dShow1_a3We
Main.$fShowBiList_$cshowList
@ a_a3Wb[ssk] @ b_a3Wc[ssk] $dShow_a3Wd $dShow1_a3We]
Main.$fShowBiList =
\ (@ a_a3Wb)
(@ b_a3Wc)
($dShow_a3Wd :: Show b_a3Wc)
($dShow1_a3We :: Show a_a3Wb) ->
GHC.Show.C:Show
@ (BiList a_a3Wb b_a3Wc)
(Main.$fShowBiList_$cshowsPrec
@ a_a3Wb @ b_a3Wc $dShow_a3Wd $dShow1_a3We)
(Main.$fShowBiList_$cshow
@ a_a3Wb @ b_a3Wc $dShow_a3Wd $dShow1_a3We)
(Main.$fShowBiList_$cshowList
@ a_a3Wb @ b_a3Wc $dShow_a3Wd $dShow1_a3We)
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$trModule2 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=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=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=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'Cons1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}]
Main.$tc'Cons1 = GHC.Types.TrNameS "'Cons"#
-- RHS size: {terms: 5, types: 0, coercions: 0}
Main.$tc'Cons :: GHC.Types.TyCon
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
Main.$tc'Cons =
GHC.Types.TyCon
18207026349337875767##
15163872925107883080##
Main.$trModule
Main.$tc'Cons1
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$tc'Nil1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
Main.$tc'Nil1 = GHC.Types.TrNameS "'Nil"#
-- RHS size: {terms: 5, types: 0, coercions: 0}
Main.$tc'Nil :: GHC.Types.TyCon
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
Main.$tc'Nil =
GHC.Types.TyCon
16673662833419711035##
7628056425835309196##
Main.$trModule
Main.$tc'Nil1
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.$tcBiList1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}]
Main.$tcBiList1 = GHC.Types.TrNameS "BiList"#
-- RHS size: {terms: 5, types: 0, coercions: 0}
Main.$tcBiList :: GHC.Types.TyCon
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 50}]
Main.$tcBiList =
GHC.Types.TyCon
18311180314888507822##
6271562668187668960##
Main.$trModule
Main.$tcBiList1
Rec {
-- RHS size: {terms: 17, types: 13, coercions: 0}
fromList [Occ=LoopBreaker] :: [Int] -> BiList Int Int
[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>]
fromList =
\ (ds_d4bp :: [Int]) ->
case ds_d4bp of {
[] -> Main.Nil @ Int @ Int;
: x_a18k xs_a18l ->
Main.Cons
@ Int
@ Int
x_a18k
(case x_a18k of { GHC.Types.I# x1_a4ej ->
GHC.Types.I# (GHC.Prim.+# x1_a4ej 1#)
})
(fromList xs_a18l)
}
end Rec }
-- RHS size: {terms: 2, types: 1, coercions: 0}
Main.main5 :: Monoid (Data.Monoid.Sum Int)
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=True,
WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
Main.main5 = Data.Monoid.$fMonoidSum @ Int GHC.Num.$fNumInt
-- RHS size: {terms: 3, types: 0, coercions: 0}
Main.main4 :: [Int]
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
Main.main4 = GHC.Enum.eftInt 0# 10000#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main3 :: BiList Int Int
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
Main.main3 = fromList Main.main4
-- RHS size: {terms: 16, types: 19, coercions: 12}
Main.main2 :: String
[GblId,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 120 30}]
Main.main2 =
case (Main.$fBifoldableBiList_$cbifoldMap
@ (Data.Monoid.Sum Int)
@ Int
@ Int
Main.main5
((Data.Bifoldable.bisum3 @ Int)
`cast` (<Int>_R -> Sym (Data.Monoid.N:Sum[0] <Int>_R)
:: ((Int -> Int) :: *) ~R# ((Int -> Data.Monoid.Sum Int) :: *)))
((Data.Bifoldable.bisum2 @ Int)
`cast` (<Int>_R -> Sym (Data.Monoid.N:Sum[0] <Int>_R)
:: ((Int -> Int) :: *) ~R# ((Int -> Data.Monoid.Sum Int) :: *)))
Main.main3)
`cast` (Data.Monoid.N:Sum[0] <Int>_R
:: (Data.Monoid.Sum Int :: *) ~R# (Int :: *))
of
{ GHC.Types.I# ww3_a4Es ->
case GHC.Show.$wshowSignedInt 0# ww3_a4Es (GHC.Types.[] @ Char) of
{ (# ww5_a4Ew, ww6_a4Ex #) ->
GHC.Types.: @ Char ww5_a4Ew ww6_a4Ex
}
}
-- 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=<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_a4i3 :: GHC.Prim.State# GHC.Prim.RealWorld) ->
GHC.IO.Handle.Text.hPutStr2
GHC.IO.Handle.FD.stdout Main.main2 GHC.Types.True eta_a4i3
-- RHS size: {terms: 1, types: 0, coercions: 3}
main :: IO ()
[GblId,
Arity=1,
Str=<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.main6
:: GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)
[GblId,
Arity=1,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
Main.main6 =
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,
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.main6
`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.main6
`cast` (Sym (GHC.Types.N:IO[0] <()>_R)
:: ((GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, () #)) :: *)
~R#
(IO () :: *))
------ Local rules for imported ids --------
"SC:$cshowsPrec0" [ALWAYS]
forall (@ b_a3Wc)
(@ a_a3Wb)
(sc_s6Nc :: BiList a_a3Wb b_a3Wc)
(sc1_s6Nb :: GHC.Prim.Int#)
(sc2_s6Na :: Show a_a3Wb)
(sc3_s6N9 :: Show b_a3Wc).
Main.$fShowBiList_$cshowsPrec @ a_a3Wb
@ b_a3Wc
sc3_s6N9
sc2_s6Na
(GHC.Types.I# sc1_s6Nb)
sc_s6Nc
= Main.$fShowBiList_$s$cshowsPrec
@ b_a3Wc @ a_a3Wb sc_s6Nc sc1_s6Nb sc2_s6Na sc3_s6N9
Linking Example ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.