Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Recently came to ReScript? Give us your thoughts on error messages!

$
0
0

Here’s one that just caught me off guard for like half an hour. I have a manually curried function and couldn’t understand why my pipe wasn’t working

let decode = decoder => data =>
  decoder(data)->Result.map(x => "foo" ++ x)

let result = json->decode(decoder)
This uncurried function has type
    (
  'o => RescriptCore.Result.t<string, 'p>,
) => 'o => RescriptCore.Result.t<string, 'p>
  It is applied with 2 arguments but it requires 1.

Viewing all articles
Browse latest Browse all 2592

Trending Articles