A handle managing output to the Haskell program's standard error channel.
A handle managing input from the Haskell program's standard input channel.
A handle managing output to the Haskell program's standard output channel.
Increases the precedence context by one.
Convert a strict ST computation into a lazy one. The strict state thread passed to strictToLazyST is not performed until the result of the lazy state thread it returns is demanded.
Parses and returns the specified string.
The stripPrefix function drops the given prefix from a list. It returns Nothing if the list did not start with the prefix given, or Just the list after the prefix, if it does.
> stripPrefix "foo" "foobar" == Just "bar"
> stripPrefix "foo" "foo" == Just ""
> stripPrefix "foo" "barfoo" == Nothing
> stripPrefix "foo" "barfoobaz" == Nothing
A monad transformer embedding lazy state transformers in the IO monad. The RealWorld parameter indicates that the internal state used by the ST computation is a special one supplied by the IO monad, and thus distinct from those used by invocations of runST.
A monad transformer embedding strict state transformers in the IO monad. The RealWorld parameter indicates that the internal state used by the ST computation is a special one supplied by the IO monad, and thus distinct from those used by invocations of runST.
Provides an unsafe API for inserting heterogeneous data in a collection keyed by StableNames and for later retrieving it.
Whereas most memo combinators memoize based on equality, stable-memo does it based on whether the exact same argument has been passed to the function before (that is, is the same argument in memory).
* stable-memo only evaluates keys to WHNF.
* This can be more suitable for recursive functions over graphs with cycles.
* stable-memo doesn't retain the keys it has seen so far, which allows them to be garbage collected if they will no longer be used. Finalizers are put in place to remove the corresponding entries from the memo table if this happens.
* Data.StableMemo.Weak provides an alternative set of combinators that also avoid retaining the results of the function, only reusing results if they have not yet been garbage collected.
* There is no type class constraint on the function's argument.
stable-memo will not work for arguments which happen to have the same value but are not the same heap object. This rules out many candidates for memoization, such as the most common example, the naive Fibonacci implementation whose domain is machine Ints; it can still be made to work for some domains, though, such as the lazy naturals.
> data Nat = Succ Nat | Zero
> fib :: Nat -> Integer
> fib = memo fib'
> where fib' Zero = 0
> fib' (Succ Zero) = 1
> fib' (Succ n1@(Succ n2)) = fib n1 + fib n2
Below is an implementation of map that preserves sharing of the spine for cyclic lists. It should even be safe to use this on arbitrarily long, acyclic lists since as long as the garbage collector is chasing you, the size of the memo table should stay under control, too.
> map :: (a -> b) -> [a] -> [b]
> map f = go
> where go = memo map'
> map'  = 
> map' (x:xs) = f x : go xs
This library is largely based on the implementation of memo found in "Stretching the storage manager: weak pointers and stable names in Haskell", from Simon Peyton Jones, Simon Marlow, and Conal Elliott (http://community.haskell.org/~simonmar/papers/weak.pdf).
the collected values for this test case
Fundamental * -> * types, operators, and covariant instances.
Contravariant instances for the fundamental * -> * types and operators.
A haskell memcached client. See http://memcached.org for more information.
This implements the new binary protocol, so it only works with memcached version 1.3 and newer.
Show more results