2

So I was writing up some code in standard ML, and trying to compile it with smlnj. I got the following error:

Error: operator and operand don't agree [tycon mismatch]
  operator domain: unit -> Absyn.fundec
  operand:         unit
                   -> (pos * pos) * 
                      ((string * int) * (string * int) * Absyn.tp * Absyn.tp
                       * Absyn.exp)

Now, this looks like it should be a type match based on my cursory inspection of the types. I'm not going to tell you them since I want a general solution, not the bug in my code.

Is it possible to expand both types into the base datatypes so I can figure out how they differ? With all these typedefs floating around things get confusing, and digging through .sml files for all the definitions and writing the expansion on paper seems like a tedious solution.

I would love to say something like:

typeof Absyn.fundec

and figure out what the heck kind of expression might produce a valid fundec.

4

1 回答 1

1

由于 Absyn.fundec 不是 int、bool 等标准类型,因此必须有一个数据类型或类型声明,它应该准确地告诉您 Absyn.fundec 类型是如何定义的。

于 2011-07-14T16:30:22.890 回答