diff options
Diffstat (limited to 'docs/users_guide/exts/primitives.rst')
-rw-r--r-- | docs/users_guide/exts/primitives.rst | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/users_guide/exts/primitives.rst b/docs/users_guide/exts/primitives.rst index a596c13f23..9caab6b146 100644 --- a/docs/users_guide/exts/primitives.rst +++ b/docs/users_guide/exts/primitives.rst @@ -136,7 +136,7 @@ There are some restrictions on the use of primitive types: f x = let !(Foo a b, w) = ..rhs.. in ..body.. - since ``b`` has type ``Int#``. + since ``b`` has type ``Int#``. See :ref:`recursive-and-polymorphic-let-bindings`. .. _unboxed-tuples: @@ -198,7 +198,8 @@ example desugars like this: q = snd t in ..body.. -Indeed, the bindings can even be recursive. +Indeed, the bindings can even be recursive. See :ref:`recursive-and-polymorphic-let-bindings` +for a more precise account. To refer to the unboxed tuple type constructors themselves, e.g. if you want to attach instances to them, use ``(# #)``, ``(#,#)``, ``(#,,#)``, etc. @@ -436,9 +437,13 @@ argument either way), GHC currently disallows the more general type ``PEither @l Int Bool -> Bool``. This is a consequence of the `representation-polymorphic binder restriction <#representation-polymorphism-restrictions>`__, -Due to :ghc-ticket:`19487`, it's -currently not possible to declare levity-polymorphic data types with nullary -data constructors. There's a workaround, though: :: +Pattern matching against an unlifted data type work just like that for lifted +types; but see :ref:`recursive-and-polymorphic-let-bindings` for the semantics of +pattern bindings involving unlifted data types. + +Due to :ghc-ticket:`19487`, it is +not currently possible to declare levity-polymorphic data types with nullary +data constructors. There is a workaround, though: :: type T :: TYPE (BoxedRep l) data T where |