Pattern Synonym Documentation
ClosedPublic

Authored by mpickering on Oct 14 2015, 10:54 AM.

Details

Summary

This patch adds documentation for record pattern synonyms (D1258) and bundling pattern synonyms with type constructors in export lists (D1152).

There are also other small improvements motivated by Trac #10900.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mpickering updated this revision to Diff 4495.Oct 14 2015, 10:54 AM
mpickering retitled this revision from to WIP - Pattern Synonym Documentation.
mpickering edited the test plan for this revision. (Show Details)
mpickering updated the Trac tickets for this revision.
mpickering updated this revision to Diff 4496.Oct 14 2015, 10:58 AM
mpickering edited edge metadata.

Try to get the dependency working.

mpickering updated this revision to Diff 4497.Oct 14 2015, 11:02 AM
mpickering edited edge metadata.

Try to get dependency working...

mpickering added inline comments.Oct 14 2015, 11:11 AM
docs/users_guide/glasgow_exts.rst
884

confusing.

1040

fix for new signature syntax.

bgamari accepted this revision.Oct 25 2015, 8:28 AM
bgamari edited edge metadata.

For the record, ReST allows you to place the block delimiter :: at the end of a paragraph, allowing you to turn

For example, we can construct the value `intEndo` using the pattern synonyms
`Arrow` and `Int` as defined previously.

::

      intEndo :: Type
      intEndo = Arrow Int Int

into this,

For example, we can construct the value `intEndo` using the pattern synonyms
`Arrow` and `Int` as defined previously. ::

      intEndo :: Type
      intEndo = Arrow Int Int

I didn't apply this very consistently in the conversion (largely because Pandoc doesn't produce code this way) but it does make things a bit more concise. I'll let you decide whether you want to make this change.

Otherwise this looks quite good.

docs/users_guide/glasgow_exts.rst
884

Agreed, this wording could be improved. Here's my feeble attempt at doing this,

The name of the pattern synonym is in the same namespace as proper data constructors. Like normal data constructors, pattern synonyms can be imported and exported through association with a type constructor or independently.

This revision is now accepted and ready to land.Oct 25 2015, 8:28 AM

@mpickering, do you consider this to still be a work-in-progress?

bgamari requested changes to this revision.Oct 26 2015, 3:54 PM
bgamari edited edge metadata.

@mpickering is going to continue work on this.

This revision now requires changes to proceed.Oct 26 2015, 3:54 PM
mpickering added inline comments.Oct 29 2015, 8:59 AM
docs/users_guide/glasgow_exts.rst
824

typo

mpickering updated this revision to Diff 4762.Oct 29 2015, 11:27 AM
mpickering edited edge metadata.
  • Small changes

Think this is ready to merge now but it does also refer to D1258.

goldfire edited edge metadata.Oct 29 2015, 11:57 AM

Thanks!

docs/users_guide/glasgow_exts.rst
764

s/seperate/separate/

811

Shouldn't that data constructor be Point?

912

I still strongly prefer "bundle" instead of "associate" here.

936

I think linking here is good, but there should be some mention of the type restriction. It's straightforward enough (in its current form) to include here.

bgamari requested changes to this revision.Nov 1 2015, 6:55 AM
bgamari edited edge metadata.

A few more changes needed. Almost there!

docs/users_guide/glasgow_exts.rst
912

I agree here; I think it is a mistake to overload "associate" in this way.

This revision now requires changes to proceed.Nov 1 2015, 6:55 AM
mpickering updated this revision to Diff 5181.Nov 18 2015, 10:54 AM
mpickering edited edge metadata.
  • Small changes
  • Update docs

@bgamari

Can you just glance over the release notes to make sure they make sense and then I will land it.

bgamari accepted this revision.Nov 19 2015, 5:10 AM
bgamari edited edge metadata.

Looks good to me! Feel free to merge at your convenience.

This revision is now accepted and ready to land.Nov 19 2015, 5:10 AM
mpickering retitled this revision from WIP - Pattern Synonym Documentation to Pattern Synonym Documentation.Nov 19 2015, 7:37 AM
mpickering updated this object.
mpickering edited edge metadata.
This revision was automatically updated to reflect the committed changes.