嘿伙计们,这是我遇到的一个奇怪的小错误,我不明白为什么它会给我。
它在输入“appendString”中显示解析错误,但我认为它没有任何问题......
我从 if,then else 语句中调用它,如下所示:
createShow currentIndex (Grid {delta = d, middle = (x,y), points = g}) dir counter =
if currentIndex ==0 || dir == 2
then (appendString d (x,y) g currentIndex) ++ (createShow currentIndex+1 (Grid {delta = d, middle = (x,y), points = g}) 2 (counter+1))
else if counter == (2*d+1)
then (appendString d (x,y) g currentIndex) ++ (appendX x)
else if dir == 1
then (appendString d (x,y) g currentIndex) ++ (createShow currentIndex-1 (Grid {delta = d, middle = (x,y), points = g}) 1 (counter+1))
其中 createShow 返回一个字符串,appendString 也是如此
appendString 在构造函数中给出错误:
appendString d (x,y) g currentIndex =
(if currentIndex == y
then "y "
else
" " ) ++ (show currentIndex) ++(rowFunction g x d 0 (x+d) 1)++ "\n"
你知道我哪里做错了吗?
编辑:添加了整个区域