Skip to content

Commit 97776db

Browse files
committed
declare axioms_ as typeclass
1 parent aa5ffc3 commit 97776db

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Changelog.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
`T` to `S.type` whenever `T` is not a global type (e.g. a variable). Note
1313
that `S.pack` can cast a `t : T` to `S.type` only if an instance of the
1414
class `S` on `t` is found by type class inference
15-
- **Change** `HB.structure` declares the class of a structure (`axioms_`) as a
16-
type class on the subject with all arguments in output mode but for the
17-
subject that is in input mode.
15+
- **New** Attribute `#[typeclass]` to declare the class of a
16+
structure (`axioms_`) as a type class on the subject with all arguments in
17+
output mode but for the subject that is in input mode.
1818

1919
## [1.7.0] - 2024-01-10
2020

HB/structure.elpi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ declare Module BSkel Sort :- std.do! [
127127
])
128128
(coq.say "declare:" ClassName "should be an inductive", fail),
129129

130+
if (get-option "typeclass" tt) (
131+
coq.TC.declare-class ClassName,
132+
coq.hints.add-mode ClassName "typeclass_instances" {std.append {std.map {std.iota {w-params.nparams MLwP}} (_\ r\ r = mode-output)} [mode-input]})
133+
(true),
134+
130135
if-verbose (coq.say {header} "accumulating various props"),
131136
std.flatten [
132137
Factories, [ClassAlias], [is-structure Structure],

0 commit comments

Comments
 (0)