[Haskell-cafe] Pointfree composition for higher arity
leather at cs.uu.nl
Wed Feb 17 10:31:16 EST 2010
I find myself often writing this pattern:
someFun x y z = ...
fun y z = runFun $ someFun someDefault y z
fun y = runFun . someFun someDefault y
The second option approaches the ideal pointfreeness (or pointlessness if
you prefer), but I'd like to go farther:
(...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
> (...) f g x y = f (g x y)
> infixr 9 ...
fun = runFun ... someFun someDefault
There, that's better. More points for fewer points (which means I should
really change the name from fun to pun).
Does anybody else care about this? What are some alternative solutions? I'd
love to have something like this available in the Prelude or a library. (I
have no strong feelings about the particular operator.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe