mwotton / Hubris

Bridge from Ruby to Haskell
shimweasel.com
260 stars 16 forks source link

Multiple argument support #15

Closed larrytheliquid closed 13 years ago

larrytheliquid commented 14 years ago

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.

mwotton commented 14 years ago

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?

larrytheliquid commented 14 years ago

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.

mwotton commented 13 years ago

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