In this case, a
is last because we want ParsecT s u m __
to be a monad, that way, what our parsers look for can depend on what they found before, and so forth. If u
came last we couldn't write
instance Monad m => Monad (ParsecT s u m) where ...
m
is next-to-last because we want ParsecT s u
to be a 'monad transformer'
class MonadTrans t where
lift :: m a -> t m a
instance MonadTrans (ParsecT s u) where ...
If we put the m
first, this instance wouldn't be possible. There doesn't seem to be any similar reason for the ordering of s
and u
.