Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

syntax - Type int vs. [int ty] in sml

My problem seems simple enough but I can't seem to find an answer anywhere. I'm not sure what the difference is between types int and [int ty] in sml. I'm getting a [tycon mismatch] error when trying to use a list of int tuples as input for my function. For example:

input: number_in_month ((1993, 2, 2), (1776, 7 4), (1994, 7, 5)) 7;

Error: operator and operand don't agree [tycon mistmatch]
operator domain: (int * int * int) list * int
operand:         ([int ty] * [int ty] * [int ty]) *
                 ([int ty] * [int ty] * [int ty]) *
                 ([int ty] * [int ty] * [int ty])

I've tried several ways to enclose my input paren-wise, but nothing seems to change the result.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...