Stephen Tetley <stephen.tetley <at> gmail.com> writes:

> -- | 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.



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to