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.
forever :: Applicative f => f a -> f bprotolude Protolude.Monad 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.forceTag :: DeriveType -> Boolsafecopy Data.SafeCopy.Internal No documentation available.
formatRealFloatAltB :: RealFloat a => FPFormat -> Maybe Int -> Bool -> a -> Buildertext-show TextShow.Data.Floating Converts a RealFloat value to a Builder, specifying if a decimal point should always be shown. Since: 2
formatRealFloatB :: RealFloat a => FPFormat -> Maybe Int -> a -> Buildertext-show TextShow.Data.Floating Like formatRealFloatAltB, except that the decimal is only shown for arguments whose absolute value is between 0.1 and 9,999,999. Since: 2
foreignToTH :: DForeign -> Foreignth-desugar Language.Haskell.TH.Desugar.Sweeten No documentation available.
forward :: (HasCallStack, WebDriver wd) => wd ()webdriver Test.WebDriver.Commands Navigate forward in the browser history.
formatHtfStack :: HtfStack -> StringHTF Test.Framework.TestInterface Formats a stack trace.
-
HaXml Text.XML.HaXml.Posn Just used to strictify the internal values of a position, to avoid space leaks.
forceEither :: Show e => Either e a -> aMissingH Data.Either.Utils Pulls a Right value out of an Either value. If the Either value is Left, raises an exception with "error".
forceEitherMsg :: Show e => String -> Either e a -> aMissingH Data.Either.Utils Like forceEither, but can raise a specific message with the error.