HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Data.Unboxed

  • 1 type
  • 4 values
  • Packageghc-9.10.3
  • Exports7
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceUnboxed.hs
newtypenewtype MaybeUB a
#

Like Maybe, but using unboxed sums.

Use with care. Using a unboxed maybe is not always a win in execution *time* even when allocations go down. So make sure to benchmark for execution time as well. If the difference in *runtime* for the compiler is too small to measure it's likely better to use a regular Maybe instead.

This is since it causes more function arguments to be passed, and potentially more variables to be captured by closures increasing closure size.