在具有至少两个元素pos1
和的列表上进行以下模式匹配有什么问题pos2
?
type Pos = (Float, Float)
type Tail = [Pos]
tail_cut : Float -> Tail -> Tail
tail_cut _ [] = []
tail_cut _ [pos] = [pos]
tail_cut cut (pos1:pos2:poss) = [] --line 91
[1 of 1] Compiling Main
Parse error at (line 91, column 19):
unexpected ":"
expecting "::", pattern, whitespace, comma ',' or closing paren ')'
请注意,我没有发布正文,只是返回一个空列表以保持片段较小。