|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The nascent Number module also serves as a proof of concept for dealing
with records in the Agda standard library that are parameterized by
levels instead of sets, like those in the Algebra hierarchy. These
records are difficult to use as type classes, because Agda’s normal
mechanism for generating type classes ('open SomeRecord ⦃...⦄') will
make the levels the instance arguments, rather than the actual set the
record’s functions operate on.
To work around this, I defined wrapper records (effectively just named
dependent pairs) parameterized in the way I desire. Each contains an
underlying algebraic structure and a proof of type equality (usually
just 'refl') between the parameter and the structure’s carrier. Then, I
define functions over my wrapper record to rewrite with the type
equality and use the underlying structure’s code.
This work is related to standard library bug #35
<https://github.com/agda/agda-stdlib/issues/35>; fixing this bug would
obviate the need for my workaround.
|