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.
forDamageEffect :: Effect -> BoolLambdaHack Game.LambdaHack.Content.ItemKind Whether a non-nested effect always applies raw damage.
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)LambdaHack Game.LambdaHack.Core.Prelude forM is mapM with its arguments flipped. For a version that ignores the results see forM_.
forM_ :: (Foldable t, Monad m) => t a -> (a -> m ()) -> m ()LambdaHack Game.LambdaHack.Core.Prelude This has a more specific type (unit result) than normally, to catch errors.
forever :: Applicative f => f a -> f bLambdaHack Game.LambdaHack.Core.Prelude 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.fork :: ParIVar ivar m => m () -> m ()abstract-par Control.Monad.Par.Class Forks a computation to happen in parallel. The forked computation may exchange values with other computations using IVars.
formatPointer :: Pointer -> Textaeson-diff Data.Aeson.Pointer Format a Pointer as described in RFC 6901.
>>> formatPointer (Pointer []) "" >>> formatPointer (Pointer [OKey ""]) "/" >>> formatPointer (Pointer [OKey " "]) "/ " >>> formatPointer (Pointer [OKey "foo"]) "/foo" >>> formatPointer (Pointer [OKey "foo", AKey 0]) "/foo/0" >>> formatPointer (Pointer [OKey "a/b"]) "/a~1b" >>> formatPointer (Pointer [OKey "c%d"]) "/c%d" >>> formatPointer (Pointer [OKey "e^f"]) "/e^f" >>> formatPointer (Pointer [OKey "g|h"]) "/g|h" >>> formatPointer (Pointer [OKey "i\\j"]) "/i\\j" >>> formatPointer (Pointer [OKey "k\"l"]) "/k\"l" >>> formatPointer (Pointer [OKey "m~n"]) "/m~0n"
-
algebraic-graphs Algebra.Graph The forest graph constructed from a given Forest data structure. Complexity: O(F) time, memory and size, where F is the size of the given forest (i.e. the number of vertices in the forest).
forest [] == empty forest [x] == tree x forest [Node 1 [Node 2 [], Node 3 []], Node 4 [Node 5 []]] == edges [(1,2), (1,3), (4,5)] forest == overlays . map tree
forest :: Forest Int -> AdjacencyIntMapalgebraic-graphs Algebra.Graph.AdjacencyIntMap The forest graph constructed from a given Forest data structure. Complexity: O((n + m) * log(n)) time and O(n + m) memory.
forest [] == empty forest [x] == tree x forest [Node 1 [Node 2 [], Node 3 []], Node 4 [Node 5 []]] == edges [(1,2), (1,3), (4,5)] forest == overlays . map tree
forest :: Ord a => Forest a -> AdjacencyMap aalgebraic-graphs Algebra.Graph.AdjacencyMap The forest graph constructed from a given Forest data structure. Complexity: O((n + m) * log(n)) time and O(n + m) memory.
forest [] == empty forest [x] == tree x forest [Node 1 [Node 2 [], Node 3 []], Node 4 [Node 5 []]] == edges [(1,2), (1,3), (4,5)] forest == overlays . map tree
forest :: Graph g => Forest (Vertex g) -> galgebraic-graphs Algebra.Graph.Class The forest graph constructed from a given Forest data structure. Complexity: O(F) time, memory and size, where F is the size of the given forest (i.e. the number of vertices in the forest).
forest [] == empty forest [x] == tree x forest [Node 1 [Node 2 [], Node 3 []], Node 4 [Node 5 []]] == edges [(1,2), (1,3), (4,5)] forest == overlays . map tree