my implementation so far I cant seem to understand where is the issue
let uncurry_test1 _test_ctxt =
assert_equal
uncurry f (4 3)
7
my implementation so far I cant seem to understand where is the issue
let uncurry_test1 _test_ctxt =
assert_equal
uncurry f (4 3)
7
Copyright © 2021 Jogjafile Inc.
The
assert_equalfunction from the OUnit2 library has type,There are only two non-keyword parameters, but you're applying it to four. I would suggest you read at least the OCaml tutorial and learn how functions are applied in OCaml. For example, the piece of code
(4 3)in OCaml means apply4to3, where "apply F to Y" means call the function F with argument X. Obviously,4is not a function (spoiler, it is a number), so this code doesn't make sense and raises a type error.It is hard to guess from the information that you provided what is the type of
uncurryand what is the type off, but probably you meant something like this,Which says, that we expect
7when we uncurry the functionfand apply it to4and3.where
fis probablycurry (+)