Prelude Control.Applicative> let superdot =
(((<*>).(((<*>).).(((.).).).(.)))<*>const const)
Prelude ...> :t superdot
superdot ::
(b -> b -> c) -> (b1 -> b) -> b1 -> b1 -> c
Prelude ...> superdot compare snd (0, 1) (0, 0)
GT
Hi, it is NISHIO Hirokazu. I just needed "dot" operator for 2-args function.
Prelude ...> let superdot = \f g x y -> f (g x) (g y)
Prelude ...> superdot compare snd (0, 1) (1, 0)
GT
Why such a function isn't in Prelude?
2 comments:
Data.Function.on ?
http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0.0/Data-Function.html#v:on
That's it!
Thank you for information!
Post a Comment