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. forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()

    base-compat-batteries Control.Monad.Compat

    forM_ is mapM_ with its arguments flipped. For a version that doesn't ignore the results see forM. forM_ is just like for_, but specialised to monadic actions.

  2. forever :: Applicative f => f a -> f b

    base-compat-batteries Control.Monad.Compat

    Repeat an action indefinitely.

    Examples

    A common use of forever is to process input from network sockets, Handles, and channels (e.g. MVar and Chan). For example, here is how we might implement an echo server, using forever both to listen for client connections on a network socket and to echo client input on client connection handles:
    echoServer :: Socket -> IO ()
    echoServer socket = forever $ do
    client <- accept socket
    forkFinally (echo client) (\_ -> hClose client)
    where
    echo :: Handle -> IO ()
    echo client = forever $
    hGetLine client >>= hPutStrLn client
    
    Note that "forever" isn't necessarily non-terminating. If the action is in a MonadPlus and short-circuits after some number of iterations. then forever actually returns mzero, effectively short-circuiting its caller.

  3. package formatting

    Combinator-based type-safe formatting (like printf() or FORMAT) Combinator-based type-safe formatting (like printf() or FORMAT), modelled from the HoleyMonoids package. See the README at https://github.com/AJChapman/formatting#readme for more info.

  4. format :: Format Text a -> a

    formatting Formatting

    Run the formatter and return a lazy Text value.

  5. formatToString :: Format String a -> a

    formatting Formatting

    Run the formatter and return a list of characters.

  6. formatted :: FromBuilder t => (t -> o) -> Format o a -> a

    formatting Formatting

    Makes it easy to add formatting to any api that is expecting a builder, a strict or lazy text, or a string. It is essentially (flip runFormat), but with a more generous type due to the typeclass. For example: >>> formatted TL.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted T.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted (id TL.Text) ("x is: " % int % "n") 7 "x is: 7n" >>> formatted (id T.Text) ("x is: " % int % "n") 7 "x is: 7n"

  7. formatted :: FromBuilder t => (t -> o) -> Format o a -> a

    formatting Formatting.FromBuilder

    Makes it easy to add formatting to any api that is expecting a builder, a strict or lazy text, or a string. It is essentially (flip runFormat), but with a more generous type due to the typeclass. For example: >>> formatted TL.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted T.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted (id TL.Text) ("x is: " % int % "n") 7 "x is: 7n" >>> formatted (id T.Text) ("x is: " % int % "n") 7 "x is: 7n"

  8. format :: Format Text a -> a

    formatting Formatting.Internal

    Run the formatter and return a lazy Text value.

  9. formatToString :: Format String a -> a

    formatting Formatting.Internal

    Run the formatter and return a list of characters.

  10. formatHeader :: Header -> String

    hspec-wai Test.Hspec.Wai.Internal

    No documentation available.

Page 54 of many | Previous | Next