Commit bd666766 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

users-guide: Clarify that bundled patsyns were introduced in GHC 8.0

Closes #17094.
parent 3900cb83
Pipeline #15558 passed with stages
in 672 minutes and 42 seconds
...@@ -298,9 +298,11 @@ example: :: ...@@ -298,9 +298,11 @@ example: ::
would bring into scope the data constructor ``Just`` from the ``Maybe`` would bring into scope the data constructor ``Just`` from the ``Maybe``
type, without also bringing the type constructor ``Maybe`` into scope. type, without also bringing the type constructor ``Maybe`` into scope.
To bundle a pattern synonym with a type constructor, we list the pattern As of GHC 8.0.1 you may also "bundle" pattern synonyms with an exported type
synonym in the export list of a module which exports the type constructor. constructor, making that pattern appear as a data constructor of that type. To
For example, to bundle ``Zero`` with ``MyNum`` we could write the following: :: bundle a pattern synonym, we list the pattern synonym in the export list of a
module which exports the type constructor. For example, to bundle ``Zero``
with ``MyNum`` we could write the following: ::
module Example ( MyNum(Zero) ) where module Example ( MyNum(Zero) ) where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment