This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
Monadic comprehensions #41
tiansivive
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposed syntax:
We take advantage of curly blocks to introduce
then
constructs, similar to haskell list comprehensionsWe add
if
clauses (potentiallyunless
too) to backcall, which get desugared to guards on the results of the backcallQuestions:
Do we need to ensure purity? Do we need to work only with monads?
A
then
statements could simply desugar to introducing a new code block scoped to all the variables of the current block.For example:
Would desugar to:
Consequently, one can do
Which desugars to
Beta Was this translation helpful? Give feedback.
All reactions