[m-rev.] for review: improvementstopprintinterface
Mark Brown
dougl at cs.mu.OZ.AU
Thu May 9 00:07:09 AEST 2002
On 06-May-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 2
> Branches: main
>
> Extended the interface to pprint to reduce the syntactic burden of
> constructing docs by introducing the doc/1 type class and the ++/2
> doc instance concatenation operator.
>
> NEWS:
> Mentioned the new changes.
>
> library/pprint.m:
> Added the doc/1 typeclass.
> Made docs, strings, chars, ints and floats instances of doc/1.
> Added the ++/2 operator which is analogous to `<>`/2, but operates
> on doc/1 instances.
> Used the new facilities to simplify the various doc construction
> combinators provided by pprint.
This changes to the code are fine. However, I have a few suggestions
for the documentation:
- It would probably be good to change the examples at the top
of the module to use the new parts of the interface.
- You might also document the addition of the typeclass in the
"changes" part of the documentation.
- Is there an expectation that users would usually add all the
types they wish to print as instances of the typeclass? This
would be good, because they could then write a function that
converts, say, map(K, V) into doc where K and V are constrained
by doc, without necessarily resorting to the generic to_doc
function. You could then make map/2 an instance of doc. If
this is the expectation, then I suggest adding examples of this
to the documentation.
Feel free to address this third point in a separate change.
Cheers,
Mark.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list