Give seq a more precise type and remove magic

Authored by bgamari on Nov 7 2019, 4:24 PM.

Description

Give seq a more precise type and remove magic

GHC.Prim.seq previously had the rather plain type:

seq :: forall a b. a -> b -> b

However, it also had a special typing rule to applications
where b is not of kind Type.

Issue Trac #17440 noted that levity polymorphism allows us to rather give
it the more precise type:

seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b

This allows us to remove the special typing rule that we previously
required to allow applications on unlifted arguments. T9404 contains a
non-Type application of seq which should verify that this works as
expected.

Closes Trac #17440.

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Tue, Nov 19, 10:53 AM
Parents
rGHCa8adb5b4d782: desugar: Drop stale Note [Matching seqId]
Branches
Unknown
Tags
Unknown
Marge Bot <ben+marge-bot@smart-cactus.org> committed rGHC08d595c026f0: Give seq a more precise type and remove magic (authored by bgamari).Tue, Nov 19, 10:53 AM