[m-dev.] for review: tuples [1]
Simon Taylor
stayl at cs.mu.OZ.AU
Thu Aug 3 09:34:46 AEST 2000
Peter Schachte wrote:
> Hang on. If you're going to do that, wouldn't you be a lot better off using
> the defn:
>
> :- type (T1,T2) ---> (T1,T2)
> I can only see one disadvantage: for triples and above, the representation is
> inefficient (and for pairs, the standard pair type is probably fine). This
> could be fixed by implementing structure inlining of single-constructor types.
> Of course, this would have benefits in many other situations, as well. Is
> there some reason that this is a more difficult optimization than it would
> seem?
It doesn't work well with polymorphic predicates because
the structures would need to be un-inlined before passing
them to a predicate such as io__write or std_util__deconstruct.
This optimization is in the same category as the type unfolding
discussed earlier in this thread -- it's difficult to work out
when it will improve performance.
Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list