function composition with reverse syntax

HaskellSyntaxFunction Composition

Haskell Problem Overview


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.

Haskell Solutions


Solution 1 - Haskell

f >>> g from Control.Arrow.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfredoverflowView Question on Stackoverflow
Solution 1 - HaskellJosh LeeView Answer on Stackoverflow