Next: , Previous: Predicate and function type declarations, Up: Types   [Contents]


3.4 Field access functions

Fields of constructors of discriminated union types may be labelled (see Discriminated unions). These labels cause the compiler to generate functions which can be used to select and update fields of a term in a manner independent of the definition of the type.

The Mercury language includes syntactic sugar to make it more convenient to select and update fields inside nested terms (see Record syntax) and to select and update fields of the DCG arguments of a clause (see DCG-goals).