ArrowApply型クラス
関数 f :: a->b
と値 x :: a
があるとき、 f x
とすると b
型になる
f
と x
という、2つの引数から、 f x
を得る、とみなせる
イメージ的には、 (f,x) -> f x
ちゃんと型で書くと (a->b, a) -> b
ただの関数適用を、computationとみなしている
(a->b, a) -> b
を一般化して、 ->
を h
とすると、
h (h a b, a) b
と書き換えられる
これがArrowApply
でっていう

何が嬉しいの?
本などでは、カリー化関数 crruyA
の逆関数が app
と説明されているが、
app
って関数じゃないじゃん

これは逆関数なの?
ArrowApplyはなんで逆関数の方のみを定義にしたの?
「Monadクラスの利便性が低い版」とは
ref

p.223下
定義
hsclass Arrow h => ArrowApply h where
-- 計算と値から結果を得るという計算
app :: h (h a b, a) b
インスタンスの例
普通の関数 ->
hsinstance ArrowApply (->) where
app ~(f,c) = f c
ユースケース
どういうふうに使っているのか見たい

参考
めちゃくちゃわかりやすい

