# Syntaxic sugar: String.set -\> Bytes.set?

**URL:** <https://discuss.ocaml.org/t/syntaxic-sugar-string-set-bytes-set/10275>\
**Category:** Learning\
**Tags:** evolution\
**Created:** [August 8, 2022, 9:00am UTC](https://discuss.ocaml.org/t/syntaxic-sugar-string-set-bytes-set/10275 "2022-08-08T09:00:23Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![thierry-martinez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/thierry-martinez/32/1481_2.png) [@thierry-martinez](https://discuss.ocaml.org/u/thierry-martinez)\
**Post date:** [August 12, 2022, 1:43pm UTC](https://discuss.ocaml.org/t/syntaxic-sugar-string-set-bytes-set/10275/17 "2022-08-12T13:43:33Z")

</div>

> [@nojb](#):
>
> This is an interesting proposal (and has been discussed in the context of `array` and `floatarray`), but this requires designing a new language feature. RFC/PRs welcome 🙂

Don’t we already have this? 😉

```auto
module Bytes = struct
  include Bytes

  module String = struct
    let get = get
  end
end

module String = struct
  include String

  module String = struct
    let get = get
  end
end

let s : string = "Hello, world!"

let () = assert String.(s.[0] = 'H')

let b : bytes = Bytes.of_string "Hello, world!"

let () = assert Bytes.(b.[0] = 'H')

```

---

_[View the full topic](https://discuss.ocaml.org/t/syntaxic-sugar-string-set-bytes-set/10275)._
