function composition with reverse syntax
-
13-01-2021 - |
質問
If I want to apply f
first and g
second, I have to write:
g . f
Is there another standard syntax that would allow me to write the functions in the reverse order?
f <whatever> g
I know I can just invent my own syntax:
compose f g x = g (f x)
and then use it like this:
f `compose` g
But I would rather use a standard library facility.
解決
f >>> g
from Control.Arrow.
所属していません StackOverflow