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 bturtle Turtle 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.-
turtle Turtle.Format Convert a Format string to a print function that takes zero or more typed arguments and returns a Text string
fork :: MonadManaged managed => IO a -> managed (Async a)turtle Turtle.Prelude Fork a thread, acquiring an Async value
foreignPtrToPtr :: ForeignPtr a -> Ptr aunsafe System.Unsafe No documentation available.
formDataFiles :: FormDataResult a -> [File a]webgear-core WebGear.Core.MIMETypes No documentation available.
formDataParams :: FormDataResult a -> [Param]webgear-core WebGear.Core.MIMETypes No documentation available.
forbidden403 :: Set h Status => h () (With Response '[Status])webgear-core WebGear.Core.Trait.Status Forbidden 403 response
forestGreen :: Color (SRGB 'NonLinear) Word8Color Graphics.Color.Standard.SVG Defined in SVG1.1 as
forestgreen = rgb(34, 139, 34)
Example
>>> import Codec.Picture as JP >>> import Codec.Picture.Png (writePng) >>> let ColorSRGB r g b = forestGreen >>> let img = JP.generateImage (\_ _ -> JP.PixelRGB8 r g b) 200 34 >>> writePng "files/svg/ForestGreen.png" img
forever :: forall (m :: Type -> Type) a b e . Monad m => AutomatonExcept a b m e -> Automaton m a bautomaton Data.Automaton.Trans.Except No documentation available.
-
automaton Data.Stream Execute the stream until it throws an exception, then restart it. One might be tempted to define this function recursively with applyExcept, but this would result in a runtime error, trying to define an infinite state.