Convert a Boolean in numeric representation to a Haskell value
Converts an arbitrary value into an object of type Dynamic.
The type of the object must be an instance of Typeable, which ensures that only monomorphically-typed objects may be converted to Dynamic. To convert a polymorphic object into Dynamic, give it a monomorphic type signature. For example:
> toDyn (id :: Int -> Int)
Converts a hash table to a list of key/value pairs.
List of elements of a structure.
Convert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.
Convert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged.
This function ensures that the foreign object in question is alive at the given place in the sequence of IO actions. In particular Foreign.ForeignPtr.withForeignPtr does a touchForeignPtr after it executes the user action.
Note that this function should not be used to express dependencies between finalizers on ForeignPtrs. For example, if the finalizer for a ForeignPtr F1 calls touchForeignPtr on a second ForeignPtr F2, then the only guarantee is that the finalizer for F2 is never started before the finalizer for F1. They might be started together if for example both F1 and F2 are otherwise unreachable, and in that case the scheduler might end up running the finalizer for F2 first.
In general, it is not recommended to use finalizers on separate objects with ordering constraints between them. To express the ordering robustly requires explicit synchronisation using MVars between the finalizers, but even then the runtime sometimes runs multiple finalizers sequentially in a single thread (for performance reasons), so synchronisation between finalizers could result in artificial deadlock. Another alternative is to use explicit reference counting.
Convert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.
A helper module to parse lexical elements (tokens). See makeTokenParser for a description of how to use it.
Parsec compatibility module
This library provides the class:
class ToString s where toString :: s -> String
Instances for String, Char and ShowS are provided. For other instances see the package:
Also included is a general coercion function between string-like types:
fromToString :: (IsString s2, ToString s1) => s1 -> s2
fromToString = fromString . toString
This library provides the following instances for the ToString class:
Note that the instances can be enabled or disabled based on cabal flags.
The idea is that eventually all packages providing string-like types will provide instances for ToString themselves. In the mean time this package is here to provide them.
O(n). Convert the map to a list of key/value pairs keys are in ascending order. Subject to list fusion.
> toAscList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]
O(n). Convert the set to an ascending list of elements. Subject to list fusion.
Show more results