summaryrefslogtreecommitdiff
path: root/docs/users_guide/exts/monadfail_desugaring.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/exts/monadfail_desugaring.rst')
-rw-r--r--docs/users_guide/exts/monadfail_desugaring.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/exts/monadfail_desugaring.rst b/docs/users_guide/exts/monadfail_desugaring.rst
new file mode 100644
index 0000000000..ddc6cff6b4
--- /dev/null
+++ b/docs/users_guide/exts/monadfail_desugaring.rst
@@ -0,0 +1,23 @@
+.. _monadfail-desugaring:
+
+New monadic failure desugaring mechanism
+----------------------------------------
+
+.. extension:: MonadFailDesugaring
+ :shortdesc: Enable monadfail desugaring.
+
+ :since: 8.0.1
+
+ Use the ``MonadFail.fail`` instead of the legacy ``Monad.fail`` function
+ when desugaring refutable patterns in ``do`` blocks.
+
+The ``-XMonadFailDesugaring`` extension switches the desugaring of
+``do``-blocks to use ``MonadFail.fail`` instead of ``Monad.fail``.
+
+This extension is enabled by default since GHC 8.6.1, under the
+`MonadFail Proposal (MFP)
+<https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail>`__.
+
+This extension is temporary, and will be deprecated in a future release.
+
+