Hoogle Search
Within LTS Haskell 24.34 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
formatRealFloatAlt :: RealFloat a => FFFormat -> Maybe Int -> Bool -> a -> Stringghc-internal GHC.Internal.Float No documentation available.
for_ :: Applicative f => Infinite a -> (a -> f ()) -> f Voidinfinite-list Data.List.Infinite Flipped traverse_.
forConcurrently :: (Traversable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m (t b)lifted-async Control.Concurrent.Async.Lifted Generalized version of forConcurrently.
forConcurrently_ :: (Foldable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m ()lifted-async Control.Concurrent.Async.Lifted Generalized version of forConcurrently_.
-
lifted-async Control.Concurrent.Async.Lifted.Safe Generalized version of forConcurrently.
-
lifted-async Control.Concurrent.Async.Lifted.Safe Generalized version of forConcurrently_.
-
massiv Data.Massiv.Array Same as mapIO but with arguments flipped.
forIO_ :: (Load r ix e, MonadUnliftIO m) => Array r ix e -> (e -> m a) -> m ()massiv Data.Massiv.Array Same as mapIO_ but with arguments flipped.
Example
This is the same example as in forM_, with important difference that accumulator ref will be modified concurrently by as many threads as there are capabilities.>>> import Data.Massiv.Array >>> import Data.IORef >>> ref <- newIORef 0 :: IO (IORef Int) >>> forIO_ (range Par (Ix1 0) 1000) $ \ i -> atomicModifyIORef' ref (\v -> (v+i, ())) >>> readIORef ref 499500
-
massiv Data.Massiv.Array Same as mapM except with arguments flipped.
forM_ :: (Source r a, Index ix, Monad m) => Array r ix a -> (a -> m b) -> m ()massiv Data.Massiv.Array Just like mapM_, except with flipped arguments.
Examples
Here is a common way of iterating N times using a for loop in an imperative language with mutation being an obvious side effect:>>> import Data.Massiv.Array as A >>> import Data.IORef >>> ref <- newIORef 0 :: IO (IORef Int) >>> A.forM_ (range Seq (Ix1 0) 1000) $ \ i -> modifyIORef' ref (+i) >>> readIORef ref 499500