Hoogle Search

Within LTS Haskell 24.48 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. forEach :: forall a b (es :: Effects) r . (forall (e1 :: Effects) . () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r

    bluefin Bluefin.Coroutine

    Apply an effectful function to each element yielded to the stream.

    >>> runPureEff $ yieldToList $ \y -> do
    for_ [0 .. 4] $ \i -> do
    yield y i
    yield y (i * 10)
    ([0, 0, 1, 10, 2, 20, 3, 30], ())
    

  2. forEach :: forall a b (es :: Effects) r . (forall (e1 :: Effects) . () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r

    bluefin Bluefin.Stream

    Apply an effectful function to each element yielded to the stream.

    >>> runPureEff $ yieldToList $ \y -> do
    for_ [0 .. 4] $ \i -> do
    yield y i
    yield y (i * 10)
    ([0, 0, 1, 10, 2, 20, 3, 30], ())
    

  3. force :: (Cased Mixed b -> c) -> b -> c

    cased Data.Cased

    No documentation available.

  4. forConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)

    classy-prelude-yesod ClassyPrelude.Yesod

    Similar to mapConcurrently but with arguments flipped

  5. forConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Similar to mapConcurrently_ but with arguments flipped

  6. forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)

    classy-prelude-yesod ClassyPrelude.Yesod

    forM is mapM with its arguments flipped. For a version that ignores the results see forM_.

  7. forM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Synonym for oforM_

  8. for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Synonym for ofor_

  9. force :: NFData a => a -> a

    classy-prelude-yesod ClassyPrelude.Yesod

    a variant of deepseq that is useful in some circumstances:

    force x = x `deepseq` x
    
    force x fully evaluates x, and then returns it. Note that force x only performs evaluation when the value of force x itself is demanded, so essentially it turns shallow evaluation into deep evaluation. force can be conveniently used in combination with ViewPatterns:
    {-# LANGUAGE BangPatterns, ViewPatterns #-}
    import Control.DeepSeq
    
    someFun :: ComplexData -> SomeResult
    someFun (force -> !arg) = {- 'arg' will be fully evaluated -}
    
    Another useful application is to combine force with evaluate in order to force deep evaluation relative to other IO operations:
    import Control.Exception (evaluate)
    import Control.DeepSeq
    
    main = do
    result <- evaluate $ force $ pureComputation
    {- 'result' will be fully evaluated at this point -}
    return ()
    
    Finally, here's an exception safe variant of the readFile' example:
    readFile' :: FilePath -> IO String
    readFile' fn = bracket (openFile fn ReadMode) hClose $ \h ->
    evaluate . force =<< hGetContents h
    

  10. foreignAttrs :: ForeignDef -> ![Attr]

    classy-prelude-yesod ClassyPrelude.Yesod

    No documentation available.

Page 201 of many | Previous | Next