我创建了这个程序来返回一个没有零值的矩阵的位置列表。
此代码:
type Pos = (Int,Int)
type Matrix = [[Int]]
v0 [Pos]->Matrix->[Pos]
v0 [] m =[]
v0 [p:ps] m = if ((takeH m p) == 0) then v0 ps m
else p:v0 ps m
takeH:: Matrix->Pos->Int
takeH m (i,j)= (m!!(i-1))!!(j-1)
产生此错误:
Parse error on input '->'
Failed,modules loades: nome.
为什么 ?
我希望我已经清楚了。