Sml 为什么a和字符串不能统一?

Sml 为什么a和字符串不能统一?,sml,Sml,我试图构造一些灵活的向量函数,类似于非灵活向量的函数。我收到一条我不理解的错误消息: > val jimmy = update(john,0,"mccoy"); Error-Type error in function application. Function: update : 'a flexVector * int * 'a -> 'a flexVector Argument: (john, 0, "mccoy") : string flexVector * int

我试图构造一些灵活的向量函数,类似于非灵活向量的函数。我收到一条我不理解的错误消息:

> val jimmy = update(john,0,"mccoy");
Error-Type error in function application.
   Function: update : 'a flexVector * int * 'a -> 'a flexVector
   Argument: (john, 0, "mccoy") : string flexVector * int * string
   Reason:
      Can't unify 'a flexVector with string flexVector
      (Different type constructors)
Found near update (john, 0, "mccoy")
Static Errors

这怎么可能?据我所知,“a数据类型是非特定的,因此可能是字符串…?

您的更新函数是什么样子的?它是否适用于其他类型,比如int?你确定你没有在同一个结构中,在john的定义或创建john的函数和函数update的定义之间,两次定义“flexVector”吗?对不起,我写这篇文章大约两年了,我甚至不记得sml了:P