Skip to content

Commit

Permalink
declare axioms_ as typeclass
Browse files Browse the repository at this point in the history
  • Loading branch information
Tragicus committed Jun 24, 2024
1 parent a7f0bfc commit 9840d13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
`T` to `S.type` whenever `T` is not a global type (e.g. a variable). Note
that `S.pack` can cast a `t : T` to `S.type` only if an instance of the
class `S` on `t` is found by type class inference
- **Change** `HB.structure` declares the class of a structure (`axioms_`) as a
type class on the subject with all arguments in output mode but for the
subject that is in input mode.
- **New** Attribute `#[typeclass]` to declare the class of a
structure (`axioms_`) as a type class on the subject with all arguments in
output mode but for the subject that is in input mode.

## [1.7.0] - 2024-01-10

Expand Down
5 changes: 5 additions & 0 deletions HB/structure.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ declare Module BSkel Sort :- std.do! [
])
(coq.say "declare:" ClassName "should be an inductive", fail),

if (get-option "typeclass" tt) (
coq.TC.declare-class ClassName,
coq.hints.add-mode ClassName "typeclass_instances" {std.append {std.map {std.iota {w-params.nparams MLwP}} (_\ r\ r = mode-output)} [mode-input]})
(true),

if-verbose (coq.say {header} "accumulating various props"),
std.flatten [
Factories, [ClassAlias], [is-structure Structure],
Expand Down

0 comments on commit 9840d13

Please sign in to comment.