diff --git a/changelog.d/20260712_165906_unisay.md b/changelog.d/20260712_165906_unisay.md new file mode 100644 index 00000000..0aa7136f --- /dev/null +++ b/changelog.d/20260712_165906_unisay.md @@ -0,0 +1,7 @@ +### Changed + +- `Data.Unit.unit` is pinned to the shared foreign singleton + (`@inline unit never`). The value is a table constructor (`{}`), so the + former `always` pragma duplicated the allocation at every use site; `never` + keeps one shared table, matching the foreign-table sharing the compiler now + performs by default (purescript-lua/purescript-lua#176). diff --git a/src/Data/Unit.purs b/src/Data/Unit.purs index b45f6005..91b30de6 100644 --- a/src/Data/Unit.purs +++ b/src/Data/Unit.purs @@ -1,4 +1,4 @@ --- @inline unit always +-- @inline unit never module Data.Unit where -- | The `Unit` type has a single inhabitant, called `unit`. It represents