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

Don’t we already have this? :wink:

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')
4 Likes