mwotton/Hubris

Multiple argument support

Closed this issue · 3 comments

Ability to call multi-argument functions from the Ruby side. Requiring all arguments in Ruby-land would be acceptable if it's easier at first IMO.

Yep, this is one of the features I want to get to pretty soon. The problem is that I'm currently relying on the "Value -> Value" type being the only one that passes over. The ideal would be to make the binary library self-describing, so that any arity would be possible - I looked into using libbfd for it, but didn't have much luck in the time I had.

What do you mean by requiring all args in Rubyland?

I mean not supporting currying at first if that's easier (though it would be cool).

.e.g. obj.myFun(1, 2, 3) vs myFun(1).call(2).call(3)
... and e.g. being able to get back Proc objects in Rubyland that represent functions returned by higher order functions.

This is working now. No currying yet.

from the spec:

describe "multiple arguments" do
it "can call a haskell function with multiple arguments" do
class Mult
hubris :inline => <<EOF
add :: Integer -> Integer -> Integer -> Integer
add x y z = x+y+z
EOF
end

Mult.new.add(1,9,100).should == 110

end
end