Stream: ideas

Topic: ✔ support backpassing (<-) for more than one argument


view this post on Zulip Matthieu Pizenberg (Jun 23 2024 at 13:27):

So I’ve seen all the discussions about removing backpassing in favor of just having (!) and (?) operators for the two most common use cases. That makes me a bit sad as I found backpassing really enjoyable and useful for readability. Anyway in case it doesn’t disappear, I’d like to propose extending it to more than one argument. For example

a, b <- List.map2 listA listB
a + b

I feel like more versatile backpassing would be super useful for many use cases. And I was looking forward to having backpassing for things like property based testing.

view this post on Zulip Kilian Vounckx (Jun 23 2024 at 13:47):

This already works no?
The following compiles just fine and I can use the foo function

foo : List U32, List U32 -> List U32
foo = \list1, list2 ->
    x, y <- List.map2 list1 list2
    x + y

view this post on Zulip Matthieu Pizenberg (Jun 23 2024 at 13:57):

Ha my bad sorry it seems you’re right. I’m not sure why, I thought I tried it and didn’t work. I must have had another error in the code at that time

view this post on Zulip Notification Bot (Jun 23 2024 at 13:58):

Matthieu Pizenberg has marked this topic as resolved.


Last updated: Jun 16 2026 at 16:19 UTC