Skip to content

Instantly share code, notes, and snippets.

View PatrickMassot's full-sized avatar

Patrick Massot PatrickMassot

View GitHub Profile
@PatrickMassot
PatrickMassot / apply_fun.lean
Created July 4, 2019 12:35
`apply_fun` tactic
import order.basic
open tactic interactive (parse) interactive (loc.ns)
interactive.types (texpr location) lean.parser (tk)
local postfix `?`:9001 := optional
meta def apply_fun_name (e : expr) (h : name) (M : option pexpr) : tactic unit :=
do {
H ← get_local h,
@PatrickMassot
PatrickMassot / doc_blame.lean
Last active July 11, 2019 12:50
find definitions without docstring
import tactic.interactive
open tactic declaration environment
/-- test that name was not auto-generated -/
@[reducible] def name.is_not_auto (n : name) : Prop :=
n.components.ilast ∉ [`no_confusion, `rec_on, `cases_on, `no_confusion_type, `sizeof,
`rec, `mk, `sizeof_spec, `inj_arrow, `has_sizeof_inst, `inj_eq, `inj]
/-- Print the declaration name if it's a definition without a docstring -/