Stream: beginners

Topic: Currying in Roc


view this post on Zulip Nate Brunette (Aug 25 2022 at 18:56):

I'm not sure if this is the right place to ask this, but I was watching a youtube video and it was mentioned that roc is not a curried language? Does that mean you can't create partially applied functions?

view this post on Zulip Brendan Hansknecht (Aug 25 2022 at 19:00):

You have to use an explicit lambda

view this post on Zulip Brendan Hansknecht (Aug 25 2022 at 19:01):

\x -> Num.add 3 x

view this post on Zulip Brendan Hansknecht (Aug 25 2022 at 19:02):

Also, I moved this into a separate thread from the multiline formating thread.

view this post on Zulip Nate Brunette (Aug 25 2022 at 19:03):

ah, thanks. I've never used this chat before. Bummer about the currying, but thanks for the info!

view this post on Zulip Richard Feldman (Aug 25 2022 at 19:04):

there's a FAQ entry explaining that design decision: https://github.com/roc-lang/roc/blob/main/FAQ.md#why-arent-roc-functions-curried-by-default

view this post on Zulip Nate Brunette (Aug 25 2022 at 19:07):

ah, that makes sense. I'm glad that there's a simple way to opt-in if it would be beneficial in specific cases (Edit: I also wrongly assumed that it was required for pipelines)


Last updated: Jul 06 2025 at 12:14 UTC