Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created October 4, 2017 18:42
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 mpickering/f84a5f842861211e8e731c63e82d5c01 to your computer and use it in GitHub Desktop.
Save mpickering/f84a5f842861211e8e731c63e82d5c01 to your computer and use it in GitHub Desktop.
[1 of 1] Compiling Foo ( test.hs, test.o )
==================== Tidy Core ====================
Result size of Tidy Core
= {terms: 89, types: 63, coercions: 0, joins: 0/0}
-- RHS size: {terms: 10, types: 11, coercions: 0, joins: 0/0}
isItSilly :: forall a. a -> Silly a -> Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<L,U><S(S(LLC(C(S))LLLLL)L),1*U(1*U(A,A,1*C1(C1(U)),A,A,A,A,A),U)>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
Tmpl= \ (@ a_a22c)
(a1_a1U4 [Occ=Once] :: a_a22c)
(ds_d23r [Occ=Once!] :: Silly a_a22c) ->
case ds_d23r of { Silly $dOrd_a22e [Occ=Once] x_a1U5 [Occ=Once] ->
< @ a_a22c $dOrd_a22e a1_a1U4 x_a1U5
}}]
isItSilly
= \ (@ a_a22c) (a1_a1U4 :: a_a22c) (ds_d23r :: Silly a_a22c) ->
case ds_d23r of { Silly $dOrd_a22e x_a1U5 ->
< @ a_a22c $dOrd_a22e a1_a1U4 x_a1U5
}
-- RHS size: {terms: 1, types: 1, coercions: 0, joins: 0/0}
isItSillyIntTa :: Int -> Silly Int -> Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<L,U><S(S(LLC(C(S))LLLLL)L),1*U(1*U(A,A,1*C1(C1(U)),A,A,A,A,A),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= isItSilly @ Int}]
isItSillyIntTa = isItSilly @ Int
-- RHS size: {terms: 1, types: 1, coercions: 0, joins: 0/0}
isItSillyInt :: Int -> Silly Int -> Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<L,U><S(S(LLC(C(S))LLLLL)L),1*U(1*U(A,A,1*C1(C1(U)),A,A,A,A,A),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= isItSilly @ Int}]
isItSillyInt = isItSilly @ Int
-- RHS size: {terms: 8, types: 8, coercions: 0, joins: 0/0}
isItSillyInt3 :: Int -> Silly Int -> Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<S(S),1*U(U)><S(LS(S)),1*U(A,1*U(U))>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
Tmpl= \ (a_a1Ua [Occ=Once] :: Int)
(ds_d23A [Occ=Once!] :: Silly Int) ->
case ds_d23A of { Silly _ [Occ=Dead] x_a1Ub [Occ=Once] ->
GHC.Classes.ltInt a_a1Ua x_a1Ub
}}]
isItSillyInt3
= \ (a_a1Ua :: Int) (ds_d23A :: Silly Int) ->
case ds_d23A of { Silly $dOrd_a22p x_a1Ub ->
GHC.Classes.ltInt a_a1Ua x_a1Ub
}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
isItSillyInt2 :: Int -> Silly Int -> Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=<S(S),1*U(U)><S(LS(S)),1*U(A,1*U(U))>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
Tmpl= \ (a_a1U8 [Occ=Once] :: Int)
(ds_d23k [Occ=Once!] :: Silly Int) ->
case ds_d23k of { Silly _ [Occ=Dead] x_a1U9 [Occ=Once] ->
GHC.Classes.ltInt a_a1U8 x_a1U9
}}]
isItSillyInt2 = isItSillyInt3
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
Foo.$trModule4 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
Foo.$trModule4 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
Foo.$trModule3 :: 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 [] 10 20}]
Foo.$trModule3 = GHC.Types.TrNameS Foo.$trModule4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
Foo.$trModule2 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
Foo.$trModule2 = "Foo"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
Foo.$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 [] 10 20}]
Foo.$trModule1 = GHC.Types.TrNameS Foo.$trModule2
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
Foo.$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}]
Foo.$trModule = GHC.Types.Module Foo.$trModule3 Foo.$trModule1
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep_r239 :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m2]
$krep_r239 = GHC.Types.KindRepVar 0#
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep1_r25i :: [GHC.Types.KindRep]
[GblId, Caf=NoCafRefs, Str=m2]
$krep1_r25i
= GHC.Types.:
@ GHC.Types.KindRep $krep_r239 (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep2_r25j :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m1]
$krep2_r25j
= GHC.Types.KindRepTyConApp GHC.Classes.$tcOrd $krep1_r25i
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
Foo.$tcSilly2 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]
Foo.$tcSilly2 = "Silly"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
Foo.$tcSilly1 :: 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 [] 10 20}]
Foo.$tcSilly1 = GHC.Types.TrNameS Foo.$tcSilly2
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Foo.$tcSilly :: 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 70}]
Foo.$tcSilly
= GHC.Types.TyCon
14837496839660505799##
5132289573983476353##
Foo.$trModule
Foo.$tcSilly1
0#
GHC.Types.krep$*Arr*
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep3_r25k :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m1]
$krep3_r25k = GHC.Types.KindRepTyConApp Foo.$tcSilly $krep1_r25i
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep4_r25l :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m4]
$krep4_r25l = GHC.Types.KindRepFun $krep_r239 $krep3_r25k
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
Foo.$tc'Silly1 [InlPrag=[~]] :: GHC.Types.KindRep
[GblId, Caf=NoCafRefs, Str=m4]
Foo.$tc'Silly1 = GHC.Types.KindRepFun $krep2_r25j $krep4_r25l
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
Foo.$tc'Silly3 :: GHC.Prim.Addr#
[GblId,
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]
Foo.$tc'Silly3 = "'Silly"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
Foo.$tc'Silly2 :: 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 [] 10 20}]
Foo.$tc'Silly2 = GHC.Types.TrNameS Foo.$tc'Silly3
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Foo.$tc'Silly :: 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 70}]
Foo.$tc'Silly
= GHC.Types.TyCon
18003675465690111138##
18341445684017984320##
Foo.$trModule
Foo.$tc'Silly2
1#
Foo.$tc'Silly1
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeApplications #-}
module Foo where
data Silly a where
Silly :: Ord a => a -> Silly a
isItSilly :: a -> Silly a -> Bool
isItSilly a (Silly x) = a < x
isItSillyIntTa :: Int -> Silly Int -> Bool
isItSillyIntTa = isItSilly @Int
isItSillyInt :: Int -> Silly Int -> Bool
isItSillyInt a x = isItSilly a x
isItSillyInt2 :: Int -> Silly Int -> Bool
isItSillyInt2 a (Silly x) = a < x
isItSillyInt3 :: Int -> Silly Int -> Bool
isItSillyInt3 a (Silly x) = isItSilly a (Silly x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment