如何创建字符串映射
当我尝试编译 Opa 程序时,
m: stringmap(list(string)) = StringMap.empty()
出现此错误:
Function was found of type ordered_map(string, 'a, String.order) but application expects it to be of type -> 'b.
我希望有任何提示/帮助来找出我的代码出了什么问题。蒂亚,
--
巴赫曼
When I try to compile an Opa program with
m: stringmap(list(string)) = StringMap.empty()
I get this error:
Function was found of type ordered_map(string, 'a, String.order) but application expects it to be of type -> 'b.
I'd appreciate any hint/help to figure out what's wrong with my code. TIA,
--
Bahman
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想这样写:
-> 'b
指的是您引用的类型错误中的StringMap.empty()
,这与您的强制转换不兼容。You probably want to write this:
-> 'b
refers toStringMap.empty()
in the type error you quoted, which is incompatible with your coercion.