Skip to content

Commit c85171f

Browse files
committed
appease our forefathers
1 parent e94474e commit c85171f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

dunai/src/Data/MonadicStreamFunction/Instances/Profunctor.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Control.Arrow
1111

1212
#if !MIN_VERSION_base(4,8,0)
1313
import Data.Traversable (traverse)
14-
import Control.Applicative (pure)
1514
#endif
1615

1716
-- profunctors
@@ -35,11 +34,11 @@ instance Monad m => Strong (MSF m) where
3534
instance 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')

0 commit comments

Comments
 (0)