Copy a string: Difference between revisions

m
Line 1,567:
<br/>
Between 4.02 and 4.06 (2017), immutable strings were optionally enabled via a flag: <code>-safe-string</code>. A <code>Bytes</code> module was added to provide safe and unsafe mutable views on strings. The two modules were synonymous unless the aforementioned flag was added.
<lang ocaml>(* SpecialTransition-caseperiod synonymy between types, explicit type annotations are just for emphasis *)
let dst1 : string = Bytes.copy (src : bytes)
let dst2 : bytes = Bytes.copy (src : string)
13

edits