Added another helper function, seqPair, to the Utils module

This commit is contained in:
Neil Brown 2007-11-09 01:23:46 +00:00
parent 8f96af8bb8
commit 47f5e36f9c

View File

@ -123,3 +123,9 @@ applyAll x = map (\f -> f x)
-- | Like concat applied after mapM (or the monadic version of concatMap).
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
concatMapM f x = mapM f x >>* concat
-- | Like the monadic sequence function, but for pairs instead of lists.
seqPair :: Monad m => (m a, m b) -> m (a,b)
seqPair (x,y) = do x' <- x
y' <- y
return (x',y')