[m-rev.] For review: user-configurable pretty printer
Peter Ross
pro at missioncriticalit.com
Wed Jun 6 18:26:41 AEST 2007
On 6/6/07, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
> Ralph Becket, Wednesday, 6 June 2007:
> > The drawback is that it makes the interface more complicated:
> > - adding a new pretty printer also involves specifying the corresponding
> > type_ctor_desc, e.g.:
> >
> > add_user_defined_pp(type_ctor(type_desc(_ : map(unit, unit))),
> > pp_map, !IO)
> >
> > (we need to supply types for map in order to avoid a warning; I've
> > used unit, but it's all rather ugly) rather than just
> >
> > add_user_defined_pp(pp_map, !IO)
>
> A thought occurs: what about this,
>
> add_user_defined_pp("map", pp_map, !IO)
>
> where "map" is the type constructor name for the type handled
> by pp_map. The name would be used to hash to the list of type-
> specific pps, which would be tried in turn until the value in
> question is converted to docs.
>
> - Is this horrible?
> - If not, should we include the module name? The type arity?
> Personally I think the type name should suffice.
>
Who is responsible for passing the name "map" the user, or is it done
automatically?
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list