for package:Cabal-syntax

for is traverse with its arguments flipped. For a version that ignores the results see for_.
for_ is traverse_ with its arguments flipped. For a version that doesn't ignore the results see for. This is forM_ generalised to Applicative actions. for_ is just like forM_, but generalised to Applicative actions.

Examples

Basic usage:
>>> for_ [1..4] print
1
2
3
4
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. force can be conveniently used in combination with ViewPatterns:
{-# LANGUAGE BangPatterns, ViewPatterns #-}
import Control.DeepSeq

someFun :: ComplexData -> SomeResult
someFun (force -> !arg) = {- 'arg' will be fully evaluated -}
Another useful application is to combine force with evaluate in order to force deep evaluation relative to other IO operations:
import Control.Exception (evaluate)
import Control.DeepSeq

main = do
result <- evaluate $ force $ pureComputation
{- 'result' will be fully evaluated at this point -}
return ()
Finally, here's an exception safe variant of the readFile' example:
readFile' :: FilePath -> IO String
readFile' fn = bracket (openFile fn ReadMode) hClose $ \h ->
evaluate . force =<< hGetContents h
Build information for this foreign library.
Is the foreign library shared?
(Windows-specific) module definition files This is a list rather than a maybe field so that we can flatten the condition trees (for instance, when creating an sdist)
Modules defined by a foreign library.
Name of the foreign library
What options apply to this foreign library (e.g., are we merging in all foreign dependencies.)
What kind of foreign library is this (static or dynamic).
Get a version number for a foreign library. If we're on Linux, and a Linux version is specified, use that. If we're on Linux, and libtool-style version-info is specified, translate that field into appropriate version numbers. Otherwise, this feature is unsupported so we don't return any version data.
Libtool-style version-info data to compute library version. Refer to the libtool documentation on the current:revision:age versioning scheme.
Linux library version