
10 Oct
2010
10 Oct
'10
6:47 p.m.
On 10 October 2010 22:32, Johannes Waldmann
Oh, and while we're at it - are there standard notations for "forward" function composition and application?
I mean instead of h . g . f $ x I'd sometimes prefer x ? f ? g ? h but what are the "?"
While asking you use the same symbol for function composition, and something like inverse function application. I don't think there exists an operator ?, such that h . g . f $ x is equivalent to x ? f ? g ? h. But you can simply define an inverse function application like the following and have a close enough alternative, ($$) :: a -> (a -> b) -> b ($$) = flip ($) infixl 5 $$ Now the following two expression are identical, I suppose: h . g . f $ x x $$ f . g . h Cheers, Ozgur