Extra parentheses in pipe operator cause code to fail compilation.
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 decode = codec => codec.decode
}
The code above can be compiled in Rescript v10, but can not be compiled in V11.0.1 v10 playground
This code snippest is from the rescript-jzon library, and it prevents me from upgradding to Rescript v11.
You can use https://github.com/ds300/patch-package or https://pnpm.io/cli/patch. Or prepare a PR to add V11 support for rescript-jzon. I know the author and can ping him for review. He's not using ReScript anymore, so probably he won't have time to update the package by himself. Also, you can migrate to rescript-schema 😈
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.