File: .lake/packages/lean4/src/lean/Lean/Elab/PatternVar.lean

full_name: Lean.Elab.Term.PatternVar
code: abbrev PatternVar 
goal: Type

full_name: Lean.Elab.Term.CollectPatternVars.instInhabitedState
code: /-- State for the pattern variable collector monad. -/
structure State where
  /-- Pattern variables found so far. -/
  found     : NameSet := {}
  /-- Pattern variables found so far as an array. It contains the order they were found. -/
  vars      : Array PatternVar := #[]
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.CollectPatternVars.State

full_name: Lean.Elab.Term.CollectPatternVars.State.found
code: /-- State for the pattern variable collector monad. -/
structure State where
  /-- Pattern variables found so far. -/
  found     : NameSet := {}
  /-- Pattern variables found so far as an array. It contains the order they were found. -/
  vars      : Array PatternVar := #[]
  deriving Inhabited
goal: Lean.NameSet

full_name: Lean.Elab.Term.CollectPatternVars.State.vars
code: /-- State for the pattern variable collector monad. -/
structure State where
  /-- Pattern variables found so far. -/
  found     : NameSet := {}
  /-- Pattern variables found so far as an array. It contains the order they were found. -/
  vars      : Array PatternVar := #[]
  deriving Inhabited
goal: Array Lean.Elab.Term.PatternVar

full_name: Lean.Elab.Term.CollectPatternVars.State
code: /-- State for the pattern variable collector monad. -/
structure State where
  /-- Pattern variables found so far. -/
  found     : NameSet := {}
  /-- Pattern variables found so far as an array. It contains the order they were found. -/
  vars      : Array PatternVar := #[]
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.CollectPatternVars.M
code: abbrev M 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.throwCtorExpected
code: private def throwCtorExpected {α} (ident : Option Syntax) : M α 
goal: Lean.Elab.Term.CollectPatternVars.M α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.throwCtorExpected.showName
code: private def throwCtorExpected {α} (ident : Option Syntax) : M α 
goal: Lean.MessageData

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.throwInvalidPattern
code: private def throwInvalidPattern {α} : M α 
goal: Lean.Elab.Term.CollectPatternVars.M α

full_name: Lean.Elab.Term.CollectPatternVars.Context.explicit
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Bool

full_name: Lean.Elab.Term.CollectPatternVars.Context.paramDeclIdx
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Nat

full_name: Lean.Elab.Term.CollectPatternVars.Context.funId
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Lean.Ident

full_name: Lean.Elab.Term.CollectPatternVars.Context.ctorVal?
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Option Lean.ConstructorVal

full_name: Lean.Elab.Term.CollectPatternVars.Context
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.CollectPatternVars.Context.newArgs
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Array Lean.Term

full_name: Lean.Elab.Term.CollectPatternVars.instInhabitedContext
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.CollectPatternVars.Context

full_name: Lean.Elab.Term.CollectPatternVars.Context.namedArgs
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Array Lean.Elab.Term.NamedArg

full_name: Lean.Elab.Term.CollectPatternVars.Context.args
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: List Lean.Elab.Term.Arg

full_name: Lean.Elab.Term.CollectPatternVars.Context.ellipsis
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Bool

full_name: Lean.Elab.Term.CollectPatternVars.Context.paramDecls
code: structure Context where
  funId         : Ident
  ctorVal?      : Option ConstructorVal -- It is `some`, if constructor application
  explicit      : Bool
  ellipsis      : Bool
  paramDecls    : Array (Name × BinderInfo) -- parameters names and binder information
  paramDeclIdx  : Nat := 0
  namedArgs     : Array NamedArg
  args          : List Arg
  newArgs       : Array Term := #[]
  deriving Inhabited
goal: Array (Lean.Name × Lean.BinderInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.isDone
code: private def isDone (ctx : Context) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.finalize
code: private def finalize (ctx : Context) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.isNextArgAccessible
code: private def isNextArgAccessible (ctx : Context) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.getNextParam
code: private def getNextParam (ctx : Context) : (Name × BinderInfo) × Context 
goal: (Lean.Name × Lean.BinderInfo) × Lean.Elab.Term.CollectPatternVars.Context

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.processVar
code: private def processVar (idStx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PatternVar.0.Lean.Elab.Term.CollectPatternVars.samePatternsVariables
code: private def samePatternsVariables (startingAt : Nat) (s₁ s₂ : State) : Bool 
goal: Bool

full_name: Lean.Elab.Term.CollectPatternVars.collect.processExplicitArg
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Elab.Term.CollectPatternVars.Context

full_name: Lean.Elab.Term.CollectPatternVars.collect.pushNewArg
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Elab.Term.CollectPatternVars.Context

full_name: Lean.Elab.Term.CollectPatternVars.collect
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.collect.processCtor
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.collect.processCtorApp
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.collect.processImplicitArg
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Elab.Term.CollectPatternVars.Context

full_name: Lean.Elab.Term.CollectPatternVars.collect.processCtorAppContext
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.collect.processId
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.collect.processCtorAppCore
code: partial def collect (stx : Syntax) : M Syntax 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Syntax

full_name: Lean.Elab.Term.CollectPatternVars.main
code: def main (alt : MatchAltView) : M MatchAltView 
goal: Lean.Elab.Term.CollectPatternVars.M Lean.Elab.Term.MatchAltView

full_name: Lean.Elab.Term.collectPatternVars
code: /--
Collect pattern variables occurring in the `match`-alternative object views.
It also returns the updated views.
-/
def collectPatternVars (alt : MatchAltView) : TermElabM (Array PatternVar × MatchAltView) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Term.PatternVar × Lean.Elab.Term.MatchAltView)

full_name: Lean.Elab.Term.getPatternVars
code: /--
Return the pattern variables in the given pattern.
Remark: this method is not used by the main `match` elaborator, but in the precheck hook and other macros (e.g., at `Do.lean`).
-/
def getPatternVars (patternStx : Syntax) : TermElabM (Array PatternVar) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Term.PatternVar)

full_name: Lean.Elab.Term.getPatternsVars
code: /--
Return the pattern variables occurring in the given patterns.
This method is used in the `match` and `do` notation elaborators
-/
def getPatternsVars (patterns : Array Syntax) : TermElabM (Array PatternVar) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Term.PatternVar)

full_name: Lean.Elab.Term.getPatternVarNames
code: def getPatternVarNames (pvars : Array PatternVar) : Array Name 
goal: Array Lean.Name