HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

ModuleAgda-2.8.0.2Haskell2010

Agda.Compiler.Treeless.Builtin

Translates the Agda builtin nat datatype to arbitrary-precision integers.

Philipp, 20150921: At the moment, this optimization is the reason that there is a TAPlus alternative. For Haskell, this can easily be translated to guards. However, in the long term it would be easier for the backends if these things were translated directly to a less-than primitive and if-then-else expressions or similar. This would require us to add some internal Bool-datatype as compiler-internal type and a primitive less-than function, which will be much easier once Treeless is used for whole modules.

Ulf, 2015-09-21: No, actually we need the n+k patterns, or at least guards. Representing them with if-then-else would make it a lot harder to do optimisations that analyse case tree, like impossible case elimination.

Ulf, 2015-10-30: Guards are actually a better primitive. Fixed that.

  • 1 value
  • PackageAgda-2.8.0.2
  • Exports1
  • LanguageHaskell2010
  • LicenceMIT
  • SourceBuiltin.hs