开发者

Can I expand a typedef in SMLNJ?

开发者 https://www.devze.com 2023-02-11 11:32 出处:网络
So I was writing up some code in standard ML, and trying to compile it with smlnj. I got the following error:

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 solu开发者_如何学Gotion.

I would love to say something like:

typeof Absyn.fundec

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


As Absyn.fundec is not a standard type as int, bool, etc. there must be a datatype or a type declaration which should tell you exactly how the Absyn.fundec type is defined.

0

精彩评论

暂无评论...
验证码 换一张
取 消