Tutorial by Examples

Patterns annotated with a bang (!) are evaluated strictly instead of lazily. foo (!x, y) !z = [x, y, z] In this example, x and z will both be evaluated to weak head normal form before returning the list. It's equivalent to: foo (x, y) z = x `seq` z `seq` [x, y, z] Bang patterns are enabled ...
This example provides a brief overview - for a more in-depth explanation of normal forms and examples, see this question. Reduced normal form The reduced normal form (or just normal form, when the context is clear) of an expression is the result of evaluating all reducible subexpressions in the gi...
Lazy, or irrefutable, patterns (denoted with the syntax ~pat) are patterns that always match, without even looking at the matched value. This means lazy patterns will match even bottom values. However, subsequent uses of variables bound in sub-patterns of an irrefutable pattern will force the patter...
In a data declaration, prefixing a type with a bang (!) makes the field a strict field. When the data constructor is applied, those fields will be evaluated to weak head normal form, so the data in the fields is guaranteed to always be in weak head normal form. Strict fields can be used in both rec...

Page 1 of 1