| 20 | `longestWord` here produces the simplified Core`, |

| 21 | |

| 22 | {{{#!hs |

| 23 | Rec { |

| 24 | Ticket.$wgo1 :: [T.Text] -> GHC.Prim.Int# -> GHC.Prim.Int# |

| 25 | Ticket.$wgo1 = |

| 26 | \ (w_s4GJ :: [T.Text]) (ww_s4GN :: GHC.Prim.Int#) -> |

| 27 | case w_s4GJ of _ { |

| 28 | [] -> ww_s4GN; |

| 29 | : y_a4vC ys_a4vD -> |

| 30 | case y_a4vC |

| 31 | of _ { Data.Text.Internal.Text dt_a4jP dt1_a4jQ dt2_a4jR -> |

| 32 | let { |

| 33 | a_a4jO :: GHC.Prim.Int# |

| 34 | a_a4jO = GHC.Prim.+# dt1_a4jQ dt2_a4jR } in |

| 35 | letrec { |

| 36 | -- Why must you allocate? For the love of all that is good, why? |

| 37 | $wloop_length_s4GI :: GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int# |

| 38 | $wloop_length_s4GI = |

| 39 | \ (ww1_s4Gz :: GHC.Prim.Int#) (ww2_s4GD :: GHC.Prim.Int#) -> |

| 40 | case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.>=# ww2_s4GD a_a4jO) -- bounds check |

| 41 | of _ { |

| 42 | False -> { |

| 43 | ... |

| 44 | -- in this body there are few cases analyses with |

| 45 | -- recursive calls of the form |

| 46 | $wloop_length_s4GI (GHC.Prim.+# ww1_s4Gz 1) (GHC.Prim.+# ww2_s4GD 1) |

| 47 | ... |

| 48 | True -> ww1_s4Gz |

| 49 | }; } in |

| 50 | case $wloop_length_s4GI 0 dt1_a4jQ of ww1_s4GH { __DEFAULT -> |

| 51 | case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.<=# ww_s4GN ww1_s4GH) |

| 52 | of _ { |

| 53 | False -> Ticket.$wgo1 ys_a4vD ww_s4GN; |

| 54 | True -> Ticket.$wgo1 ys_a4vD ww1_s4GH |

| 55 | } |

| 56 | } |

| 57 | } |

| 58 | } |

| 59 | end Rec } |

| 60 | |

| 61 | longestWord :: T.Text -> Int |

| 62 | longestWord = |

| 63 | \ (w_s4GT :: T.Text) -> |

| 64 | case w_s4GT |

| 65 | of _ { Data.Text.Internal.Text ww1_s4GW ww2_s4GX ww3_s4GY -> |

| 66 | case Ticket.$wgo1 (Ticket.$wgo ww1_s4GW ww2_s4GX ww3_s4GY) 0 |

| 67 | of ww4_s4H2 { __DEFAULT -> |

| 68 | GHC.Types.I# ww4_s4H2 |

| 69 | } |

| 70 | } |

| 71 | }}} |

| 72 | |

| 73 | Notice `$wloop_length_s4GI`: It should be a nice tight loop traversing `dt_a4jP :: ByteArray#` until it finds whitespace. However, GHC fails to lambda-lift this closure, thereby turning it into an allocating operation! Oh no! |