Skip to content

Instantly share code, notes, and snippets.

@NathanHowell
Created December 4, 2011 05:28
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 NathanHowell/243818cd8f216bdaa09b to your computer and use it in GitHub Desktop.
Save NathanHowell/243818cd8f216bdaa09b to your computer and use it in GitHub Desktop.
Differences in desugared output from GHC 7.2.1 -O0, note: Any?? -> Any
destroyer:inc2 nhowell$ diff one/Fun.dump-ds two/Fun.dump-ds
1c1
< Result size = 78
---
> Result size = 84
69c69
< @ (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)
---
> @ (GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int)
72,75c72,78
< @ (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)
< (Inc.$fArityx
< @ (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)))
< (\ _ _ -> GHC.Types.I# 3)
---
> @ (GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int)
> (Inc.$fArity(->)
> @ (GHC.Prim.Any?? -> GHC.Types.Int)
> @ GHC.Prim.Any
> (Inc.$fArityx @ (GHC.Prim.Any?? -> GHC.Types.Int))))
> (\ (x_arc :: GHC.Prim.Any) _ ->
> case x_arc of _ { __DEFAULT -> GHC.Types.I# 3 })
destroyer:inc2 nhowell$ diff one/Fun.dump-simpl two/Fun.dump-simpl
1c1
< Result size = 74
---
> Result size = 80
3c3
< $dArity_rrt :: Inc.Arity (GHC.Types.Int -> GHC.Types.Int)
---
> $dArity_rru :: Inc.Arity (GHC.Types.Int -> GHC.Types.Int)
5c5
< $dArity_rrt =
---
> $dArity_rru =
9c9
< $dArity1_rru
---
> $dArity1_rrv
12c12
< $dArity1_rru =
---
> $dArity1_rrv =
14c14
< @ (GHC.Types.Int -> GHC.Types.Int) @ GHC.Types.Int $dArity_rrt
---
> @ (GHC.Types.Int -> GHC.Types.Int) @ GHC.Types.Int $dArity_rru
26c26
< $dArity1_rru)
---
> $dArity1_rrv)
68c68
< ($dArity1_rru
---
> ($dArity1_rrv
82c82
< @ (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)
---
> @ (GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int)
84,85c84,87
< ((Inc.$fArityx <--------- here is the base case, where '0' is returned instead of '2'
< @ (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int))
---
> ((Inc.$fArity(->) <--------- GHC selects a different overload once it knows the variable(s) are live
> @ (GHC.Prim.Any?? -> GHC.Types.Int)
> @ GHC.Prim.Any
> (Inc.$fArityx @ (GHC.Prim.Any?? -> GHC.Types.Int)))
87,88c89,90
< <GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int>
< :: Inc.T:Arity (GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)
---
> <GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int>
> :: Inc.T:Arity (GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int)
90c92
< ((GHC.Prim.Any?? -> GHC.Prim.Any?? -> GHC.Types.Int)
---
> ((GHC.Prim.Any -> GHC.Prim.Any?? -> GHC.Types.Int)
92c94,95
< (\ _ _ -> GHC.Types.I# 3)
---
> (\ (x_arc :: GHC.Prim.Any) _ ->
> case x_arc of _ { __DEFAULT -> GHC.Types.I# 3 })
destroyer:inc2 nhowell$ diff one/Fun.hs two/Fun.hs
22c22
< zero = arity $ \x y -> (3 :: Int)
---
> zero = arity $ \x y -> x `seq` (3 :: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment