File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
dunai/src/Data/MonadicStreamFunction/Instances Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import Control.Arrow
1111
1212#if !MIN_VERSION_base(4,8,0)
1313import Data.Traversable (traverse )
14- import Control.Applicative (pure )
1514#endif
1615
1716-- profunctors
@@ -35,11 +34,11 @@ instance Monad m => Strong (MSF m) where
3534instance Monad m => Profunctor (MSF m ) where
3635 dimap l r p = arr l >>> p >>> arr r
3736
38- instance (Monad m ) => Traversing (MSF m ) where
37+ instance (Functor m , Applicative m , Monad m ) => Traversing (MSF m ) where
3938 traverse' (MSF msf) =
4039 let unMSF' x = StateT (\ (MSF m) -> m x)
4140 in MSF $ \ xs -> do
4241 -- `StateT (MSF m a b) m a` is isomorphic to `a -> m (b, MSF m a b)`, and
4342 -- `StateT`'s Applicative instance is needed for writing this traversal
4443 (fb, msf') <- runStateT (traverse unMSF' xs) (MSF msf)
45- pure (fb, traverse' msf')
44+ return (fb, traverse' msf')
You can’t perform that action at this time.
0 commit comments