@@ -58,7 +58,8 @@ sequence = mapM id
5858 forward each element of the result.
5959-}
6060mapFoldable :: forall a b m t r
61- . (Monad m , Foldable t )
61+ . Monad m
62+ => Foldable t
6263 => (a -> t b )
6364 -> Pipe a b m r
6465mapFoldable f = for cat (\a -> each (f a))
@@ -117,7 +118,7 @@ drop = loop
117118 where
118119 loop 0 = cat
119120 loop n = do
120- await
121+ _ <- await
121122 loop (n-1 )
122123
123124{-| dropWhile discards values going downstream until one violates the
@@ -135,7 +136,7 @@ dropWhile predicate = go
135136 cat
136137
137138-- | Flatten all 'Foldable' elements flowing downstream
138- concat :: forall a m f r . ( Monad m , Foldable f ) => Pipe (f a ) a m r
139+ concat :: forall a m f r . Monad m => Foldable f => Pipe (f a ) a m r
139140concat = for cat each
140141
141142-- | Outputs the indices of all elements that satisfied the predicate
@@ -183,7 +184,7 @@ chain f = for cat $ \a -> do
183184 yield a
184185
185186-- | Convert `Show`able values to `String`s
186- show :: forall a m r . ( Monad m , Show a ) => Pipe a String m r
187+ show :: forall a m r . Monad m => Show a => Pipe a String m r
187188show = map Prelude .show
188189
189190-- | Evaluate all values flowing downstream to WHNF
@@ -270,11 +271,11 @@ or :: forall m. Monad m => Producer Boolean m Unit -> m Boolean
270271or = any id
271272
272273-- | elem returns `True` if p has an element equal to a, `False` otherwise
273- elem :: forall a m . ( Monad m , Eq a ) => a -> Producer a m Unit -> m Boolean
274+ elem :: forall a m . Monad m => Eq a => a -> Producer a m Unit -> m Boolean
274275elem a = any (a == _)
275276
276277-- | notElem returns `False` if p has an element equal to a, `True` otherwise
277- notElem :: forall a m . ( Monad m , Eq a ) => a -> Producer a m Unit -> m Boolean
278+ notElem :: forall a m . Monad m => Eq a => a -> Producer a m Unit -> m Boolean
278279notElem a = all (a /= _)
279280
280281-- | Find the first element of a `Producer` that satisfies the predicate
@@ -318,7 +319,7 @@ length :: forall a m. Monad m => Producer a m Unit -> m Int
318319length = fold (\n _ -> n + 1 ) 0 id
319320
320321-- | Find the maximum element of a `Producer`
321- maximum :: forall a m . ( Monad m , Ord a ) => Producer a m Unit -> m (Maybe a )
322+ maximum :: forall a m . Monad m => Ord a => Producer a m Unit -> m (Maybe a )
322323maximum = fold step Nothing id
323324 where
324325 step x a = Just $ case x of
@@ -328,7 +329,7 @@ maximum = fold step Nothing id
328329 | otherwise = y
329330
330331-- | Find the minimum element of a `Producer`
331- minimum :: forall a m . ( Monad m , Ord a ) => Producer a m Unit -> m (Maybe a )
332+ minimum :: forall a m . Monad m => Ord a => Producer a m Unit -> m (Maybe a )
332333minimum = fold step Nothing id
333334 where
334335 step x a = Just $ case x of
0 commit comments