【发布时间】:2014-05-24 01:29:23
【问题描述】:
我有这个代码:
datatype ('a, 'b) alterlist = nil | :: of ('a*'b) * ('a, 'b) alterlist;
infixr 5 ::
fun build4(x, one, y, two) = (x,one)::(y,two);
我得到这个错误:
datatype ('a,'b) alterlist = :: of ('a * 'b) * ('a,'b) alterlist | nil
stdIn:41.30-41.46 Error: operator and operand don't agree [tycon mismatch]
operator domain: ('Z * 'Y) * ('Z,'Y) alterlist
operand: ('Z * 'Y) * ('X * 'W)
in expression:
(x,one) :: (y,two)
为什么?
【问题讨论】:
标签: error-handling ml