夜、
私は機能を持っています
partialDecode :: [(Char, Char)] -> String -> String
partialDecode [] y = y -- If we have gone through all guesses we may return the string
partialDecode x y = partialDecode (drop 1 x) replace ((fst (x !! 0) snd (x !! 0) y)) -- Recurse over the function: Drop the leading element in the list of guesses and substitute every occurrence of the guess in the string
ただし、実行すると、再帰時に 2 つではなく 3 つのパラメーターを指定していることを示すエラーが ghci から返されます。これが何を意味するのかわかりません。(drop 1 x) でタプルのリストを提供し、replace ((fst (x !! 0) snd (x !! 0) y)) で文字列を提供しています。
提案?
乾杯!