eqtype and functors

brian <briand-/[email protected]> Wed, 30 May 2007 20:39:49 -0700
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Hi,

I'm trying to use fgl (a functional graph library) and I ran across  
this:

signature GRAPH_NODE =
sig
   eqtype node = int
end

sml throws an error on that statement.  I simply removed the "= int"  
to fix it.

This change however causes another problem.  I've put the rest of it  
at the bottom of the e-mail because I think the short question is:  
what do I do to implement the intent of the original code ?

Thanks

Brian


applic/lamtr.sml:128.18-128.50 Error: operator and operand don't  
agree [tycon mismatch]
   operator domain: (int * Value.node_label list * (G.node * G.node *  
'Z) list
                     -> (Value.node_label,'Z) G.graph)
                    * (int * int * CombExpr.comb_term
                       -> int * Value.node_label list
                          * (G.node * G.node * 'Z) list)
   operand:         (int * Value.node_label list * (G.node * G.node *  
'Z) list
                     -> (Value.node_label,'Z) G.graph)
                    * (int * int * CombExpr.comb_term
                       -> int * Value.node_label list
                          * (int * int * Value.edge_label) list)
   in expression:
     G.mkgr o UTuple.t23 o toEdgeList

Here's the statement:

   fun toGraph r l = (G.mkgr o UTuple.t23 o toEdgeList) (r,0,E.comb l)

and it's in a functor:

functor LambdaTrans (G:GRAPH) =
struct
...

So if I parse the error message correctly, it looks as though there  
is a problem in the the function composition.  I believe that the  
problem is toEdgeList is assuming that the node/node ID is an  
integer, when in fact it's actually a TBD type.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/