Re: eqtype and functors
John Reppy <[email protected]> Thu, 31 May 2007 09:26:17 -0500
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
A better fix would be to just drop the "eq", since int is an eqtype by definition. - John On May 30, 2007, at 10:39 PM, brian wrote: > 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/ > _______________________________________________ > Smlnj-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/smlnj-list > ------------------------------------------------------------------------- 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/