First of all, there's a mistake in your [original, unedited] question:
h = f . g is equivalent to h x = g(f x)
— that's not true: h = f . g
is equivalent to h x = f (g x)
.
However, as to why it's that way and not the other way around, it's most likely because that's how it works and has worked in math; see http://en.wikipedia.org/wiki/Function_composition:
[...] composite function is denoted g ∘ f : X → Z, defined by (g ∘ f )(x) = g(f(x)) for all x in X.
It's also intuitive because of the equality (f . g) x == f (g x)
— as you can see, the order of f
and g
is the same on both sides.
Moreover, it's trivial to create your own "reverse composition" operator if you desire one for reasons of e.g. readability:
(.>) = flip (.)
so that
Prelude> ((+1) .> (*2)) 3
8
Prelude> ((+1) . (*2)) 3
7
In fact, you can just use Control.Arrow.(>>>)
which does the same for functions but is more general and works for other things as well:
Prelude Control.Arrow> ((+1) >>> (*2)) 3
8