Stream: beginners

Topic: backpassing


view this post on Zulip Qqwy / Marten (Jun 16 2022 at 15:50):

I have some questions about backpassing:

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:06):

backpassing is syntactic sugar for lambdas

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:07):

so you can do anything with them that you could do with a lambda, and vice versa

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:08):

so for example, these desugar to the same thing:

foo bar baz (\arg1, arg2, arg3 -> blah blah)
arg1, arg2, arg3 <- foo bar baz

blah blah

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:08):

backpassing is sort of like "writing the lambda backwards"

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:09):

the feature doesn't do anything other than being syntactic sugar for a lambda

view this post on Zulip Folkert de Vries (Jun 16 2022 at 16:09):

and within an arg, you can have a pattern, but that must be exhaustive

view this post on Zulip Richard Feldman (Jun 16 2022 at 16:09):

right, same as a lambda

view this post on Zulip Qqwy / Marten (Jun 16 2022 at 21:28):

Thanks a lot! Makes a lot of sense.
(And sidestepping the whole 'MonadFail' debacle is probably a smart choice :upside_down: )

view this post on Zulip James Brock (Feb 11 2023 at 01:20):

Can I describe “backpassing” as “do-notation for continuation-passing-style?”

view this post on Zulip James Brock (Feb 11 2023 at 01:26):

Maybe not because backpassing only allows for one continuation.


Last updated: Jul 05 2025 at 12:14 UTC