File: Mathlib/Tactic/DeriveTraversable.lean

full_name: Mathlib.Deriving.Traversable.nestedMap
code: /-- `nestedMap f α (List (Array (List α)))` synthesizes the expression
`Functor.map (Functor.map (Functor.map f))`. `nestedMap` assumes that `α` appears in
`(List (Array (List α)))`.

(Similar to `nestedTraverse` but for `Functor`.) -/
partial def nestedMap (f v t : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Mathlib.Deriving.Traversable.mapField
code: /-- similar to `traverseField` but for `Functor` -/
def mapField (n : Name) (cl f α β e : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Mathlib.Deriving.Traversable.getAuxDefOfDeclName
code: /-- Get the auxiliary local declaration corresponding to the current declaration. If there are
multiple declaraions it will throw. -/
def getAuxDefOfDeclName : TermElabM FVarId 
goal: Lean.Elab.TermElabM Lean.FVarId

full_name: Mathlib.Deriving.Traversable.mapConstructor
code: /-- similar to `traverseConstructor` but for `Functor` -/
def mapConstructor (c n : Name) (f α β : Expr) (args₀ : List Expr)
    (args₁ : List (Bool × Expr)) (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.mkCasesOnMatch
code: /-- Makes a `match` expression corresponding to the application of `casesOn` like:
```lean
match (motive := motive) indices₁, indices₂, .., (val : type.{univs} params₁ params₂ ..) with
| _, _, .., ctor₁ fields₁₁ fields₁₂ .. => rhss ctor₁ [fields₁₁, fields₁₂, ..]
| _, _, .., ctor₂ fields₂₁ fields₂₂ .. => rhss ctor₂ [fields₂₁, fields₂₂, ..]
```
This is convenient to make a definition with equation lemmas. -/
def mkCasesOnMatch (type : Name) (levels : List Level) (params : List Expr) (motive : Expr)
    (indices : List Expr) (val : Expr)
    (rhss : (ctor : Name) → (fields : List FVarId) → TermElabM Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Mathlib.Deriving.Traversable.getFVarIdsNotImplementationDetails
code: /-- Get `FVarId`s which is not implementation details in the current context. -/
def getFVarIdsNotImplementationDetails : MetaM (List FVarId) 
goal: Lean.MetaM (List Lean.FVarId)

full_name: Mathlib.Deriving.Traversable.getFVarsNotImplementationDetails
code: /-- Get `Expr`s of `FVarId`s which is not implementation details in the current context. -/
def getFVarsNotImplementationDetails : MetaM (List Expr) 
goal: Lean.MetaM (List Lean.Expr)

full_name: Mathlib.Deriving.Traversable.mkMap
code: /-- derive the `map` definition of a `Functor` -/
def mkMap (type : Name) (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.deriveFunctor
code: /-- derive the `map` definition and declare `Functor` using this. -/
def deriveFunctor (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.mkInstanceNameForTypeExpr
code: /-- Similar to `mkInstanceName`, but for a `Expr` type. -/
def mkInstanceNameForTypeExpr (type : Expr) : TermElabM Name 
goal: Lean.Elab.TermElabM Lean.Name

full_name: Mathlib.Deriving.Traversable.mkOneInstance
code: /-- Derive the `cls` instance for the inductive type constructor `n` using the `tac` tactic. -/
def mkOneInstance (n cls : Name) (tac : MVarId → TermElabM Unit)
    (mkInst : Name → Expr → TermElabM Expr := fun n arg => mkAppM n #[arg]) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.higherOrderDeriveHandler
code: /-- Make the new deriving handler depends on other deriving handlers. -/
def higherOrderDeriveHandler (cls : Name) (tac : MVarId → TermElabM Unit)
    (deps : List DerivingHandlerNoArgs := [])
    (mkInst : Name → Expr → TermElabM Expr := fun n arg => mkAppM n #[arg]) :
    DerivingHandlerNoArgs 
goal: Lean.Elab.DerivingHandlerNoArgs

full_name: Mathlib.Deriving.Traversable.functorDeriveHandler
code: /-- The deriving handler for `Functor`. -/
def functorDeriveHandler : DerivingHandlerNoArgs 
goal: Lean.Elab.DerivingHandlerNoArgs

full_name: Mathlib.Deriving.Traversable.initFn._@.Mathlib.Tactic.DeriveTraversable._hyg.3277
code: initialize registerDerivingHandler ``Functor functorDeriveHandler
goal: IO Unit

full_name: Mathlib.Deriving.Traversable.deriveLawfulFunctor
code: /-- Prove the functor laws and derive `LawfulFunctor`. -/
def deriveLawfulFunctor (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.lawfulFunctorDeriveHandler
code: /-- The deriving handler for `LawfulFunctor`. -/
def lawfulFunctorDeriveHandler : DerivingHandlerNoArgs 
goal: Lean.Elab.DerivingHandlerNoArgs

full_name: Mathlib.Deriving.Traversable.initFn._@.Mathlib.Tactic.DeriveTraversable._hyg.4547
code: initialize registerDerivingHandler ``LawfulFunctor lawfulFunctorDeriveHandler
goal: IO Unit

full_name: Mathlib.Deriving.Traversable.nestedTraverse
code: /-- `nestedTraverse f α (List (Array (List α)))` synthesizes the expression
`traverse (traverse (traverse f))`. `nestedTraverse` assumes that `α` appears in
`(List (Array (List α)))` -/
partial def nestedTraverse (f v t : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Mathlib.Deriving.Traversable.traverseField
code: /--
For a sum type `inductive Foo (α : Type) | foo1 : List α → ℕ → Foo α | ...`
``traverseField `Foo f `α `(x : List α)`` synthesizes
`traverse f x` as part of traversing `foo1`. -/
def traverseField (n : Name) (cl f v e : Expr) : TermElabM (Bool × Expr) 
goal: Lean.Elab.TermElabM (Bool × Lean.Expr)

full_name: Mathlib.Deriving.Traversable.traverseConstructor
code: /--
For a sum type `inductive Foo (α : Type) | foo1 : List α → ℕ → Foo α | ...`
``traverseConstructor `foo1 `Foo applInst f `α `β [`(x : List α), `(y : ℕ)]``
synthesizes `foo1 <$> traverse f x <*> pure y.` -/
def traverseConstructor (c n : Name) (applInst f α β : Expr) (args₀ : List Expr)
    (args₁ : List (Bool × Expr)) (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.traverseConstructor.mkFunCtor
code: /--
For a sum type `inductive Foo (α : Type) | foo1 : List α → ℕ → Foo α | ...`
``traverseConstructor `foo1 `Foo applInst f `α `β [`(x : List α), `(y : ℕ)]``
synthesizes `foo1 <$> traverse f x <*> pure y.` -/
def traverseConstructor (c n : Name) (applInst f α β : Expr) (args₀ : List Expr)
    (args₁ : List (Bool × Expr)) (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Mathlib.Deriving.Traversable.mkTraverse
code: /-- derive the `traverse` definition of a `Traversable` instance -/
def mkTraverse (type : Name) (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.deriveTraversable
code: /-- derive the `traverse` definition and declare `Traversable` using this. -/
def deriveTraversable (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.traversableDeriveHandler
code: /-- The deriving handler for `Traversable`. -/
def traversableDeriveHandler : DerivingHandlerNoArgs 
goal: Lean.Elab.DerivingHandlerNoArgs

full_name: Mathlib.Deriving.Traversable.initFn._@.Mathlib.Tactic.DeriveTraversable._hyg.6414
code: initialize registerDerivingHandler ``Traversable traversableDeriveHandler
goal: IO Unit

full_name: Mathlib.Deriving.Traversable.simpFunctorGoal
code: /-- Simplify the goal `m` using `functor_norm`. -/
def simpFunctorGoal (m : MVarId) (s : Simp.Context) (simprocs : Simp.SimprocsArray := {})
    (discharge? : Option Simp.Discharge := none)
    (simplifyTarget : Bool := true) (fvarIdsToSimp : Array FVarId := #[])
    (stats : Simp.Stats := {}) :
    MetaM (Option (Array FVarId × MVarId) × Simp.Stats) 
goal: Lean.MetaM (Option (Array Lean.FVarId × Lean.MVarId) × Lean.Meta.Simp.Stats)

full_name: Mathlib.Deriving.Traversable.traversableLawStarter
code: /--
Run the following tactic:
```lean
intros _ .. x
dsimp only [Traversable.traverse, Functor.map]
induction x <;> (the simp tactic corresponding to s) <;> (tac)
```
-/
def traversableLawStarter (m : MVarId) (n : Name) (s : MetaM Simp.Context)
    (tac : Array FVarId → InductionSubgoal → MVarId → MetaM Unit) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Mathlib.Deriving.Traversable.deriveLawfulTraversable
code: /-- Prove the traversable laws and derive `LawfulTraversable`. -/
def deriveLawfulTraversable (m : MVarId) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Mathlib.Deriving.Traversable.lawfulTraversableDeriveHandler
code: /-- The deriving handler for `LawfulTraversable`. -/
def lawfulTraversableDeriveHandler : DerivingHandlerNoArgs 
goal: Lean.Elab.DerivingHandlerNoArgs

full_name: Mathlib.Deriving.Traversable.initFn._@.Mathlib.Tactic.DeriveTraversable._hyg.7828
code: initialize registerDerivingHandler ``LawfulTraversable lawfulTraversableDeriveHandler
goal: IO Unit