錯誤:爲什麼要給我錯誤?
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