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_equal
function 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 apply4
to3
, where "apply F to Y" means call the function F with argument X. Obviously,4
is 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
uncurry
and what is the type off
, but probably you meant something like this,Which says, that we expect
7
when we uncurry the functionf
and apply it to4
and3
.where
f
is probablycurry (+)