module Codec = {
type encode<'v> = 'v => Js.Json.t
type decode<'v> = Js.Json.t => result<'v, exn>
type t<'v> = {
encode: encode<'v>,
decode: decode<'v>,
}
let make = (encode, decode) => {encode: encode, decode: decode}
let encode = codec => codec.encode
// let encodeString = (codec, value) => (codec->encode)(value)->Js.Json.stringify
let encodeString = (codec, value) => codec->encode(value)->Js.Json.stringify
let decode = codec => codec.decode
}
The code let encodeString = (codec, value) => codec->encode(value)->Js.Json.stringify
is able to be compiled in version v10 but not in v11.
issue here