Checks if an expression is a Name literal, and if so returns the name.
Equations
- One or more equations did not get rendered due to their size.
- (Lean.Expr.const `Lean.Name.anonymous us).name? = some Lean.Name.anonymous
- (((Lean.Expr.const `Lean.Name.str us).app n).app (Lean.Expr.lit (Lean.Literal.strVal s))).name? = Option.map (fun (x : Lean.Name) => x.str s) n.name?
- (((Lean.Expr.const `Lean.Name.num us).app n).app i).name? = (i.rawNatLit? <|> i.nat?).bind fun (i : Nat) => Option.map (fun (x : Lean.Name) => x.num i) n.name?
- ((Lean.Expr.const `Lean.Name.mkStr1 us).app (Lean.Expr.lit (Lean.Literal.strVal a))).name? = some (Lean.Name.mkStr1 a)
- (((Lean.Expr.const `Lean.Name.mkStr2 us).app (Lean.Expr.lit (Lean.Literal.strVal a1))).app (Lean.Expr.lit (Lean.Literal.strVal a2))).name? = some (Lean.Name.mkStr2 a1 a2)
- x✝.name? = none