-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow users to use
initialize registerBuiltinDerivingHandler ...
- Loading branch information
1 parent
93f3773
commit d953ac8
Showing
6 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import UserDeriving.Tst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Lean | ||
|
||
class Simple (α : Type u) where | ||
val : α | ||
|
||
open Lean | ||
open Lean.Elab | ||
open Lean.Elab.Command | ||
def mkSimpleHandler (declNames : Array Name) : CommandElabM Bool := do | ||
dbg_trace ">> mkSimpleHandler {declNames}" | ||
-- TODO: see examples at src/Lean/Elab/Deriving | ||
return true | ||
|
||
initialize | ||
registerBuiltinDerivingHandler ``Simple mkSimpleHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import UserDeriving.Simple | ||
|
||
inductive Foo where | ||
| mk₁ | ||
| mk₂ | ||
deriving Simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[package] | ||
name = "UserDeriving" | ||
version = "0.1" |