[m-rev.] diff: allow user defined store types

Julien Fischer juliensf at csse.unimelb.edu.au
Tue May 27 16:49:13 AEST 2008


(The rationale for this change is that the next generation of G12's
solver interfaces libraries will have (mostly-)unique state arguments
threaded through the procedures.  We need to attach refs to this state;
this change means that we should be able to re-use the standard library
stuff rather than defining it all separately for G12's state types.)

Estimated hours take: 0.1
Branches: main

Allow users to define their own store types.

library/store.m:
 	Export the definition of the store/1 typeclass so that users
 	can define their own stores.

Julien.

Index: store.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/store.m,v
retrieving revision 1.62
diff -u -r1.62 store.m
--- store.m	30 May 2007 08:16:07 -0000	1.62
+++ store.m	27 May 2008 06:43:26 -0000
@@ -41,7 +41,7 @@
      % type system to ensure at compile time that you never attempt to use
      % a key from one store to access a different store.
      %
-:- typeclass store(S).
+:- typeclass store(T) where [].
  :- type store(S).

  :- instance store(io.state).
@@ -243,7 +243,6 @@
  :- import_module deconstruct.
  :- import_module require.

-:- typeclass store(T) where [].
  :- instance store(store(S)) where [].
  :- instance store(io.state) where [].


--------------------------------------------------------------------------
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