有很多关于Applicative 不需要自己的变压器类的讨论,如下所示:
class AppTrans t where
    liftA :: Applicative f => f a -> t f a
但我可以定义似乎不是应用程序组合的应用变换器!例如,有效的流:
data MStream f a = MStream (f (a, MStream f a))
提升只是在每一步都执行副作用:
instance AppTrans MStream where
    liftA action = MStream $ (,) <$> action <*> pure (liftA action)
如果f是一个应用程序,那么MStream f也是如此:
instance Functor f => Functor (MStream f) where
    fmap fun (MStream stream) = MStream $ (\(a, as) -> (fun a, fmap fun as)) <$> …