私はhaskellを学習していますが、関数アプリケーション演算子$ curryのやり方は少し混乱しています。
GHCによると$のタイプは
*Main>:t ($)
($) :: (a->b) -> a -> b
あるしかし、私は、私はフリップを使用する必要がありますと仮定しますけれども、私は$の署名によると、次のコード
*Main>map ($ 2) [(*2), (+2), (/2)]
[4.0,4.0,1.0]
を入力することができます$への最初のパラメータは(a-> b)であるためです。例えば、私は次の
curry_test :: Integer -> String -> String
curry_test x y = (show x) ++ " " ++ y
*Main> let x = curry_test "123"
Couldn't match expected type `Integer' with actual type `[Char]'
In the first argument of `curry_test', namely `"123"'
In the expression: curry_test "123"
In an equation for `x': x = curry_test "123"
を
を行うことはできません。しかし、私は
let x = curry_test 2
ヒントを行うことができます – DiegoNolan