- inline : InlineAttributeKind
- noinline : InlineAttributeKind
- macroInline : InlineAttributeKind
- inlineIfReduce : InlineAttributeKind
- alwaysInline : InlineAttributeKind
Instances For
Equations
- Lean.Compiler.instBEqInlineAttributeKind.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- Lean.Compiler.instHashableInlineAttributeKind.hash Lean.Compiler.InlineAttributeKind.inline = 0
- Lean.Compiler.instHashableInlineAttributeKind.hash Lean.Compiler.InlineAttributeKind.noinline = 1
- Lean.Compiler.instHashableInlineAttributeKind.hash Lean.Compiler.InlineAttributeKind.macroInline = 2
- Lean.Compiler.instHashableInlineAttributeKind.hash Lean.Compiler.InlineAttributeKind.inlineIfReduce = 3
- Lean.Compiler.instHashableInlineAttributeKind.hash Lean.Compiler.InlineAttributeKind.alwaysInline = 4
Instances For
Changes the inlining behavior. This attribute comes in several variants:
- @[inline]: marks the definition to be inlined when it is appropriate.
- @[inline_if_reduce]: marks the definition to be inlined if an application of it after inlining and applying reduction isn't a- matchexpression. This attribute can be used for inlining structurally recursive functions.
- @[noinline]: marks the definition to never be inlined.
- @[always_inline]: marks the definition to always be inlined.
- @[macro_inline]: marks the definition to always be inlined at the beginning of compilation. This makes it possible to define functions that evaluate some of their parameters lazily. Example:
 Only non-recursive functions may be marked- @[macro_inline] def test (x y : Nat) : Nat := if x = 42 then x else y #eval test 42 (2^1000000000000) -- doesn't compute 2^1000000000000- @[macro_inline].
def
Lean.Compiler.setInlineAttribute
(env : Environment)
(declName : Name)
(kind : InlineAttributeKind)
 :
Equations
- Lean.Compiler.setInlineAttribute env declName kind = Lean.Compiler.inlineAttrs.setValue env declName kind
Instances For
Equations
- Lean.Compiler.getInlineAttribute? env declName = Lean.Compiler.inlineAttrs.getValue env declName
Instances For
@[inline]
Equations
- Lean.Compiler.hasInlineAttribute env declName = Lean.Compiler.hasInlineAttrCore✝ env Lean.Compiler.InlineAttributeKind.inline declName
Instances For
Equations
Instances For
Equations
- Lean.Compiler.hasNoInlineAttribute env declName = Lean.Compiler.hasInlineAttrCore✝ env Lean.Compiler.InlineAttributeKind.noinline declName
Instances For
Equations
- Lean.Compiler.hasMacroInlineAttribute env declName = Lean.Compiler.hasInlineAttrCore✝ env Lean.Compiler.InlineAttributeKind.macroInline declName
Instances For
@[inline]