
7 Jul
2017
7 Jul
'17
6:38 p.m.
Quoting the report[1], "A boolean guard, g, is semantically equivalent to the pattern guard True <- g," which means the answer is "Yes". A boolean guard is equivalent to a pattern match. A predicate involving ==, however, introduces an Eq constraint that would not be required by pattern matching. For a properly equivalent guard, you need to write your predicates using pattern matching isEven Even = True isEven _ = False to avoid the spurious Eq constraint. [1] https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.1...