-
8fadf2e0
by I-Al-Istannen at 2026-06-27T12:09:51+02:00
Strict: add the wired-in unlifted box type
Adds the wired-in type Strict :: Type -> UnliftedType with its single
strict constructor MkStrict, an evaluated-and-properly-tagged box for strict
fields, and the isStrictTy predicate. See Note [The Strict type].
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
1f961f09
by I-Al-Istannen at 2026-06-27T12:09:52+02:00
Strict: make demand analysis and CPR transparent to the box
Demand and CPR analysis look through Strict/MkStrict so that a product
demand on Strict a is passed to the wrapped field and CPR information flows
likewise, and exprIsTrivial / unfolding sizing treat MkStrict on a value as
trivial. Accepts the resulting signature churn in the test suite.
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
8a89b9ef
by I-Al-Istannen at 2026-06-27T12:09:52+02:00
Strict: unbox strict arguments through the box in worker/wrapper
Worker/wrapper marks each strictified worker argument with Strict, so the
wrapper passes an evaluated value and the worker need not re-force it, and
unboxes the wrapped type when profitable.
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
0eaa66ed
by I-Al-Istannen at 2026-06-27T12:09:52+02:00
Desugar: only reconstruct constructor fields used by the body
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
4165000f
by I-Al-Istannen at 2026-06-27T12:09:52+02:00
CorePrep: erase MkStrict via a representational cast
MkStrict is erased in CorePrep: a producer becomes the field cast to
Strict a with a heterogeneous representational coercion, forcing the field
first when it is not already a value; a consumer match becomes the scrutinee
cast back. Core Lint tolerates the resulting out-of-scope type variables and
the Strict coercion. See Note [The Strict type].
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
7d62101e
by I-Al-Istannen at 2026-06-27T12:09:52+02:00
Strict: STG representation and code generation
Treats Strict a as a single unlifted heap pointer through RepType,
unarisation, STG lint, tag inference and StgToCmm: an unlifted box is already
evaluated and properly tagged, so it is returned directly unless applied as a
function. An STG Lint check flags an evaluated binder lowered to an updatable
indirection.
Co-authored-by: Sebastian Graf <sgraf1337@gmail.com>
-
335c17b6
by Sebastian Graf at 2026-06-27T12:09:52+02:00
Strict: add a should_run test for the strict-field machinery
StrictBox exercises a strict value field built from a thunk (forced to an
evaluated, properly-tagged value), a strict field of function type that is
applied, worker/wrapper unboxing of a strict argument, and a strict field
holding another boxed value. Run with -dtag-inference-checks so that a strict
field that is not properly tagged aborts at runtime.