guard package:ghc-source-gen

An expression guarded by a single boolean statement.
| otherwise = ()
=====
guard (var "otherwise") unit
A guarded right-hand side of a match.
| x = False
| otherwise = True
=====
guardedRhs
[ guard (var "x") (var "False")
, guard (var "otherwise") (var "True")
]
An expression guarded by multiple statements, using the PatternGuards extension.
| Just y <- x, y = ()
=====
guards [conP "Just" (bvar "x") <-- var "y", bvar "x"] unit
An expression with a single guard. For example:
| otherwise = ()