You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2025. It is now read-only.
Instance deriving uses a table of {deftech}_deriving handlers_ that maps type classnamestometaprogramsthatderiveinstancesforthem.
52
53
Derivinghandlersmaybeaddedtothetableusing {lean}`registerDerivingHandler`, which should be called in an {keywordOf Lean.Parser.Command.initialize}`initialize` block.
53
54
Each deriving handler should have the type {lean}`Array Name → CommandElabM Bool`.
54
55
When a user requests that an instanceofaclassbederived,itsregisteredhandlersarecalledoneatatime.
55
56
Theyareprovidedwith all of the names in the mutual block for which the instanceistobederived,andshouldeithercorrectlyderiveaninstanceandreturn {lean}`true` or have no effect and return {lean}`false`.
56
57
When a handler returns {lean}`true`, no further handlers are called.
0 commit comments