Trying to Define `$` Type

六月ゝ 毕业季﹏ 提交于 2019-12-25 01:57:59

问题


Using Standard ML of New Jersey (v110.77), I'm trying to define the $ data type from Purely Functional Data Structures:

datatype alpha susp = $ of alpha

But I get an error:

- datatype alpha susp = $ of alpha;
stdIn:1.11-2.7 Error: syntax error: deleting  ID ID EQUALOP

What am I doing wrong?


回答1:


In Standard ML, type variables are prefixed with a single quote:

datatype 'alpha susp = $ of 'alpha


来源:https://stackoverflow.com/questions/28802305/trying-to-define-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!