[Git][ghc/ghc][master] User's guide: Fix the "no-backtracking" example of -XOrPatterns (#25250)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Sep 12 02:21:36 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
aa4500ae by Sebastian Graf at 2024-09-11T22:21:13-04:00
User's guide: Fix the "no-backtracking" example of -XOrPatterns (#25250)

Fixes #25250.

- - - - -


1 changed file:

- docs/users_guide/exts/or_patterns.rst


Changes:

=====================================
docs/users_guide/exts/or_patterns.rst
=====================================
@@ -114,8 +114,8 @@ Or-patterns do not employ backtracking when given guarded right hand sides, i.e.
 when one alternative of the or-pattern matches, the others are not tried when
 the guard fails. The following code yields ``"no backtracking"``: ::
 
-  case (True, error "backtracking") of
-    ((True; _); (_; True)) | False -> error "inaccessible"
+  case error "backtracking" of
+    (_; True) | False -> error "inaccessible"
     _ -> error "no backtracking"
 
 (The exact syntax and semantics of or-patterns are found



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa4500aecca763be5ce27c4784473f00e2ce5aa3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aa4500aecca763be5ce27c4784473f00e2ce5aa3
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240911/794e681e/attachment-0001.html>


More information about the ghc-commits mailing list