File tree 3 files changed +10
-10
lines changed
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -760,6 +760,6 @@ transpose ((x : xs) : xss) =
760
760
-- ------------------------------------------------------------------------------
761
761
762
762
-- | Perform a fold using a monadic step function.
763
- foldM :: forall m a b . Monad m => (a -> b -> m a ) -> a -> List b -> m a
764
- foldM _ a Nil = pure a
765
- foldM f a (b : bs ) = f a b >>= \a ' -> foldM f a' bs
763
+ foldM :: forall m a b . Monad m => (b -> a -> m b ) -> b -> List a -> m b
764
+ foldM _ b Nil = pure b
765
+ foldM f b (a : as ) = f b a >>= \b ' -> foldM f b' as
Original file line number Diff line number Diff line change @@ -727,12 +727,12 @@ transpose xs =
727
727
-- ------------------------------------------------------------------------------
728
728
729
729
-- | Perform a fold using a monadic step function.
730
- foldM :: forall m a b . Monad m => (a -> b -> m a ) -> a -> List b -> m a
731
- foldM f a xs =
730
+ foldM :: forall m a b . Monad m => (b -> a -> m b ) -> b -> List a -> m b
731
+ foldM f b xs =
732
732
case uncons xs of
733
- Nothing -> pure a
734
- Just { head: b , tail: bs } ->
735
- f a b >>= \a ' -> foldM f a' bs
733
+ Nothing -> pure b
734
+ Just { head: a , tail: as } ->
735
+ f b a >>= \b ' -> foldM f b' as
736
736
737
737
-- | Perform a right fold lazily
738
738
foldrLazy :: forall a b . Z.Lazy b => (a -> b -> b ) -> b -> List a -> b
Original file line number Diff line number Diff line change @@ -299,5 +299,5 @@ zip = zipWith Tuple
299
299
unzip :: forall a b . NonEmptyList (Tuple a b ) -> Tuple (NonEmptyList a ) (NonEmptyList b )
300
300
unzip ts = Tuple (map fst ts) (map snd ts)
301
301
302
- foldM :: forall m a b . Monad m => (a -> b -> m a ) -> a -> NonEmptyList b -> m a
303
- foldM f a (NonEmptyList (b :| bs )) = f a b >>= \a ' -> L .foldM f a' bs
302
+ foldM :: forall m a b . Monad m => (b -> a -> m b ) -> b -> NonEmptyList a -> m b
303
+ foldM f b (NonEmptyList (a :| as )) = f b a >>= \b ' -> L .foldM f b' as
You can’t perform that action at this time.
0 commit comments