forever act repeats the action infinitely.
Sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread.
The new thread will be a lightweight thread; if you want to use a foreign library that uses thread-local storage, use Control.Concurrent.forkOS instead.
GHC note: the new thread inherits the masked state of the parent (see Control.Exception.mask).
The newly created thread has an exception handler that discards the exceptions BlockedIndefinitelyOnMVar, BlockedIndefinitelyOnSTM, and ThreadKilled, and passes all other exceptions to the uncaught exception handler (see setUncaughtExceptionHandler).
Like forkIO, but the child thread is created with asynchronous exceptions unmasked (see Control.Exception.mask).
Like forkIO, this sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread.
However, forkOS creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent#boundthreads).
Using forkOS instead of forkIO makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use forkOS instead of forkIO to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the -threaded option when linking your program, and to make sure the foreign import is not marked unsafe.
forM is mapM with its arguments flipped.
Plus, OpT, Yoneda, CoYoneda, Free, Cofree, Density, Codensity, CoT, CodensityAsk, Initialize, Finalize, Decompose, Recompose
Explicit universal quantification: uses an explicitly given test case generator.
This is a GHC/Hugs extension, and as such is not portable Haskell 98/2010. It is only a reserved word within types.
Type variables in a Haskell type expression are all assumed to be universally quantified; there is no explicit syntax for universal quantification, in standard Haskell 98/2010. For example, the type expressiona -> a denotes the type forall a. a ->a.
For clarity, however, we often write quantification explicitly when discussing the types of Haskell programs. When we write an explicitly quantified type, the scope of the forall extends as far to the right as possible; for example,
> forall a. a -> a
> forall a. (a -> a)
> GHC introduces a forall keyword, allowing explicit quantification, for example, to encode
> data Foo = forall a. MkFoo a (a -> Bool)
> | Nil
> MkFoo :: forall a. a -> (a -> Bool) -> Foo
> Nil :: Foo
> [MkFoo 3 even, MkFoo 'c' isUpper] :: [Foo]
Like forAll, but tries to shrink the argument for failing test cases.
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.
Simulation engine for doing simple force-based layout, e.g. for trees or graphs. See the diagrams-contrib package for usage examples.
Show more results