I\'m trying to understand the result of
(*) . (+)
in Haskell. I know that the composition operator is just the standard composition of ma
Let:
m = (*)
a = (+)
then
(m.a) x = (m (a x)) = m (a x)
Now m expects a Num a as a parameter, on the other hand (a x) , i.e. (x +) is a unary function (a -> a) by definition of (+). I guess what happened is that GHC tries to unite these two types so that, if you have a type that is both a number and a unary function, m can take a number and a unary function and return a unary function, since they are considered the same type.
As @Syd pointed, this unification wouldn't make sense for any normal number types such as integers and floating point numbers.