
29 Dec
2009
29 Dec
'09
9:09 p.m.
Stephen Tetley
-- | Compose an arity 1 function with an arity 2 function. -- B1 - blackbird oo :: (c -> d) -> (a -> b -> c) -> a -> b -> d oo f g = (f .) . g
Extending the arity works quite nicely too:
-- | Compose an arity 1 function with an arity 3 function. -- B2 - bunting ooo :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e ooo f g = ((f .) .) . g
And oo = (.).(.) and ooo = (.).(.).(.) There was a suggestion a few years back to standardise these as I recall something like: $0 = $ $1 = . $2 = (.).(.) and so on but nothing came of it. Dominic.