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.

  1. formatRealFloatAlt :: RealFloat a => FFFormat -> Maybe Int -> Bool -> a -> String

    ghc-internal GHC.Internal.Float

    No documentation available.

  2. for_ :: Applicative f => Infinite a -> (a -> f ()) -> f Void

    infinite-list Data.List.Infinite

    Flipped traverse_.

  3. forConcurrently :: (Traversable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m (t b)

    lifted-async Control.Concurrent.Async.Lifted

    Generalized version of forConcurrently.

  4. forConcurrently_ :: (Foldable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m ()

    lifted-async Control.Concurrent.Async.Lifted

    Generalized version of forConcurrently_.

  5. forConcurrently :: (Traversable t, MonadBaseControl IO m, Forall (Pure m)) => t a -> (a -> m b) -> m (t b)

    lifted-async Control.Concurrent.Async.Lifted.Safe

    Generalized version of forConcurrently.

  6. forConcurrently_ :: (Foldable t, MonadBaseControl IO m, Forall (Pure m)) => t a -> (a -> m b) -> m ()

    lifted-async Control.Concurrent.Async.Lifted.Safe

    Generalized version of forConcurrently_.

  7. forIO :: forall r ix b r' a m . (Size r', Load r' ix a, Manifest r b, MonadUnliftIO m) => Array r' ix a -> (a -> m b) -> m (Array r ix b)

    massiv Data.Massiv.Array

    Same as mapIO but with arguments flipped.

  8. 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
    

  9. forM :: forall r ix b r' a m . (Source r' a, Manifest r b, Index ix, Monad m) => Array r' ix a -> (a -> m b) -> m (Array r ix b)

    massiv Data.Massiv.Array

    Same as mapM except with arguments flipped.

  10. 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
    

Page 61 of many | Previous | Next