- inline : InlineAttributeKind
- noinline : InlineAttributeKind
- macroInline : InlineAttributeKind
- inlineIfReduce : InlineAttributeKind
- alwaysInline : InlineAttributeKind
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 amatch
expression. 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
@[reducible, 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
@[reducible, inline]
Equations
Instances For
@[export lean_has_inline_attribute]
Equations
Instances For
@[export lean_has_inline_if_reduce_attribute]
Equations
Instances For
@[export lean_has_noinline_attribute]
Equations
Instances For
@[export lean_has_macro_inline_attribute]