[m-dev.] Pretty printing non-canonical types
Ian MacLarty
maclarty at csse.unimelb.edu.au
Mon Oct 8 09:39:43 AEST 2007
On Fri, Oct 05, 2007 at 02:52:11PM +1000, Ralph Becket wrote:
> I'm trying to debug the new LP interface.
> The debugger uses the new pretty_printer module.
> The pretty_printer module uses deconstruct(..., canonicalize, ...) to
> decide what to do with each subterm.
> The canonicalize form just returns the type name for non-canonical
> values, rather than any structural information.
> This is most unhelpful for debugging.
> Using deconstruct(..., include_details_cc, ...) does the right thing,
> but is cc_multi.
> I want the include_details_cc behavious, but I don't want to propagate
> the cc_multi aspect into the interface to the pretty printer, because
> that could make using it rather awkward in many circumstances.
>
> Is there any objection to me using include_details_cc wrapped in a
> promise_equivalent_solutions scope, even though the promise is a lie?
>
Why not add a predicate like the following:
:- pred format_io(S::in, doc::in, formatter_map::in, int::in, int::in,
formatting_limit::in, io::di, io::uo) is det <= stream.writer(S,
string, io).
in which you do the required promise. The promise is okay under a
suitable interpretation of the IO state.
Ian.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list