git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update syntax.rst
commit03b42b639ff75b06a9f55b7bd2bd3117695f92ce authorPhil Freeman <paf31@cantab.net> dateWed 23 Apr 2014, 22:28 (13 years ago) parentee81e70
1 file changed+9
docs/source/syntax.rst+9
docs/source/syntax.rst+9
@@ -173,6 +173,15 @@ Statements can have the following form:
173173- ``x`` which desugars to ``x >>= \_ -> ...`` or just ``x`` if this is the last statement.
174174- A let binding ``let a = x`` where ``a`` can be either a name or a binder. Note the lack of the ``in`` keyword.
175175
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+
176185Binders can be used on the left hand side of ``<-`` or ``=``. For example::
177186
178187 test arr = do