diff --git a/CHANGELOG.md b/CHANGELOG.md index 231e356f8494cc84bcc0908dc8ec7203c5e0f8a5..0881670fda22fcdc6cbed745d056ef3dfd0c5f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ API-breaking change is listed. exported by the prelude. This is a breaking change if one only imports `list.v`, but not the prelude. - Rename `drop_insert` into `drop_insert_gt` and add `drop_insert_le`. +- Added `Countable` instance for `Ascii.ascii`. ## std++ 1.3 (released 2020-03-18) diff --git a/theories/strings.v b/theories/strings.v index f83f075b172b0e9483097059351e782e71fa5b48..a9f2bcc535f3bcdb87833ddf0e7f0b71ca19c7a3 100644 --- a/theories/strings.v +++ b/theories/strings.v @@ -115,3 +115,7 @@ Program Instance string_countable : Countable string := {| encode := string_to_pos; decode p := Some (string_of_pos p) |}. Solve Obligations with naive_solver eauto using string_of_to_pos with f_equal. +Lemma ascii_of_to_digits a : ascii_of_digits (ascii_to_digits a) = a. +Proof. by destruct a as [[][][][][][][][]]. Qed. +Instance ascii_countable : Countable ascii := + inj_countable' ascii_to_digits ascii_of_digits ascii_of_to_digits.