问题
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