juvix icon indicating copy to clipboard operation
juvix copied to clipboard

Add do-notation

Open janmasrovira opened this issue 1 year ago • 1 comments

  • Depends on #2354.

We would support three kinds of statements (bind, let, expression), and we could borrow the syntax from haskell.

do {
  <var> <- <expr>; -- bind
  let <fundef>; -- pure let
  <expr>; -- monadic expression
};

In the future we can consider some extensions:

  1. Allow patterns of single constructor types on the left of <-.
  2. @paulcadman mentioned Idris !-notation.
  3. Do notation for Applicative.

janmasrovira avatar Sep 12 '23 11:09 janmasrovira