Commit b1382481 authored by kanetw's avatar kanetw Committed by Ben Gamari

Improved data family export documentation

Reviewers: simonpj, austin, bgamari

Reviewed By: simonpj

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11164
parent c205aebd
......@@ -1223,8 +1223,9 @@ exports_from_avail Nothing rdr_env _imports _this_mod
-- #11164: when we define a data instance
-- but not data family, re-export the family
-- Generally, whenever we export a part of a declaration,
-- export the declaration, too.
-- Even though we don't check whether this is actually a data family
-- only data families can locally define subordinate things (`ns` here)
-- without locally defining (and instead importing) the parent (`n`)
fix_faminst (AvailTC n ns flds)
| not (n `elem` ns)
= AvailTC n (n:ns) flds
......@@ -6666,6 +6666,11 @@ adjustment for type families:
associated types ``Tj``. The types need a keyword "``type``" to
distinguish them from data constructors.
- Whenever there is no export list and a data instance is defined, the
corresponding data family type constructor is exported along with
the new data constructors, regardless of whether the data family
is defined locally or in another module.
.. _data-family-impexp-examples:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment