-
Notifications
You must be signed in to change notification settings - Fork 571
Closed
Labels
Milestone
Description
The paper describes many details and all that is easily mapped to purescript.
Essentially the process of desugaring is about splitting the do-notation statements into subsequences (parallel blocks) in such a way that the blocks don't share any binders. Those parallel blocks are then combined with map, apply and join.
That allows to make use of all the applicative benefits while still being able to use do-notation sugar.
It comes at cost of making do-notation desugaring much harder for understanding, though you could still use the simple bind desugaring as a mental model until you need to know more.
This would cause some breaking changes too:
- the imports of
mapandapplywould have to be added in relevant places; - the rebindable syntax trick would get more involved. Previously you could just define the
bind, but now you'd have to also define themapandapply; - when
apply's semantic differs fromap's the meaning of a program might get changed.