Equations
- Lean.instInhabitedOptions = { default := { entries := [] } }
Equations
- Lean.instForInOptionsProdNameDataValue = inferInstanceAs (ForIn m Lean.KVMap (Lean.Name × Lean.DataValue))
Equations
- Lean.instInhabitedOptionDecl = { default := { defValue := default, group := default, descr := default } }
Equations
- Lean.instInhabitedOptionDecls = { default := ∅ }
@[export lean_register_option]
Equations
- One or more equations did not get rendered due to their size.
@[export lean_get_option_decls_array]
Equations
- Lean.getOptionDeclsArray = do let decls ← Lean.getOptionDecls pure (Std.RBMap.fold (fun r k v => Array.push r (k, v)) #[] decls)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.getOptionDefaulValue name = do let decl ← Lean.getOptionDecl name pure decl.defValue
Equations
- Lean.getOptionDescr name = do let decl ← Lean.getOptionDecl name pure decl.descr
Equations
- One or more equations did not get rendered due to their size.
- getOptions : m Lean.Options
instance
Lean.instMonadOptions
{m : Type → Type}
{n : Type → Type}
[inst : MonadLift m n]
[inst : Lean.MonadOptions m]
:
def
Lean.getBoolOption
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadOptions m]
(k : Lean.Name)
(defValue : optParam Bool false)
:
m Bool
Equations
- Lean.getBoolOption k defValue = do let opts ← Lean.getOptions pure (Lean.KVMap.getBool opts k defValue)
def
Lean.getNatOption
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadOptions m]
(k : Lean.Name)
(defValue : optParam Nat 0)
:
m Nat
Equations
- Lean.getNatOption k defValue = do let opts ← Lean.getOptions pure (Lean.KVMap.getNat opts k defValue)
- withOptions : {α : Type} → (Lean.Options → Lean.Options) → m α → m α
instance
Lean.instMonadWithOptions
{m : Type → Type}
{n : Type → Type}
[inst : MonadFunctor m n]
[inst : Lean.MonadWithOptions m]
:
Equations
- Lean.instMonadWithOptions = { withOptions := fun {α} f x => monadMap (fun {β} => Lean.withOptions f) x }
Equations
- Lean.withInPattern x = Lean.withOptions (fun o => Lean.KVMap.setBool o `_inPattern true) x
Equations
- Lean.Options.getInPattern o = Lean.KVMap.getBool o `_inPattern
- name : Lean.Name
- defValue : α
A strongly-typed reference to an option.
Equations
- Lean.instInhabitedOption = { default := { name := default, defValue := default } }
def
Lean.Option.get?
{α : Type}
[inst : Lean.KVMap.Value α]
(opts : Lean.Options)
(opt : Lean.Option α)
:
Option α
Equations
- Lean.Option.get? opts opt = Lean.KVMap.get? opts opt.name
def
Lean.Option.get
{α : Type}
[inst : Lean.KVMap.Value α]
(opts : Lean.Options)
(opt : Lean.Option α)
:
α
Equations
- Lean.Option.get opts opt = Lean.KVMap.get opts opt.name opt.defValue
def
Lean.Option.set
{α : Type}
[inst : Lean.KVMap.Value α]
(opts : Lean.Options)
(opt : Lean.Option α)
(val : α)
:
Equations
- Lean.Option.set opts opt val = Lean.KVMap.set opts opt.name val
def
Lean.Option.setIfNotSet
{α : Type}
[inst : Lean.KVMap.Value α]
(opts : Lean.Options)
(opt : Lean.Option α)
(val : α)
:
Similar to set
, but update opts
only if it doesn't already contains an setting for opt.name
Equations
- Lean.Option.setIfNotSet opts opt val = if Lean.KVMap.contains opts opt.name = true then opts else Lean.Option.set opts opt val
def
Lean.Option.register
{α : Type}
[inst : Lean.KVMap.Value α]
(name : Lean.Name)
(decl : Lean.Option.Decl α)
:
IO (Lean.Option α)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.