Add Countable instances for byte
Merge request reports
Activity
byte
s are an efficient representation of an 8-bit number. They're mainly used as part of the newString Notation
feature, which allows customizing string literals to be parsed using an arbitrary Gallina function of typelist Byte.byte -> option T
and printed with an inverse function.If you want compact bytes they're also good (and you probably don't want to write your own inductive with 256 constructors).
Originally I had them in a separate file but that seemed excessive, and they're sort of related to Coq strings (which are basically byte arrays).
I don't see the construction in the standard library, but it's just a few lines of code:
From Coq Require Import Init.Byte. Record bytes := bytes_from_list { bytes_to_list : list byte }. Declare Scope bytestring_scope. Open Scope bytestring_scope. String Notation bytes bytes_from_list bytes_to_list : bytestring_scope. Definition foo : bytes := "foo".
Edited by Tej Chajedadded 14 commits
-
535b3d81...befe38d4 - 13 commits from branch
iris:master
- 5346dd70 - Add Countable instances for byte
-
535b3d81...befe38d4 - 13 commits from branch
Let's continue that discussion at iris#317
I think this MR can be merged. Thanks :)
mentioned in commit a2ac9e66
mentioned in commit e99804d9
mentioned in merge request !160 (merged)
So should we reopen the MR then to track re-landing this?
The latest released std++ and Iris already support Coq 8.9. So at least on the Iris side I would not hesitate much to drop support for it.
std++ has not dropped support for old Coq versions in a long time. @robbertkrebbers not sure what your policy on that is?
For Iris, let's do that in iris#318 (closed).
Okay seems like reopening is not possible... @tchajed could you open an MR or issue so we don't forger about
byte
?mentioned in issue #62