Ix
The Ix class is used to map a contiguous subrange of values in type onto integers. It is used primarily for array indexing (see the array package).
The Ix class is used to map a contiguous subrange of values in a type onto integers. It is used primarily for array indexing (see the array package).
The first argument (l,u) of each of these operations is a pair specifying the lower and upper bounds of a contiguous subrange of values.
An implementation is entitled to assume the following laws about these operations:
* inRange (l,u) i == elem i (range (l,u))
* range (l,u) !! index (l,u) i == i, when inRange (l,u) i
* map (index (l,u)) (range (l,u))) == [0..rangeSize (l,u)-1]
* rangeSize (l,u) == length (range (l,u))
Minimal complete instance: range, index and inRange.
Reshape multi-dimensional arrays.
Provides the Shapable class, respresenting those instances of Ix that provide to arrays indexing that is isomorphic to that of C-style multi-dimensional arrays.
Factored out of the carray library with the kind permission of its author.
Version 0.1.0
This preprocessor expands a Haskell program using "ixdo" notation into a Haskell program using the indexed monad bind operator (>>>=). It also serves as an example for the preprocessor-tools package.
While GHC 6.10 can now expand do-notation when (>>=) is rebound at a non-standard type, this makes it difficult to use do-notation for both monads and custom monad-like structures in the same compilation module. This preprocessor makes it easy to use do-like syntax for indexed monads while retaining "do" for monads.
If installed in ~.cabal, then ~.cabal/bin must be in the path for GHC to find it from a -pgmF flag.
Version 0.1.1
Returns a new array derived from the original array by applying a function to each of the indices.
ixmap allows for transformations on array indices. It may be thought of as providing function composition on the right with the mapping that the original array embodies.
A similar transformation of array values may be achieved using fmap from the Array instance of the Functor class.
Create and query sets that are indexed by multiple indices.
Version 1.0.3
Gets the fixity of a constructor
Monadic fixpoints.
For a detailed discussion, see Levent Erkok's thesis, Value Recursion in Monadic Computations, Oregon Graduate Institute, 2002.
This module defines a "Fixed" type for fixed-precision arithmetic. The parameter to Fixed is any type that's an instance of HasResolution. HasResolution has a single method that gives the resolution of the Fixed type.
This module also contains generalisations of div, mod, and divmod to work with any Real instance.
fix f is the least fixed point of the function f, i.e. the least defined x such that f x = x.
Fixity of constructors
Allow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixST f = _|_.
The isInfixOf function takes two lists and returns True iff the first list is contained, wholly and intact, anywhere within the second.
Example:
> isInfixOf "Haskell" "I really like Haskell." == True
> isInfixOf "Ial" "I really like Haskell." == False
The isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second.
The isSuffixOf function takes two lists and returns True iff the first list is a suffix of the second. Both lists must be finite.
Show more results