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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | -- the code of the whole pidigits program is at: http://shootout.alioth.debian.org/u32q/benchmark.php?test=pidigits&lang=ghc&id=2 digits ∷ [(String, F)] digits = ("", (F 1 1 0 1)):[next state | state ← map snd digits] {- 16 Lets floated to top level; 0 Lets floated elsewhere; from 4 Lambda groups 2 Lets floated to top level; 0 Lets floated elsewhere; from 14 Lambda groups Total ticks: 1574 268 PreInlineUnconditionally 636 PostInlineUnconditionally 134 UnfoldingDone 14 RuleFired 2 ++ 1 /=#->case 3 ==#->case 1 fold/build 2 foldr/app 2 map 1 mapList 1 unpack 1 unpack-list 18 LetFloatFromLet 4 EtaReduction 336 BetaReduction 13 CaseOfCase 134 KnownBranch 16 CaseIdentity 1 FillInCaseDefault 19 SimplifierDone -} {- a_sU4 :: [(String, F)] a_sU4 = build @ (String, F) (\ (@ a_dQQ) (c_dQR :: (String, F) -> a_dQQ -> a_dQQ) (n_dQS :: a_dQQ) -> foldr @ F @ a_dQQ (\ (ds_dQU :: F) (ds_dQT :: a_dQQ) -> c_dQR (next ds_dQU) ds_dQT) n_dQS (map @ (String, F) @ F (Data.Tuple.snd @ String @ F) digits)) digits [ALWAYS LoopBreaker Nothing] :: [(String, F)] digits = : @ (String, F) a_sU2 a_sU4 -} {- lvl9_r1qS :: ([GHC.Base.Char], Main.F) [GlobalId] [NoCafRefs] lvl9_r1qS = (GHC.Base.[] @ GHC.Base.Char, lvl8_r1qQ) Rec { lvl10_r1qU :: [(GHC.Base.String, Main.F)] [GlobalId] [] lvl10_r1qU = GHC.Base.: @ (GHC.Base.String, Main.F) lvl9_r1qS Main.a1 Main.a1 :: [(GHC.Base.String, Main.F)] [GlobalId] [Str: DmdType] Main.a1 = go_r1qM lvl10_r1qU end Rec } -} {- go_r1IM :: [(String, F)] -> [(String, F)] go_r1IM = \ (ds_aTz :: [(String, F)]) -> case ds_aTz of wild_aTA { [] -> [] @ (String, F); : y_aTE ys_aTF -> : @ (String, F) (case y_aTE of wild1_aTL { (ds1_aTN, y1_aTO) -> case y1_aTO of w_X1EW { F ww_s1Ey ww1_s1Ez ww2_s1EA ww3_s1EB -> case $wnext_r1IK ww_s1Ey ww1_s1Ez ww2_s1EA ww3_s1EB of ww4_s1EQ { (# ww5_s1ES, ww6_s1ET #) -> (ww5_s1ES, ww6_s1ET) } } }) (go_r1IM ys_aTF) } -} ---------------- digits ∷ [(String, F)] digits = ("", (F 1 1 0 1)): map (next · snd) digits {- 15 Lets floated to top level; 0 Lets floated elsewhere; from 2 Lambda groups 2 Lets floated to top level; 0 Lets floated elsewhere; from 14 Lambda groups Total ticks: 1545 258 PreInlineUnconditionally 633 PostInlineUnconditionally 133 UnfoldingDone 14 RuleFired 2 ++ 1 /=#->case 3 ==#->case 2 foldr/app 2 map 2 mapList 1 unpack 1 unpack-list 17 LetFloatFromLet 4 EtaReduction 322 BetaReduction 13 CaseOfCase 134 KnownBranch 16 CaseIdentity 1 FillInCaseDefault 17 SimplifierDone -} {- a_sTE :: [(String, F)] a_sTE = map @ (String, F) @ (String, F) (. @ F @ (String, F) @ (String, F) next (Data.Tuple.snd @ String @ F)) digits digits [ALWAYS LoopBreaker Nothing] :: [(String, F)] digits = : @ (String, F) a_sTC a_sTE -} {- Rec { lvl11_r1ql :: [(GHC.Base.String, Main.F)] [GlobalId] [] lvl11_r1ql = GHC.Base.: @ (GHC.Base.String, Main.F) lvl9_r1qh Main.a1 Main.a1 :: [(GHC.Base.String, Main.F)] [GlobalId] [Str: DmdType] Main.a1 = GHC.Base.map @ (GHC.Base.String, Main.F) @ (GHC.Base.String, Main.F) lvl10_r1qj lvl11_r1ql end Rec } -} {- lvl7_r1Ia :: (String, F) -> (String, F) lvl7_r1Ia = \ (x_aTi :: (String, F)) -> case x_aTi of wild_aTm { (ds1_aTo, y_aTp) -> case y_aTp of w_X1Ec { F ww_s1DP ww1_s1DQ ww2_s1DR ww3_s1DS -> case $wnext_r1I2 ww_s1DP ww1_s1DQ ww2_s1DR ww3_s1DS of ww4_s1E7 { (# ww5_s1E9, ww6_s1Ea #) -> (ww5_s1E9, ww6_s1Ea) } } } lvl8_r1Ic :: [(String, F)] lvl8_r1Ic = : @ (String, F) lvl6_r1I8 a1 a1 :: [(String, F)] a1 = map @ (String, F) @ (String, F) lvl7_r1Ia lvl8_r1Ic -} |