[m-dev.] generic result types

Peter Ross pro at missioncriticalit.com
Wed Feb 18 13:36:44 AEDT 2009


Hi,

Do people think it would be useful to add the following generic types
to the standard library?

:- type result(T, E)
    --->    ok(T)
    ;       error(E)
    .

:- type partial_result(T, E) == partial_result(T, T, E).

:- type partial_result(T, P, E)
    --->    ok(T)
    ;       error(P, E)

:- type result(E)
    --->    ok
    ;       error(E)
    .

Then the various io and stream types could be redefined in terms of these types.

I ask because we have written a lot of code at MC which should use these generic
result types, so I was going to add this to our library but ian
suggested we should
see first if it goes better in the mercury standard library.

Pete


-- 
Peter Ross - Mission Critical Australia
AU: +61 424 651 834
BE: +32 485 482 559
--------------------------------------------------------------------------
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