summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/spec004.stderr
blob: 825319bcb676ac5b3657e4c24a17ba4a872d86fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

==================== Specialise ====================
Result size of Specialise
  = {terms: 53, types: 46, coercions: 0, joins: 0/0}

-- RHS size: {terms: 14, types: 12, coercions: 0, joins: 0/0}
$sfoo [InlPrag=NOINLINE[0]] :: Int -> [Char]
[LclId, Arity=1]
$sfoo
  = \ (y :: Int) ->
      GHC.Base.build
        @Char
        (\ (@b) (c [OS=OneShot] :: Char -> b -> b) (n [OS=OneShot] :: b) ->
           GHC.Base.foldr
             @Char
             @b
             c
             (GHC.CString.unpackFoldrCString# @b "!"# c n)
             (show @Int GHC.Show.$fShowInt y))

-- RHS size: {terms: 17, types: 17, coercions: 0, joins: 0/0}
foo [InlPrag=NOINLINE[0]] :: forall a. () -> Show a => a -> String
[LclIdX,
 Arity=3,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 30 0] 150 40},
 RULES: "SPEC foo @Int" [0]
            forall (ds :: ()) ($dShow :: Show Int). foo @Int ds $dShow = $sfoo]
foo
  = \ (@a) _ [Occ=Dead] ($dShow :: Show a) (y :: a) ->
      GHC.Base.build
        @Char
        (\ (@b) (c [OS=OneShot] :: Char -> b -> b) (n [OS=OneShot] :: b) ->
           GHC.Base.foldr
             @Char
             @b
             c
             (GHC.CString.unpackFoldrCString# @b "!"# c n)
             (show @a $dShow y))

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Prim.Addr#
[LclId,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
$trModule = "main"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Types.TrName
[LclId,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
$trModule = GHC.Types.TrNameS $trModule

-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Prim.Addr#
[LclId,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 50 0}]
$trModule = "ShouldCompile"#

-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Types.TrName
[LclId,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
$trModule = GHC.Types.TrNameS $trModule

-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
ShouldCompile.$trModule :: GHC.Unit.Module
[LclIdX,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
ShouldCompile.$trModule = GHC.Unit.Module $trModule $trModule

-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
bar :: String
[LclIdX,
 Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
         WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
bar = foo @Int GHC.Tuple.() GHC.Show.$fShowInt (GHC.Types.I# 42#)