嘿家伙,所以这是一个奇怪的小错误,我得到了,我不明白为什么它给了我。解析错误输入'appendString'Haskell
它说,在输入解析错误“appendString”但我认为没有错吧......
我把它从若,然后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"
你看到我可能出错了吗?
编辑:增加了整个区域
,请复制粘贴代码 – jozefg 2013-04-10 04:38:54
全断面虽然它无关,你问的错误,你需要'currentIndex-1'的括号。 – hammar 2013-04-10 04:40:52
添加了完整部分 – 2013-04-10 04:42:31