app "test" imports [TotallyNotJson] provides [main] to "./platform" HelloWorld := {} implements [Encoding {toEncoder}] toEncoder = \@HelloWorld {} -> Encode.custom \bytes, fmt -> bytes |> Encode.appendWith (Encode.string "Hello, World!\n") fmt f = when Str.fromUtf8 (Encode.toBytes (@HelloWorld {}) TotallyNotJson.json) is Ok s -> s _ -> "" main = f # ^ Str