Is a way to define Functions with multiple equations, each with different patterns. The function will match an input value to the first pattern it finds that fits.

The wildcard pattern _ can be used to match any value.

Examples

The logical and && can be implemented as

(&&) :: Bool -> Bool -> Bool
True && True    = True
True && False   = False
False && True   = False
False && False  = False

However this can be simplified using the wildcard pattern as

(&&) :: Bool -> Bool -> Bool
True && True    = True
_ && _          = False