diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 2746faa34e4879f1059b117dc7bd00e7c84d6240..7e801dde21652628324c22b28767caad82e09343 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -339,7 +339,7 @@ $tab+ { warn Opt_WarnTabs (text "Tab character") } } <0> { - "(#" / { ifExtension unboxedTuplesEnabled `alexAndPred` notFollowedBySymbol } + "(#" / { ifExtension unboxedTuplesEnabled } { token IToubxparen } "#)" / { ifExtension unboxedTuplesEnabled } { token ITcubxparen } diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index c4dd6bbf5efd7da891f59cd9dab148a51833f14c..1357395eff1cd97002582e4fbb047209346e8b9a 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -224,6 +224,14 @@ type (primitive or non-primitive). The type of an unboxed tuple looks the same. + +Note that when unboxed tuples are enabled, +(# is a single lexeme, so for example when using +operators like # and #- you need +to write ( # ) and ( #- ) rather than +(#) and (#-). + + Unboxed tuples are used for functions that need to return multiple values, but they avoid the heap allocation normally associated with