-Note [Unused spec binders]
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-Consider
- f :: a -> a
- {-# SPECIALISE f :: Eq a => a -> a #-}
-It's true that this *is* a more specialised type, but the rule
-we get is something like this:
- f_spec d = f
- RULE: f = f_spec d
-Note that the rule is bogus, becuase it mentions a 'd' that is
-not bound on the LHS! But it's a silly specialisation anyway, becuase
-the constraint is unused. We could bind 'd' to (error "unused")
-but it seems better to reject the program because it's almost certainly
-a mistake. That's what the isDeadBinder call detects.
-
-Note [Constant rule dicts]
-~~~~~~~~~~~~~~~~~~~~~~~
-When the LHS of a specialisation rule, (/\as\ds. f es) has a free dict,
-which is presumably in scope at the function definition site, we can quantify
-over it too. *Any* dict with that type will do.
-
-So for example when you have
- f :: Eq a => a -> a
- f = <rhs>
- {-# SPECIALISE f :: Int -> Int #-}
-
-Then we get the SpecPrag
- SpecPrag (f Int dInt)
-
-And from that we want the rule
-
- RULE forall dInt. f Int dInt = f_spec
- f_spec = let f = <rhs> in f Int dInt
-
-But be careful! That dInt might be GHC.Base.$fOrdInt, which is an External
-Name, and you can't bind them in a lambda or forall without getting things
-confused. Likewise it might have an InlineRule or something, which would be
-utterly bogus. So we really make a fresh Id, with the same unique and type
-as the old one, but with an Internal name and no IdInfo.
-