git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update syntax.rst
03b42b6Phil Freeman
docs/source/syntax.rst+9
@@ -173,6 +173,15 @@ Statements can have the following form:
173- ``x`` which desugars to ``x >>= \_ -> ...`` or just ``x`` if this is the last statement.
173- ``x`` which desugars to ``x >>= \_ -> ...`` or just ``x`` if this is the last statement.
174- A let binding ``let a = x`` where ``a`` can be either a name or a binder. Note the lack of the ``in`` keyword.
174- A let binding ``let a = x`` where ``a`` can be either a name or a binder. Note the lack of the ``in`` keyword.
175
175
176+The example ``evenSum`` desugars to::
177+
178+ evenSum a b =
179+ a >>= \n ->
180+ b >>= \m ->
181+ let sum = n + m in
182+ isEven sum >>= \_ ->
183+ return sum
184+
176Binders can be used on the left hand side of ``<-`` or ``=``. For example::
185Binders can be used on the left hand side of ``<-`` or ``=``. For example::
177
186
178 test arr = do
187 test arr = do