fre*_*low 37 syntax haskell function-composition
如果我想申请f第一和g第二,我必须写:
g . f
Run Code Online (Sandbox Code Playgroud)
是否有另一种标准语法允许我以相反的顺序编写函数?
f <whatever> g
Run Code Online (Sandbox Code Playgroud)
我知道我可以发明自己的语法:
compose f g x = g (f x)
Run Code Online (Sandbox Code Playgroud)
然后像这样使用它:
f `compose` g
Run Code Online (Sandbox Code Playgroud)
但我宁愿使用标准的库设施.
Jos*_*Lee 44
f >>> g来自Control.Arrow.