Skip to content

Commit 299d87a

Browse files
ginsbachp0
andauthored
better explanation of the purpose of type unions
Co-authored-by: Pavel Avgustinov <[email protected]>
1 parent 0562b4a commit 299d87a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/language/ql-handbook/types.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ Type unions are used for creating restricted subsets of an existing :ref:`algebr
497497
selecting a subset of the branches of that datatype and binding them to a new type.
498498
Type unions of :ref:`database types <database-types>` are also supported.
499499

500-
You can use a type union to explicitly restrict the permitted branches from an algebraic datatype
501-
and resolve spurious :ref:`recursion <recursion>` in predicates.
500+
You can use a type union to give a name to a subset of the branches from an algebraic datatype.
501+
In some cases, using the type union over the whole algebraic datatype can avoid spurious
502+
:ref:`recursion <recursion>` in predicates.
502503
For example, the following construction is legal::
503504

504505
newtype InitialValueSource =

0 commit comments

Comments
 (0)