The Naturality law states that:
t . traverse f == traverse (t . f) -- for every applicative transformer t
Now for the RHS of the law, if f has the type Applicative a => x -> a y
, then t has to be of the type (Applicative a, Applicative b) => a y -> b y
, due to the function composition.
For the LHS, traverse f has the type (Applicative a, Traversable c) => c x -> a (c y)
. But since traverse f is composed with t . traverse f, t has to be of the type (c x -> a (c y)) -> b y.
Now, for the LHS, t has the type a (c y) -> b y, but from the RHS it has the type a y -> b y. How is the law sound from a type perspective?
Edit: Fixed the type t in LHS