Help | Examples | About | API | Blog | Hackage | Haskell
Concurrently search more than 6250 packages and more than 585655 functions! (Index generated: Tue, 25 Mar 2014 16:41:17 UTC )
Found 4991 functions, 167 packages and 107 completions.
collection of crypto hashes, fast, pure and practical
A collection of crypto hashes, with a practical incremental and one-pass, pure APIs, with performance close to the fastest implementations available in other languages. The implementations are made in C with a haskell FFI wrapper that hide the C implementation. Simple examples using the unified API: import Crypto.Hash sha1 :: ByteString -> Digest SHA1 sha1 = hash hexSha3_512 :: ByteString -> String hexSha3_512 bs = show (hash bs :: Digest SHA3_512) Simple examples using the module API: import qualified Crypto.Hash.SHA1 as SHA1 main = putStrLn $ show $ SHA1.hash (Data.ByteString.pack [0..255]) import qualified Crypto.Hash.SHA3 as SHA3 main = putStrLn $ show $ digest where digest = SHA3.finalize ctx ctx = foldl' SHA3.update iCtx (map Data.ByteString.pack [ [1,2,3], [4,5,6] ] iCtx = SHA3.init 224 No changelog available
Vincent Hanquez <vincent@snarc.org>
Command line argument processing
This library provides an easy way to define command line parsers. Most users will want to use the System.Console.CmdArgs.Implicit module, whose documentation contains an example. System.Console.CmdArgs.Explicit provides a way to write command line parsers for both single mode programs (most programs) and multiple mode programs (e.g. darcs or cabal). Parsers are defined by constructing a data structure. System.Console.CmdArgs.Implicit provides a way to concisely define command line parsers, up to three times shorter than getopt. These parsers are translated into the Explicit data type. System.Console.CmdArgs.GetOpt provides a wrapper allowing compatiblity with existing getopt parsers, mapping to the Explicit data type. For a general reference on what command line flags are commonly used, see http://www.faqs.org/docs/artu/ch10s05.html . No changelog available
Neil Mitchell <ndmitchell@gmail.com>
A raw binding for the OpenGL graphics system
OpenGLRaw is a raw Haskell binding for the OpenGL 3.2 graphics system and lots of OpenGL extensions. It is basically a 1:1 mapping of OpenGL's C API, intended as a basis for a nicer interface. OpenGLRaw offers access to all necessary functions, tokens and types plus a general facility for loading extension entries. The module hierarchy closely mirrors the naming structure of the OpenGL extensions, making it easy to find the right module to import. All API entries are loaded dynamically, so no special C header files are needed for building this package. If an API entry is not found at runtime, a userError is thrown. OpenGL is the industry's most widely used and supported 2D and 3D graphics application programming interface (API), incorporating a broad set of rendering, texture mapping, special effects, and other powerful visualization functions. For more information about OpenGL and its various extensions, please see http://www.opengl.org/ and http://www.opengl.org/registry/ . No changelog available
Vector & affine spaces, linear maps, and derivatives
vector-space provides classes and generic operations for vector spaces and affine spaces. It also defines a type of infinite towers of generalized derivatives. A generalized derivative is a linear transformation rather than one of the common concrete representations (scalars, vectors, matrices, ...). Warning : this package depends on type families working fairly well, requiring GHC version at least 6.9. Project wiki page: http://haskell.org/haskellwiki/vector-space © 2008-2012 by Conal Elliott; BSD3 license. No changelog available
Conal Elliott
A binding for the OpenGL graphics system
A Haskell binding for the OpenGL graphics system (GL, version 4.4) and its accompanying utility library (GLU, version 1.3). OpenGL is the industry's most widely used and supported 2D and 3D graphics application programming interface (API), incorporating a broad set of rendering, texture mapping, special effects, and other powerful visualization functions. For more information about OpenGL and its various extensions, please see http://www.opengl.org/ and http://www.opengl.org/registry/ . No changelog available
A raw binding for the OpenGL graphics system
GLURaw is a raw Haskell binding for the GLU 1.3 OpenGL utility library. It is basically a 1:1 mapping of GLU's C API, intended as a basis for a nicer interface. OpenGL is the industry's most widely used and supported 2D and 3D graphics application programming interface (API), incorporating a broad set of rendering, texture mapping, special effects, and other powerful visualization functions. For more information about OpenGL and its various extensions, please see http://www.opengl.org/ and http://www.opengl.org/registry/ . No changelog available
Run IO operations asynchronously and wait for their results
This package provides a higher-level interface over threads, in which an Async a is a concurrent thread that will eventually deliver a value of type a . The package provides ways to create Async computations, wait for their results, and cancel them. Using Async is safer than using threads in two ways: When waiting for a thread to return a result, if the thread dies with an exception then the caller must either re-throw the exception ( wait ) or handle it ( waitCatch ); the exception cannot be ignored. The API makes it possible to build a tree of threads that are automatically killed when their parent dies (see withAsync ). Changes in 2.0.1.5: Bump base dependencies for GHC 7.8 Changes in 2.0.1.4: Bump base dependency of test suite Changes in 2.0.1.3: Bump base dependency to allow 4.6 Changes in 2.0.1.2: Bump stm dependency to 2.4 Changes in 2.0.1.1: Safe Haskell support: Control.Concurrent.Async is now Trustworthy Changes in 2.0.1.0: Added a Functor instance for Async Added asyncBound , asyncOn , asyncWithUnmask , asyncOnWithUnmask , withAsyncBound , withAsyncOn , withAsyncWithUnmask , withAsyncOnWithUnmask . Added mapConcurrently Added Concurrently (with Applicative and Alternative instances) No changelog available
Simon Marlow
FFI domain specific language, on top of hsc2hs.
This is a set of macros to be used when writing Haskell FFI. They were designed to be able to fully describe C interfaces, so that hsc2hs can extract from them all Haskell code needed to mimic such interfaces. All Haskell names used are automatically derived from C names, structures are mapped to Haskell instances of Storable, and there are also macros you can use with C code to help write bindings to inline functions or macro functions. Documentation is available at package homepage: https://github.com/jwiegley/bindings-dsl/wiki The extra module Bindings.Utilities will contain tools that may be convenient when working with FFI. Changelog
Maurício C. Antunes
A simple directory-like tree datatype, with useful IO functions
A simple directory-like tree datatype, with useful IO functions and Foldable and Traversable instance Provides a simple data structure mirroring a directory tree on the filesystem, as well as useful functions for reading and writing file and directory structures in the IO monad. Importing the library and optional (useful) Foldable and Traverable libraries: import System.Directory.Tree import qualified Data.Foldable as F import qualified Data.Traversable as T Write a hand-made directory tree of textfiles (strings) to the disk. Simulates creating a new user Tux's home directory on a unix machine: writeDirectory$ "/home" :/ Dir "Tux" [File "README" "Welcome!"] read a directory by opening all the files at a filepath with readFile, returning an 'AnchoredDirTree String' (d2). Then check for any IO failures: do (base :/ d2) <- readDirectory "../parent_dir/dir2/" let failed = anyFailed d2 if failed then ... Use Foldable instance function to concat a directory dir of text files into a single file under the same directory: do (b :/ dt) <- readDirectory dir let f = F.concat dt return$ b :/ File "ALL_TEXT" f Open all the files in the current directory as lazy bytestrings, ignoring the base path in Anchored wrapper: import qualified Data.ByteString.Lazy as B do (_ :/ dTree) <- readDirectoryWith B.readFile "./" This version also offers an experimental function readDirectoryWithL that does lazy directory IO, allowing you to treat the returned DirTree as if it were a normal lazily-generated data structure. For example, the following does only the amount of IO necessary to list the file names of the children of the root directory, similar to ls / : do d <- readDirectoryWithL readFile "/" mapM_ (putStrLn . name) $ contents $ free d Any ideas or suggestions for improvements are most welcome :-) CHANGES : from 0.10.1 added records for AnchoredDirTree: anchor , dirTree free deprecated in favor of dirTree added a new function dropTo implemented lenses compatible with lens package No changelog available
Brandon Simmons
Mutable hash tables in the ST monad
This package provides a couple of different implementations of mutable hash tables in the ST monad, as well as a typeclass abstracting their common operations, and a set of wrappers to use the hash tables in the IO monad. QUICK START : documentation for the hash table operations is provided in the Data.HashTable.Class module, and the IO wrappers (which most users will probably prefer) are located in the Data.HashTable.IO module. This package currently contains three hash table implementations: 1. Data.HashTable.ST.Basic contains a basic open-addressing hash table using linear probing as the collision strategy. On a pure speed basis it should currently be the fastest available Haskell hash table implementation for lookups, although it has a higher memory overhead than the other tables and can suffer from long delays when the table is resized because all of the elements in the table need to be rehashed. 2. Data.HashTable.ST.Cuckoo contains an implementation of "cuckoo hashing" as introduced by Pagh and Rodler in 2001 (see http://en.wikipedia.org/wiki/Cuckoo_hashing ). Cuckoo hashing has worst-case O(1) lookups and can reach a high "load factor", in which the table can perform acceptably well even when more than 90% full. Randomized testing shows this implementation of cuckoo hashing to be slightly faster on insert and slightly slower on lookup than Data.Hashtable.ST.Basic , while being more space efficient by about a half-word per key-value mapping. Cuckoo hashing, like the basic hash table implementation using linear probing, can suffer from long delays when the table is resized. 3. Data.HashTable.ST.Linear contains a linear hash table (see http://en.wikipedia.org/wiki/Linear_hashing ), which trades some insert and lookup performance for higher space efficiency and much shorter delays when expanding the table. In most cases, benchmarks show this table to be currently slightly faster than Data.HashTable from the Haskell base library. It is recommended to create a concrete type alias in your code when using this package, i.e.: import qualified Data.HashTable.IO as H type HashTable k v = H.BasicHashTable k v foo :: IO (HashTable Int Int) foo = do ht <- H.new H.insert ht 1 1 return ht Firstly, this makes it easy to switch to a different hash table implementation, and secondly, using a concrete type rather than leaving your functions abstract in the HashTable class should allow GHC to optimize away the typeclass dictionaries. This package accepts a couple of different cabal flags: unsafe-tricks , default ON . If this flag is enabled, we use some unsafe GHC-specific tricks to save indirections (namely unsafeCoerce# and reallyUnsafePtrEquality# . These techniques rely on assumptions about the behaviour of the GHC runtime system and, although they've been tested and should be safe under normal conditions, are slightly dangerous. Caveat emptor. In particular, these techniques are incompatible with HPC code coverage reports. sse41 , default OFF . If this flag is enabled, we use some SSE 4.1 instructions (see http://en.wikipedia.org/wiki/SSE4 , first available on Intel Core 2 processors) to speed up cache-line searches for cuckoo hashing. bounds-checking , default OFF . If this flag is enabled, array accesses are bounds-checked. debug , default OFF . If turned on, we'll rudely spew debug output to stdout. portable , default OFF . If this flag is enabled, we use only pure Haskell code and try not to use unportable GHC extensions. Turning this flag on forces unsafe-tricks and sse41 OFF . This package has been tested with GHC 7.0.3, on: a MacBook Pro running Snow Leopard with an Intel Core i5 processor, running GHC 7.0.3 in 64-bit mode. an Arch Linux desktop with an AMD Phenom II X4 940 quad-core processor. a MacBook Pro running Snow Leopard with an Intel Core 2 Duo processor, running GHC 6.12.3 in 32-bit mode. Please send bug reports to https://github.com/gregorycollins/hashtables/issues . No changelog available
Gregory Collins
Prelude.map:: (a -> b) -> [a] -> [b]
base

map f xs is the list obtained by applying f to each element of xs, i.e.,

 map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
 map f [x1, x2, ...] == [f x1, f x2, ...]
Source
Prelude.concatMap:: (a -> [b]) -> [a] -> [b]
base

Map a function over a list and concatenate the results.

Source
Data.Map.Map:: module
containers

Note: You should use Data.Map.Strict instead of this module if:

  • You will eventually need all the values stored.
  • The stored values don't represent large virtual data structures to be lazily computed.

An efficient implementation of ordered maps from keys to values (dictionaries).

These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.

  import qualified Data.Map as Map

The implementation of Map is based on size balanced binary trees (or trees of bounded balance) as described by:

  • Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, http://www.swiss.ai.mit.edu/~adams/BB/.
  • J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", SIAM journal of computing 2(1), March 1973.

Note that the implementation is left-biased -- the elements of a first argument are always preferred to the second, for example in union or insert.

Operation comments contain the operation time complexity in the Big-O notation (http://en.wikipedia.org/wiki/Big_O_notation).

Source
Data.List.map:: (a -> b) -> [a] -> [b]
base

map f xs is the list obtained by applying f to each element of xs, i.e.,

 map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
 map f [x1, x2, ...] == [f x1, f x2, ...]
Source
Data.Map.Strict.map:: (a -> b) -> Map k a -> Map k b
containers

O(n). Map a function over all values in the map.

 map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]
Source
Data.Map.Lazy.map:: (a -> b) -> Map k a -> Map k b
containers

O(n). Map a function over all values in the map.

 map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]
Source
Data.ByteString.map:: (Word8 -> Word8) -> ByteString -> ByteString
bytestring

O(n) map f xs is the ByteString obtained by applying f to each element of xs.

Source
Prelude.map:: (a -> b) -> [a] -> [b]
fay-base
No description.
Source
Data.Text.map:: (Char -> Char) -> Text -> Text
text

O(n) map f t is the Text obtained by applying f to each element of t. Subject to fusion. Performs replacement on invalid scalar values.

Source
Data.Set.map:: (a -> b) -> Set a -> Set b
containers
No description.
Source
Powered by Haskell, HXT, Snap, and
Please send any feedback to hayoo@holumbus.org