6.7.1. Pattern guards

PatternGuards
Since:

6.8.1

Status:

Disabled in Haskell98, enabled in Haskell2010 and later.

Haskell 2010 allows pattern match guards to contain pattern guards:

case animal of
  Fish { name=nm }
    | "bob" <- nm  -> "it's Bob!"
  --  ^^^^^^^^^^^ a pattern guard

This extension controls whether pattern guard syntax is allowed, independent of language edition.

© 2002–2007 The University Court of the University of Glasgow. All rights reserved.
Licensed under the Glasgow Haskell Compiler License.
https://downloads.haskell.org/~ghc/9.12.1/docs/users_guide/exts/pattern_guards.html