You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce SeqConstraintUnit to reduce possible overhead
The definition of `Extendss` that involves pairs:
type Extendss p xs where
Extendss p '[] = ()
Extendss p (x : xs) = (Extends p x, Extendss p xs)
Would produce a constraint that looks like this: `((), ((), ((), ...)))`
That may result in a runtime overhead if GHC would be incapable to
perform cross-module inlining here (it would be)
The new `SeqConstraintUnit` type family ensures that `Extends p x` reduces
to the constraint unit and drops it after that entirely. Hence, produced
constraint would be just `()`. Much better!
0 commit comments