Skip to content

Commit 9840d13

Browse files
committed
declare axioms_ as typeclass
1 parent a7f0bfc commit 9840d13

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Changelog.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
`T` to `S.type` whenever `T` is not a global type (e.g. a variable). Note
1010
that `S.pack` can cast a `t : T` to `S.type` only if an instance of the
1111
class `S` on `t` is found by type class inference
12-
- **Change** `HB.structure` declares the class of a structure (`axioms_`) as a
13-
type class on the subject with all arguments in output mode but for the
14-
subject that is in input mode.
12+
- **New** Attribute `#[typeclass]` to declare the class of a
13+
structure (`axioms_`) as a type class on the subject with all arguments in
14+
output mode but for the subject that is in input mode.
1515

1616
## [1.7.0] - 2024-01-10
1717

HB/structure.elpi

+5
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)