Fix: Add missing (<*>) implementation for StateT
While evaluating
Control.Monad.Trans.State> evalState ((\x -> (x ++ " world")) <$> get) "hello"
"hello world"
works correctly, evaluating
Control.Monad.Trans.State> evalState (pure (\x -> (x ++ " world")) <*> get) "hello"
currently causes the program to loop (due to an infinite recursion between the default definition of (<*>)
and liftA2
). This branch fixes this oversight by adding the corresponding (<*>)
implementation to the Applicative
instance of StateT
.