[mercury-users] parsing a term of a dicriminated union type...

Ralph Becket rafe at csse.unimelb.edu.au
Wed Oct 3 12:27:37 AEST 2007

Hi Andrea,

what you're getting is a reasonable error with an unreasonably bad error
message.  Existentially quantified constructors have arguments added to
carry type information about the quantified arguments.  This information
is needed by the Mercury runtime to decide how to test such values for
equality, compare them, deconstruct them, invoke type class methods etc.
(rather like a vtable in OO language implementations).  Unfortunately
we have no sensible way of writing out or reading in higher order
values, hence read_term_from_string throws an exception: it does not
know how to parse a c1 constructor because the c1 constructor has an
extra type info. argument and that type info. argument contains higher
order data.

Hope this explains the problem,
-- Ralph
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list