だから私は y-combinator と匿名関数をいじっていて、この奇妙なエラーに遭遇しました:
Couldn't match expected type `t0 -> t1 -> t2'
with actual type `forall b. b -> [b] -> [b]'
The lambda expression `\ (n :: Int) newVal xs -> ...'
has three arguments,
but its type `Int -> forall b. b -> [b] -> [b]' has only one
(エラーを作成するソースコードと、最終的に動作するようになったバージョン)
ランク N ポリモーフィズム (use )を避けるために型を少し変更するforall b. Int -> b -> [b] -> [b]
と、エラーは次のようになります。
Couldn't match expected type `t0 -> t1 -> t2 -> t3'
with actual type `forall b. Int -> b -> [b] -> [b]'
The lambda expression `\ (n :: Int) newVal xs -> ...'
has three arguments,
but its type `forall b. Int -> b -> [b] -> [b]' has none
forall b. b -> [b] -> [b]
なぜ議論がないのか誰かが私に説明でき ますか?