After playing with haskell a bit, I came across this function:
Prelude Data.Maclaurin> :t ((+) . ($) . (+)) ((+) . ($) . (+)) :: (Num a) => a -> (a -> a) -> a -> a
(Data.Maclaurin is exported by the vector space of the package.) Thus, it takes Num, a function, another Num, and ultimately returns Num. What magic does the next job?
Prelude Data.Maclaurin> ((+) . ($) . (+)) 1 2 3 6
2 is obviously not a function (a-> a) or am I missing something?
types haskell numeric typeclass
Long
source share