错误:为什么要给我错误?
ERROR file:.\2.hs:6 - Syntax error in declaration (unexpected `(')
代码:
frist (y:ys)= (y:ys) !! 0
remove1 (y:[]) = []
remove1 (y:y2:ys) = if y==y2 then remove1 (y:ys) else [y2] ++ remove1 (y:ys)
count&remove (x:xs) = length (x:xs) - length (remove1 (x:xs))
makepairlist [] = []
makepairlist l = [(count&remove l , y)] ++ makepairlist l
文件名后的':6'表示错误在第6行 – luqui
您不能在标识符中使用'&'。用其他字符替换它。 – chi