Currying not supported yet?

76 views
Skip to first unread message

Andreas Hartmann

unread,
Oct 8, 2013, 5:35:52 AM10/8/13
to roy...@googlegroups.com
Hi everyone,

is it correct that currying isn't supported yet?
I found this: https://github.com/puffnfresh/roy/issues/175

A quick test seems to confirm:

let f a b = console.log a b
let g = f "hello"

g "world"


=> Type error on line 1: Function(String, #d) is not Function(String, String, Native)

I would be interested in this functionality. Is it on anybody's roadmap?

TIA for any feedback!

-- Andreas

Brian McKenna

unread,
Oct 11, 2013, 11:10:49 AM10/11/13
to roy...@googlegroups.com
Hi Andreas,

Sadly currying is not yet supported. We have a plan for implementing
it but have not yet done anything about it.

I'll have a go sometime soon, it shouldn't be too hard to implement :)

Thanks!
> --
> You received this message because you are subscribed to the Google Groups
> "roylang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to roylang+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Andreas Hartmann

unread,
Oct 13, 2013, 4:00:45 PM10/13/13
to roy...@googlegroups.com
Hi Brian,

thanks for your reply!
I have implemented a simple version for my current needs:
https://github.com/devkat/roy/commit/0c41d2b632c4b29cf99dae6fa0ade0e70b59721a

There is certainly much room for improvement (e.g., it generates a new function for every identical partial call), but feel free to use the code if you think it makes sense. I'll be happy to submit a pull request including any desired modifications.

-- Andreas
Reply all
Reply to author
Forward
0 new messages