Note [seqId magic]
'GHC.Prim.seq' is special in several ways. a) Its fixity is set in GHC.Iface.Load.ghcPrimIface b) It has quite a bit of desugaring magic. See GHC.HsToCore.Utils Note [Desugaring seq] (1) and (2) and (3) c) There is some special rule handing: Note [User-defined RULES for seq] Historical note: In GHC.Tc.Gen.Expr we used to need a special typing rule for 'seq', to handle calls whose second argument had an unboxed type, e.g. x `seq` 3# However, with representation polymorphism we can now give seq the type seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b which handles this case without special treatment in the typechecker.
References 2
- Desugaring seq GHC.HsToCore.Expr
- User-defined RULES for seq GHC.Types.Id.Make
Referenced by 3
- GHC.Types.Id.Make call site ×2
- User-defined RULES for seq GHC.Types.Id.Make