dw         ! " # $ % & ' ( ) *+,-./01 2 34 5 6 7 8 9:;<=>?@AB CDEF GH IJ KLMNOPQRSTUVWXY Z [\]^_`abcdefghijklmnopqrstuvwxyz{| } ~             !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk!l!m!n!op q r s t u v w x y z { | } ~                  """"""""""""""""""""""""""""""""""#################$$$$$$$$$$$$$$$$%&&&&&&&&&&&&&&&&&&&&&&&&& & &   ''((( !"#$%&)'()*+,-*.+/ 0 1 2,3,4)5)6)7'8'9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~------------'''''''''''''''''' ' ' ' ' ''''''''''''''''. .!.".#)$)%)&/'/(/)/*/+/,/-%.%/%0%1%2%3%4%5060708090:0;0<0=0>0?0@0A1B1CDEFGHIJ0K0L0M0N0O2P2Q2R2S2T2U2V2W3X3Y3Z3[3\3]4^4_4`4a4b4c4d4e4f4g5h5i5j5k5l5m5n5o5p5q5r5s5t5u5v5w5x5y5z5{6|6}6~6666666666666666666666777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 7 7 7 7 7777778888888888888 8!8"9#9$9%9&9'9(9)9*9+9,9-9.9/909192939495969798999:9;9<9=9>+?+@+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P:Q+R:S+T+U+V:WX:Y:Z+[+\+]+^+_+`+a+b+c+d+e+f+g+h+i*j*k*l*m*n*o*p*q+r+s:t+u+v+w+x+y+z+{+|+}~;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      !"#$%&'()*+,-./0123456789:;<=>?@ABCDE=F>G>H>I>J>K*L*M*N*O*P?Q?R?S?T?U?V?W?X?Y@Z@[@\@]A^A_A`AaBbBcBdBeBfBgBh:i:j:k:l:m:n:o:p:qCrCsCtCuCvCwCxCyCzC{D|D}D~DDDDDDDDEEFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII!JJ J J K K KKKKKKKKKLLLMNNNNNN O!O"O#P$P%P&P'P(P)P*P+P,P-P.P/P0Q1Q2R3R4R5R6R7R8(9(:(;S<S=S>S?T@UAUBUC.D.E.FVGVHVIVJVKVL M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v zportable experimentallibraries@haskell.orgoooWnon-portable (GHC extensions)internalcvs-ghc@haskell.orgBoolean "and" Boolean "or" BThe B  class defines equality (1 ) and inequality ( ). ) All the basic datatypes exported by the Prelude are instances of B ,  and B = may be derived for any datatype whose constituents are also  instances of B . $Minimal complete definition: either 1  or  . JThe J . class is used for totally ordered datatypes.  Instances of J % can be derived for any user-defined ) datatype whose constituent types are in J . The declared order E of the constructors in the data declaration determines the ordering  in derived J  instances. The wXY datatype allows a single > comparison to determine the precise ordering of two objects. $Minimal complete definition: either |  or  .  Using | * can be more efficient for complex types. Boolean "not" 12BJ|}~12B1J|}2~|}~portable experimentallibraries@haskell.org'Extract the first component of a pair. (Extract the second component of a pair. 7 converts an uncurried function to a curried function. 5 converts a curried function to a function on pairs. Znon-portable (GHC extensions)internalcvs-ghc@haskell.org'A list producer that can be fused with .  This function is merely   augment g xs = g (:) xs but GHC'6s simplifier will transform an expression of the form   k z ( g xs)%, which may arise after inlining, to  g k ( k z xs)/, which avoids producing an intermediate list. Append two lists, i.e.,  > [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] 6 [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...] ?If the first list is not finite, the result is the first list. 'A list producer that can be fused with .  This function is merely   build g = g (:) [] but GHC'6s simplifier will transform an expression of the form   k z ( g)%, which may arise after inlining, to g k z, . which avoids producing an intermediate list. <, applied to a binary operator, a starting value (typically C the right-identity of the operator), and a list, reduces the list 0 using the binary operator, from right to left: B foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)  is defined as the value xX[. It helps to make  guards more readable. eg.  f x | x < 0 = ...  | otherwise = ... #If the first argument evaluates to xX[, then the result is the  second argument. Otherwise an AssertionFailed exception is raised,  containing a l- with the source file and line number of the  call to . AAssertions can normally be turned on or off with a compiler flag H (for GHC, assertions are normally on unless optimisation is turned on  with -O or the -fignore-asserts > option is given). When assertions are turned off, the first  argument to ( is ignored, and the second argument is  returned as the result.  The call '(lazy e)' means the same as e, but  has a A magical strictness property: it is lazy in its first argument, & even though its semantics is strict.  The call ' (inline f)' reduces to f, but  has a BuiltInRule  that tries to inline f* (if it has an unfolding) unconditionally  The NOINLINE4 pragma arranges that inline only gets inlined (and ? hence eliminated) late in compilation, after the rule has had  a god chance to fire.  f xs" is the list obtained by applying f to each element  of xs, i.e., 4 map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] * map f [x1, x2, ...] == [f x1, f x2, ...] 48Fail with a message. This operation is not part of the E mathematical definition of a monad, but is invoked on pattern-match  failure in a do expression. 5=Sequentially compose two actions, passing any value produced , by the first as an argument to the second. 6@Sequentially compose two actions, discarding any value produced A by the first, like sequencing operators (such as the semicolon)  in imperative languages. 7&Inject a value into the monadic type. FThe F + class defines the basic operations over a monad, 0a concept from a branch of mathematics known as category theory. EFrom the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do5 expressions provide a convenient syntax for writing monadic expressions. Minimal complete definition: 5  and 7 .  Instances of F $ should satisfy the following laws:   return a >>= k == k a  m >>= return == m . m >>= (\x -> k x >>= h) == (m >>= k) >>= h Instances of both F  and H & should additionally satisfy the law:  " fmap f xs == xs >>= return . f The instances of F  for lists, Data.Maybe.Maybe and  System.IO.IO defined in the Prelude satisfy these laws. HThe H 2 class is used for types that can be mapped over.  Instances of H $ should satisfy the following laws:   fmap id == id # fmap (f . g) == fmap f . fmap g The instances of H  for lists, Data.Maybe.Maybe and  System.IO.IO defined in the Prelude satisfy these laws. lA lB is a list of characters. String constants in Haskell are values  of type l. The Prelude.toEnum method restricted to the type Data.Char.Char. The Prelude.fromEnum method restricted to the type Data.Char.Char. Identity function. Constant function. Function composition.  f9 takes its (first) two arguments in the reverse order of f. BApplication operator. This operator is redundant, since ordinary  application (f x) means the same as (f  x) . However,  has C low, right-associative binding precedence, so it sometimes allows ) parentheses to be omitted; for example:  ! f $ g $ h x = f (g (h x)) 6It is also useful in higher-order situations, such as  ( 0) xs,  or Data.List.zipWith () fs xs.  p f yields the result of applying f until p holds. ! is a type-restricted version of . It is usually E used as an infix operator, and its typing forces its first argument D (which is usually overloaded) to have the same type as the second. 8Shift the argument left by the specified number of bits  (which must be non-negative). 9Shift the argument right by the specified number of bits  (which must be non-negative). 8Shift the argument left by the specified number of bits  (which must be non-negative). BShift the argument right (signed) by the specified number of bits  (which must be non-negative). DShift the argument right (unsigned) by the specified number of bits  (which must be non-negative). yz{|}~124567BFHJwlx      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~|}~     Dz|}~4567F5674Hl     \non-portable (GHC extensions)internalcvs-ghc@haskell.org -Used in Haskell's translation of [n..]. .Used in Haskell's translation of [n,n'..]. /Used in Haskell's translation of [n..m]. 0Used in Haskell's translation of [n,n'..m]. @The @7 class is used to name the upper and lower limits of a  type. J  is not a superclass of @ since types that are not 7 totally ordered may also have upper and lower bounds. The @0 class may be derived for any enumeration type;  ( is the first constructor listed in the data declaration  and  is the last.  @< may also be derived for single-constructor datatypes whose  constituent types are in @. AClass A3 defines operations on sequentially ordered types. The enumFrom... methods are used in Haskell's translation of  arithmetic sequences.  Instances of A0 may be derived for any enumeration type (types C whose constructors have no fields). The nullary constructors are ) assumed to be numbered left-to-right by  from 0 through n-1.  See Chapter 10 of the Haskell Report for more details. *For any type that is an instance of class @ as well as A,  the following should hold:  The calls   and   should result in  a runtime error.   and % should give a runtime error if the 9 result value is not representable in the result type.  For example,  7 :: X[ is an error.  - and .+ should be defined with an implicit bound,  thus: 1 enumFrom x = enumFromTo x maxBound 0 enumFromThen x y = enumFromThenTo x y bound  where 4 bound | fromEnum y >= fromEnum x = maxBound 4 | otherwise = minBound .the successor of a value. For numeric types,  adds 1. 0the predecessor of a value. For numeric types,  subtracts 1. Convert from an X]. Convert to an X]. % It is implementation-dependent what  returns when 3 applied to a value that is too large to fit in an X]. -./0@A-./0@A-./0portable experimentallibraries@haskell.org[DClass for string-like datastructures; used by the overloaded string , extension (-foverloaded-strings in GHC). ?[[??[?portable experimentallibraries@haskell.orgx portablestablelibraries@haskell.org1BB1portablestablelibraries@haskell.org The 7 type encapsulates an optional value. A value of type   a! either contains a value of type a (represented as  a),  or it is empty (represented as  ). Using  is a good way to D deal with errors or exceptional cases without resorting to drastic  measures such as . The 5 type is also a monad. It is a simple kind of error , monad, where all errors are represented by  . A richer $ error monad can be built using the Data.Either.Either type. The 3 function takes a default value, a function, and a   value. If the  value is , the function returns the H default value. Otherwise, it applies the function to the value inside  the  and returns the result. The  function returns xX[ iff its argument is of the  form Just _. The  function returns xX[ iff its argument is . The ( function extracts the element out of a  and $ throws an error if its argument is . The ( function takes a default value and and   value. If the  is !, it returns the default values; 2 otherwise, it returns the value contained in the . The + function returns an empty list when given  $ or a singleton list when not given . The  function returns  on an empty list  or  a where a# is the first element of the list. The  function takes a list of s and returns  a list of all the  values. The  function is a version of  which can throw ? out elements. In particular, the functional argument returns  something of type  b. If this is  , no element - is added on to the result list. If it just  b, then b is  included in the result list. ^non-portable (GHC Extensions)internalcvs-ghc@haskell.org) Concatenate a list of lists.  9, applied to a predicate and a list, returns the list of 2 those elements that satisfy the predicate; i.e., # filter p xs = [ x | x <- xs, p x]  < takes two lists and returns a list of corresponding pairs. D If one input list is short, excess elements of the longer list are  discarded. >Extract the first element of a list, which must be non-empty. HExtract the elements after the head of a list, which must be non-empty. HExtract the last element of a list, which must be finite and non-empty. 7Return all the elements of a list except the last one. ( The list must be finite and non-empty. Test whether a list is empty. + returns the length of a finite list as an X]. ' It is an instance of the more general Data.List.genericLength, 5 the result type of which may be any kind of number. <, applied to a binary operator, a starting value (typically B the left-identity of the operator), and a list, reduces the list 0 using the binary operator, from left to right:  G foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn The list must be finite.  is similar to #, but returns a list of successive  reduced values from the left:  B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs.  is a variant of & that has no starting value argument: 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]  is a variant of & that has no starting value argument, . and thus must be applied to non-empty lists.  is the right-to-left dual of .  Note that & head (scanr f z xs) == foldr f z xs.  is a variant of & that has no starting value argument.  f x3 returns an infinite list of repeated applications  of f to x: ' iterate f x == [x, f x, f (f x), ...]  x is an infinite list, with x the value of every element.  n x is a list of length n with x the value of  every element. ' It is an instance of the more general Data.List.genericReplicate,  in which n may be of any integral type. : ties a finite list into a circular one, or equivalently, C the infinite repetition of the original list. It is the identity  on infinite lists. , applied to a predicate p and a list xs, returns the $ longest prefix (possibly empty) of xs of elements that satisfy p: , takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] $ takeWhile (< 9) [1,2,3] == [1,2,3]  takeWhile (< 0) [1,2,3] == []  p xs$ returns the suffix remaining after  p xs: 4 dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]  dropWhile (< 9) [1,2,3] == [] $ dropWhile (< 0) [1,2,3] == [1,2,3]  n, applied to a list xs, returns the prefix of xs  of length n, or xs itself if n >  xs:  " take 5 "Hello World!" == "Hello"  take 3 [1,2,3,4,5] == [1,2,3]  take 3 [1,2] == [1,2]  take 3 [] == []  take (-1) [1,2] == []  take 0 [1,2] == [] &It is an instance of the more general Data.List.genericTake,  in which n may be of any integral type.  n xs returns the suffix of xs  after the first n elements, or [] if n >  xs:  # drop 6 "Hello World!" == "World!"  drop 3 [1,2,3,4,5] == [4,5]  drop 3 [1,2] == []  drop 3 [] == []  drop (-1) [1,2] == [1,2]  drop 0 [1,2] == [1,2] &It is an instance of the more general Data.List.genericDrop,  in which n may be of any integral type.  n xs( returns a tuple where first element is xs prefix of  length n2 and second element is the remainder of the list:  1 splitAt 6 "Hello World!" == ("Hello ","World!") * splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5]) " splitAt 1 [1,2,3] == ([1],[2,3]) # splitAt 3 [1,2,3] == ([1,2,3],[]) # splitAt 4 [1,2,3] == ([1,2,3],[]) # splitAt 0 [1,2,3] == ([],[1,2,3]) & splitAt (-1) [1,2,3] == ([],[1,2,3]) It is equivalent to ( n xs,  n xs).  $ is an instance of the more general Data.List.genericSplitAt,  in which n may be of any integral type. , applied to a predicate p and a list xs, returns a tuple where 5 first element is longest prefix (possibly empty) of xs of elements that  satisfy p2 and second element is the remainder of the list:  7 span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) $ span (< 9) [1,2,3] == ([1,2,3],[]) $ span (< 0) [1,2,3] == ([],[1,2,3])  p xs is equivalent to ( p xs,  p xs) , applied to a predicate p and a list xs, returns a tuple where 5 first element is longest prefix (possibly empty) of xs of elements that  do not satisfy p2 and second element is the remainder of the list:  8 break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4]) % break (< 9) [1,2,3] == ([],[1,2,3]) % break (> 9) [1,2,3] == ([1,2,3],[])  p is equivalent to  ( . p).  xs returns the elements of xs in reverse order.  xs must be finite. B returns the conjunction of a Boolean list. For the result to be  xX[, the list must be finite; X[, however, results from a X[ 7 value at a finite index of a finite or infinite list. B returns the disjunction of a Boolean list. For the result to be  X[, the list must be finite; xX[, however, results from a xX[ 7 value at a finite index of a finite or infinite list. #Applied to a predicate and a list,  determines if any element & of the list satisfies the predicate. #Applied to a predicate and a list,  determines if all elements $ of the list satisfy the predicate. B is the list membership predicate, usually written in infix form,  e.g., x `elem` xs.  is the negation of .   key assocs( looks up a key in an association list. 8Map a function over a list and concatenate the results. 2List index (subscript) operator, starting from 0. ' It is an instance of the more general Data.List.genericIndex, , which takes an index of any integral type. ? takes three lists and returns a list of triples, analogous to   .  generalises  $ by zipping with the function given 7 as the first argument, instead of a tupling function.  For example,  (+)( is applied to two lists to produce the  list of corresponding sums. The 0 function takes a function which combines three I elements, as well as three lists and returns a list of their point-wise  combination, analogous to . < transforms a list of pairs into a list of first components " and a list of second components. The 4 function takes a list of triples and returns three  lists, analogous to . . + _non-portable (GHC Extensions)internalcvs-ghc@haskell.org O!Conversion of values to readable ls. Minimal complete definition:  or . Derived instances of O& have the following properties, which * are compatible with derived instances of Text.Read.Read:  The result of $ is a syntactically correct Haskell : expression containing only constants, given the fixity B declarations in force at the point where the type is declared. D It contains only the constructor names defined in the data type, B parentheses, and spaces. When labelled constructor fields are E used, braces, commas, field names, and equal signs are also used. = If the constructor is defined to be an infix operator, then  5 will produce infix applications of the constructor. ; the representation will be enclosed in parentheses if the . precedence of the top-level constructor in x is less than d ) (associativity is ignored). Thus, if d is 0 then the result * is never surrounded in parentheses; if d is 11 it is always A surrounded in parentheses, unless it is an atomic expression. 9 If the constructor is defined using record syntax, then  E will produce the record-syntax form, with the fields given in the + same order as the original declaration. $For example, given the declarations   infixr 5 :^: - data Tree a = Leaf a | Tree a :^: Tree a the derived instance of O is equivalent to  * instance (Show a) => Show (Tree a) where  : showsPrec d (Leaf m) = showParen (d > app_prec) $ ; showString "Leaf " . showsPrec (app_prec+1) m  where app_prec = 10  : showsPrec d (u :^: v) = showParen (d > up_prec) $ ( showsPrec (up_prec+1) u . ' showString " :^: " . % showsPrec (up_prec+1) v  where up_prec = 5 !Note that right-associativity of :^: is ignored. For example,   (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string  "Leaf 1 :^: (Leaf 2 :^: Leaf 3)". Convert a value to a readable l.  should satisfy the law  2 showsPrec d x r ++ s == showsPrec d x (r ++ s) Derived instances of Text.Read.Read and O satisfy the following:  (x,"") is an element of  (Text.Read.readsPrec d ( d x "")).  That is, Text.Read.readsPrec parses the string produced by  , and delivers the value that  started with. A specialised variant of , using precedence context ! zero, and returning an ordinary l.  The method ( is provided to allow the programmer to 4 give a specialised way of showing lists of values. - For example, this is used by the predefined O instance of  the X] type, where values of type l should be shown 8 in double quotes, rather than between square brackets. The shows/ functions return a function that prepends the  output l to an existing l. This allows constant-time 6 concatenation of results using function composition. equivalent to  with a precedence of 0. utility function converting a X] to a show function that * simply prepends the character unchanged. utility function converting a l to a show function that ' simply prepends the string unchanged. =utility function that surrounds the inner show function with  parentheses when the X[ parameter is xX[. AConvert a character to a string using only printable characters, A using Haskell source-language escape conventions. For example: # showLitChar '\n' s = "\\n" ++ s  Convert an X] in the range 0..15 to the corresponding single  digit X]6. This function fails on other inputs, and generates  lower-case hexadecimal digits. OO`non-portable (GHC Extensions)internalcvs-ghc@haskell.org*Conversion from an ab. ? An integer literal represents the application of the function  *" to the appropriate value of type ab,  so such literals have type (I a) => a. 3Unary negation. IBasic numeric class. (Minimal complete definition: all except 3 or (-) Absolute value. Sign of a number.  The functions  and  should satisfy the law:   abs x * signum x == x For real numbers, the  is either -1 (negative), 0 (zero)  or 1 (positive).  the same as  (+). Because -. is treated specially in the Haskell grammar,  (- e): is not a section, but an application of prefix negation.  However, ( exp)* is equivalent to the disallowed section. ;*+3I !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL*+3I+3*BCDEFGHIJKLcnon-portable (GHC Extensions)internalcvs-ghc@haskell.org,Conversion from a a (that is ` ab). 1 A floating literal stands for an application of ,  to a value of type a, so such literals have type  (D a) => a. D.Fractional numbers, supporting real division. Minimal complete definition: , and ( or ()) E/Integral numbers, supporting integer division. Minimal complete definition:  and  N$Extracting components of fractions. Minimal complete definition:  `9Rational numbers, with numerator and denominator of some E type. a@Arbitrary-precision rational numbers, represented as a ratio of  two ab5 values. A rational number may be constructed using  the  operator.  The function  takes a real fractional number x  and returns a pair (n,f) such that x = n+f, and:  n- is an integral number with the same sign as x; and  f. is a fraction with the same type and sign as x, % and with absolute value less than 1. The default definitions of the , ,   and  functions are in terms of .  x returns the integer nearest x between zero and x  x returns the nearest integer to x;  the even integer if x% is equidistant between two integers  x) returns the least integer not less than x  x/ returns the greatest integer not greater than x fractional division reciprocal fraction 'integer division truncated toward zero integer remainder, satisfying # (x `quot` y)*y + (x `rem` y) == x 4integer division truncated toward negative infinity integer modulus, satisfying " (x `div` y)*y + (x `mod` y) == x  simultaneous  and   simultaneous  and  conversion to ab Athe rational equivalent of its real argument with full precision )Forms the ratio of two integral numbers. 4Extract the numerator of the ratio in reduced form: I the numerator and denominator have no common factor and the denominator  is positive. 6Extract the denominator of the ratio in reduced form: I the numerator and denominator have no common factor and the denominator  is positive. %general coercion from integral types %general coercion to fractional types Converts a possibly-negative L value to a string. 0raise a number to a non-negative integral power $raise a number to an integral power  x y6 is the greatest (positive) integer that divides both x  and y; for example  (-3) 6 = 3,  (-3) (-6) = 3,   0 4 = 4.  0 0 raises a runtime error.  x y, is the smallest positive integer that both x and y divide. 1,DELN`aMNOPQRSTUVWXYZ[1,D,ELN`MaMNOPQRSTUVWXYZ[portable experimentallibraries@haskell.orgThe 7 class defines bitwise operations over integral types. 5 Bits are numbered from 0 with bit 0 being the least  significant bit. Minimal complete definition: , , , , ( or (  and  )), ( or ( and )),   and  . Bitwise "and" Bitwise "or" Bitwise "xor" &Reverse all the bits in the argument  x i shifts x left by i bits if i is positive,  or right by -i bits otherwise. D Right shifts perform sign extension on signed number types; 2 i.e. they fill the top bits with 1 if the x is negative  and with 0 otherwise. +An instance can define either this unified  or   and   8, depending on which is more convenient for the type in  question.  x i rotates x left by i bits if i is positive,  or right by -i bits otherwise. For unbounded types like ab,  is equivalent to . +An instance can define either this unified  or  and  8, depending on which is more convenient for the type in  question. bit i is a value with the i th bit set x `setBit` i is the same as  x .|. bit i x `clearBit` i is the same as x .&. complement (bit i) x ` complementBit` i is the same as x `xor` bit i  Return xX[ if the nth bit of the argument is 1  CReturn the number of bits in the type of the argument. The actual 8 value of the argument is ignored. The function   is C undefined for types that do not have a fixed bitsize, like ab.  Return xX[/ if the argument is a signed type. The actual * value of the argument is ignored  8Shift the argument left by the specified number of bits & (which must be non-negative). 'An instance can define either this and   or the unified  8, depending on which is more convenient for the type in  question.  ?Shift the first argument right by the specified number of bits & (which must be non-negative). D Right shifts perform sign extension on signed number types; 2 i.e. they fill the top bits with 1 if the x is negative  and with 0 otherwise. 'An instance can define either this and   or the unified  8, depending on which is more convenient for the type in  question. 9Rotate the argument left by the specified number of bits & (which must be non-negative). 'An instance can define either this and  or the unified  8, depending on which is more convenient for the type in  question. :Rotate the argument right by the specified number of bits & (which must be non-negative). 'An instance can define either this and  or the unified  8, depending on which is more convenient for the type in  question.                     dnon-portable (GHC Extensions)internalcvs-ghc@haskell.org$The strict state-transformer monad.  A computation of type   s a& transforms an internal state indexed  by s, and returns a value of type a.  The s parameter is either 8 an uninstantiated type variable (inside invocations of  ), or  Xe (inside invocations of Control.Monad.ST.stToIO). ?It serves to keep the internal states of different invocations  of  2 separate from each other and from invocations of  Control.Monad.ST.stToIO. The 5  and 6 3 operations are strict in the state (though not in , values stored in the state). For example,   (writeSTRef _|_ v >>= f) = _|_HAllow the result of a state transformer computation to be used (lazily)  inside the computation.  Note that if f is strict,   f = _|_. >Return the value computed by a state transformer computation.  The forall- ensures that the internal state used by the   9 computation is inaccessible to the rest of the program. \]^_`a \]^^_``anon-portable (GHC extensions)internalcvs-ghc@haskell.orgPThe P9 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 K specifying the lower and upper bounds of a contiguous subrange of values. GAn implementation is entitled to assume the following laws about these  operations:   (l,u) i ==  i ( (l,u))  (l,u)   (l,u) i == i, when  (l,u) i  ( (l,u)) ( (l,u))) == [0.. (l,u)-1]  (l,u) ==  ( (l,u))Minimal complete instance: ,  and . )Mutable, boxed, non-strict arrays in the   monad. The type  arguments are as follows:  s&: the state variable argument for the   type  i8: the index type of the array (should be an instance of P)  e!: the element type of the array. 0The type of immutable non-strict (boxed) arrays  with indices in i and elements in e. 1 The Int is the number of elements in the Array. ?The list of values in the subrange defined by a bounding pair. -The position of a subscript in the subrange. Like 3, but without checking that the value is in range. Returns xX[/ the given subscript lies in the range defined  the bounding pair. 5The size of the subrange defined by a bounding pair. like /, but without checking that the upper bound is  in range. !CConstruct an array with the specified bounds and containing values ( for given indices within these bounds. AThe array is undefined (i.e. bottom) if any index in the list is E out of bounds. The Haskell 98 Report further specifies that if any E two associations in the list have the same index, the value at that 2 index is undefined (i.e. bottom). However in GHC's implementation, F the value at such an index is the value part of the last association  with that index in the list. 6Because the indices must be checked for these errors, ! is E strict in the bounds argument and in the indices of the association C list, but nonstrict in the values. Thus, recurrences such as the  following are possible:  @ a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i <- [2..100]]) BNot every index within the bounds of the array need appear in the F association list, but the values associated with indices that do not ) appear will be undefined (i.e. bottom). GIf, in any dimension, the lower bound is greater than the upper bound, E then the array is legal, but empty. Indexing an empty array always " gives an array-bounds error, but + still yields the bounds ' with which the array was constructed. &AConstruct an array from a pair of bounds and a list of values in  index order. '*The value at the given index in an array. +0The bounds with which an array was constructed. ,%The number of elements in the array. -4The list of indices of an array in ascending order. .1The list of elements of an array in index order. /5The list of associations of an array in index order. 0The 00 deals with repeated indices in the association  list using an accumulating function which combines the values of # associations with the same index. 9 For example, given a list of values of some index type, hist H produces a histogram of the number of occurrences of each index within  a specified range:  4 hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b G hist bnds is = accumArray (+) 0 bnds [(i, 1) | i<-is, inRange bnds i] -If the accumulating function is strict, then 0 is strict in E the values, as well as the indices, in the association list. Thus, # unlike ordinary arrays built with !, accumulated arrays should  not in general be recursive. 4GConstructs an array identical to the first argument except that it has 9 been updated by the associations in the right argument.  For example, if m is a 1-origin, n by n matrix, then   m//[((i,i), 0) | i <- [1..n]] 5is the same matrix, except with the diagonal zeroed. <Repeated indices in the association list are handled as for !: K Haskell 98 specifies that the resulting array is undefined (i.e. bottom),  but GHC';s implementation uses the last association for each index. 66 f8 takes an array and an association list and accumulates C pairs from the list into the array with the accumulating function f.  Thus 0 can be defined using 6: > accumArray f z b = accum f (array b [(i, z) | i <- range b]) 99. allows for transformations on array indices. E It may be thought of as providing function composition on the right 4 with the mapping that the original array embodies. ?A similar transformation of array values may be achieved using    from the  instance of the H  class. 5P !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG5P !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG5P !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGfnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgC>Trigonometric and hyperbolic functions and related functions. Minimal complete definition:  V, W, Y, \, ^, b, d,  _, a, `, e, g and f M=Efficient, machine-independent access to the components of a  floating-point number. Minimal complete definition:  all except M, N, O and U H?a constant function, returning the radix of the representation  (often 2) I7a constant function, returning the number of digits of  H in the significand J=a constant function, returning the lowest and highest values  the exponent may assume K The function K" applied to a real floating-point 0 number returns the significand expressed as an ab and an # appropriately scaled exponent (an X]). If K x  yields (m,n), then x is equal in value to m*b^^n, where b 6 is the floating-point radix, and furthermore, either m and n  are both zero or else b^(d-1) <= m < b^d, where d is the value  of I x. In particular, K 0 = (0,0). LL performs the inverse of K Mthe second component of K. Nthe first component of K, scaled to lie in the open  interval (-1,1) ODmultiplies a floating-point number by an integer power of the radix PxX[ if the argument is an IEEE " not-a-number" (NaN) value QxX[: if the argument is an IEEE infinity or negative infinity RxX[3 if the argument is too small to be represented in  normalized format SxX[* if the argument is an IEEE negative zero TxX[2 if the argument is an IEEE floating point number UBa version of arctangent taking two real floating-point arguments.  For real floating x and y, U y x computes the angle A (from the positive x-axis) of the vector from the origin to the  point (x,y). U y x returns a value in the range [-pi,  pi]<. It follows the Common Lisp semantics for the origin when  signed zeroes are supported. U y 1, with y in a type  that is M", should return the same value as ` y.  A default definition of U is provided, but implementors - can provide a more accurate implementation. hShow a signed M value to full precision J using standard decimal notation for arguments whose absolute value lies  between 0.1 and  9,999,999%, and scientific notation otherwise. ii! takes a base and a non-negative M number, 0 and returns a list of digits and an exponent.  In particular, if x>=0, and  , floatToDigits base x = ([d1,d2,...,dn], e) then  n >= 1 x = 0.d1d2...dn * (base**e) 0 <= di <= base-1j Converts a a value into any type in class M. zCMbcdefghijklmnopHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghqrijstuvwxyz{|}~tCVWXYZ[\]^_`abcdefgMHIJKLMNOPQRSTUbcdefghijklmponnopHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghqrijstuvwxyz{|}~gnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgka value of type  STRef s a' is a mutable variable in state thread s,  containing a value of type a l Build a new k! in the current state thread mRead the value of an k! nWrite a new value into an k! klmnklmnportable provisionallibraries@haskell.orgoAShow a list (using square brackets and commas), given a function  for showing elements. Oo Ooo portable provisionallibraries@haskell.org Z-Monads that also support choice and failure. pthe identity of q (. It should also satisfy the equations   mzero >>= f = mzero  v >> mzero = mzero (but the instance for  System.IO.IO defined in Control.Monad.Error 6 in the mtl package does not satisfy the second one). qan associative operation rSame as 5 ', but with the arguments interchanged. s9Evaluate each action in the sequence from left to right,  and collect the results. t9Evaluate each action in the sequence from left to right,  and ignore the results. uu  f is equivalent to s  .  f. vv  f is equivalent to t  .  f. ww  b is 7  () if b is xX[,  and p  if b is X[. x This generalizes the list-based   function. yy  is u  with its arguments flipped zz  is v  with its arguments flipped { This generalizes the list-based   function. |-Left-to-right Kleisli composition of monads. }-Right-to-left Kleisli composition of monads. '(>=>)', with the arguments flipped ~~  act repeats the action infinitely. The  A function is the conventional monad join operator. It is used to O remove one level of monadic structure, projecting its bound argument into the  outer level. The  9 function maps its first argument over a list, returning N the result as a pair of lists. This function is mainly used with complicated 0 data structures or a state-transforming monad. The   function generalizes  to arbitrary monads.   is the extension of  ! which ignores the final result. The   function is analogous to , except that its result is #encapsulated in a monad. Note that   works from left-to-right over 1the list arguments. This could be an issue where '(>>)' and the `folded function' are not commutative.  % foldM f a1 [x1, x2, ..., xm ] ==   do  a2 <- f a1 x1  a3 <- f a2 x2  ...  f am xm LIf right-to-left evaluation is required, the input list should be reversed. Like  , but discards the result.   n act performs the action n times,  gathering the results. Like  , but discards the result. <Conditional execution of monadic expressions. For example,  ) when debug (putStr "Debugging\n") will output the string  Debugging\n if the Boolean value debug is xX[, and otherwise do nothing. The reverse of  . Promote a function to a monad. CPromote a function to a monad, scanning the monadic arguments from  left to right. For example, ' liftM2 (+) [0,1] [0,2] = [0,2,1,3] * liftM2 (+) (Just 1) Nothing = Nothing CPromote a function to a monad, scanning the monadic arguments from  left to right (cf.  ). CPromote a function to a monad, scanning the monadic arguments from  left to right (cf.  ). CPromote a function to a monad, scanning the monadic arguments from  left to right (cf.  ). In many situations, the  ' operations can be replaced by uses of  (, which promotes function application.  ) return f `ap` x1 `ap` ... `ap` xn is equivalent to  liftMn f x1 x2 ... xn '4567FHZpqrstuvwxyz{|}~'HF5674Zpquvyzstr|}~{xw Zpqpqrstuvwxyz{|}~hnon-portable (GHC extensions)internalcvs-ghc@haskell.orgArithmetic exceptions. #This is thrown when the user calls . The String is the  argument given to . DAny type that you wish to throw or catch as an exception must be an instance of the  Exception- class. The simplest case is a new exception type directly below the root:  2 data MyException = ThisException | ThatException  deriving (Show, Typeable)   instance Exception MyException &The default method definitions in the  Exception class do what we need *in this case. You can now throw and catch  ThisException and  ThatException as exceptions:   *Main> throw ThisException catch e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException GIn more complicated examples, you may wish to define a whole hierarchy of exceptions:  G --------------------------------------------------------------------- F -- Make the root exception type for all the exceptions in a compiler  P data SomeCompilerException = forall e . Exception e => SomeCompilerException e  deriving Typeable  + instance Show SomeCompilerException where - show (SomeCompilerException e) = show e  * instance Exception SomeCompilerException  C compilerExceptionToException :: Exception e => e -> SomeException D compilerExceptionToException = toException . SomeCompilerException  K compilerExceptionFromException :: Exception e => SomeException -> Maybe e ' compilerExceptionFromException x = do 0 SomeCompilerException a <- fromException x  cast a  G --------------------------------------------------------------------- G -- Make a subhierarchy for exceptions in the frontend of the compiler  P data SomeFrontendException = forall e . Exception e => SomeFrontendException e  deriving Typeable  + instance Show SomeFrontendException where - show (SomeFrontendException e) = show e  0 instance Exception SomeFrontendException where 0 toException = compilerExceptionToException 4 fromException = compilerExceptionFromException  C frontendExceptionToException :: Exception e => e -> SomeException D frontendExceptionToException = toException . SomeFrontendException  K frontendExceptionFromException :: Exception e => SomeException -> Maybe e ' frontendExceptionFromException x = do 0 SomeFrontendException a <- fromException x  cast a  G --------------------------------------------------------------------- H -- Make an exception type for a particular frontend compiler exception  4 data MismatchedParentheses = MismatchedParentheses  deriving (Typeable, Show)  0 instance Exception MismatchedParentheses where 2 toException = frontendExceptionToException 4 fromException = frontendExceptionFromException We can now catch a MismatchedParentheses exception as MismatchedParentheses, SomeFrontendException or SomeCompilerException, but not other types, e.g.  IOException:  #*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught "' ++ show (e :: MismatchedParentheses)) Caught MismatchedParentheses #*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught "' ++ show (e :: SomeFrontendException)) Caught MismatchedParentheses #*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught "' ++ show (e :: SomeCompilerException)) Caught MismatchedParentheses #*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: IOException)) %*** Exception: MismatchedParentheses The  SomeException3 type is the root of the exception type hierarchy. When an exception of type e$ is thrown, behind the scenes it is encapsulated in a  SomeException. :Throw an exception. Exceptions may be thrown from purely 4 functional code, but may only be caught within the IO monad.  portablestablelibraries@haskell.org ' comparing p x y = compare (p x) (p y) 2Useful combinator for use in conjunction with the xxxBy family  of functions from  Data.List, for example: " ... sortBy (comparing fst) ... 2Jw|}~ J|}2~"-non-portable (local universal quantification) provisionallibraries@haskell.org!A parser for a type a), represented as a function that takes a  l* and returns a list of possible parses as (a,l) pairs. @Note that this kind of backtracking parser is very inefficient; 1 reading a large structure may be quite slow (cf "). )Consumes and returns the next character. $ Fails if there is no input left. @Look-ahead: returns the part of the input that is left, without  consuming it. Always fails. Symmetric choice. 5Local, exclusive, left-biased choice: If left parser < locally produces any result at all, then right parser is  not used. 5Transforms a parser into one that does the same, but 2 in addition returns the exact characters read.  IMPORTANT NOTE: "- gives a runtime error if its first argument 2 is built using any occurrences of readS_to_P. =Consumes and returns the next character, if it satisfies the  specified predicate. ,Parses and returns the specified character. )Parses and returns the specified string. CParses the first zero or more characters satisfying the predicate. BParses the first one or more characters satisfying the predicate. ,Combines all parsers in the specified list. Skips all whitespace.  count n p parses n occurrences of p in sequence. A list of  results is returned. between open close p parses open, followed by p and finally  close. Only the value of p is returned.  option x p will either parse p or return x without consuming  any input.  optional p optionally parses p and always returns (). 5Parses zero or more occurrences of the given parser. 4Parses one or more occurrences of the given parser. Like ", but discards the result. Like ", but discards the result.  sepBy p sep$ parses zero or more occurrences of p, separated by sep. ( Returns a list of values returned by p.  sepBy1 p sep# parses one or more occurrences of p, separated by sep. ( Returns a list of values returned by p.  endBy p sep$ parses zero or more occurrences of p, separated and ended  by sep.  endBy p sep# parses one or more occurrences of p, separated and ended  by sep.  chainr p op x$ parses zero or more occurrences of p, separated by op. ! Returns a value produced by a right associative application of all  functions returned by op!. If there are no occurrences of p, x is  returned.  chainl p op x$ parses zero or more occurrences of p, separated by op. ! Returns a value produced by a left associative application of all  functions returned by op!. If there are no occurrences of p, x is  returned. Like "(, but parses one or more occurrences of p. Like "(, but parses one or more occurrences of p. manyTill p end$ parses zero or more occurrences of p, until end 2 succeeds. Returns a list of values returned by p. 7Converts a parser into a Haskell ReadS-style function. ) This is the main way in which you can "run" a " parser:  the expanded type is  / readP_to_S :: ReadP a -> String -> [(a,String)]  7Converts a Haskell ReadS-style function into a parser. @ Warning: This introduces local backtracking in the resulting 2 parser, and therefore a possible inefficiency. """#0non-portable (uses Text.ParserCombinators.ReadP) provisionallibraries@haskell.org Lift a precedence-insensitive " to a #. )Increases the precedence context by one. 'Resets the precedence context to zero.  (prec n p)+ checks whether the precedence context is  less than or equal to n, and  if not, fails  if so, parses p in context n. )Consumes and returns the next character. $ Fails if there is no input left. @Look-ahead: returns the part of the input that is left, without  consuming it. Symmetric choice. 5Local, exclusive, left-biased choice: If left parser < locally produces any result at all, then right parser is  not used. Always fails. ,Combines all parsers in the specified list. $0non-portable (uses Text.ParserCombinators.ReadP) provisionallibraries@haskell.org Haskell lexemes. Floating point literal Integer literal Haskell symbol, e.g. >>, :% Haskell identifier, e.g. foo, Baz %Punctuation or reserved symbol, e.g. (, :: )String literal, with escapes interpreted Character literal @Haskell lexer: returns the lexed string, rather than the lexeme inon-portable (GHC Extensions)internalcvs-ghc@haskell.orgK Parsing of ls, producing values. Minimal complete definition:  (or, for GHC only, ) Derived instances of K' make the following assumptions, which  derived instances of Text.Show.Show obey: A If the constructor is defined to be an infix operator, then the  derived K0 instance will parse only infix applications of * the constructor (not the prefix form). D Associativity is not used to reduce the occurrence of parentheses,  although precedence may be. @ If the constructor is defined using record syntax, the derived K G will parse only the record-syntax form, and furthermore, the fields @ must be given in the same order as the original declaration.  The derived K. instance allows arbitrary Haskell whitespace C between tokens of the input string. Extra parentheses are also  allowed. $For example, given the declarations   infixr 5 :^: - data Tree a = Leaf a | Tree a :^: Tree a the derived instance of K in Haskell 98 is equivalent to  * instance (Read a) => Read (Tree a) where  3 readsPrec d r = readParen (d > app_prec) / (\r -> [(Leaf m,t) | 7 ("Leaf",s) <- lex r, H (m,t) <- readsPrec (app_prec+1) s]) r  2 ++ readParen (d > up_prec) . (\r -> [(u:^:v,w) | D (u,s) <- readsPrec (up_prec+1) r, 6 (":^:",t) <- lex s, G (v,w) <- readsPrec (up_prec+1) t]) r   where app_prec = 10  up_prec = 5 !Note that right-associativity of :^: is unused. -The derived instance in GHC is equivalent to * instance (Read a) => Read (Tree a) where  1 readPrec = parens $ (prec app_prec $ do 7 Ident "Leaf" <- lexP 5 m <- step readPrec 3 return (Leaf m))  - +++ (prec up_prec $ do 5 u <- step readPrec 7 Symbol ":^:" <- lexP 5 v <- step readPrec 4 return (u :^: v))   where app_prec = 10  up_prec = 5  , readListPrec = readListPrecDefault Battempts to parse a value from the front of the string, returning C a list of (parsed value, remaining string) pairs. If there is no / successful parse, the returned list is empty. Derived instances of K and Text.Show.Show satisfy the following:  (x,"") is an element of  ( d (Text.Show.showsPrec d x "")).  That is,  parses the string produced by  Text.Show.showsPrec, and delivers the value that  Text.Show.showsPrec started with.  The method ( is provided to allow the programmer to 4 give a specialised way of parsing lists of values. - For example, this is used by the predefined K instance of  the X] type, where values of type l should be are = expected to use double quotes, rather than square brackets. Proposed replacement for % using new-style parsers (GHC only). Proposed replacement for % using new-style parsers (GHC only).  The default definition uses . Instances that define   should also define  as .  xX[ p parses what p parses, but surrounded with  parentheses.  X[ p parses what p parses, but optionally  surrounded with parentheses. *A possible replacement definition for the  method (GHC only). 7 This is only needed for GHC, and even then only for K instances  where  isn' t defined as . *A possible replacement definition for the  method,  defined using  (GHC only). The ; function reads a single lexeme from the input, discarding G initial white space, and returning the characters that constitute the 9 lexeme. If the input string contains only white space,  returns a  single successful `lexeme'( consisting of the empty string. (Thus   "" = [("","")]'.) If there is no legal lexeme at the  beginning of the input string,  fails (i.e. returns []). DThis lexer is not completely faithful to the Haskell lexical syntax  in the following respects: * Qualified names are not handled properly E Octal and hexadecimal numerics are not recognized as a single token # Comments are not treated properly ;Read a string representation of a character, using Haskell 3 source-language escape conventions. For example: / lexLitChar "\\nHello" = [("\\n", "Hello")] ;Read a string representation of a character, using Haskell E source-language escape conventions, and convert it to the character  that it encodes. For example: . readLitChar "\\nHello" = [('\n', "Hello")] ,Reads a non-empty string of decimal digits. Parse a single lexeme  (paren p) parses "(P0)"  where p parses "P0" in precedence context zero  (parens p) parses "P", "(P0)", "((P0))", etc,  where p parses "P"$ in the current precedence context  and parses "P0" in precedence context zero (list p)# parses a list of things parsed by p, ( using the usual square-bracket syntax. 6Parse the specified lexeme and continue as specified. + Esp useful for nullary constructors; e.g.   choose [("A", return A), ("B" , return B)] KKjnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgdA d5 is an unsigned integral type, with the same size as X]. e8-bit unsigned integer type f16-bit unsigned integer type g32-bit unsigned integer type h64-bit unsigned integer type defghdefghknon-portable (GHC Extensions)internalcvs-ghc@haskell.org\8-bit signed integer type ]16-bit signed integer type ^32-bit signed integer type _64-bit signed integer type \]^_\]^_portable experimentallibraries@haskell.org\]^_\]^_portable experimentallibraries@haskell.orgdefghdefgh&portable provisionalffi@haskell.org Haskell type representing the C jmp_buf type.  Haskell type representing the C fpos_t type.  Haskell type representing the C FILE type.  Haskell type representing the C time_t type. To convert to a Data.Time.UTCTime, use the following formula: 2 posixSecondsToUTCTime (realToFrac :: POSIXTime)  Haskell type representing the C clock_t type.  Haskell type representing the C  sig_atomic_t type.  Haskell type representing the C wchar_t type.  Haskell type representing the C size_t type.  Haskell type representing the C  ptrdiff_t type.  Haskell type representing the C  long double type.  Haskell type representing the C double type.  Haskell type representing the C float type.  Haskell type representing the C unsigned long long type.  Haskell type representing the C  long long type.  Haskell type representing the C  unsigned long type.  Haskell type representing the C long type.  Haskell type representing the C  unsigned int type.  Haskell type representing the C int type.  Haskell type representing the C unsigned short type.  Haskell type representing the C short type.  Haskell type representing the C  unsigned char type.   Haskell type representing the C  signed char type.   Haskell type representing the C char type.       lnon-portable (GHC Extensions)internalcvs-ghc@haskell.org/cA value of type c a) is a computation which, when performed,  does some I/#O before returning a value of type a.  There is really only one way to "perform" an I/O action: bind it to  Main.main2 in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary 0function, unless that function is itself in the c monad and called ,at some point, directly or indirectly, from  Main.main. c is a monad, so c6 actions can be combined using either the do-notation or the 6  and 5  operations from the F  class. ;An abstract type that contains a value for each variant of '. Exceptions that occur in the IO monad.  An  IOException3 records a more specific error type, a descriptive > string and maybe the handle that was used when the error was  flagged. *The Haskell 98 type for exceptions in the c monad.  Any I/O operation may raise an ' instead of returning a result. G For a more general type of exception, including also those that arise  in pure code, see Control.Exception.Exception. 'In Haskell 98, this is an opaque type. -indicates program failure with an exit code. ) The exact interpretation of the code is 9 operating-system dependent. In particular, some values 9 may be prohibited (e.g. 0 on a POSIX-compliant system). "indicates successful termination; )Exceptions generated by array operations 1An attempt was made to evaluate an element of an & array that had not been initialized. .An attempt was made to index an array outside  its declared bounds. Asynchronous exceptions. :This exception is raised by default in the main thread of = the program when the user requests to terminate the program = via the usual mechanism(s) (e.g. Control-C in the console). +This exception is raised by another thread  calling Control.Concurrent.killThread, or by the system . if it needs to terminate the thread for some  reason.  The program'"s heap is reaching its limit, and 8 the program should take action to reduce the amount of  live data it has. Notes: 7 It is undefined which thread receives this exception.  GHC currently does not throw  exceptions. The current thread's stack exceeded its limit. / Since an exception has been raised, the thread's stack 2 will certainly be below its limit again, but the ( programmer should take remedial action  immediately. Exceptions generated by . The String gives information - about the source location of the assertion.  =There are no runnable threads, so the program is deadlocked.  The Deadlock. exception is raised in the main thread only. "DThe thread is awiting to retry an STM transaction, but there are no  other references to any TVars involved, so it can't ever continue. $The thread is blocked on an MVar$, but there are no other references  to the MVar so it can't ever continue. An . is a mutable, boxed, non-strict array in the c monad. $ The type arguments are as follows:  i8: the index type of the array (should be an instance of P)  e!: the element type of the array. &A mutable variable in the c monad '9Three kinds of buffering are supported: line-buffering, B block-buffering or no-buffering. These modes have the following 0 effects. For output, items are written out, or flushed, 8 from the internal buffer according to the buffer mode:  line-buffering&: the entire output buffer is flushed 9 whenever a newline is output, the buffer overflows,  a System.IO.hFlush% is issued, or the handle is closed.  block-buffering/: the entire buffer is written out whenever it  overflows, a System.IO.hFlush% is issued, or the handle is closed.   no-buffering2: output is written immediately, and never stored  in the buffer. ?An implementation is free to flush the buffer more frequently, 0 but not less frequently, than specified above. B The output buffer is emptied as soon as it has been written out. ESimilarly, input occurs according to the buffer mode for the handle:  line-buffering/: when the buffer for the handle is not empty, C the next item is obtained from the buffer; otherwise, when the E buffer is empty, characters up to and including the next newline E character are read into the buffer. No characters are available D until the newline character is available or the buffer is full.  block-buffering0: when the buffer for the handle becomes empty, 4 the next block of data is read into the buffer.   no-buffering,: the next input item is read and returned.  The System.IO.hLookAhead+ operation implies that even a no-buffered / handle may require a one-character buffer. 6The default buffering mode when a handle is opened is C implementation-dependent and may depend on the file system object # which is attached to that handle. K For most implementations, physical files will normally be block-buffered / and terminals will normally be line-buffered. (/block-buffering should be enabled if possible.  The size of the buffer is n items if the argument  is  n, and is otherwise implementation-dependent. ).line-buffering should be enabled if possible. *#buffering is disabled if possible. +,File and directory names are values of type l, whose precise H meaning is operating system dependent. Files can be opened, yielding a H handle which can then be used to operate on the contents of that file. ,KHaskell defines operations to read and write characters from and to files,  represented by values of type Handle . Each value of this type is a  handle2: a record used by the Haskell run-time system to manage I/O L with file system objects. A handle has at least the following properties: - whether it manages input or output or both;  whether it is open, closed or  semi-closed; ! whether the object is seekable; E whether buffering is disabled, or enabled on a line or block basis; & a buffer (whose length may be zero). 'Most handles will also have a current I/%O position indicating where the next 4 input or output operation will occur. A handle is readable if it > manages only input or both input and output; likewise, it is writable if ? it manages only output or both input and output. A handle is open when  first allocated. H Once it is closed it can no longer be used for either input or output, E though an implementation cannot re-use its storage while references # remain to it. Handles are in the O and B  classes. The string E produced by showing a handle is system dependent; it should include G enough information to identify the handle for debugging. A handle is  equal according to 1  only to itself; no attempt J is made to compare the internal state of different handles for equality.  GHC note: a ,/ will be automatically closed when the garbage C collector detects that it has become unreferenced by the program. B However, relying on this behaviour is not generally recommended: D the garbage collector is unpredictable. If possible, use explicit  an explicit hClose to close ,s when they are no longer ; required. GHC does not currently attempt to free up file B descriptors when they have run out, it is your responsibility to  ensure that this doesn' t happen. -An .+-* (pronounced "em-var"$) is a synchronising variable, used Dfor communication between concurrent threads. It can be thought of (as a a box, which may be empty or full. /?A monad transformer embedding strict state transformers in the c  monad. The Xe- parameter indicates that the internal state  used by the  . computation is a special one supplied by the c < monad, and thus distinct from those used by invocations of  . 2 This is the " back door" into the c monad, allowing c/ computation to be performed at any time. For this to be safe, the c computation should be 9free of side effects and independent of its environment. If the I/O computation wrapped in 2, Cperforms side effects, then the relative order in which those side *effects take place (relative to the main I/O trunk, or other calls to 2,2) is indeterminate. You have to be careful when 'writing and compiling modules that use 2,:  Use {-# NOINLINE foo #-} as a pragma on any function foo  that calls 2,. If the call is inlined,  the I/#O may be performed more than once.  Use the compiler flag -fno-cse" to prevent common sub-expression G elimination being performed on the module, which might combine I two side effects that were meant to be separate. A good example 1 is using multiple global variables (like test in the example below). E Make sure that the either you switch off let-floating, or that the  call to 2,/ cannot float outside a lambda. For example,  if you say:   , f x = unsafePerformIO (newIORef [])   H you may get only one reference cell shared between all calls to f.  Better would be   - f x = unsafePerformIO (newIORef [x])    because now it can't float outside the lambda. It is less well known that 2,! is not type safe. For example:   test :: IORef [a] * test = unsafePerformIO $ newIORef []   main = do " writeIORef test [42] $ bang <- readIORef test $ print (bang :: [Char]) GThis program will core dump. This problem with polymorphic references Bis well known in the ML community, and does not arise with normal Gmonadic use of references. There is no easy way to make it impossible  once you use 2,. Indeed, it is possible to write coerce :: a -> b with the help of 2,. So be careful! This version of 2, is slightly more efficient, Dbecause it omits the check that the IO is only being performed by a &single thread. Hence, when you write , Dthere is a possibility that the IO action may be performed multiple Btimes (on a multiprocessor), and you should therefore ensure that %it gives the same results each time. 33, allows c$ computation to be deferred lazily. When passed a value of type IO a, the c will only be performed when the value of the a. is demanded. This is used to implement lazy file reading, see System.IO.hGetContents. DEnsures that the suspensions under evaluation by the current thread Care unique; that is, the current thread is not evaluating anything Gthat is also under evaluation by another thread that has also executed . ,This operation is used in the definition of 2, to Kprevent the IO action from being executed multiple times, which is usually  undesirable. 4 Build a new &) 5Read the value of an &) 6Write a new value into an &)  Build a new  Read a value from an  Write a new value into an  Read a value from an  Write a new value into an  7 Raise an ' in the c monad. 8 Construct an '+ value with a string describing the error.  The 4  method of the c instance of the F  class raises a  8', thus:  instance Monad IO where  ... " fail s = ioError (userError s) 9 A variant of " that can only be used within the c monad.  Although 9/ has a type that is an instance of the type of , the % two functions are subtly different:  ! throw e `seq` x ===> throw e  throwIO e `seq` x ===> x +The first example will cause the exception e to be raised,  whereas the second one won' t. In fact, 9 will only cause 6 an exception to be raised when it is used within the c monad.  The 9) variant should be used in preference to  to  raise an exception within the c monad because it guarantees  ordering with respect to other c operations, whereas   does not. : Applying : to a computation will 7 execute that computation with asynchronous exceptions  blocked. That is, any thread which ; attempts to raise an exception in the current thread with Control.Exception.throwTo will be @ blocked until asynchronous exceptions are enabled again. There's E no need to worry about re-enabling asynchronous exceptions; that is , done automatically on exiting the scope of  :. Threads created by Control.Concurrent.forkIO inherit the blocked D state from the parent; that is, to start a thread in blocked mode,  use block $ forkIO ..... This is particularly useful if you need to @ establish an exception handler in the forked thread before any ' asynchronous exceptions are received. ;9To re-enable asynchronous exceptions inside the scope of  :, ; can be ; used. It scopes in exactly the same way, so on exit from  ;& asynchronous exception delivery will  be disabled again. <;returns True if asynchronous exceptions are blocked in the  current thread. =BForces its argument to be evaluated to weak head normal form when  the resultant c- action is executed. It can be used to order " evaluation with respect to other c operations; its semantics are  given by   evaluate x `seq` y ==> y 6 evaluate x `catch` f ==> (return $! x) `catch` f 2 evaluate x >>= f ==> (return $! x) >>= f Note:! the first equation implies that  (evaluate x) is not the  same as  (return $! x). A correct definition is ) evaluate x = (return $! x) >>= return c    !"#$%&'()*+         ,  -.  / 0123       456      !78 " #9:;<= $c      !!"##$%%&'*)(()*+               ,    -..  / 0123       456      !78 " #9:;<= $,portable provisionallibraries@haskell.org2323mnon-portable (GHC extensions)internalcvs-ghc@haskell.orgp8Selects alphabetic or numeric digit Unicode characters. FNote that numeric digits outside the ASCII range are selected by this  function but not by s*. Such digits may be part of identifiers B but are not used by the printer and reader to represent numbers. q"Selects ASCII hexadecimal digits,  i.e. '0'..'9', 'a'..'f', 'A'..'F'. r!Selects ASCII octal digits, i.e. '0'..'7'. sSelects ASCII digits, i.e. '0'..'9'. tBSelects alphabetic Unicode characters (lower-case, upper-case and N title-case letters, plus letters of caseless scripts and modifiers letters).  This function is equivalent to Data.Char.isLetter. u<Selects lower-case alphabetic Unicode characters (letters). vJSelects upper-case or title-case alphabetic Unicode characters (letters). C Title case is used by a small number of letter ligatures like the  single-character form of Lj. w5Selects white-space characters in the Latin-1 range. G (In Unicode terms, this includes spaces and some control characters.) x%Selects printable Unicode characters = (letters, numbers, marks, punctuation, symbols and spaces). yESelects control characters, which are the non-printing characters of  the Latin-1 subset of Unicode. z?Selects the first 256 characters of the Unicode character set, : corresponding to the ISO 8859-1 (Latin-1) character set. {?Selects the first 128 characters of the Unicode character set, + corresponding to the ASCII character set. B"Selects ASCII lower-case letters, ! i.e. characters satisfying both { and u. C"Selects ASCII upper-case letters, ! i.e. characters satisfying both { and v. DAConvert a letter to the corresponding lower-case letter, if any. , Any other character is returned unchanged. EAConvert a letter to the corresponding upper-case letter, if any. , Any other character is returned unchanged. F?Convert a letter to the corresponding title-case or upper-case G letter, if any. (Title case differs from upper case only for a small  number of ligature letters.) , Any other character is returned unchanged. pqrstuvwxyz{ %BCDEFpqrstuvwxyz{ %BCDEFportablestablelibraries@haskell.org'G?Unicode General Categories (column 2 of the UnicodeData table) 7 in the order they are listed in the Unicode standard. HCn: Other, Not Assigned ICo: Other, Private Use JCs: Other, Surrogate KCf: Other, Format LCc: Other, Control MZp: Separator, Paragraph NZl: Separator, Line OZs: Separator, Space PSo: Symbol, Other QSk: Symbol, Modifier RSc: Symbol, Currency SSm: Symbol, Math TPo: Punctuation, Other UPf: Punctuation, Final quote VPi: Punctuation, Initial quote WPe: Punctuation, Close XPs: Punctuation, Open YPd: Punctuation, Dash ZPc: Punctuation, Connector [No: Number, Other \Nl: Number, Letter ]Nd: Number, Decimal ^Me: Mark, Enclosing _Mc: Mark, Spacing Combining `Mn: Mark, Non-Spacing aLo: Letter, Other bLm: Letter, Modifier cLt: Letter, Titlecase dLl: Letter, Lowercase eLu: Letter, Uppercase fConvert a single digit X] to the corresponding X]. 3 This function fails unless its argument satisfies q, = but recognises both upper and lower-case hexadecimal digits  (i.e. '0'..'9', 'a'..'f', 'A'..'F'). g/The Unicode general category of the character. hBSelects alphabetic Unicode characters (lower-case, upper-case and N title-case letters, plus letters of caseless scripts and modifiers letters).  This function is equivalent to Data.Char.isAlpha. iBSelects Unicode mark characters, e.g. accents and the like, which ! combine with preceding letters. jBSelects Unicode numeric characters, including digits from various  scripts, Roman numerals, etc. k@Selects Unicode punctuation characters, including various kinds % of connectors, brackets and quotes. l>Selects Unicode symbol characters, including mathematical and  currency symbols. m0Selects Unicode space and separator characters. @lpqrstuvwxyz{BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm?lywuvtpxsrqhijklm{zCBGedcba`_^]\[ZYXWVUTSRQPONMLKJIHgEDFf'Gedcba`_^]\[ZYXWVUTSRQPONMLKJIHHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmportablestablelibraries@haskell.orgDnThe n. function drops the given prefix from a list.  It returns + if the list did not start with the prefix  given, or ( 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 oThe o1 function returns the index of the first element & in the given list which is equal (by 1 ) to the query element,  or  if there is no such element. pThe p function extends o, by returning the I indices of all elements equal to the query element, in ascending order. qThe q7 function takes a predicate and a list and returns the 6 first element in the list matching the predicate, or  if  there is no such element. rThe r3 function takes a predicate and a list and returns F the index of the first element in the list satisfying the predicate,  or  if there is no such element. sThe s function extends r, by returning the G indices of all elements satisfying the predicate, in ascending order. tThe t& function takes two lists and returns xX[ / iff the first list is a prefix of the second. uThe u& function takes two lists and returns xX[ / iff the first list is a suffix of the second.  Both lists must be finite. vThe v& function takes two lists and returns xX[ 5 iff the first list is contained, wholly and intact,  anywhere within the second.  Example: 5isInfixOf "Haskell" "I really like Haskell." -> True 2isInfixOf "Ial" "I really like Haskell." -> False wThe w2 function removes duplicate elements from a list. D In particular, it keeps only the first occurrence of each element.  (The name w means `essence'.)  It is a special case of x(, which allows the programmer to supply  their own equality test. xThe x function behaves just like w, except it uses a < user-supplied equality predicate instead of the overloaded 1   function. yy x! removes the first occurrence of x from its list argument.  For example,   delete 'a' "banana" == "bnana" It is a special case of z!, which allows the programmer to ! supply their own equality test. zThe z function behaves like y, but takes a # user-supplied equality predicate. {The {1 function is list difference ((non-associative).  In the result of xs { ys*, the first occurrence of each element of  ys( in turn (if any) has been removed from xs. Thus   (xs ++ ys) \\ xs == ys. It is a special case of , which allows the programmer $ to supply their own equality test. |The |3 function returns the list union of the two lists.  For example,   "dog" `union` "cow" == "dogcw" ADuplicates, and elements of the first list, are removed from the E the second list, but if the first list contains duplicates, so will  the result.  It is a special case of }(, which allows the programmer to supply  their own equality test. }The }+ function is the non-overloaded version of |. ~The ~4 function takes the list intersection of two lists.  For example,  * [1,2,3,4] `intersect` [2,4,6,8] == [2,4] ;If the first list contains duplicates, so will the result.  It is a special case of !, which allows the programmer to ! supply their own equality test. The + function is the non-overloaded version of ~. The * function takes an element and a list and  ` intersperses'0 that element between the elements of the list.  For example, ( intersperse ',' "abcde" == "a,b,c,d,e"  xs xss is equivalent to (  ( xs xss)).  It inserts the list xs in between the lists in xss and concatenates the  result. The ; function transposes the rows and columns of its argument.  For example, 4 transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]] The / function takes a predicate a list and returns ? the pair of lists of elements which do and do not satisfy the  predicate, respectively; i.e., 6 partition p xs == (filter p xs, filter (not . p) xs) The ( function behaves like a combination of  and  ;; it applies a function to each element of a list, passing E an accumulating parameter from left to right, and returning a final 7 value of this accumulator together with the new list. The ( function behaves like a combination of  and  ;; it applies a function to each element of a list, passing E an accumulating parameter from right to left, and returning a final 7 value of this accumulator together with the new list. The 6 function takes an element and a list and inserts the C element into the list at the last position where it is still less @ than or equal to the next element. In particular, if the list < is sorted before the call, the result will also be sorted.  It is a special case of !, which allows the programmer to ' supply their own comparison function. The non-overloaded version of . ( returns the maximum value from a list, : which must be non-empty, finite, and of an ordered type.  It is a special case of , which allows the 5 programmer to supply their own comparison function. ( returns the minimum value from a list, : which must be non-empty, finite, and of an ordered type.  It is a special case of , which allows the 5 programmer to supply their own comparison function. The 1 function takes a comparison function and a list J and returns the greatest element of the list by the comparison function. ( The list must be finite and non-empty. The 1 function takes a comparison function and a list G and returns the least element of the list by the comparison function. ( The list must be finite and non-empty. The & function is an overloaded version of . In % particular, instead of returning an X], it returns any type which is  an instance of I'. It is, however, less efficient than . The & function is an overloaded version of , which  accepts any E* value as the number of elements to take. The & function is an overloaded version of , which  accepts any E* value as the number of elements to drop. The & function is an overloaded version of , which  accepts any E* value as the position at which to split. The & function is an overloaded version of , which  accepts any E value as the index. The & function is an overloaded version of ,  which accepts any E- value as the number of repetitions to make. The 1 function takes four lists and returns a list of  quadruples, analogous to  . The 1 function takes five lists and returns a list of  five-tuples, analogous to  . The < function takes six lists and returns a list of six-tuples,  analogous to  . The 2 function takes seven lists and returns a list of  seven-tuples, analogous to  . The / function takes a function which combines four H elements, as well as four lists and returns a list of their point-wise  combination, analogous to . The / function takes a function which combines five H elements, as well as five lists and returns a list of their point-wise  combination, analogous to . The . function takes a function which combines six G elements, as well as six lists and returns a list of their point-wise  combination, analogous to . The 0 function takes a function which combines seven I elements, as well as seven lists and returns a list of their point-wise  combination, analogous to . The 6 function takes a list of quadruples and returns four  lists, analogous to . The 7 function takes a list of five-tuples and returns five  lists, analogous to . The 5 function takes a list of six-tuples and returns six  lists, analogous to . The 3 function takes a list of seven-tuples and returns  seven lists, analogous to . The . function takes a predicate and two lists and E returns the first list with the first occurrence of each element of  the second list removed. The 8 function takes a list and returns a list of lists such K that the concatenation of the result is equal to the argument. Moreover, H each sublist in the result contains only equal elements. For example,  < group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"] It is a special case of (, which allows the programmer to supply  their own equality test. The + function is the non-overloaded version of . The 8 function returns all initial segments of the argument,  shortest first. For example, $ inits "abc" == ["","a","ab","abc"] The 6 function returns all final segments of the argument,  longest first. For example, & tails "abc" == ["abc", "bc", "c",""] The @ function returns the list of all subsequences of the argument. = subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"] &The  &@ function returns the list of all subsequences of the argument,  except for the empty list. B nonEmptySubsequences "abc" == ["a","b","ab","c","ac","bc","abc"] The @ function returns the list of all permutations of the argument. = permutations "abc" == ["abc","bac","cba","bca","cab","acb"] The + function is the non-overloaded version of . The 1 function implements a stable sorting algorithm.  It is a special case of (, which allows the programmer to supply  their own comparison function. The  function is a `dual' to : while  $ reduces a list to a summary value,  builds a list from ; a seed value. The function takes the element and returns  - if it is done producing the list or returns  (a,b) , in which  case, a is a prepended to the list and b is used as the next , element in a recursive call. For example,  , iterate f == unfoldr (\x -> Just (x, f x)) In some cases,  can undo a  operation:  ! unfoldr f' (foldr f z xs) == xs if the following holds:   f' (f x y) = Just (x,y)  f' z = Nothing A simple use of unfoldr: > unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10  [10,9,8,7,6,5,4,3,2,1] A strict version of .  is a variant of & that has no starting value argument, . and thus must be applied to non-empty lists. A strict version of  The 8 function computes the sum of a finite list of numbers. The < function computes the product of a finite list of numbers. 6 breaks a string up into a list of strings at newline = characters. The resulting strings do not contain newlines.  is an inverse operation to . @ It joins lines, after appending a terminating newline to each. ? breaks a string up into a list of words, which were delimited  by white space.  is an inverse operation to . ( It joins words with separating spaces. o nopqrstuvwxyz{|}~o ntuvq oprs wy{|~xz}Cnopqrstuvwxyz{|}~-portable provisionallibraries@haskell.org 7A sample (and useful) hash function for Int and Int32, ? implemented by extracting the uppermost 32 bits of the 64-bit C result of multiplying by a 33-bit constant. The constant is from ' Knuth, derived from the golden ratio:  & golden = round ((sqrt 5 - 1) * 2^32) +We get good key uniqueness on small inputs % (a problem with previous versions): 5 (length $ group $ sort $ map hashInt [-32767..65536]) == 65536 + 32768 @A sample hash function for Strings. We keep multiplying by the 2 golden ratio and adding. The implementation is:   hashString = foldl' f golden < where f m c = fromIntegral (ord c) * magic + hashInt32 m  magic = 0xdeadbeef 3Where hashInt32 works just as hashInt shown above. >Knuth argues that repeated multiplication by the golden ratio 2 will minimize gaps in the hash space, and thus it's a good choice 3 for combining together multiple keys to form one. DHere we know that individual characters c are often small, and this 8 produces frequent collisions if we use ord c alone. A = particular problem are the shorter low ASCII and ISO-8859-1 B character strings. We pre-multiply by a magic twiddle factor to A obtain a good distribution. In fact, given the following test:   testp :: Int32 -> Int A testp k = (n - ) . length . group . sort . map hs . take n $ ls : where ls = [] : [c : l | l <- ls, c <- ['\0'..'\xff']]  hs = foldl' f golden 8 f m c = fromIntegral (ord c) * k + hashInt32 m  n = 100000 "We discover that testp magic = 0. 0A prime larger than the maximum hash table size FCreates a new hash table. The following property should hold for the eq  and hash functions passed to -:  eq A B => hash A == hash B  Inserts a key/#value mapping into the hash table.  Note that - doesn'(t remove the old entry from the table - 2 the behaviour is like an association list, where - returns A the most-recently-inserted mapping for a key in the table. The  reason for this is to keep - as efficient as possible. If / you need to update a mapping, then we provide -. %Remove an entry from the hash table. .Updates an entry in the hash table, returning xX[ if there was # already an entry for this key, or X[ otherwise. After - H there will always be exactly one entry for the given key in the table. - is more efficient than - if you don' t care about A multiple entries, or you know for sure that multiple entries can't  occur. However, - is more efficient than - followed  by -. /Looks up the value of a key in the hash table. Convert a list of key/1value pairs into a hash table. Equality on keys 1 is taken from the Eq instance for the key type. &Converts a hash table to a list of key/ value pairs. :This function is useful for determining whether your hash E function is working well for your data set. It returns the longest  chain of key/5value pairs in the hash table for which all the keys D hash to the same bucket. If this chain is particularly long (say, E longer than 14 elements or so), then it might be a good idea to try  a different hash function.   portable provisionallibraries@haskell.org  Reads an unsigned E value in an arbitrary base. +Read an unsigned number in octal notation. -Read an unsigned number in decimal notation. 1Read an unsigned number in hexadecimal notation. / Both upper or lower case letters are allowed.  Reads an unsigned N value, + expressed in decimal scientific notation. Reads a signed L. value, given a reader for an unsigned value. Show  non-negative E numbers in base 10. Show a signed M value / using scientific (exponential) notation (e.g. 2.45e2, 1.5e-3).  In the call  digs val, if digs is , * the value is shown to full precision; if digs is  d,  then at most d+ digits after the decimal point are shown. Show a signed M value ' using standard decimal notation (e.g. 245000, 0.0015).  In the call  digs val, if digs is , * the value is shown to full precision; if digs is  d,  then at most d+ digits after the decimal point are shown. Show a signed M value J using standard decimal notation for arguments whose absolute value lies  between 0.1 and  9,999,999%, and scientific notation otherwise.  In the call  digs val, if digs is , * the value is shown to full precision; if digs is  d,  then at most d+ digits after the decimal point are shown. Shows a  non-negative E( number using the base specified by the K first argument, and the character representation specified by the second. Show  non-negative E numbers in base 16. Show  non-negative E numbers in base 8. hijhij nnon-portable (GHC Extensions)internalffi@haskell.org iA value of type i a* represents a pointer to an object, or an E array of objects, which may be marshalled to or from Haskell values  of type a.  The type a$ will often be an instance of class  Foreign.Storable.Storable, which provides the marshalling operations. H However this is not essential, and you can provide your own operations C to access the pointer. For example you might write small foreign + functions to get or set the fields of a C struct. jA value of type j a% is a pointer to a function callable  from foreign code. The type a will normally be a  foreign type, 3 a function type with zero or more arguments where  the argument types are marshallable foreign types,  i.e. X], X], Prelude.Double,  Prelude.Float,  X[,  Data.Int.Int8, Data.Int.Int16, Data.Int.Int32,  Data.Int.Int64, Data.Word.Word8, Data.Word.Word16,  Data.Word.Word32, Data.Word.Word64, i a, j a,  Foreign.StablePtr.StablePtr a or a renaming of any of these  using newtype. G the return type is either a marshallable foreign type or has the form   Prelude.IO t where t# is a marshallable foreign type or (). A value of type j a) may be a pointer to a foreign function, @ either returned by another foreign function or imported with a  a static address import like  ' foreign import ccall "stdlib.h &free" % p_free :: FunPtr (Ptr a -> IO ()) 3or a pointer to a Haskell function created using a wrapper stub  declared to produce a j$ of the correct type. For example:  # type Compare = Int -> Int -> Bool  foreign import ccall "wrapper" / mkCompare :: Compare -> IO (FunPtr Compare) Calls to wrapper stubs like  mkCompare allocate storage, which  should be released with Foreign.Ptr.freeHaskellFunPtr when no  longer required.  To convert j0 values to corresponding Haskell functions, one  can define a dynamic* stub for the specific foreign type, e.g. " type IntFunction = CInt -> IO () ! foreign import ccall "dynamic" . mkFun :: FunPtr IntFunction -> IntFunction  The constant # contains a distinguished value of i 6 that is not associated with a valid memory location. The 4 function casts a pointer from one type to another. 9Advances the given address by the given offset in bytes. 8Given an arbitrary address and an alignment constraint,  2 yields the next higher address that fulfills the 0 alignment constraint. An alignment constraint x is fulfilled by  any address divisible by x!. This operation is idempotent. AComputes the offset required to get from the second to the first  argument. We have ' p2 == p1 `plusPtr` (p2 `minusPtr` p1)  The constant  contains a  distinguished value of j that is not * associated with a valid memory location. Casts a j to a j of a different type. Casts a j to a i. Note:= this is valid only on architectures where data and function H pointers range over the same set of addresses, and should only be used F for bindings to external libraries whose interface already relies on  this assumption. Casts a i to a j. Note:= this is valid only on architectures where data and function H pointers range over the same set of addresses, and should only be used F for bindings to external libraries whose interface already relies on  this assumption. ij ijonon-portable (GHC Extensions)internalffi@haskell.org>Create a stable pointer referring to the given Haskell value. bA stable pointer0 is a reference to a Haskell expression that is Nguaranteed not to be affected by garbage collection, i.e., it will neither be Jdeallocated nor will the value of the stable pointer itself change during Hgarbage collection (ordinary references may be relocated during garbage Kcollection). Consequently, stable pointers can be passed to foreign code, >which can treat it as an opaque reference to a Haskell value. A value of type  StablePtr a" is a stable pointer to a Haskell expression of type a. DDissolve the association between the stable pointer and the Haskell 7 value. Afterwards, if the stable pointer is passed to   or , the behaviour is @ undefined. However, the stable pointer may still be passed to   , but the Foreign.Ptr.Ptr () value returned  by -, in this case, is undefined (in particular,  it may be Foreign.Ptr.nullPtr). Nevertheless, the call  to  is guaranteed not to diverge. CObtain the Haskell value referenced by a stable pointer, i.e., the 9 same value that was passed to the corresponding call to   makeStablePtr. If the argument to  has  already been freed using , the behaviour of   is undefined. DCoerce a stable pointer to an address. No guarantees are made about E the resulting value, except that the original stable pointer can be  recovered by &. In particular, the address may not F refer to an accessible memory location and any attempt to pass it to # the member functions of the class Foreign.Storable.Storable leads to  undefined behaviour. The inverse of , i.e., we have the identity  2 sp == castPtrToStablePtr (castStablePtrToPtr sp) for any stable pointer sp on which  has # not been executed yet. Moreover,  may 8 only be applied to pointers that have been produced by  . b 'b ' 'portable provisionalffi@haskell.orgbbpnon-portable (GHC Extensions)internalffi@haskell.org ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F Gqnon-portable (GHC extensions)internalcvs-ghc@haskell.org0 stops execution and displays an error message. A special case of . D It is expected that compilers will recognize this and insert error = messages which are more appropriate to the context in which   appears.  H Hportable experimentallibraries@haskell.org Q The class Q/ allows a concrete representation of a type to  be calculated. R$Variant for unary type constructors S%Variant for binary type constructors T$Variant for 3-ary type constructors U$Variant for 4-ary type constructors V$Variant for 5-ary type constructors W$Variant for 6-ary type constructors X$Variant for 7-ary type constructors The type-safe cast operation 2Applies a type constructor to a sequence of types  Builds a - object representing a type constructor. An  implementation of  Data.Typeable) should ensure that the following holds:  mkTyCon "a" == mkTyCon "a" Takes a value of type a' and returns a concrete representation  of that type. The value& of the argument should be ignored by  any instance of Q, so that it is safe to pass  as  the argument. 3An abstract representation of a type constructor.  objects can  be built using . 4A concrete representation of a (monomorphic) type.  ) supports reasonably efficient equality. +Returns a unique integer associated with a  . This can , be used for making a mapping with TypeReps 2 as the keys, for example. It is guaranteed that t1 == t2 if and only if  typeRepKey t1 == typeRepKey t2.  It is in the c/ monad because the actual value of the key may ? vary from run to run of the program. You should only rely on I the equality property, not any actual key value. The relative ordering  of keys has no meaning either. A special case of , which applies the function & type constructor to a pair of types. &Splits a type constructor application -Applies a type to a function type. Returns:  u if the . first argument represents a function of type t -> u and the / second argument represents a function of type t. Otherwise,  returns . &Adds a TypeRep argument to a TypeRep. 6Observe the type constructor of a type representation 4Observe the argument types of a type representation 1Observe string encoding of a type representation For defining a Q instance from any R instance. For defining a R instance from any S instance. For defining a S instance from any T instance. For defining a T instance from any U instance. For defining a U instance from any V instance. For defining a V instance from any W instance. For defining a W instance from any X instance. 9A flexible variation parameterised in a type constructor Cast for * -> * Cast for * -> * -> * (QRSTUVWX(QRSTUVWX(QRSTUVWXportable experimentallibraries@haskell.orgkThe k; type represents values with two possibilities: a value of type k a b is either m a or n b. The k6 type is sometimes used to represent a value which is /either correct or an error; by convention, the m constructor is $used to hold an error value and the n constructor is used to  hold a correct value (mnemonic: "right" also means "correct"). Case analysis for the k type.  If the value is m a, apply the first function to a;  if it is n b, apply the second function to b. Extracts from a list of k all the m elements  All the m" elements are extracted in order. Extracts from a list of k all the n elements  All the n" elements are extracted in order. Partitions a list of k into two lists  All the m0 elements are extracted, in order, to the first ) component of the output. Similarly the n elements are extracted ( to the second component of the output. kmnkmnkmnmn'portable provisionallibraries@haskell.orgThe construct ' comp( exposes IO errors which occur within a / computation, and which are not fully handled. Non-I/:O exceptions are not caught by this variant; to catch all  exceptions, use Control.Exception.try from Control.Exception.  Construct an '- of the given type where the second argument @ describes the error location and the third and fourth argument C contain the file handle and file path of the file involved in the  error if applicable. An error indicating that an c operation failed because & one of its arguments already exists. An error indicating that an c operation failed because & one of its arguments does not exist. An error indicating that an c operation failed because A one of its arguments is a single-use resource, which is already B being used (for example, opening the same file twice for writing  might give this error). An error indicating that an c operation failed because  the device is full. An error indicating that an c operation failed because # the end of file has been reached. An error indicating that an c operation failed because ! the operation was not possible. " Any computation which returns an c result may fail with  '0. In some cases, an implementation will not be F able to distinguish between the possible error causes. In this case  it should fail with '. An error indicating that an c operation failed because > the user does not have sufficient operating system privilege  to perform that operation. 3A programmer-defined error value constructed using 8'. I/@O error where the operation failed because one of its arguments  already exists. I/@O error where the operation failed because one of its arguments  does not exist. I/@O error where the operation failed because one of its arguments 8 is a single-use resource, which is already being used. I/?O error where the operation failed because the device is full. I/?O error where the operation failed because the end of file has  been reached. I/-O error where the operation is not possible. I/=O error where the operation failed because the user does not G have sufficient operating system privilege to perform that operation. I/$O error that is programmer-defined.  I/@O error where the operation failed because one of its arguments  already exists.  I/@O error where the operation failed because one of its arguments  does not exist.  I/@O error where the operation failed because one of its arguments 8 is a single-use resource, which is already being used.  I/?O error where the operation failed because the device is full.  I/?O error where the operation failed because the end of file has  been reached. I/-O error where the operation is not possible. I/=O error where the operation failed because the user does not G have sufficient operating system privilege to perform that operation. I/$O error that is programmer-defined.  Catch any ', that occurs in the computation and throw a  modified version. BAdds a location description and maybe a file path and file handle  to an '7. If any of the file handle or file path is not given  the corresponding value in the ' remains unaltered. +78A     *8     7&     0non-portable (uses Text.ParserCombinators.ReadP) provisionallibraries@haskell.orgequivalent to  with a precedence of 0. The 3 function reads input from a string, which must be + completely consumed by the input process. (KKrnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgBA weak pointer object with a key and a value. The value has type v. AA weak pointer expresses a relationship between two objects, the key and the value/: if the key is considered to be alive by the Cgarbage collector, then the value is also alive. A reference from the value to the key does not keep the key alive. 1A weak pointer may also have a finalizer of type IO (); if it does, Ethen the finalizer will be run at most once, at a time after the key 'has become unreachable by the program ("dead"). The storage manager Eattempts to run the finalizer(s) for an object soon after the object *dies, but promptness is not guaranteed. BIt is not guaranteed that a finalizer will eventually run, and no Fattempt is made to run outstanding finalizers when the program exits. ETherefore finalizers should not be relied on to clean up resources - Gother methods (eg. exception handlers) should be employed, possibly in addition to finalisers. EReferences from the finalizer to the key are treated in the same way Bas references from the value to the key: they do not keep the key Aalive. A finalizer may therefore ressurrect the key, perhaps by 'storing it in the same data structure. CThe finalizer, and the relationship between the key and the value, Aexist regardless of whether the program keeps a reference to the . object or not. @There may be multiple weak pointers with the same key. In this Acase, the finalizers for each of these weak pointers will all be Crun in some arbitrary order, or perhaps concurrently, when the key Cdies. If the programmer specifies a finalizer that assumes it has Dthe only reference to an object (for example, a file that it wishes Bto close), then the programmer must ensure that there is only one such finalizer. DIf there are no other threads to run, the runtime system will check Ffor runnable finalizers before declaring the system to be deadlocked.  Establishes a weak pointer to k , with value v and a finalizer. @This is the most general interface for building a weak pointer. !>Dereferences a weak pointer. If the key is still alive, then  v is returned (where v is the value! in the weak pointer), otherwise  is returned. The return value of !.' depends on when the garbage collector runs, hence it is in the c monad. "@Causes a the finalizer associated with a weak pointer to be run  immediately.  I J !" K I I J !" K)portable experimentallibraries@haskell.org#Make a . pointer to an &) $Mutate the contents of an &) %'Atomically modifies the contents of an &). "This function is useful for using &)" in a safe way in a multithreaded  program. If you only have one &) , then using %) to 4 access and modify it will prevent race conditions. $Extending the atomicity to multiple &)s is problematic, so it A is recommended that if you need to do anything more complicated  then using Control.Concurrent.MVar.MVar instead is a good idea. &456#$%&456$%##$%snon-portable (GHC Extensions)internalcvs-ghc@haskell.org}~ L M L M/portable experimentallibraries@haskell.org&A value of type &/3 is an object encapsulated together with its type. A &/7 may only represent a monomorphic value; an attempt to  create a value of type &/ from a polymorphically-typed 4 expression will result in an ambiguity error (see '/). Oing a value of type &/) returns a pretty-printed representation  of the object's type; useful for debugging. '3Converts an arbitrary value into an object of type &/. .The type of the object must be an instance of Q, which E ensures that only monomorphically-typed objects may be converted to  &/(. To convert a polymorphic object into &/ , give it - a monomorphic type signature. For example:  toDyn (id :: Int -> Int) ( Converts a &// object back into an ordinary Haskell value of  the correct type. See also )/. ) Converts a &// object back into an ordinary Haskell value of  the correct type. See also (/. /QRSTUVWX&'()*+,&'()*+,&'()*+,%portable provisionalffi@haskell.org @The member functions of this class facilitate writing values of Fprimitive types to raw memory (which may have been allocated with the @above mentioned routines) and reading values from blocks of raw Dmemory. The class, furthermore, includes support for computing the Cstorage requirements and alignment restrictions of storable types. 3Memory addresses are represented as values of type i a , for some a which is an instance of class %. The type argument to i= helps provide some valuable type safety in FFI code (you can't Amix pointers of different types without an explicit cast), while Ghelping the Haskell type system figure out which marshalling method is needed for a given pointer. BAll marshalling between Haskell and a foreign language ultimately Bboils down to translating Haskell data structures into the binary @representation of a corresponding data structure of the foreign Elanguage and vice versa. To code this marshalling in Haskell, it is Dnecessary to manipulate primitive data types stored in unstructured memory blocks. The class %" facilitates this manipulation on Eall types for which it is instantiated, which are the standard basic !types of Haskell, the fixed size Int types (\, ], ^, _), the fixed size Word types (e, f, g, h), b, all types from Foreign.C.Types,  as well as i. Minimal complete definition: -%, .% , one of 3%, /% and 1% , and one of 4%, 0% and 2%. ->Computes the storage requirements (in bytes) of the argument. ( The value of the argument is not used. .7Computes the alignment constraint of the argument. An  alignment constraint x' is fulfilled by any address divisible  by x*. The value of the argument is not used. /5Read a value from a memory area regarded as an array C of values of the same kind. The first argument specifies F the start address of the array and the second the index into = the array (the first element of the array has index  0"). The following equality holds,  2 peekElemOff addr idx = IOExts.fixIO $ \result -> / peek (addr `plusPtr` (idx * sizeOf result)) ,Note that this is only a specification, not 8 necessarily the concrete implementation of the  function. 07Write a value to a memory area regarded as an array of A values of the same kind. The following equality holds:  pokeElemOff addr idx x = , poke (addr `plusPtr` (idx * sizeOf x)) x 14Read a value from a memory location given by a base < address and offset. The following equality holds: 2 peekByteOff addr off = peek (addr `plusPtr` off) 23Write a value to a memory location given by a base < address and offset. The following equality holds: 6 pokeByteOff addr off x = poke (addr `plusPtr` off) x 3-Read a value from the given memory location. =Note that the peek and poke functions might require properly A aligned addresses to function correctly. This is architecture D dependent; thus, portable code should ensure that when peeking or  poking values of some type a, the alignment  constraint for a, as given by the function  .% is fulfilled. 4?Write the given value to the given memory location. Alignment  restrictions might apply; see 3%. -./01234 -./01234 -./01234-./01234tnon-portable (GHC extensions)internalcvs-ghc@haskell.org6GA Finalizer is represented as a pointer to a foreign function that, at G finalisation time, gets as an argument a plain pointer variant of the 8 foreign pointer that the finalizer is associated with. 7 The type 70+ represents references to objects that are B maintained in a foreign language, i.e., that are not part of the A data structures usually managed by the Haskell storage manager. " The essential difference between 70s and vanilla memory  references of type Ptr a& is that the former may be associated  with  finalizers0. A finalizer is a routine that is invoked when D the Haskell storage manager detects that - within the Haskell heap D and stack - there are no more references left that are pointing to  the 70/. Typically, the finalizer will, then, invoke C routines in the foreign language that free the resources bound by  the foreign object. The 70% is parameterised in the same way as i. The  type argument of 70# should normally be an instance of  class %. N8Turns a plain memory reference into a foreign object by E associating a finalizer - given by the monadic operation - with the @ reference. The storage manager will start the finalizer, in a < separate thread, some time after the last reference to the   ForeignPtr7 is dropped. There is no guarantee of promptness, and B in fact there is no guarantee that the finalizer will eventually  run at all. ANote that references from a finalizer do not necessarily prevent + another object from being finalized. If A's finalizer refers to B  (perhaps using =0", then the only guarantee is that  B'*s finalizer will never be started before A's. If both A and B A are unreachable, then both finalizers will start together. See  =0! for more on finalizer ordering. 8"Allocate some memory and return a 70 to it. The memory ) will be released automatically when the 70 is discarded. 80 is equivalent to  6 do { p <- malloc; newForeignPtr finalizerFree p } Calthough it may be implemented differently internally: you may not $ assume that the memory returned by 80 has been  allocated with Foreign.Marshal.Alloc.malloc.  GHC notes: 80 has a heavily optimised > implementation in GHC. It uses pinned memory in the garbage  collected heap, so the 70! does not require a finalizer to  free the memory. Use of 80 and associated 4 functions is strongly recommended in preference to  newForeignPtr  with a finalizer. 9This function is similar to 80, except that the G size of the memory required is given explicitly as a number of bytes. O"Allocate some memory and return a 70 to it. The memory ) will be released automatically when the 70 is discarded.  GHC notes:  O has a heavily optimised > implementation in GHC. It uses pinned memory in the garbage E collected heap, as for mallocForeignPtr. Unlike mallocForeignPtr, a F ForeignPtr created with mallocPlainForeignPtr carries no finalizers. D It is not possible to add a finalizer to a ForeignPtr created with F mallocPlainForeignPtr. This is useful for ForeignPtrs that will live A only inside Haskell (such as those created for packed strings). E Attempts to add a finalizer to a ForeignPtr created this way, or to 3 finalize such a pointer, will throw an exception. PThis function is similar to 90, except that ? the internally an optimised ForeignPtr representation with no > finalizer is used. Attempts to add a finalizer will cause an  exception to be thrown. :AThis function adds a finalizer to the given foreign object. The  finalizer will run before# all other finalizers for the same , object which have already been registered. ;like ;0 but allows the finalizer to be @ passed an additional environment parameter to be passed to the E finalizer. The environment passed to the finalizer is fixed by the  second argument to ;0 Q,This function adds a finalizer to the given  ForeignPtr. The  finalizer will run before# all other finalizers for the same , object which have already been registered. This is a variant of addForeignPtrFinalizer, where the finalizer  is an arbitrary IO, action. When it is invoked, the finalizer  will run in a new thread. DNB. Be very careful with these finalizers. One common trap is that @ if a finalizer references another finalized value, it does not : prevent that value from being finalized. In particular, ,s = are finalized objects, so a finalizer should not refer to a ,  (including stdout, stdin or stderr). <BTurns a plain memory reference into a foreign pointer that may be % associated with finalizers by using :0. =1This 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 =0 after it  executes the user action. CNote that this function should not be used to express dependencies  between finalizers on 70"s. For example, if the finalizer  for a 70 F1 calls =0 on a second  70 F20, 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 D 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 A objects with ordering constraints between them. To express the ; ordering robustly requires explicit synchronisation using MVars B between the finalizers, but even then the runtime sometimes runs : multiple finalizers sequentially in a single thread (for C performance reasons), so synchronisation between finalizers could ? result in artificial deadlock. Another alternative is to use  explicit reference counting. >:This function extracts the pointer component of a foreign A pointer. This is a potentially dangerous operations, as if the  argument to >0 is the last usage E occurrence of the given foreign pointer, then its finalizer(s) will > be run, which potentially invalidates the plain pointer just  obtained. Hence, =0 must be used D wherever it has to be guaranteed that the pointer lives on - i.e.,  has another usage occurrence. =To avoid subtle coding errors, hand written marshalling code  should preferably use !Foreign.ForeignPtr.withForeignPtr rather  than combinations of >0 and  =0. However, the later routines @ are occasionally preferred in tool generated marshalling code. ?This function casts a 70 . parameterised by one type into another type. @BCauses the finalizers associated with a foreign pointer to be run  immediately. 567 R N89 O P:; Q<=>?@567 R R N89 O P:; Q<=>?@1#non-portable (requires concurrency) provisionalffi@haskell.orgADTurns a plain memory reference into a foreign object by associating D a finalizer - given by the monadic operation - with the reference. @ The finalizer will be executed after the last reference to the D foreign object is dropped. Note that there is no guarantee on how F soon the finalizer is executed after the last reference was dropped; G this depends on the details of the Haskell storage manager. The only E guarantee is that the finalizer runs before the program terminates. B,This function adds a finalizer to the given 70. G The finalizer will run after the last reference to the foreign object  is dropped, but before. all previously registered finalizers for the  same object. ABABABportable provisionalffi@haskell.orgC.Release the storage associated with the given j, which E must have been obtained from a wrapper stub. This should be called E whenever the return value from a foreign import wrapper function is ? no longer required; otherwise, the storage it uses will leak. DDA signed integral type that can be losslessly converted to and from  Ptr. EGAn unsigned integral type that can be losslessly converted to and from  Ptr. Fcasts a Ptr to a WordPtr Gcasts a WordPtr to a Ptr Hcasts a Ptr to an IntPtr I casts an IntPtr to a Ptr ijCDEFGHIijCDHIEFGCDEFGHI0portable provisionalffi@haskell.orgJ;Turns a plain memory reference into a foreign pointer, and L associates a finaliser with the reference. The finaliser will be executed M after the last reference to the foreign object is dropped. Note that there F is no guarantee on how soon the finaliser is executed after the last K reference was dropped; this depends on the details of the Haskell storage K manager. Indeed, there is no guarantee that the finalizer is executed at E all; a program may exit with finalizers outstanding. (This is true > of GHC, other implementations may give stronger guarantees). K5This is a way to look at the pointer living inside a : foreign object. This function takes a function which is ( applied to that pointer. The resulting c action is then < executed. The foreign object is kept alive at least during 3 the whole action, even if it is not used directly = inside. Note that it is not safe to return the pointer from < the action and use it after the action completes. All uses % of the pointer should be inside the  K0 bracket. The reason for $ this unsafeness is the same as for  >0 below: the finalizer > may run earlier than expected, because the compiler can only  track usage of the 70 object, not  a i object made from it. 7This function is normally used for marshalling data to & or from the object pointed to by the  70 , using the operations from the  % class. LThis variant of J0" adds a finalizer that expects an D environment in addition to the finalized pointer. The environment I that will be passed to the finalizer is fixed by the second argument to  L0. MThis function is similar to !Foreign.Marshal.Array.mallocArray, F but yields a memory area that has a finalizer attached that releases  the memory area. As with 80, it is not guaranteed that & the block of memory was allocated by Foreign.Marshal.Alloc.malloc. NThis function is similar to "Foreign.Marshal.Array.mallocArray0, F but yields a memory area that has a finalizer attached that releases  the memory area. As with 80, it is not guaranteed that & the block of memory was allocated by Foreign.Marshal.Alloc.malloc. 56789:;<=>?@JKLMN765J<:L;K@>=?89MNJKLMN2portable provisionalffi@haskell.orgO.A pointer to a foreign function equivalent to V2, which may be  used as a finalizer (cf Foreign.ForeignPtr.ForeignPtr) for storage  allocated with P2, Q2, T2 or U2. PEAllocate a block of memory that is sufficient to hold values of type  a7. The size of the area allocated is determined by the -%  method from the instance of % for the appropriate type. $The memory may be deallocated using V2 or O2 when  no longer required. Q9Allocate a block of memory of the given number of bytes. B The block of memory is sufficiently aligned for any of the basic D foreign types that fits into a memory block of the allocated size. $The memory may be deallocated using V2 or O2 when  no longer required. RR2 f executes the computation f, passing as argument D a pointer to a temporarily allocated block of memory sufficient to  hold values of type a. The memory is freed when f' terminates (either normally or via an & exception), so the pointer passed to f must not be used after this. SS2 n f executes the computation f, passing as argument 9 a pointer to a temporarily allocated block of memory of n bytes. B The block of memory is sufficiently aligned for any of the basic D foreign types that fits into a memory block of the allocated size. The memory is freed when f' terminates (either normally or via an & exception), so the pointer passed to f must not be used after this. T-Resize a memory area that was allocated with P2 or Q2 , to the size needed to store values of type b. The returned pointer F may refer to an entirely different memory area, but will be suitably  aligned to hold values of type b". The contents of the referenced C memory area will be the same as of the original pointer up to the = minimum of the original size and the size of values of type b. If the argument to T2 is , T2 behaves like  P2. U-Resize a memory area that was allocated with P2 or Q2 C to the given size. The returned pointer may refer to an entirely H different memory area, but will be sufficiently aligned for any of the F basic foreign types that fits into a memory block of the given size. C The contents of the referenced memory area will be the same as of E the original pointer up to the minimum of the original size and the  given size. If the pointer argument to U2 is , U2  behaves like P2. If the requested size is 0, U2  behaves like V2. V/Free a block of memory that was allocated with P2,  Q2, T2, U2, Foreign.Marshal.Utils.new  or any of the newX functions in Foreign.Marshal.Array or  Foreign.C.String. OPQRSTUVRSPQTUVOOPQRSTUV3portable provisionalffi@haskell.orgW Execute an c action, throwing a 8' if the predicate yields  xX[, when applied to the result returned by the c action. B If no exception is raised, return the result of the computation. XLike W3, but discarding the result Y&Guards against negative result values ZLike Y3, but discarding the result [Guards against null pointers \Discard the return value of an c action WXYZ[\WXYZ[\WXYZ[\4portable provisionalffi@haskell.org S+Basic C routines needed for memory copying ]7Allocate a block of memory and marshal a value into it  (the combination of P2 and 4%). 5 The size of the area allocated is determined by the Foreign.Storable.sizeOf  method from the instance of % for the appropriate type. $The memory may be deallocated using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree when no longer required. ^^4 val f executes the computation f, passing as argument A a pointer to a temporarily allocated block of memory into which  val) has been marshalled (the combination of R2 and 4%). The memory is freed when f' terminates (either normally or via an & exception), so the pointer passed to f must not be used after this. _Convert a Haskell X[ to its numeric representation `?Convert a Boolean in numeric representation to a Haskell value a>Allocate storage and marshall a storable value wrapped into a   the  is used to represent  b Converts a withXXX1 combinator into one marshalling a value wrapped  into a , using  to represent . c/Convert a peek combinator into a one returning  if applied to a   d Replicates a withXXX7 combinator over a list of objects, yielding a list of  marshalled objects eHCopies the given number of bytes from the second area (source) into the + first (destination); the copied areas may not overlap fHCopies the given number of bytes from the second area (source) into the ' first (destination); the copied areas may overlap ]^_`abcdef ^]_`abcdef ]^_`abcdef5portable provisionalffi@haskell.orggEAllocate storage for the given number of elements of a storable type  (like Foreign.Marshal.Alloc.malloc, but for multiple elements). hLike g5., but add an extra position to hold a special  termination element. i<Temporarily allocate space for the given number of elements  (like Foreign.Marshal.Alloc.alloca, but for multiple elements). jLike i5., but add an extra position to hold a special  termination element. kAdjust the size of an array lLAdjust the size of an array including an extra position for the end marker. mDConvert an array of given length into a Haskell list. This version @ traverses the array backwards using an accumulating parameter, C which uses constant stack space. The previous version using mapM  needed linear stack space. nHConvert an array terminated by the given end marker into a Haskell list o0Write the list elements consecutive into memory pLWrite the list elements consecutive into memory and terminate them with the  given marker element qFWrite a list of storable elements into a newly allocated, consecutive  sequence of storable values  (like Foreign.Marshal.Utils.new, but for multiple elements). rFWrite a list of storable elements into a newly allocated, consecutive M sequence of storable values, where the end is fixed by the given end marker s6Temporarily store a list of storable values in memory  (like Foreign.Marshal.Utils.with, but for multiple elements). tLike s5+, but the action gets the number of values  as an additional parameter uLike s52, but a terminator indicates where the array ends vLike t52, but a terminator indicates where the array ends wJCopy the given number of elements from the second array (source) into the 1 first array (destination); the copied areas may not overlap xJCopy the given number of elements from the second array (source) into the - first array (destination); the copied areas may overlap yDReturn the number of elements in an array, excluding the terminator z@Advance a pointer into an array by the given number of elements ghijklmnopqrstuvwxyzghijklmnopqrsutvwxyzghijklmnopqrstuvwxyz6portable provisionalffi@haskell.org{<A wide character string with explicit length information in &s E instead of a terminating NUL (allowing NUL characters in the middle  of the string). |@A C wide string is a reference to an array of C wide characters  terminated by NUL. }@A string with explicit length information in bytes instead of a H terminating NUL (allowing NUL characters in the middle of the string). ~IA C string is a reference to an array of C characters terminated by NUL. 9Marshal a NUL terminated C string into a Haskell string. ?Marshal a C string with explicit length into a Haskell string. 9Marshal a Haskell string into a NUL terminated C string.  the Haskell string may not contain any NUL characters 7 new storage is allocated for the C string and must be  explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. DMarshal a Haskell string into a C string (ie, character array) with  explicit length information. 7 new storage is allocated for the C string and must be  explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. HMarshal a Haskell string into a NUL terminated C string using temporary  storage.  the Haskell string may not contain any NUL characters @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. ?Marshal a Haskell string into a C string (ie, character array) 9 in temporary storage, with explicit length information. @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. >Determines whether a character can be accurately encoded in a ~6. - Unrepresentable characters are converted to '?'. 5Currently only Latin-1 characters are representable. IConvert a C byte, representing a Latin-1 character, to the corresponding  Haskell character. .Convert a Haskell character to a C character. 9 This function is only safe on the first 256 characters. 9Marshal a NUL terminated C string into a Haskell string. ?Marshal a C string with explicit length into a Haskell string. 9Marshal a Haskell string into a NUL terminated C string.  the Haskell string may not contain any NUL characters 7 new storage is allocated for the C string and must be  explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. DMarshal a Haskell string into a C string (ie, character array) with  explicit length information. 7 new storage is allocated for the C string and must be  explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. HMarshal a Haskell string into a NUL terminated C string using temporary  storage.  the Haskell string may not contain any NUL characters @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. ?Marshal a Haskell string into a C string (ie, character array) 9 in temporary storage, with explicit length information. @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. >Marshal a NUL terminated C wide string into a Haskell string. DMarshal a C wide string with explicit length into a Haskell string. >Marshal a Haskell string into a NUL terminated C wide string.  the Haskell string may not contain any NUL characters 9 new storage is allocated for the C wide string and must  be explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. IMarshal a Haskell string into a C wide string (ie, wide character array) # with explicit length information. 9 new storage is allocated for the C wide string and must  be explicitly freed using Foreign.Marshal.Alloc.free or  #Foreign.Marshal.Alloc.finalizerFree. CMarshal a Haskell string into a NUL terminated C wide string using  temporary storage.  the Haskell string may not contain any NUL characters @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. CMarshal a Haskell string into a NUL terminated C wide string using  temporary storage.  the Haskell string may not contain any NUL characters @ the memory is freed when the subcomputation terminates (either B normally or via an exception), so the pointer to the temporary  storage must not be used after this. {|}~~}|{{|}~7portable provisionalffi@haskell.orgHaskell representation for errno values. C The implementation is deliberately exposed, to allow users to add  their own definitions of 77 values. Yield xX[ if the given 77 value is valid on the system.  This implies that the B  instance of 77 is also system dependent + as it is only defined for valid values of 77. Get the current value of errno in the current thread. Reset the current thread's errno value to 7.  Throw an '' corresponding to the current value of 7.  Throw an '' corresponding to the current value of 7  if the result value of the c# action meets the given predicate. as 7!, but discards the result of the c action after  error handling. as 7, but retry the c action when it yields the  error code 7/ - this amounts to the standard retry loop for ! interrupted POSIX system calls. as 71, but checks for operations that would block and > executes an alternative action before retrying in that case. as 7, but discards the result. as 7, but discards the result.  Throw an '' corresponding to the current value of 7  if the c action returns a result of -1. as 7, but discards the result.  Throw an '' corresponding to the current value of 7  if the c action returns a result of -1, but retries in case of  an interrupted operation. as 7, but discards the result. as 7., but checks for operations that would block. as 7, but discards the result.   Throw an '' corresponding to the current value of 7  if the c action returns .   Throw an '' corresponding to the current value of 7  if the c action returns , 0 but retry in case of an interrupted operation.  as  7., but checks for operations that would block.  as 7:, but exceptions include the given path when appropriate.  as 7-, but exceptions include the given path when  appropriate. as 7-, but exceptions include the given path when  appropriate. as  7-, but exceptions include the given path when  appropriate. as 7-, but exceptions include the given path when  appropriate. as 7-, but exceptions include the given path when  appropriate. Construct a Haskell 98 I/O error based on the given 77 value. A The optional information can be used to improve the accuracy of  error messages.                uportable provisionalffi@haskell.org  {|}~     8portable provisionalsven.panne@aedion.deA memory pool. Allocate a fresh memory pool. HDeallocate a memory pool and everything which has been allocated in the  pool itself. EExecute an action with a fresh memory pool, which gets automatically E deallocated (including its contents) after the action has finished. IAllocate space for storable type in the given pool. The size of the area  allocated is determined by the -% method from the instance of  % for the appropriate type. ;Allocate the given number of bytes of storage in the pool. HAdjust the storage area for an element in the pool to the given size of  the required type. FAdjust the storage area for an element in the pool to the given size. LAllocate storage for the given number of elements of a storable type in the  pool. LAllocate storage for the given number of elements of a storable type in the K pool, but leave room for an extra element to signal the end of the array. /Adjust the size of an array in the given pool. BAdjust the size of an array with an end marker in the given pool. JAllocate storage for a value in the given pool and marshal the value into  this storage.  HAllocate consecutive storage for a list of values in the given pool and  marshal these values into it. !HAllocate consecutive storage for a list of values in the given pool and J marshal these values into it, terminating the end with the given marker.  ! ! !vportable provisionalffi@haskell.org;OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz !wportable provisionalffi@haskell.org\]^_bdefghij     2-./0123456789:;<=>?@CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz !29non-portable (requires POSIX) provisionallibraries@haskell.org"#$%&'()*+,-./0123456789:;<==<;:987654321/0.-,+*)$%#('&""#$%&'()*+,-./00123456789:;<=xnon-portable (requires POSIX)internalcvs-ghc@haskell.orgx T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  x T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   +non-portable (GHC extensions)internalcvs-ghc@haskell.org/@AShared memory locations that support atomic memory transactions. B/A monad supporting atomic memory transactions. DThe current status of a thread E*the thread received an uncaught exception F'the thread is blocked on some resource Gthe thread has finished H,the thread is currently runnable or running J)blocked on some other resource. Without  -threaded,  I/O and s+ show up as J+, with  -threaded  they show up as O+. Kcurrently in a foreign call L blocked in `+ in an STM transaction M blocked in W+ N7blocked on a computation in progress by another thread Oblocked on on .+-+ PA Q+P+8 is an abstract type representing a handle to a thread. Q+P+ is an instance of B , J  and O, where the J 6 instance implements an arbitrary total ordering over Q+P+s. The O/ instance lets you convert an arbitrary-valued Q+P+ to string form; showing a Q+P+ value is occasionally Buseful when debugging or diagnosing the behaviour of a concurrent  program. Note: in GHC, if you have a Q+P+, you essentially have Aa pointer to the thread itself. This means the thread itself can't be %garbage collected until you drop the Q+P+. =This misfeature will hopefully be corrected at a later date. Note9: Hugs does not provide any operations on other threads;  it defines Q+P+ as a synonym for (). R#Sparks off a new thread to run the c computation passed as the  first argument, and returns the Q+P+ of the newly created thread. JThe new thread will be a lightweight thread; if you want to use a foreign ,library that uses thread-local storage, use Control.Concurrent.forkOS instead. &GHC note: the new thread inherits the blocked state of the parent (see Control.Exception.block). DThe newly created thread has an exception handler that discards the  exceptions %$, #", and 2, and passes all other exceptions to the uncaught exception handler (see {+). SLike R+2, but lets you specify on which CPU the thread is created. Unlike a R+ thread, a thread created by S+ 3will stay on the same CPU for its entire lifetime (R+ threads >can migrate between CPUs according to the scheduling policy). S+9 is useful for overriding the scheduling policy when you 4know in advance how best to distribute the threads. The X]= argument specifies the CPU number; it is interpreted modulo T+6 (note that it actually specifies a capability number Crather than a CPU number, but to a first approximation the two are  equivalent). Tthe value passed to the +RTS -N flag. This is the number of @ Haskell threads that can run truly simultaneously at any given C time, and is typically set to the number of physical CPU cores on  the machine. VV+) terminates the given thread (GHC only). 'Any work already done by the thread isn't Elost: the computation is suspended until required by another thread. AThe memory used by the thread will be garbage collected if it isn't referenced from anywhere. The V+ function is defined in  terms of W+:  + killThread tid = throwTo tid ThreadKilled BKillthread is a no-op if the target thread has already completed. WW+@ raises an arbitrary exception in the target thread (GHC only). W+< does not return until the exception has been raised in the target thread. 7The calling thread can thus be certain that the target Fthread has received the exception. This is a useful property to know Ewhen dealing with race conditions: eg. if there are two threads that Ccan kill each other, it is guaranteed that only one of the threads will get to kill the other. BIf the target thread is currently making a foreign call, then the (exception will not be raised (and hence W+ will not return) Funtil the call has completed. This is the case regardless of whether the call is inside a : or not. !Important note: the behaviour of W+ differs from that described in  the paper ""Asynchronous exceptions in Haskell" ( =http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, W+8 is non-blocking; but the library implementation adopts #a more synchronous design in which W+% does not return until the exception Yis received by the target thread. The trade-off is discussed in Section 9 of the paper. Like any blocking operation, W+0 is therefore interruptible (see Section 5.3 of  the paper). @There is currently no guarantee that the exception delivered by W+ will be Kdelivered at the first possible opportunity. In particular, a thread may ,unblock and then re-block exceptions (using ; and :) without receiving  a pending W++. This is arguably undesirable behaviour. X Returns the Q+P+# of the calling thread (GHC only). YThe Y+7 action allows (forces, in a co-operative multitasking B implementation) a context-switch to any other currently runnable @ threads (if any), and is occasionally useful when implementing  concurrency abstractions. ZZ+2 stores a string as identifier for this thread if Hyou built a RTS with debugging support. This identifier will be used in Ethe debugging output to make distinction of different threads easier 0(otherwise you only have the thread state object's address in the heap). BOther applications like the graphical Concurrent Haskell Debugger ( +http://www.informatik.uni-kiel.de/~fhu/chd/) may choose to overload Z+ for their purposes as well. ^AUnsafely performs IO in the STM monad. Beware: this is a highly  dangerous thing to do. = The STM implementation will often run transactions multiple C times, so you need to be prepared for this if your IO has any  side effects. B The STM implementation will abort transactions that are known to I be invalid and need to be restarted. This may happen in the middle  of ^+, so make sure you don't acquire any resources G that need releasing (exception handlers are ignored when aborting F the transaction). That includes doing any IO using Handles, for J example. Getting this wrong will probably lead to random deadlocks. C The transaction may have seen an inconsistent view of memory when D the IO runs. Invariants that you expect to be true throughout C your program may not be true inside a transaction, due to the < way transactions are implemented. Normally this wouldn' t be visible " to the programmer, but using ^+ can expose it. _,Perform a series of STM actions atomically. You cannot use _+ inside an 2, or 3,. I Any attempt to do so will result in a runtime error. (Reason: allowing L this would effectively allow a transaction inside a transaction, depending * on exactly when the thunk is evaluated.)  However, see f+, which can be called inside 2,, 3 and which allows top-level TVars to be allocated. `FRetry execution of the current memory transaction because it has seen H values in TVars which mean that it should not continue (e.g. the TVars G represent a shared buffer that is now empty). The implementation may H block the thread until one of the TVars that it has read from has been  udpated. (GHC only) aECompose two alternative STM actions (GHC only). If the first action D completes without retrying then it forms the result of the orElse. C Otherwise, if the first action retries, then the second action is A tried in its place. If both actions retry then the orElse as a  whole retries. b'Exception handling within STM actions. BLow-level primitive on which always and alwaysSucceeds are built. ? checkInv differs form these in that (i) the invariant is not > checked when checkInv is called, only at the end of this and B subsequent transcations, (ii) the invariant failure is indicated  by raising an exception. cBalwaysSucceeds adds a new invariant that must be true when passed B to alwaysSucceeds, at the end of the current transaction, and at > the end of every subsequent transaction. If it fails at any > of those points then the transaction violating it is aborted : and the exception raised by the invariant is propagated. d@always is a variant of alwaysSucceeds in which the invariant is C expressed as an STM Bool action that must return True. Returning G False or raising an exception are both treated as invariant failures. e+Create a new TVar holding a value supplied fIO version of e+). This is useful for creating top-level  A+@+s using  System.IO.Unsafe.unsafePerformIO, because using  _+ inside  System.IO.Unsafe.unsafePerformIO isn't  possible. g*Return the current value stored in a TVar h%Write the supplied value into a TVar i Create an .+-+ which is initially empty. j Create an .+-+$ which contains the supplied value. kReturn the contents of the .+-+ . If the .+-+ is currently  empty, k+& will wait until it is full. After a k+,  the .+-+ is left empty. .There are two further important properties of k+:  k+3 is single-wakeup. That is, if there are multiple  threads blocked in k+ , and the .+-+ becomes full, D only one thread will be woken up. The runtime guarantees that $ the woken thread completes its k+ operation. ) When multiple threads are blocked on an .+-+ , they are ; woken up in FIFO order. This is useful for providing 5 fairness properties of abstractions built using .+-+s. lPut a value into an .+-+ . If the .+-+ is currently full,  l+# will wait until it becomes empty. .There are two further important properties of l+:  l+3 is single-wakeup. That is, if there are multiple  threads blocked in l+ , and the .+-+ becomes empty, D only one thread will be woken up. The runtime guarantees that $ the woken thread completes its l+ operation. ) When multiple threads are blocked on an .+-+ , they are ; woken up in FIFO order. This is useful for providing 5 fairness properties of abstractions built using .+-+s. mA non-blocking version of k+. The m+ function  returns immediately, with  if the .+-+ was empty, or   a if the .+-+ was full with contents a . After m+,  the .+-+ is left empty. nA non-blocking version of l+. The n+ function  attempts to put the value a into the .+-+ , returning xX[ if  it was successful, or X[ otherwise. oCheck whether a given .+-+ is empty. >Notice that the boolean value returned is just a snapshot of D the state of the MVar. By the time you get to react on its result, > the MVar may have been filled (or emptied) - so be extremely * careful when using this operation. Use m+ instead if possible. pAdd a finalizer to an .+-+ (GHC only). See Foreign.ForeignPtr and  System.Mem.Weak for more about finalizers. q@Block the current thread until data is available to read on the # given file descriptor (GHC only). r:Block the current thread until data can be written to the # given file descriptor (GHC only). s?Suspends the current thread for a given number of microseconds  (GHC only). CThere is no guarantee that the thread will be rescheduled promptly C when the delay has expired, but the thread will never continue to  run earlier than specified. t?Set the value of returned TVar to True after a given number of C microseconds. The caveats associated with threadDelay also apply. ,the stick is for poking the IO manager with A-.>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|APQRSTUXVW\[YZDHGFEIONMLKJ]stqr-.jiklmnopBC_`abcd@Aefgh^?>xwuv{|zy?>?@AABCCDHGFEEFGHIONMLKJJKLMNOPQQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|"non-portable (extended exceptions) experimentallibraries@haskell.org})Thrown when the program attempts to call  atomically , from the stm ! package, inside another call to  atomically. ?Thrown when the runtime system detects that the computation is C guaranteed not to terminate. Note that there is no guarantee that A the runtime system will notice whether any given computation is ! guaranteed to terminate or not. CA class method without a definition (neither a default definition, ? nor a definition in the appropriate instance) was called. The  String. gives information about which method it was. ;A record update was performed on a constructor without the > appropriate field. This can only happen with a datatype with A multiple constructors, where some fields are in one constructor  but not another. The String$ gives information about the source  location of the record update. ,An uninitialised record field was used. The String gives < information about the source location where the record was  constructed. ;A record selector was applied to a constructor without the > appropriate field. This can only happen with a datatype with A multiple constructors, where some fields are in one constructor  but not another. The String$ gives information about the source " location of the record selector. A pattern match failed. The String gives information about the ! source location of the pattern. >This is the simplest of the exception-catching functions. It A takes a single argument, runs it, and if an exception is raised  the "handler"; is executed, with the value of the exception passed as an G argument. Otherwise, the result is returned as normal. For example:   catch (readFile f) 5 (\e -> do let err = show (e :: IOException) R hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err)  return "") .Note that we have to give a type signature to e, or the program C will not typecheck as the type is ambiguous. While it is possible C to catch exceptions of any type, see $catchall for an explanation  of the problems with doing so. %For catching exceptions in pure (non-c) expressions, see the  function =. Note that due to Haskell'#s unspecified evaluation order, an C expression may throw one of several possible exceptions: consider  the expression (error "urk") + (1 `div` 0). Does  the expression throw   ErrorCall "urk", or  DivideByZero? The answer is "it might throw either"; the choice is G non-deterministic. If you are catching any type of exception then you ( might catch either. If you are calling catch with type  .IO Int -> (ArithException -> IO Int) -> IO Int then the handler may  get run with  DivideByZero as an argument, or an  ErrorCall "urk" C exception may be propogated further up. If you call it again, you 9 might get a the opposite behaviour. This is ok, because  is an  c computation. Note that the Prelude also exports a function called   Prelude.catch with a similar type to Control.Exception.catch,  except that the Prelude& version only catches the IO and user 5 families of exceptions (as required by Haskell 98). We recommend either hiding the Prelude version of  Prelude.catch  when importing Control.Exception:   import Prelude hiding (catch)  or importing Control.Exception# qualified, to avoid name-clashes:  ) import qualified Control.Exception as C and then using C.catch  The function  is like , but it takes an extra  argument which is an exception predicate, a function which $ selects which type of exceptions we're interested in.  \ catchJust (\e -> if isDoesNotExistErrorType (ioeGetErrorType e) then Just () else Nothing)  (readFile f) C (\_ -> do hPutStrLn stderr ("No such file: " ++ show f)  return "") <Any other exceptions which are not matched by the predicate 2 are re-raised, and may be caught by an enclosing  , , etc.  A version of . with the arguments swapped around; useful in E situations where the code for the handler is shorter. For example: = do handle (\NonTermination -> exitWith (ExitFailure 1)) $  ...  A version of ( with the arguments swapped around (see  ). AThis function maps one exception into another as proposed in the  paper "$A semantics for imprecise exceptions".  Similar to , but returns an k result which is  (n a) if no exception of type e was raised, or (m ex)  if an exception of type e was raised and its value is ex. E If any other type of exception is raised than it will be propogated - up to the next enclosing exception handler.  2 try a = catch (Right `liftM` a) (return . Left)  Note that System.IO.Error also exports a function called  System.IO.Error.try with a similar type to Control.Exception.try, D except that it catches only the IO and user families of exceptions  (as required by the Haskell 98 IO module).  A variant of - that takes an exception predicate to select # which exceptions are caught (c.f. ). If the exception 0 does not match the predicate, it is re-thrown. Like 5, but only performs the final action if there was an & exception raised by the computation. ?When you want to acquire a resource, do some work with it, and 5 then release the resource, it is a good idea to use ,  because 1 will install the necessary exception handler to ? release the resource in the event that an exception is raised : during the computation. If an exception is raised, then  will 8 re-raise the exception (after performing the release). $A common example is opening a file:   bracket " (openFile "filename" ReadMode)  (hClose)  (\fileHandle -> do { ... }) The arguments to 2 are in this order so that we can partially apply  it, e.g.: : withFile name mode = bracket (openFile name mode) hClose A specialised variant of  with just a computation to run  afterward.  A variant of 3 where the return value from the first computation  is not required. Like 5, but only performs the final action if there was an 1 exception raised by the in-between computation. J  !"#$%79:;<=W}~J}~$%"# !97W=:;<  # }~~;"non-portable (extended exceptions) experimentallibraries@haskell.orgYou need this when using ;. HSometimes you want to catch two different sorts of exception. You could do something like  = f = expr `catch` \ (ex :: ArithException) -> handleArith ex = `catch` \ (ex :: IOException) -> handleIO ex IHowever, there are a couple of problems with this approach. The first is Ethat having two exception handlers is inefficient. However, the more Iserious issue is that the second exception handler will catch exceptions ,in the first, e.g. in the example above, if  handleArith throws an  IOException2 then the second exception handler will catch it. Instead, we provide a function ;, which would be used thus: K f = expr `catches` [Handler (\ (ex :: ArithException) -> handleArith ex), K Handler (\ (ex :: IOException) -> handleIO ex)] D !"#$%79:;<=W}~D}~$%"# !97W=:;<y non-portableinternallibraries@haskell.org> The action > hdl& causes any items buffered for output  in handle hdl1 to be sent immediately to the operating system. This operation may fail with:  ' if the device is full;  '/ if a system resource limit would be exceeded. I It is unspecified whether the characters in the buffer are discarded + or retained under these circumstances. ?/A handle managing output to the Haskell program's standard error channel. @/A handle managing output to the Haskell program's standard output channel. %A mode that determines the effect of   hdl mode i, as follows: the position of hdl is set to offset i  from the end of the file. the position of hdl is set to offset i  from the current position. the position of hdl is set to i. 0A handle managing input from the Haskell program's standard input channel.  Computation   file mode# allocates and returns a new, open  handle to manage the file file. It manages input if mode  is  , output if mode is  or  , & and both input and output if mode is  . EIf the file does not exist and it is opened for output, it should be  created as a new file. If mode is  and the file = already exists, then it should be truncated to zero length. E Some operating systems delete empty files, so there is no guarantee ' that the file will exist following an  with mode  4 unless it is subsequently written to successfully. 4 The handle is positioned at the end of the file if mode is   4, and otherwise at the beginning (in which case its  internal position is 0). 6 The initial buffer mode is implementation-dependent. This operation may fail with:  '5 if the file is already open and cannot be reopened;  ' if the file does not exist; or  '8 if the user does not have permission to open the file. CNote: if you will be working with files containing binary data, you' ll want to  be using . Like $, but open the file in binary mode. @ On Windows, reading a file in text mode (which is the default) C will translate CRLF to LF, and writing will translate LF to CRLF. C This is usually what you want with text files. With binary files H this is undesirable; also, as usual under Microsoft operating systems, G text mode treats control-Z as EOF. Binary mode turns off all special 6 treatment of end-of-line and end-of-file characters.  (See also .) 'Old API kept to avoid breaking clients  Computation  hdl makes handle hdl closed. Before the  computation finishes, if hdl& is writable its buffer is flushed as  for >.  Performing : on a handle that has already been closed has no effect; O doing so is not an error. All other operations on a closed handle will fail.  If : fails for any reason, any further operations (apart from  &) on the handle will still fail as if hdl had been successfully  closed.  For a handle hdl$ which attached to a physical file,   hdl/ returns the size of that file in 8-bit bytes.  hdl size) truncates the physical file with handle hdl to size bytes. For a readable handle hdl,  hdl returns  xX[' if no further input can be taken from hdl or for a  physical file, if the current I/%O position is equal to the length of " the file. Otherwise, it returns X[. NOTE: . may block, because it is the same as calling  $ and checking for an EOF exception. The computation  is identical to ,  except that it works only on .  Computation , returns the next character from the handle G without removing it from the input buffer, blocking until a character  is available. This operation may fail with:  '& if the end of file has been reached.  Computation  hdl mode sets the mode of buffering for  handle hdl! on subsequent reads and writes. #If the buffer mode is changed from ( or  ) to *, then  if hdl+ is writable, the buffer is flushed as for >;  if hdl; is not writable, the contents of the buffer is discarded. This operation may fail with:  '1 if the handle has already been used for reading H or writing and the implementation does not allow the buffering mode  to be changed.  Computation  hdl returns the current I/O position of  hdl! as a value of the abstract type .  If a call to  hdl returns a position p,  then computation  p sets the position of hdl 4 to the position it held at the time of the call to . This operation may fail with:  '/ if a system resource limit would be exceeded.  Computation   hdl mode i sets the position of handle  hdl depending on mode.  The offset i# is given in terms of 8-bit bytes. If hdlE is block- or line-buffered, then seeking to a position which is not M in the current buffer will first cause any items in the output buffer to be I written to the device, and then cause the input buffer to be discarded. ' Some handles may not be seekable (see ), or only support a J subset of the possible positioning operations (for instance, it may only H be possible to seek to the end of a tape, or to a positive offset from % the beginning or current position). ' It is not possible to set a negative I/O position, or for  a physical file, an I/+O position beyond the current end-of-file. This operation may fail with:  '/ if a system resource limit would be exceeded.  Computation  hdl$ returns the current buffering mode  for hdl. <Set the echoing status of a handle connected to a terminal. <Get the echoing status of a handle connected to a terminal. 'Is the handle connected to a terminal? Select binary mode (xX[) or text mode (X[) on a open handle.  (See also .) AReturns a duplicate of the original handle, with its own buffer. C The two Handles will share a file pointer, however. The original  handle':s buffer is flushed, including discarding any input data, " before the handle is duplicated. FMakes the second handle a duplicate of the first handle. The second 3handle will be closed first, if it is not already. @This can be used to retarget the standard Handles, for example: ' do h <- openFile "mystdout" WriteMode  hDuplicateTo h stdout  is in the c, monad, and gives more comprehensive output  than the (pure) instance of O for ,. I   >?@       D>?@       znon-portable (GHC Extensions)internalcvs-ghc@haskell.org   is wrapped around  Main.main (or whatever main is D called in the program). It catches otherwise uncaught exceptions,  and also flushes stdout/stderr before exiting.   is wrapped around every foreign export and foreign  import "wrapper"/ to mop up any uncaught exceptions. Thus, the  result of running System.Exit.exitWith in a foreign-exported ? function is the same as in the main thread: it terminates the  program. Like  8, but in the event of an exception that causes an exit,  we don'7t shut down the system cleanly, we just exit. This is E useful in some cases, because the safe exit version will give other ? threads a chance to clean up first, which might shut down the / system in a different way. For example, try Fmain = forkIO (runIO (exitWith (ExitFailure 1))) >> threadDelay 10000 This will sometimes exit with  interrupted and code 0, because the H main thread is given a chance to shut down when the child thread calls M safeExit. There is a race to shut down between the main and child threads.  The same as  ), but for non-IO computations. Used for  wrapping foreign export and foreign import "wrapper" when these 9 are used to export Haskell functions with non-IO types.  yz  <"non-portable (extended exceptions) experimentallibraries@haskell.org!BThe type of exceptions. Every kind of system-generated exception  has a constructor in the < type, and values of other  types may be injected into < by coercing them to  &/) (see the section on Dynamic Exceptions:  &Control.OldException#DynamicExceptions). 3An attempt was made to update a field in a record,  where the record doesn'&t have the requested field. This can = only occur with multi-constructor records, when one or more 8 fields are missing from some of the constructors. The  l$ argument gives the location of the & record update in the source program. 6A field selection was attempted on a constructor that  doesn'2t have the requested field. This can happen with 7 multi-constructor records when one or more fields are - missing from some of the constructors. The  l$ argument gives the location of the ) record selection in the source program. 4An attempt was made to evaluate a field of a record 9 for which no value was given at construction time. The  l$ argument gives the location of the , record construction in the source program. !A pattern matching failure. The l argument should contain a > descriptive message including the function name, source file  and line number. 7The current thread is stuck in an infinite loop. This 8 exception may or may not be thrown when the program is  non-terminating. 7An attempt was made to invoke a class method which has : no definition in this instance, and there was no default : definition given in the class declaration. GHC issues a 8 warning when you compile an instance which has missing  methods. 2These are the standard IO exceptions generated by  Haskell's IO operations. See also System.IO.Error. The < exception is thrown by System.Exit.exitWith (and  System.Exit.exitFailure). The ExitCode argument is the value passed  to System.Exit.exitWith. An unhandled < exception in the E main thread will cause the program to be terminated with the given  exit code. The < exception is thrown by . The l  argument of < is the string passed to  when it was  called. ADynamically typed exceptions (see section on Dynamic Exceptions: &Control.OldException#DynamicExceptions). 1There are no runnable threads, so the program is  deadlocked. The < exception is + raised in the main thread only (see also: Control.Concurrent). <The runtime detected an attempt to nest one STM transaction 3 inside another one, presumably due to the use of  unsafePeformIO with _+. EThe current thread was waiting to retry an atomic memory transaction I that could never become possible to complete because there are no other 1 threads referring to any of the TVars involved. +The current thread was executing a call to   Control.Concurrent.MVar.takeMVar that could never return, / because there are no other references to this .+-*. AAsynchronous exceptions (see section on Asynchronous Exceptions: +Control.OldException#AsynchronousExceptions).  This exception is thrown by the  < operation when the condition  fails. The l argument contains the 2 location of the assertion in the source program. #Exceptions raised by array-related 2 operations. (NOTE: GHC currently does not throw  <s).  Exceptions raised by arithmetic 2 operations. (NOTE: GHC currently does not throw  < s except for  DivideByZero). >This is the simplest of the exception-catching functions. It A takes a single argument, runs it, and if an exception is raised  the "handler"; is executed, with the value of the exception passed as an G argument. Otherwise, the result is returned as normal. For example:   catch (openFile f ReadMode) D (\e -> hPutStr stderr ("Couldn't open "++f++": " ++ show e)) %For catching exceptions in pure (non-c) expressions, see the  function =<. Note that due to Haskell'#s unspecified evaluation order, an D expression may return one of several possible exceptions: consider  the expression error "urk" + 1 `div` 0. Does  < execute the handler passing   ErrorCall "urk", or ArithError DivideByZero? The answer is "either": < makes a B non-deterministic choice about which exception to catch. If you C call it again, you might get a different exception back. This is  ok, because < is an c computation.  Note that <3 catches all types of exceptions, and is generally  used for " cleaning up"' before passing on the exception using  9<8. It is not good practice to discard the exception and @ continue, without first checking the type of the exception (it  might be a  ThreadKilled3, for example). In this case it is usually better  to use <. and select the kinds of exceptions to catch. Also note that the Prelude also exports a function called   Prelude.catch with a similar type to <,  except that the Prelude& version only catches the IO and user 7 families of exceptions (as required by Haskell 98). We recommend either hiding the Prelude version of  Prelude.catch  when importing Control.OldException:   import Prelude hiding (catch)  or importing Control.OldException# qualified, to avoid name-clashes:  , import qualified Control.OldException as C and then using C.catch  The function < is like <, but it takes an extra  argument which is an exception predicate, a function which $ selects which type of exceptions we're interested in. There are < some predefined exception predicates for useful subsets of  exceptions: <, <, and so on. For example,  to catch just calls to the  function, we could use  7 result <- catchJust errorCalls thing_to_try handler <Any other exceptions which are not matched by the predicate 2 are re-raised, and may be caught by an enclosing  < or <.  A version of <. with the arguments swapped around; useful in E situations where the code for the handler is shorter. For example: 0 do handle (\e -> exitWith (ExitFailure 1)) $  ...  A version of <( with the arguments swapped around (see  <). AThis function maps one exception into another as proposed in the  paper "$A semantics for imprecise exceptions".  Similar to <, but returns an k result which is  (n a) if no exception was raised, or (m e) if an ' exception was raised and its value is e.  2 try a = catch (Right `liftM` a) (return . Left) Note: as with <6, it is only polite to use this variant if you intend H to re-throw the exception after performing whatever cleanup is needed.  Otherwise, <' is generally considered to be better. Also note that System.IO.Error also exports a function called  System.IO.Error.try with a similar type to <, D except that it catches only the IO and user families of exceptions  (as required by the Haskell 98 IO module).  A variant of <- that takes an exception predicate to select # which exceptions are caught (c.f. <). If the exception 0 does not match the predicate, it is re-thrown. 7Raise any value as an exception, provided it is in the  Q class.  A variant of <) that throws the dynamic exception to an " arbitrary thread (GHC only: c.f. W<). :Catch dynamic exceptions of the required type. All other E exceptions are re-thrown, including dynamic exceptions of the wrong  type. >When using dynamic exceptions it is advisable to define a new D datatype to use for your exception type, to avoid possible clashes 2 with dynamic exceptions used in other libraries. ?When you want to acquire a resource, do some work with it, and 5 then release the resource, it is a good idea to use <,  because <1 will install the necessary exception handler to ? release the resource in the event that an exception is raised : during the computation. If an exception is raised, then < will 8 re-raise the exception (after performing the release). $A common example is opening a file:   bracket " (openFile "filename" ReadMode)  (hClose)  (\handle -> do { ... }) The arguments to <3 are in this order so that we can partially apply  it, e.g.: : withFile name mode = bracket (openFile name mode) hClose A specialised variant of < with just a computation to run  afterward.  A variant of <3 where the return value from the first computation  is not required. BLike bracket, but only performs the final action if there was an 1 exception raised by the in-between computation. A79:;=WA97W=:;*{ non-portableinternallibraries@haskell.org  Computation  hdl t * waits until input is available on handle hdl.  It returns xX[" as soon as input is available on hdl,  or X[! if no input is available within t milliseconds. If t is less than zero, then  hWaitForInput waits indefinitely. This operation may fail with:  '& if the end of file has been reached. 'NOTE for GHC users: unless you use the  -threaded flag,  hWaitForInput t where t >= 0 will block all other Haskell : threads for the duration of the call. It behaves like a  safe foreign call in this respect.  Computation  hdl$ reads a character from the file or  channel managed by hdl+, blocking until a character is available. This operation may fail with:  '& if the end of file has been reached.  Computation  hdl reads a line from the file or  channel managed by hdl. This operation may fail with:  '0 if the end of file is encountered when reading  the first character of the line. If 9 encounters end-of-file at any other point while reading A in a line, it is treated as a line terminator and the (partial)  line is returned.  Computation  hdl returns the list of characters D corresponding to the unread portion of the channel or file managed  by hdl+, which is put into an intermediate state,  semi-closed.  In this state, hdl is effectively closed,  but items are read from hdl( on demand and accumulated in a special  list returned by  hdl. 5Any operation that fails because a handle is closed, ? also fails if a handle is semi-closed. The only exception is . & A semi-closed handle becomes closed:  if  is applied to it;  if an I/5O error occurs when reading an item from the handle; : or once the entire contents of the handle has been read. >Once a semi-closed handle becomes closed, the contents of the D associated list becomes fixed. The contents of this final list is E only partially specified: it will contain at least all the items of E the stream that were evaluated prior to the handle becoming closed. Any I/>O errors encountered while a handle is semi-closed are simply  discarded. This operation may fail with:  '& if the end of file has been reached.  Computation  hdl ch writes the character ch to the  file or channel managed by hdl!. Characters may be buffered if  buffering is enabled for hdl. This operation may fail with:  ' if the device is full; or  '5 if another system resource limit would be exceeded.  Computation  hdl s writes the string  s# to the file or channel managed by hdl. This operation may fail with:  ' if the device is full; or  '5 if another system resource limit would be exceeded.   hdl buf count writes count 8-bit bytes from the  buffer buf to the handle hdl. It returns (). This operation may fail with:  , if the handle is a pipe or socket, and the H reading end is closed. (If this is a POSIX system, and the program E has not asked to ignore SIGPIPE, then a SIGPIPE may be delivered @ instead, whose default action is to terminate the program).   hdl buf count reads data from the handle hdl  into the buffer buf until either EOF is reached or  count 8-bit bytes have been read. D It returns the number of bytes actually read. This may be zero if 1 EOF was reached before any data was read (or if count is zero). ; never raises an EOF exception, instead it returns a value  smaller than count. 7If the handle is a pipe or socket, and the writing end  is closed, $ will behave as if EOF was reached.   hdl buf count reads data from the handle hdl  into the buffer buf! until either EOF is reached, or  count@ 8-bit bytes have been read, or there is no more data available  to read immediately.  is identical to , except that it will F never block waiting for data to become available, instead it returns E only whatever data is available. To wait for data to arrive before  calling , use . 7If the handle is a pipe or socket, and the writing end  is closed, $ will behave as if EOF was reached.         portablestablelibraries@haskell.orgThe 7 function outputs a value of any printable type to the  standard output device. 7 Printable types are those that are instances of class O;  1 converts values to strings for output using the  operation and  adds a newline. @For example, a program to print the first 20 integers and their " powers of 2 could be written as: * main = print ([(n, 2^n) | n <- [0..19]]) 0Write a character to the standard output device  (same as  @). -Write a string to the standard output device  (same as  @).  The same as  , but adds a newline character. 0Read a character from the standard input device  (same as  ). +Read a line from the standard input device  (same as  ). The 6 operation returns all user input as a single string, & which is read lazily as it is needed  (same as  ). The # function takes a function of type String->String F as its argument. The entire input from the standard input device is F passed to this function as its argument, and the resulting string is ' output on the standard output device. The  function reads a file and / returns the contents of the file as a string. - The file is read lazily, on demand, as with . The computation  file str function writes the string str,  to the file file. The computation  file str function appends the string str,  to the file file.  Note that  and  write a literal string = to a file. To write a value of any printable type, as with ,  use the 2 function to convert the value to a string first. @ main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]]) The  function combines  and . The  function is similar to  except that it signals  parse failure to the c+ monad instead of terminating the program.  Computation  hdl( indicates whether at least one item is ! available for input from handle hdl. This operation may fail with:  System.IO.Error.isEOFError& if the end of file has been reached.  The same as  , but adds a newline character.  Computation  hdl t% writes the string representation of t  given by the , function to the file or channel managed by hdl  and appends a newline. This operation may fail with:  System.IO.Error.isFullError if the device is full; or  !System.IO.Error.isPermissionError5 if another system resource limit would be exceeded.  name mode act opens a file using  and passes ) the resulting handle to the computation act. The handle will be  closed on exit from &, whether by normal termination or by  raising an exception.  name mode act opens a file using  4 and passes the resulting handle to the computation act. The handle  will be closed on exit from , whether by normal ) termination or by raising an exception. 9The function creates a temporary file in ReadWrite mode.  The created file isn'<t deleted automatically, so you need to delete it manually. @The file is creates with permissions such that only the current  user can read/ write it. DWith some exceptions (see below), the file will be created securely ; in the sense that an attacker should not be able to cause E openTempFile to overwrite another file on the filesystem using your E credentials, by putting symbolic links (on Unix) in the place where 3 the temporary file is to be created. On Unix the O_CREAT and  O_EXCL6 flags are used to prevent this attack, but note that  O_EXCL: is sometimes not supported on NFS filesystems, so if you B rely on this behaviour it is best to use local filesystems only. Like ), but opens the file in binary mode. See  for more comments. Lc   '()*+,>?@Lc+,@?   '*)(>portablestablelibraries@haskell.orgAThe A2 function establishes a handler that receives any  # raised in the action protected by A. An  is caught by ( the most recent handler established by A. These handlers are  not selective: all %s are caught. Exception propagation E must be explicitly provided in a handler by re-raising any unwanted  exceptions. For example, in  F f = catch g (\e -> if IO.isEOFError e then return [] else ioError e)  the function f returns [] when an end-of-file exception  (cf. System.IO.Error.isEOFError ) occurs in g; otherwise, the 4 exception is propagated to the next outer handler. CWhen an exception propagates outside the main program, the Haskell  system prints the associated  value and exits the program. Non-I/:O exceptions are not caught by this variant; to catch all  exceptions, use Control.Exception.catch from Control.Exception. 8Strict (call-by-value) application, defined in terms of yXe. y *+,-./01234567@ABCDEFHIJKLMNOwacklxmn|}~HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgrstuv+78AkmnlB1J|}2~A-./0@aI+3*LED,CVWXYZ[\]^_`abcdefgNMHIJKLMNOPQRSTUF5674Huvstr   OKc+78AA-non-portable (local universal quantification) experimentallibraries@haskell.org5GThe G+ class comprehends a fundamental primitive  for Efolding over constructor applications, say terms. This primitive can Cbe instantiated in several ways to map over the immediate subterms of a term; see the gmap- combinators later in this class. Indeed, a Igeneric programmer does not necessarily need to use the ingenious gfoldl #primitive but rather the intuitive gmap combinators. The  Dprimitive is completed by means to query top-level constructors, to Dturn constructor representations into proper terms, and to list all Dpossible datatype constructors. This completion allows us to serve Jgeneric programming scenarios like read, show, equality, term generation. The combinators , ,  , etc are all provided with  default definitions in terms of , leaving open the opportunity *to provide datatype-specific definitions. (The inclusion of the gmap! combinators as members of class G Gallows the programmer or the compiler to derive specialised, and maybe #more efficient code per datatype. Note:  is more higher-order  than the gmap7 combinators. This is subject to ongoing benchmarking )experiments. It might turn out that the gmap combinators will be moved out of the class G.) $Conceptually, the definition of the gmap combinators in terms of the  primitive $ requires the identification of the  function Garguments. Technically, we also need to identify the type constructor cD for the construction of the result type from the folded term type. In the definition of gmapQx" combinators, we use phantom type constructors for the c in the type of  because the result type Iof a query does not involve the (polymorphic) type of the term argument. In the definition of ' we simply use the plain constant type constructor because ) is left-associative anyway and so it is Dreadily suited to fold a left-associative binary operation over the Bimmediate subterms. In the definition of gmapQr, extra effort is Dneeded. We use a higher-order accumulation trick to mediate between Fleft-associative constructor application vs. right-associative binary operation (e.g., (:)/). When the query is meant to compute a value of type r2, then the result type withing generic folding is r -> r. DSo the result of folding is a function to which we finally pass the  right unit.  With the -XDeriveDataTypeable+ option, GHC can generate instances of the G: class automatically. For example, given the declaration  4 data T a b = C1 a b | C2 deriving (Typeable, Data) 4GHC will generate an instance that is equivalent to  1 instance (Data a, Data b) => Data (T a b) where , gfoldl k z (C1 a b) = z C1 `k` a `k` b  gfoldl k z C2 = z C2  + gunfold k z c = case constrIndex c of + 1 -> k (k (z C1)) # 2 -> z C2   toConstr (C1 _ _) = con_C1  toConstr C2 = con_C2   dataTypeOf _ = ty_T  ' con_C1 = mkConstr ty_T "C1" [] Prefix ' con_C2 = mkConstr ty_T "C2" [] Prefix 1 ty_T = mkDataType "Module.T" [con_C1, con_C2] @This is suitable for datatypes that are exported transparently. Fixity of constructors (Unique index for datatype constructors, B counting from 1 in the order they are given in the program text. &Public representation of constructors  #Public representation of datatypes Representation of constructors Representation of datatypes. I A package of constructor representations with names of type and module. 2The type constructor used in definition of gmapMp 2The type constructor used in definition of gmapQr 0Type constructor for adding counters to queries BThe constant type constructor needed for the definition of gmapQl AThe identity type constructor needed for the definition of gmapT >Left-associative fold operation for constructor applications.  The type of 1 is a headache, but operationally it is a simple  generalisation of a list fold. The default definition for  is   , which is 8 suitable for abstract datatypes with no substructures. #Unfolding constructor applications .Obtaining the constructor from a given datum. B For proper terms, this is meant to be the top-level constructor. E Primitive datatypes are here viewed as potentially infinite sets of  values (i.e., constructors). 'The outer type constructor of the type +Mediate types and unary type constructors.  In G instances of the form T a,  should be defined  as . The default definition is  , which is appropriate " for non-unary type constructors. ,Mediate types and binary type constructors.  In G instances of the form T a b,  should be  defined as . The default definition is  , which is appropriate # for non-binary type constructors. ?A generic transformation that maps over the immediate subterms 9The default definition instantiates the type constructor c in the  type of 0 to an identity datatype constructor, using the / isomorphism pair as injection and projection. 8A generic query with a left-associative binary operator 9A generic query with a right-associative binary operator IA generic query that processes the immediate subterms and returns a list J of results. The list is given in the same order as originally specified . in the declaratoin of the data constructors. ?A generic query that processes one child by index (zero-based)  GA generic monadic transformation that maps over the immediate subterms 9The default definition instantiates the type constructor c in  the type of - to the monad datatype constructor, defining  injection and projection using 7  and 5 . !?Transformation of at least one immediate subterm does not fail "5Transformation of one immediate subterm with success #Build a term skeleton $5Build a term and use a generic function for subterms %Monadic variation on $ &/Gets the type constructor including the module '+Gets the public presentation of a datatype (#Gets the datatype of a constructor )-Gets the public presentation of constructors *,Look up a constructor by its representation +!Constructs an algebraic datatype ,Constructs a constructor -/Gets the constructors of an algebraic datatype .<Gets the field labels of a constructor. The list of labels C is returned in the same order as they were given in the original  constructor declaration. /!Gets the fixity of a constructor 0"Gets the string for a constructor 1"Lookup a constructor via a string 2Test for an algebraic type 3=Gets the constructor for an index (algebraic datatypes only) 4;Gets the index of a constructor (algebraic datatypes only) 5<Gets the maximum constructor index of an algebraic datatype 6Constructs the X] type 7Constructs the X] type 8Constructs the l type  Helper for 6, 7, 8 <;Constructs a non-representation for a non-presentable type ="Test for a non-representable type >'Gets the unqualified type constructor:  drop *.*.*... before name ?'Gets the module of a type constructor:  take *.*.*... before name eGQRSTUVWX      !"#$%&'()*+,-./0123456789:;<=>?=G !"+678<& '*2-35=,9:;(    )./401>?#$%=G !"          !"#$%&'()*+,-./0123456789:;<=>?non-portable (GHC Extensions)internalcvs-ghc@haskell.orgThe 0 function uses the user supplied function which N projects an element out of every list element in order to to first sort the L input list and then to form groups by equality on these projected elements @The A@F type allows you to reverse sort order conveniently. A value of type  A@ a contains a value of type a (represented as A@ a).  If a has an J 0 instance associated with it then comparing two L values thus wrapped will give you the opposite of their normal sort order. N This is particularly useful when sorting in generalised list comprehensions,  as in: then sortWith by A@ x CC9 ensures that all the elements of the list are identical & and then returns that unique element DThe D- function sorts a list of elements using the A user supplied function to project something out of each element y{?[dij      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@ABCDdijB[?@ADC@AABCD|non-portable (GHC extensions)internalcvs-ghc@haskell.org=EEE>portable experimentalashley@semantic.orgFA class for categories. " id and (.) must form a monoid. Gthe identity morphism Hmorphism composition IRight-to-left composition JLeft-to-right composition FGHIJFGHIJFGHGHIJ*non-portable (concurrency) experimentallibraries@haskell.orgKThis is a combination of k* and l*; ie. it takes the value  from the -*%, puts it back, and also returns it. LTake a value from an -*, put a new value into the -* and F return the value taken. Note that there is a race condition whereby + another process can put something in the -* after the take # happens but before the put does. MM*7 is a safe wrapper for operating on the contents of an  -*9. This operation is exception-safe: it will replace the  original contents of the -* if an exception is raised (see  Control.Exception). N0A safe wrapper for modifying the contents of an -*. Like M*,  O*+ will replace the original contents of the -* if an , exception is raised during the operation. OA slight variation on N* that allows a value to be  returned (b+) in addition to the modified value of the -*. -ijklmnopKLMNO-ijklKLmnoMNOpKLMNO?non-portable (concurrency) experimentallibraries@haskell.org PP?= is an abstract type representing an unbounded FIFO channel. Q$Build and returns a new instance of P?. RWrite a value to a P?. SRead the next value from the P?. T Duplicate a P?:: the duplicate channel begins empty, but data written to N either channel from then on will be available from both. Hence this creates F a kind of broadcast channel, where data written by anyone is seen by  everyone else. UJPut a data item back onto a channel, where it will be the next item read. VReturns xX[ if the supplied P? is empty. W=Return a lazy list representing the contents of the supplied  P? , much like System.IO.hGetContents. X#Write an entire list of items to a P?. PQRSTUVWX PQRSTUVWX PQRSTUVWX@non-portable (concurrency) experimentallibraries@haskell.orgYA Y@8 is a simple quantity semaphore, in which the available  "quantity"' is always dealt with in units of one. Z Build a new Y@ [$Wait for a unit to become available \Signal that a unit of the Y@ is available YZ[\YZ[\YZ[\Anon-portable (concurrency) experimentallibraries@haskell.org]A ]A1 is a quantity semaphore, in which the available  "quantity"6 may be signalled or waited for in arbitrary amounts. ^ Build a new ]A# with a supplied initial quantity. _4Wait for the specified quantity to become available `7Signal that a given quantity is now available from the ]A. ]^_`]^_`]^_`Bnon-portable (concurrency) experimentallibraries@haskell.orga6Sample variables are slightly different from a normal -*:  Reading an empty aB causes the reader to block.  (same as k* on empty -*)  Reading a filled aB empties it and returns value.  (same as k*)  Writing to an empty aB fills it with a value, and 8 potentially, wakes up a blocked reader (same as for l* on  empty -*).  Writing to a filled aB overwrites the current value.  (different from l* on full -*.) bBuild a new, empty, aB cBuild a aB with an initial value. dBIf the SampleVar is full, leave it empty. Otherwise, do nothing. e?Wait for a value to become available, then take it and return. fWrite a value into the aB&, overwriting any previous value that  was there. gReturns xX[ if the aB is currently empty. ANote that this function is only useful if you know that no other + threads can be modifying the state of the aB , because  otherwise the state of the aB may have changed by the time  you see the result of gB. abcdefgabcdefgabcdefg:non-portable (concurrency) experimentallibraries@haskell.orghxX[! if bound threads are supported.  If rtsSupportsBoundThreads is X[, l:  will always return X[ and both k: and m: will  fail. kLike R:*, this sparks off a new thread to run the c :computation passed as the first argument, and returns the Q+P: of the newly created thread.  However, k: creates a bound# thread, which is necessary if you >need to call foreign (non-Haskell) libraries that make use of (thread-local state, such as OpenGL (see Control.Concurrent#boundthreads). Using k: instead of R:# makes no difference at all to the Dscheduling behaviour of the Haskell runtime system. It is a common #misconception that you need to use k: instead of R: to Cavoid blocking all the Haskell threads when making a foreign call; this isn'7t the case. To allow foreign calls to be made without Eblocking all the Haskell threads (with GHC), it is only necessary to use the  -threaded4 option when linking your program, and to make sure !the foreign import is not marked unsafe. lReturns xX[ if the calling thread is bound, that is, if it is H safe to use foreign libraries that rely on thread-local state from the  calling thread. mRun the cA computation passed as the first argument. If the calling thread is not bound), a bound thread is created temporarily. runInBoundThread doesn't finish until the c computation finishes. PYou can wrap a series of foreign function calls that rely on thread-local state with runInBoundThread6 so that you can use them without knowing whether the current thread is bound. nRun the cA computation passed as the first argument. If the calling thread is bound1, an unbound thread is created temporarily using R:. runInBoundThread doesn't finish until the c computation finishes. Use this function only4 in the rare case that you have actually observed a Aperformance loss due to the use of bound threads. A program that doesn' t need it'$s main thread to be bound and makes heavy use of concurrency *(e.g. a web server), might want to wrap it's main action in runInUnboundThread. o@Block the current thread until data is available to read on the # given file descriptor (GHC only). p:Block the current thread until data can be written to the # given file descriptor (GHC only). 6-PRVWXYijklmnopsKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopPXRVWYsopijhklmn hijklmnop}portable provisionallibraries@haskell.org4567FHHF5674Cportable provisionallibraries@haskell.org q'Complex numbers are an algebraic type. For a complex number z,  z# is a number with the magnitude of z, 6 but oriented in the positive real direction, whereas  z  has the phase of z, but unit magnitude. r3forms a complex number from its real and imaginary  rectangular components. s,Extracts the real part of a complex number. t1Extracts the imaginary part of a complex number. u#The conjugate of a complex number. vDForm a complex number from polar components of magnitude and phase. wwC t# is a complex value with magnitude 1  and phase t (modulo 2*V). x The function xC takes a complex number and 6 returns a (magnitude, phase) pair in canonical form: : the magnitude is nonnegative, and the phase in the range (-V, V]; 1 if the magnitude is zero, then so is the phase. y/The nonnegative magnitude of a complex number. z,The phase of a complex number, in the range (-V, V]. 1 If the magnitude is zero, then so is the phase. qrstuvwxyz qrstvwxyzu qrrstuvwxyzDportable experimental$Ashley Yakeley <ashley@semantic.org>generalisation of  to any instance of Real generalisation of  to any instance of Real generalisation of  to any instance of Real 0First arg is whether to chop off trailing zeros {|}~ ~}|{ {|}~Eportable experimentallibraries@haskell.orgE f* is the least fixed point of the function f,  i.e. the least defined x such that f x = x. (*) `on` f = \x y -> f x * f y. Typical usage: Data.List.sortBy (|  `on` ). Algebraic properties:  (*) `on` E = (*) (if (*) "  {", E "}) ((*) `on` f) `on` g = (*) `on` (f . g) E on f . E on g = E on (g . f) portable experimentallibraries@haskell.org8*The fixed point of a monadic computation.  8  f executes the action f only once, with the eventual & output fed back as the input. Hence f should not be strict,  for then 8  f would diverge. Y"Monads having fixed points with a ' knot-tying' semantics.  Instances of Y $ should satisfy the following laws:  purity  8  (7  . h) = 7  (  h) left shrinking (or  tightening)  8  (\ x -> a >>= \y -> f x y) = a >>= \y -> 8  (\ x -> f x y) sliding  8  (Control.Monad.liftM h . f) = Control.Monad.liftM h (8  (f . h)),  for strict h. nesting  8  (\x -> 8  (\y -> f x y)) = 8  (\ x -> f x x) 7This class is used in the translation of the recursive do notation  supported by GHC and Hugs. 8YY88Y8portable experimentallibraries@haskell.org9Lift a function to an arrow. ;;Send the first component of the input through the argument 5 arrow, and copy the rest unchanged to the output. =;Fanin: Split the input between the two argument arrows and  merge their outputs. ?The default definition may be overridden with a more efficient  version if desired. The >= operator expresses computations in which an output value is D fed back as input, even though the computation occurs only once.  It underlies the rec. value recursion construct in arrow notation. The  class is equivalent to F : any monad gives rise  to a  arrow, and any instance of  defines a monad. ?Some arrows allow application of arrow inputs to other inputs. >Choice, for arrows that support it. This class underlies the  if and case constructs in arrow notation.  Any instance must define '. The other combinators have sensible @ default definitions, which may be overridden for efficiency. ;Feed marked inputs through the argument arrow, passing the ) rest through unchanged to the output. A mirror image of . ?The default definition may be overridden with a more efficient  version if desired. ;Split the input between the two argument arrows, retagging  and merging their outputs. / Note that this is in general not a functor. ?The default definition may be overridden with a more efficient  version if desired. Kleisli arrows of a monad. The basic arrow class. Minimal complete definition: 9 and ;. 9The other combinators have sensible default definitions, + which may be overridden for efficiency. A mirror image of ;. ?The default definition may be overridden with a more efficient  version if desired. <Split the input between the two argument arrows and combine > their output. Note that this is in general not a functor. ?The default definition may be overridden with a more efficient  version if desired. ;Fanout: send the input to both argument arrows and combine  their output. ?The default definition may be overridden with a more efficient  version if desired. ,The identity arrow, which plays the role of 7  in arrow notation. %Precomposition with a pure function. &Postcomposition with a pure function. =Precomposition with a pure function (right-to-left variant). >Postcomposition with a pure function (right-to-left variant). Any instance of ! can be made into an instance of   by defining  = . 9;<=>IJ 9;=<>JI9;<=>><=9;non-portable (GHC extensions)internalcvs-ghc@haskell.org::: :non-portable (requires universal quantification for runST) experimentallibraries@haskell.org/01/01~:non-portable (requires universal quantification for runST) provisionallibraries@haskell.org/01F:non-portable (requires universal quantification for runST) provisionallibraries@haskell.org"The lazy state-transformer monad.  A computation of type F s a& transforms an internal state indexed  by s, and returns a value of type a.  The s parameter is either 6 an unstantiated type variable (inside invocations of F), or  Xe (inside invocations of F). BIt serves to keep the internal states of different invocations of  F2 separate from each other and from invocations of F. The 5  and 6 7 operations are not strict in the state. For example, F5 (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2>Return the value computed by a state transformer computation.  The forall- ensures that the internal state used by the F 9 computation is inaccessible to the rest of the program. HAllow the result of a state transformer computation to be used (lazily)  inside the computation.  Note that if f is strict, F f = _|_. Convert a strict F0 computation into a lazy one. The strict state thread passed to F& is not performed until the result of .the lazy state thread it returns is demanded. Convert a lazy F computation into a strict one. =A monad transformer embedding lazy state transformers in the c  monad. The Xe- parameter indicates that the internal state  used by the F. computation is a special one supplied by the c < monad, and thus distinct from those used by invocations of F. portablestablelibraries@haskell.orgPPGportable experimentallibraries@haskell.org 8Maybe monoid returning the rightmost non-Nothing value. 7Maybe monoid returning the leftmost non-Nothing value. Monoid under multiplication. Monoid under addition. "Boolean monoid under disjunction. "Boolean monoid under conjunction. /The monoid of endomorphisms under composition. <The dual of a monoid, obtained by swapping the arguments of G. The monoid class. + A minimal complete definition must supply G and G, + and these should satisfy the monoid laws.  Identity of G An associative operation Fold a list using the monoid. , For most types, the default definition for G will be ? used, but the function is included in the class definition so ? that an optimized version can be provided for specific types. Hportable experimentallibraries@haskell.orgLists, but with an H# functor based on zipping, so that f H HH xs1 H ... H HH xsn = HH (zipWithn f xs1 ... xsn)"A monoid on applicative functors. The identity of H  An associative binary operation A functor with application. -Instances should satisfy the following laws:  identity  H G> H v = v  composition  H (.) H u H v H w = u H (v H w)  homomorphism  H f H H x = H (f x)  interchange  u H H y = H ( y) H u The H  instance should satisfy      f x = H f H x If f is also a F  , define H = 7  and (H) =  . Lift a value. Sequential application. A synonym for  . Replace the value. >Sequence actions, discarding the value of the first argument. ?Sequence actions, discarding the value of the second argument.  A variant of H with the arguments reversed. Lift a function to actions. * This function may be used as a value for   in a H  instance. #Lift a binary function to actions. $Lift a ternary function to actions.  One or none.  One or more. Zero or more. Iportable experimentallibraries@haskell.org#$Data structures that can be folded. Minimal complete definition: I or I. For example, given a data type  9 data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) a suitable instance would be   instance Foldable Tree  foldMap f Empty = mempty  foldMap f (Leaf x) = f x M foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r CThis is suitable even for abstract types, as the monoid is assumed  to satisfy the monoid laws. 4Combine the elements of a structure using a monoid. /Map each element of the structure to a monoid,  and combine the results. 'Right-associative fold of a structure. I f z =  f z . I&Left-associative fold of a structure. I f z =  f z . I A variant of I that has no base case, 7 and thus may only be applied to non-empty structures. I f =  f . I A variant of I that has no base case, 7 and thus may only be applied to non-empty structures. I f =  f . I'Fold over the elements of a structure, ) associating to the right, but strictly. /Monadic fold over the elements of a structure, 4 associating to the right, i.e. from right to left. 'Fold over the elements of a structure, ( associating to the left, but strictly. /Monadic fold over the elements of a structure, 3 associating to the left, i.e. from left to right. 7Map each element of a structure to an action, evaluate ; these actions from left to right, and ignore the results. I is I with its arguments flipped. >Map each element of a structure to a monadic action, evaluate ; these actions from left to right, and ignore the results. I is I with its arguments flipped. :Evaluate each action in the structure from left to right,  and ignore the results. BEvaluate each monadic action in the structure from left to right,  and ignore the results. 1The sum of a collection of actions, generalizing I. 1The sum of a collection of actions, generalizing I. !List of elements of a structure. ?The concatenation of all the elements of a container of lists. DMap a function over all the elements of a container and concatenate  the resulting lists. I; returns the conjunction of a container of Bools. For the  result to be xX[ , the container must be finite; X[ , however,  results from a X[' value finitely far from the left end. I; returns the disjunction of a container of Bools. For the  result to be X[ , the container must be finite; xX[ , however,  results from a xX[' value finitely far from the left end. IDetermines whether any element of the structure satisfies the predicate. HDetermines whether all elements of the structure satisfy the predicate. The I: function computes the sum of the numbers of a structure. The I> function computes the product of the numbers of a structure. .The largest element of a non-empty structure. AThe largest element of a non-empty structure with respect to the  given comparison function. ,The least element of a non-empty structure. ?The least element of a non-empty structure with respect to the  given comparison function. )Does the element occur in the structure? I is the negation of I. The I8 function takes a predicate and a structure and returns B the leftmost element of the structure matching the predicate, or   if there is no such element. ###portablestablelibraries@haskell.org), applied to two real fractional numbers x and epsilon, - returns the simplest rational number within epsilon of x.  A rational number y is said to be simpler than another y' if   ( y) <=  ( y'), and   y <=  y'. 7Any real interval contains a unique simplest rational;  in particular, note that 0/1" is the simplest rational of all. `a`a!$non-portable (uses Control.Monad.ST) experimentallibraries@haskell.orgMutate the contents of an k! klmnklmnJ)non-portable (uses Control.Monad.ST.Lazy) experimentallibraries@haskell.orgk  k    +non-portable (uses Control.Monad.ST.Strict) provisionallibraries@haskell.orgklmnKportable experimentallibraries@haskell.org  AFunctors representing data structures that can be traversed from  left to right. Minimal complete definition:  K or  K. Instances are similar to H , e.g. given a data type  9 data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) a suitable instance would be   instance Traversable Tree " traverse f Empty = pure Empty ' traverse f (Leaf x) = Leaf <$> f x M traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r :This is suitable even for abstract types, as the laws for H  imply a form of associativity. 7The superclass instances should satisfy the following:  In the H  instance,  # should be equivalent to traversal + with the identity applicative functor (K).  In the I instance, Data.Foldable.foldMap should be @ equivalent to traversal with a constant applicative functor  (K).  7Map each element of a structure to an action, evaluate < these actions from left to right, and collect the results.  :Evaluate each action in the structure from left to right,  and collect the results. >Map each element of a structure to a monadic action, evaluate < these actions from left to right, and collect the results. BEvaluate each monadic action in the structure from left to right,  and collect the results. K is  K with its arguments flipped. K is K with its arguments flipped. The K( function behaves like a combination of    and 8; it applies a function to each element of a structure, E passing an accumulating parameter from left to right, and returning D a final value of this accumulator together with the new structure. The K( function behaves like a combination of    and foldr8; it applies a function to each element of a structure, E passing an accumulating parameter from right to left, and returning D a final value of this accumulator together with the new structure. )This function may be used as a value for   in a H  instance. )This function may be used as a value for Data.Foldable.foldMap  in a I instance.              L non-portable experimentallibraries@haskell.org,An abstract unique object. Objects of type L may be 4 compared for equality and ordering and hashed into X]. Creates a new object of type L. The value returned will . not compare equal to any other value of type L returned by  previous calls to L&. There is no limit on the number of  times L may be called.  Hashes a L into an X]. Two Ls may hash to the 9 same value, although in practice this is unlikely. The X] ! returned makes a good hash key. M non-portable experimentallibraries@haskell.orgWrap an c$ computation to time out and return Nothing in case no result  is available within n microseconds (1/10^6 seconds). In case a result * is available before the timeout expires, Just a is returned. A negative  timeout interval means "wait indefinitely"!. When specifying long timeouts,  be careful not to exceed maxBound :: Int. ?The design of this combinator was guided by the objective that  timeout n f # should behave exactly the same as f as long as f doesn't time out. This  means that f has the same X:# it would have without the timeout  wrapper. Any exceptions f. might throw cancel the timeout and propagate " further up. It also possible for f' to receive exceptions thrown to it by  another thread. BA tricky implementation detail is the question of how to abort an IO L computation. This combinator relies on asynchronous exceptions internally. H The technique works very well for computations executing inside of the % Haskell runtime system, but it doesn'$t work at all for non-Haskell code. D Foreign function calls, for example, cannot be timed out with this B combinator simply because an arbitrary C function cannot receive  asynchronous exceptions. When timeout" is used to wrap an FFI call that M blocks, no timeout event can be delivered until the FFI call returns, which J pretty much negates the purpose of the combinator. In practice, however, = this limitation is less severe than it may sound. Standard I/ O functions  like System.IO.hGetBuf, System.IO.hPutBuf, Network.Socket.accept, or  System.IO.hWaitForInput+ appear to be blocking, but they really don't < because the runtime system uses scheduling mechanisms like  select(2) to  perform asynchronous I/2O, so it is possible to interrupt standard socket  I/ O or file I/O using this combinator. N6non-portable (local universal quantification in ReadP) experimentallibraries@haskell.orgA NN0 represents the version of a software entity. An instance of B . is provided, which implements exact equality %modulo reordering of the tags in the N field. An instance of J - is also provided, which gives lexicographic ordering on the N( fields (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, Getc.). This is expected to be sufficient for many uses, but note that Ayou may need to use a more specific ordering for your versioning Gscheme. For example, some versioning schemes may include pre-releases which have tags "pre1", "pre2"%, and so on, and these would need to Fbe taken into account when determining ordering. In some cases, date Cordering may be more appropriate, so the application would have to  look for date tags in the N field and compare those. The bottom line is, don't always assume that |  and other J  )operations are the right thing for every NN. ASimilarly, concrete representations of versions may differ. One 2possible concrete representation is provided (see N and N9), but depending on the application a different concrete (representation may be more appropriate. 8The numeric branch for this version. This reflects the = fact that most software versions are tree-structured; there : is a main trunk which is tagged with versions at various = points (1,2,3...), and the first branch off the trunk after 9 version 3 is 3.1, the second branch off the trunk after 8 version 3 is 3.2, and so on. The tree can be branched * arbitrarily, just by adding more digits. %We represent the branch as a list of X], so  version 3.2.1 becomes [3,2,1]. Lexicographic ordering  (i.e. the default instance of J  for [Int]) gives # the natural ordering of branches. ;A version can be tagged with an arbitrary list of strings. > The interpretation of the list of tags is entirely dependent - on the entity that this version applies to. 2Provides one possible concrete representation for NN. For  a version with N = [1,2,3] and N  = ["tag1","tag2"], the output will be 1.2.3-tag1-tag2. 0A parser for versions in the format produced by N. Oportable provisionallibraries@haskell.org  O3 function outputs the trace message from IO monad.  Usually the output stream is System.IO.stderr but if the function is called N from Windows GUI application then the output will be directed to the Windows  debug console. ! When called, !O3 outputs the string in its first argument, before 1returning the second argument as its result. The !O function is not Jreferentially transparent, and should only be used for debugging, or for .monitoring execution. Some implementations of !O may decorate the string that's output to indicate that you'+re tracing. The function is implemented on top of  O. "Like !O , but uses $ on the argument to convert it to a l.  traceShow = trace . show  !" !" !"Pportable experimentallibraries@haskell.org #@Describes whether an option takes an argument or not, and if so 3 how the argument is injected into a value of type a. $optional argument %option requires argument &no argument expected 'Each 'P describes a single option. The arguments to (P are: ! list of short option characters & list of long option strings (without "--")  argument descriptor  explanation of option for user ).What to do with options following non-options *wrap non-options into options ++freely intersperse options and non-options ,,no option processing after first non-option -@Return a string describing the usage of a command, derived from ? the header (first argument) and the options described by the  second argument. .EProcess the command-line, and return the list of values that matched (and those that didn't). The arguments are:  The order requirements (see )P)  The option descriptions (see 'P) 9 The actual command line arguments (presumably got from  System.Environment.getArgs). .P= returns a triple consisting of the option arguments, a list .of non-options, and a list of error messages. /This is almost the same as .P, but returns a quadruple Econsisting of the option arguments, a list of non-options, a list of 4unrecognized options, and a list of error messages. #$%&'()*+,-./ ./-),+*'(#&%$ #&%$$%&'((),+**+,-./Qportable provisionallibraries@haskell.org0 Computation 0Q, returns the number of picoseconds CPU time ? used by the current program. The precision of this result is  implementation-dependent. 1The 1Q0 constant is the smallest measurable difference D in CPU time that the implementation can record, and is given as an ! integral number of picoseconds. 010101Rportable provisionallibraries@haskell.org2 Computation 2R returns a list of the program' s command 2 line arguments (not including the program name). 3 Computation 3R+ returns the name of the program as it was  invoked. BHowever, this is hard-to-impossible to implement on some non-Unix GOSes, so instead, for maximum portability, we just return the leafname @of the program as invoked. Even then there are some differences Ebetween platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, and that is what 3R will return. 4 Computation 4R var returns the value  of the environment variable var.  This computation may fail with:  #System.IO.Error.isDoesNotExistError if the environment variable  does not exist. 55R args act - while executing action act, have 2R return args. 66R name act - while executing action act, have 3R return name. 77R' retrieves the entire environment as a  list of  (key,value) pairs. ,If an environment entry does not contain an '=' character,  the key is the whole entry and the value is the empty string. 234567234567234567(portable provisionallibraries@haskell.org8 Computation 8( code throws  ExitException code. 1 Normally this terminates the program, returning code to the  program'6s caller. Before the program terminates, any open or ' semi-closed handles are first closed. >A program that fails in any other way is treated as if it had  called 9(. 8 A program that terminates successfully without calling 8( + explicitly is treated as it it had called 8( (. As an  ExitException is not an ', 8( bypasses  the error handling in the c$ monad and cannot be intercepted by  A from the Prelude. However it is an  , and can " be caught using the functions of Control.Exception. This means & that cleanup computations added with Control.Exception.bracket  (from Control.Exception ) are also executed properly on 8(. 9The computation 9( is equivalent to  8( (( exitfail),  where exitfail is implementation-dependent. :The computation :( is equivalent to  8( (, It terminates the program  sucessfully. 89:89:89:Sportable experimentallibraries@haskell.org;The version of >S% with which the program was compiled  or is being interpreted. <6The operating system on which the program is running. =:The machine architecture on which the program is running. >?The Haskell implementation with which the program was compiled  or is being interpreted. ;<=><=>;;<=>Tportable provisionallibraries@haskell.org?)Triggers an immediate garbage collection ???U non-portable experimentallibraries@haskell.org@DAn abstract name for an object, that supports equality and hashing. *Stable names have the following property:  If sn1 :: StableName and sn2 :: StableName and  sn1 == sn2  then sn1 and sn2 were created by calls to makeStableName on  the same object. AThe reverse is not necessarily true: if two stable names are not L equal, then the objects they name may still be equal. Note in particular  that  mkStableName may return a different @U after an  object is evaluated. -Stable Names are similar to Stable Pointers (Foreign.StablePtr), $ but differ in the following ways:  There is no freeStableName operation, unlike Foreign.StablePtrs. F Stable names are reclaimed by the runtime system when they are no  longer needed.  There is no deRefStableName operation. You can't get back from B a stable name to the original Haskell object. The reason for G this is that the existence of a stable name for an object does not J guarantee the existence of the object itself; it can still be garbage  collected. AMakes a @U0 for an arbitrary object. The object passed as ( the first argument is not evaluated by AU. B Convert a @U to an X]. The X] returned is not  necessarily unique; several @Us may map to the same X] D (in practice however, the chances of this are small, so the result  of BU makes a good hash key). @AB@AB@AB. non-portable experimentallibraries@haskell.orgCA specialised version of  .", where the key and the value are  the same object: 4 mkWeakPtr key finalizer = mkWeak key key finalizer DA specialised version of C. , where the . object @ returned is simply thrown away (however the finalizer will be = remembered by the garbage collector, and will still be run % when the key becomes unreachable). Note: adding a finalizer to a Foreign.ForeignPtr.ForeignPtr using  D. won'0t work as well as using the specialised version  )Foreign.ForeignPtr.addForeignPtrFinalizer because the latter . version adds the finalizer to the primitive  'ForeignPtr#' object  inside, whereas the generic D. will add the finalizer to F the box. Optimisations tend to remove the box, which may cause the C finalizer to run earlier than you intended. The same motivation  justifies the existence of  (Control.Concurrent.MVar.addMVarFinalizer and  Data.IORef.mkWeakIORef% (the non-uniformity is accidental). EA specialised version of  .$ where the value is actually a pair  of the key and value passed to E.:  ? mkWeakPair key val finalizer = mkWeak key (key,val) finalizer :The advantage of this is that the key can be retrieved by !.  in addition to the value.  !"CDE !"CDECDEVportable provisionallennart@augustsson.netHThe HV0 class provides the variable argument magic for  KV8. Its implementation is intentionally not visible from  this module. IThe IV0 class provides the variable argument magic for  JV8. Its implementation is intentionally not visible from A this module. If you attempt to pass an argument of a type which % is not an instance of this class to JV or KV, then 6 the compiler will report it as a missing instance of GV. JJFormat a variable number of arguments with the C-style formatting string.  The return value is either l or (c a). 6The format string consists of ordinary characters and / conversion  specifications/3, which specify how to format one of the arguments M to printf in the output string. A conversion specification begins with the  character %2, followed by one or more of the following flags:  1 - left adjust (default is right adjust) = + always use a sign (+ or -) for signed conversions . 0 pad with zeroes rather than spaces &followed optionally by a field width:   num field width 0 * as num, but taken from argument list $followed optionally by a precision:  0 .num precision (number of decimal places) !and finally, a format character:  ; c character Char, Int, Integer, ... ; d decimal Char, Int, Integer, ... ; o octal Char, Int, Integer, ... ; x hexadecimal Char, Int, Integer, ... ; X hexadecimal Char, Int, Integer, ... ; u unsigned decimal Char, Int, Integer, ... 1 f floating point Float, Double 1 g general format float Float, Double 1 G general format float Float, Double 1 e exponent format float Float, Double 1 E exponent format float Float, Double * s string String EMismatch between the argument types and the format string will cause ' an exception to be thrown at runtime.  Examples:  > printf "%d\n" (23::Int)  23 & > printf "%s %s\n" "Hello" "World"  Hello World  > printf "%.2f\n" pi  3.14 K Similar to JV*, except that output is via the specified  ,$. The return type is restricted to (c a). FGHIJKJKIHGFFGHIJKportable provisionallibraries@haskell.org Ynon-portable (GHC Extensions) Basic implementation of Parallel Arrays. This module has two functions: (1) It defines the interface to the parallel array extension of the Prelude and (2) it provides a vanilla implementation of parallel arrays that does not require to flatten the array code. The implementation is not very optimised.internal/Manuel M. T. Chakravarty <chak@cse.unsw.edu.au>#JCompute a cross of an array and the arrays produced by the given function & for the elements of the first array. 9 !"#$%&'()LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv9 )!LM$NOPQRSTU(VWXYZ[\]^_`abcdefgh"ijklm&'%nopqrstu#v9 !"#$%&'()LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv ZZZqZ^^^oZZWWZZZZZ ``c\\\\WW`ZZZZ \\WfccZZ`Wicfc_  kkkkccoljjjjjnnZmmmmmmmmmmmmWWWWWWWWZZ Z Z Z Z ZZZZZZZZZ\\\\\\ !"#$%&'(^)^*^+^,^-^.^/^0^1^2^3^4^5^6^7^8^9^:^;^<^=^>^?^@^A^B^C^D^E^F^G^H^I^J^K^L^M^N_O_P_Q_R_S_T_U_V_W_XYZ[\]^_```a`b`c`dcecfcgchcicjckclcmcncocpcqcrcsctcucvcwcxcyczc{c|c}c~cddddfffffffffffffffffffffffffffffffffffgggg                               hhhhhhhhhhhhhh """"" "!"""#"$"%"&"'"(")"*"+","-"."/"0"1"2"3"4"5"6"7"8"9":";"<"=#>#?#@#A#B#C#D###!#"# #)#E#F#G#H$I$J$K$L$M$N$O$$P$Q$R$S$T$U$V$WiXiYiZi[i\i]i^iQi_i`iaibicjd%e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z&{&|&}&~&&lllllllllllllllllllllllllllllllllllllllllllllllllllyyymmmmm      !-"-#-$-%-&---'-G-(-)-*+,-./01234567nnn8n9n:n;n<n=n>n?n@oAoBoCoDqEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'u'v'w'x'y'z'{'|'}'~''''''''''rrrr)))///////%%%%%%%%tttttttttttt1100000222222223333334&44444444455555555555555555555666666666666666666666666677777777777777 7 7 7 7 7777777777777777777 7!7"7#7$7%7&7'7(7)7*7+7,7-7.7/707172737475767778797:7;7<7=7>7?7@7A7B7C7D7E7F7G7H7I7J7K7L7M7N7O7P7Q7R7S7T7U7V7W7X7Y7Z7[7\7]7^7_7`7a7b7c7d7e7f7g7h7i7j7k7l7m7n7o7p7q7r7s7t7u7v7w7x7y7z8{8|8}8~888888888889999999999999999999999999999+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++c;;;yyyyyyyyyyyyyyyyyyy y y y y yyyyyyy<<<<<<<<<<<<<<<<<<<<<<<<<c<<<<<<<<<<< <<<<<<{!{"{#{${%{&{'{({){*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{||}~=>> > >>*****?????????@@@@AAAABBBBBBB:::::::::CCCCCCCCCCDDDDDDDDDDDEE!FFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHH.HH/IIIII/I2IIIIII I III II II)IIHIAIBICIDIIIIIIIEIFI !JJJJKKKKKKKKKKKLLLMNNNNNNOOO P!P"P#P$P%P&P'P(P)P*P+P,P-Q.Q/R0R1R2R3R4R5(6(7(8S9S:S;S<T=U>U?U@.A.B.CVDVEVFVGVHVI J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s tXYuX[vXewZxXeyZzZ{Z|Z}Xe~XeXeXeX[XeXeX]PXeX]XeX]XeXeX]LXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXXXZX]X]X[X]X]XeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXe Xe Xe Xe Xe XeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXe Xe!Xe"Xe#Xe$Xe%Xe&Xe'Xe(Xe)Xe*Xe+Xe,Xe-Xe.Xe/Xe0Xe1Xe2Xe3Xe4Xe5Xe6Xe7Xe8Xe9Xe:Xe;Xe<Xe=Xe>Xe?Xe@XeAXeBXeCXeDXeEXeFXeGXeHXeIXeJXeKXeLXeMXeNXeOXePXeQXeRXeSXeTXeUXeVXeWXeXXeYXeZXe[Xe\Xe]Xe^Xe_Xe`XeaXebXecXedXeeXefXegXehXeiXejXekXelXemXenXeoXepXeqXerXesXetXeuXevXewXexXeyXezXe{Xe|Xe}Xe~XeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXeXYXYXYXXXXqqZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ \ \ ^ ^ _______aabababababababababab ab!ab"ab#ab$ab%ab&ab'ab(ab)ab*ab+ab,ab-ab.ab/ab0ab1ab2ab3ab4ab5ab6ab7ab8ab9ab:ab;ab<`=`>`?`@`A`B`C`D`E`F`GcHcIcJcKcLcMcNcOcPcQcRcScTcUcVdWdXdXdYddZf[f\f]f^f_f`fafbfcfdfefffgfhfifjfkflfmfnfofpfqfrfsftfufvfwfxfyfzf{f|f}f~fffffffffffffffffffffffffffffffffffffffffffgiiiiXXjjjjjjjjXXkkkkllllllllllllllllllllllllllllllJlllllllllllllllllllllllllllllllllllllllllll l l l l l l l l l l l l l l l l l l l l l l m  op p p p p p p p p !p "p #p $p %p &p 'p (p )p *p +p ,p -p .p /p 0p 1p 2p 3p 4p 5p 6p 7p 8q 9rr :r ;s <s =t >t ?t @t At4 Bx Cx Dx Ex Fx Gx Hx Ix Jx Kx Lx Mx Nx Ox Px Qx Rx Sx Tx Ux Vx Wx Xx Yx Zx [x \x ]x ^x _x `x ax bx cx dx ex fx gx hx ix jx kx lx mx nx ox px qx rx sx tx ux vx wx xx yx zx {x |x }x ~x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x + + y y y y y yy y y y y y y y y y y y y y y y y y y y y y y y y y y y y z z z z z z { { { { { { {       baseGHC.Exts Data.ListPreludeControl.Exception.BaseForeign.StablePtr System.IO Data.Tuple Data.BoolGHC.PArrData.EqData.Ord Control.MonadControl.Monad.Fix Control.Arrow GHC.Desugar Data.String Data.Data Text.Read Text.ShowGHC.Arr Data.TypeableData.Int Data.Ratio Data.Word Foreign.Ptr Data.Either Data.Char Unsafe.Coerce Data.MaybeNumeric Data.BitsControl.Monad.ST Data.STRefText.ParserCombinators.ReadPText.ParserCombinators.ReadPrec Text.Read.LexForeign.StorableForeign.C.TypesSystem.IO.Error System.Exit Data.IORefControl.Concurrent.MVarGHC.ConcSystem.IO.UnsafeData.HashTableSystem.Mem.Weak Data.DynamicForeign.ForeignPtrForeign.ConcurrentForeign.Marshal.AllocForeign.Marshal.ErrorForeign.Marshal.UtilsForeign.Marshal.ArrayForeign.C.StringForeign.C.ErrorForeign.Marshal.PoolSystem.Posix.TypesControl.ConcurrentControl.ExceptionControl.OldExceptionGHC.EnvironmentControl.CategoryControl.Concurrent.ChanControl.Concurrent.QSemControl.Concurrent.QSemNControl.Concurrent.SampleVar Data.Complex Data.Fixed Data.FunctionControl.Monad.ST.Lazy Data.MonoidControl.Applicative Data.FoldableData.STRef.LazyData.Traversable Data.UniqueSystem.Timeout Data.Version Debug.TraceSystem.Console.GetOptSystem.CPUTimeSystem.Environment System.Info System.MemSystem.Mem.StableName Text.Printf GHC.Classesghc-prim GHC.OrderingGHC.BaseGHC.BoolGHC.Enum GHC.TypesGHC.ListGHC.ShowGHC.Numinteger GHC.IntegerGHC.RealGHC.STGHC.Prim GHC.Float GHC.STRef GHC.ExceptionGHC.ReadGHC.WordGHC.Int GHC.IOBase GHC.UnicodeGHC.Ptr GHC.Stable GHC.StorableGHC.ErrGHC.WeakGHC.PackGHC.ForeignPtr Foreign.CForeign.MarshalForeignSystem.Posix.Internals GHC.HandleGHC.TopHandlerGHC.IOGHC.ConsoleHandlerControl.Monad.InstancesControl.Monad.ST.StrictData.IxData.STRef.StrictText.Show.Functionsaugment++builderrorfoldrirrefutPatErrornoMethodBindingErrornonExhaustiveGuardsError runtimeErrorpatError recConErrorconcatfilterzip newStablePtrprintfstsnd otherwiseassert&&||lazy breakpointbreakpointCondinlinemap groupWith singletonPnullPlengthP replicatePmapPfilterPzipP crossMapP!:toP enumFromToPenumFromThenToPemptyP+:+ fromInteger- fromRationalenumFrom enumFromThen enumFromToenumFromThenTo==>=negatefail>>=>>returnmfixarr>>>firstapp|||loop fromStringBoundedEnumEqFloating FractionalIntegralMonadDataFunctorNumOrdReadReal RealFloatRealFracShowIxTypeable Typeable1 Typeable2 Typeable3 Typeable4 Typeable5 Typeable6 Typeable7MonadFix MonadPlusIsStringInt8Int16Int32Int64RatioRational StablePtrIOWordWord8Word16Word32Word64PtrFunPtrEitherStringLeftRight unsafeCoerce isAlphaNum isHexDigit isOctDigitisDigitisAlphaisLowerisUpperisSpaceisPrint isControlisLatin1isAsciicompare<><=maxmin/=notcurryuncurryfmapchrordidconst.flip$untilasTypeOfshiftL#shiftRL#iShiftL# iShiftRA# iShiftRL#succpredtoEnumfromEnumminBoundmaxBoundMaybeJustNothingmaybeisJust isNothingfromJust fromMaybe maybeToList listToMaybe catMaybesmapMaybeheadtaillastinitnulllengthfoldlscanlscanl1foldr1scanrscanr1iteraterepeat replicatecycle takeWhile dropWhiletakedropsplitAtspanbreakreverseandoranyallelemnotElemlookup concatMap!!zip3zipWithzipWith3unzipunzip3 showsPrecshowshowListShowSshowsshowChar showString showParen showLitChar intToDigitcast showsTypeRep mkTyConAppmkTyContypeOfTyConTypeRep+*abssignumsubtractproperFractiontruncateroundceilingfloor/recipquotremdivmodquotRemdivMod toInteger toRational% numerator denominator fromIntegral realToFrac showSignedevenodd^^^gcdlcmBits.&..|.xor complementshiftrotatebitsetBitclearBit complementBittestBitbitSizeisSignedshiftLshiftRrotateLrotateRSTunsafeInterleaveSTfixSTrunSTSTArrayArrayIPrrangeindex unsafeIndexinRange rangeSizeunsafeRangeSize indexError arrEleBottomarray unsafeArray unsafeArray'filldone listArray! safeRangeSize safeIndexunsafeAtbounds numElementsindiceselemsassocs accumArrayunsafeAccumArrayunsafeAccumArray'adjust// unsafeReplaceaccum unsafeAccumamapixmapeqArraycmpArray cmpIntArray newSTArray boundsSTArraynumElementsSTArray readSTArrayunsafeReadSTArray writeSTArrayunsafeWriteSTArray freezeSTArrayunsafeFreezeSTArray thawSTArrayunsafeThawSTArray floatRadix floatDigits floatRange decodeFloat encodeFloatexponent significand scaleFloatisNaN isInfiniteisDenormalizedisNegativeZeroisIEEEatan2piexpsqrtlog**logBasesintancosasinatanacossinhtanhcoshasinhatanhacosh showFloat floatToDigitsfromRatSTRefnewSTRef readSTRef writeSTRef showListWithmzeromplus=<<sequence sequence_mapMmapM_guardfilterMforMforM_msum>=><=<foreverjoin mapAndUnzipMzipWithM zipWithM_foldMfoldM_ replicateM replicateM_whenunlessliftMliftM2liftM3liftM4liftM5apArithExceptionDenormal DivideByZeroLossOfPrecision UnderflowOverflow ErrorCall Exception toException fromException SomeExceptionthrow comparingReadPReadSgetlookpfail+++<++gathersatisfycharstringmunchmunch1choice skipSpacescountbetweenoptionoptionalmanymany1skipMany skipMany1sepBysepBy1endByendBy1chainrchainlchainr1chainl1manyTill readP_to_S readS_to_PPrecReadPrecminPrecliftstepresetprec readPrec_to_P readP_to_Prec readPrec_to_S readS_to_PrecLexemeEOFRatIntSymbolIdentPuncCharlexhsLexlexCharreadIntPreadOctPreadDecPreadHexP readsPrecreadListreadPrec readListPrec readParenreadListDefaultreadListPrecDefault lexLitChar readLitChar lexDigitslexPparensW#StorableCUIntMaxCIntMaxCUIntPtrCIntPtrCJmpBufCFposCFileCTimeCClock CSigAtomicCWcharCSizeCPtrdiffCLDoubleCDoubleCFloatCULLongCLLongCULongCLongCUIntCIntCUShortCShortCUCharCSCharCCharIOMode ReadWriteMode AppendMode WriteModeReadMode IOErrorType IOExceptionIOErrorExitCode ExitFailure ExitSuccessArrayExceptionUndefinedElementIndexOutOfBoundsAsyncException UserInterrupt ThreadKilled HeapOverflow StackOverflowAssertionFailedDeadlockBlockedIndefinitelyBlockedOnDeadMVarIORef BufferModeBlockBuffering LineBuffering NoBufferingFilePathHandleMVarstToIO unsafeIOToST unsafeSTToIOunsafePerformIOunsafeInterleaveIOnewIORef readIORef writeIORefioError userErrorthrowIOblockunblockblockedevaluatehFlushstderrstdoutcatch isAsciiLower isAsciiUppertoLowertoUppertoTitleGeneralCategory NotAssigned PrivateUse SurrogateFormatControlParagraphSeparator LineSeparatorSpace OtherSymbolModifierSymbolCurrencySymbol MathSymbolOtherPunctuation FinalQuote InitialQuoteClosePunctuationOpenPunctuationDashPunctuationConnectorPunctuation OtherNumber LetterNumber DecimalNumber EnclosingMarkSpacingCombiningMarkNonSpacingMark OtherLetterModifierLetterTitlecaseLetterLowercaseLetterUppercaseLetter digitToIntgeneralCategoryisLetterisMarkisNumber isPunctuationisSymbol isSeparator stripPrefix elemIndex elemIndicesfind findIndex findIndices isPrefixOf isSuffixOf isInfixOfnubnubBydeletedeleteBy\\unionunionBy intersect intersectBy intersperse intercalate transpose partition mapAccumL mapAccumRinsertinsertBymaximumminimum maximumBy minimumBy genericLength genericTake genericDropgenericSplitAt genericIndexgenericReplicatezip4zip5zip6zip7zipWith4zipWith5zipWith6zipWith7unzip4unzip5unzip6unzip7deleteFirstsBygroupgroupByinitstails subsequences permutationssortBysortunfoldrfoldl'foldl1foldl1'sumproductlinesunlineswordsunwords HashTablehashInt hashStringprimenewupdatefromListtoList longestChainreadIntreadOctreadDecreadHex readFloat readSignedshowInt showEFloat showFFloat showGFloat showIntAtBaseshowHexshowOctnullPtrcastPtrplusPtralignPtrminusPtr nullFunPtr castFunPtrcastFunPtrToPtrcastPtrToFunPtr freeStablePtrdeRefStablePtrcastStablePtrToPtrcastPtrToStablePtr undefinedtypeOf7typeOf6typeOf5typeOf4typeOf3typeOf2typeOf1 typeRepKeymkFunTy splitTyConApp funResultTymkAppTy typeRepTyCon typeRepArgs tyConString typeOfDefaulttypeOf1DefaulttypeOf2DefaulttypeOf3DefaulttypeOf4DefaulttypeOf5DefaulttypeOf6Defaultgcastgcast1gcast2eitherleftsrightspartitionEitherstry mkIOErrorisAlreadyExistsErrorisDoesNotExistErrorisAlreadyInUseError isFullError isEOFErrorisIllegalOperationisPermissionError isUserErroralreadyExistsErrorTypedoesNotExistErrorTypealreadyInUseErrorType fullErrorType eofErrorTypeillegalOperationErrorTypepermissionErrorType userErrorTypeisAlreadyExistsErrorTypeisDoesNotExistErrorTypeisAlreadyInUseErrorTypeisFullErrorTypeisEOFErrorTypeisIllegalOperationErrorTypeisPermissionErrorTypeisUserErrorTypeioeGetErrorTypeioeGetErrorStringioeGetLocation ioeGetHandleioeGetFileNameioeSetErrorTypeioeSetErrorStringioeSetLocation ioeSetHandleioeSetFileName modifyIOErrorannotateIOErrorreadsreadWeakmkWeak deRefWeakfinalize mkWeakIORef modifyIORefatomicModifyIORefDynamictoDynfromDyn fromDynamicdynApplydynApp dynTypeRepsizeOf alignment peekElemOff pokeElemOff peekByteOff pokeByteOffpeekpokeFinalizerEnvPtr FinalizerPtr ForeignPtrmallocForeignPtrmallocForeignPtrBytesaddForeignPtrFinalizeraddForeignPtrFinalizerEnvnewForeignPtr_touchForeignPtrunsafeForeignPtrToPtrcastForeignPtrfinalizeForeignPtr newForeignPtrfreeHaskellFunPtrIntPtrWordPtr ptrToWordPtr wordPtrToPtr ptrToIntPtr intPtrToPtrwithForeignPtrnewForeignPtrEnvmallocForeignPtrArraymallocForeignPtrArray0 finalizerFreemalloc mallocBytesalloca allocaBytesrealloc reallocBytesfreethrowIfthrowIf_ throwIfNeg throwIfNeg_ throwIfNullvoidwithfromBooltoBoolmaybeNew maybeWith maybePeekwithMany copyBytes moveBytes mallocArray mallocArray0 allocaArray allocaArray0 reallocArray reallocArray0 peekArray peekArray0 pokeArray pokeArray0newArray newArray0 withArray withArrayLen withArray0 withArrayLen0 copyArray moveArray lengthArray0 advancePtr CWStringLenCWString CStringLenCString peekCStringpeekCStringLen newCString newCStringLen withCStringwithCStringLencharIsRepresentablecastCCharToCharcastCharToCChar peekCAStringpeekCAStringLen newCAStringnewCAStringLen withCAStringwithCAStringLen peekCWStringpeekCWStringLen newCWStringnewCWStringLen withCWStringwithCWStringLenErrnoeOKe2BIGeACCES eADDRINUSE eADDRNOTAVAILeADV eAFNOSUPPORTeAGAINeALREADYeBADFeBADMSGeBADRPCeBUSYeCHILDeCOMM eCONNABORTED eCONNREFUSED eCONNRESETeDEADLK eDESTADDRREQeDIRTYeDOMeDQUOTeEXISTeFAULTeFBIGeFTYPE eHOSTDOWN eHOSTUNREACHeIDRMeILSEQ eINPROGRESSeINTReINVALeIOeISCONNeISDIReLOOPeMFILEeMLINKeMSGSIZE eMULTIHOP eNAMETOOLONGeNETDOWN eNETRESET eNETUNREACHeNFILEeNOBUFSeNODATAeNODEVeNOENTeNOEXECeNOLCKeNOLINKeNOMEMeNOMSGeNONET eNOPROTOOPTeNOSPCeNOSReNOSTReNOSYSeNOTBLKeNOTCONNeNOTDIR eNOTEMPTYeNOTSOCKeNOTTYeNXIO eOPNOTSUPPePERM ePFNOSUPPORTePIPEePROCLIM ePROCUNAVAIL ePROGMISMATCH ePROGUNAVAILePROTOePROTONOSUPPORT ePROTOTYPEeRANGEeREMCHGeREMOTEeROFS eRPCMISMATCHeRREMOTE eSHUTDOWNeSOCKTNOSUPPORTeSPIPEeSRCHeSRMNTeSTALEeTIME eTIMEDOUT eTOOMANYREFSeTXTBSYeUSERS eWOULDBLOCKeXDEV isValidErrnogetErrno resetErrno throwErrno throwErrnoIf throwErrnoIf_throwErrnoIfRetrythrowErrnoIfRetryMayBlockthrowErrnoIfRetry_throwErrnoIfRetryMayBlock_throwErrnoIfMinus1throwErrnoIfMinus1_throwErrnoIfMinus1RetrythrowErrnoIfMinus1Retry_throwErrnoIfMinus1RetryMayBlock throwErrnoIfMinus1RetryMayBlock_throwErrnoIfNullthrowErrnoIfNullRetrythrowErrnoIfNullRetryMayBlockthrowErrnoPaththrowErrnoPathIfthrowErrnoPathIf_throwErrnoPathIfNullthrowErrnoPathIfMinus1throwErrnoPathIfMinus1_errnoToIOErrorPoolnewPoolfreePoolwithPool pooledMallocpooledMallocBytes pooledReallocpooledReallocBytespooledMallocArraypooledMallocArray0pooledReallocArraypooledReallocArray0 pooledNewpooledNewArraypooledNewArray0LimitProcessGroupID FileOffset ProcessIDFileModeFileIDDeviceID EpochTime ClockTick ByteCountGroupIDUserID LinkCountFdCRLimCTcflagCSpeedCCcCUidCNlinkCGidCSsizeCPidCOffCModeCInoCDev HandlerFunSignalTVarSTM ThreadStatus ThreadDied ThreadBlockedThreadFinished ThreadRunning BlockReasonBlockedOnOtherBlockedOnForeignCall BlockedOnSTMBlockedOnExceptionBlockedOnBlackHole BlockedOnMVarThreadIdforkIOforkOnIOnumCapabilities childHandler killThreadthrowTo myThreadIdyield labelThreadpseqpar threadStatus unsafeIOToSTM atomicallyretryorElsecatchSTMalwaysSucceedsalwaysnewTVar newTVarIOreadTVar writeTVar newEmptyMVarnewMVartakeMVarputMVar tryTakeMVar tryPutMVar isEmptyMVaraddMVarFinalizerthreadWaitReadthreadWaitWrite threadDelay registerDelayensureIOManagerIsRunning syncIOManager runHandlers setHandlerreportStackOverflow reportErrorsetUncaughtExceptionHandlergetUncaughtExceptionHandlerNestedAtomicallyNonTermination NoMethodError RecUpdError RecConError RecSelErrorPatternMatchFail catchJusthandle handleJust mapExceptiontryJust onExceptionbracketfinallybracket_bracketOnError recSelErrornonTerminationnestedAtomicallyHandlercatchesSeekMode SeekFromEnd RelativeSeek AbsoluteSeek HandlePosnstdinopenFileopenBinaryFilehClose hFileSize hSetFileSizehIsEOFisEOF hLookAhead hSetBufferinghGetPosnhSetPosnhSeekhTellhIsOpen hIsClosed hIsReadable hIsWritable hGetBuffering hIsSeekablehSetEchohGetEchohIsTerminalDevicehSetBinaryModehShow ExitException DynExceptionthrowDyn throwDynTocatchDynioErrorsarithExceptions errorCalls assertions dynExceptionsasyncExceptions userErrors hWaitForInputhGetCharhGetLine hGetContentshPutCharhPutStrhPutBufhPutBufNonBlockinghGetBufhGetBufNonBlockingputCharputStrputStrLngetChargetLine getContentsinteractreadFile writeFile appendFilereadLnreadIOhReady hPutStrLnhPrintwithFilewithBinaryFilefixIO openTempFileopenBinaryTempFile$!FixityInfixPrefixConIndex ConstrRep StringConstr FloatConstr IntConstr AlgConstrDataRepNoRep StringRepFloatRepIntRepAlgRepConstrDataTypegfoldlgunfoldtoConstr dataTypeOf dataCast1 dataCast2gmapTgmapQlgmapQrgmapQgmapQigmapMgmapMpgmapMo fromConstr fromConstrB fromConstrM dataTypeName dataTypeRep constrType constrRep repConstr mkDataTypemkConstrdataTypeConstrs constrFields constrFixity showConstr readConstr isAlgType indexConstr constrIndexmaxConstrIndex mkIntType mkFloatType mkStringType mkIntConstr mkFloatConstrmkStringConstr mkNorepType isNorepType tyconUQname tyconModuleDown maxTupleSizethesortWith getFullArgsCategory<<<readMVarswapMVarwithMVar modifyMVar_ modifyMVarChannewChan writeChanreadChandupChan unGetChan isEmptyChangetChanContentswriteList2ChanQSemnewQSemwaitQSem signalQSemQSemNnewQSemN waitQSemN signalQSemN SampleVarnewEmptySampleVar newSampleVaremptySampleVar readSampleVarwriteSampleVarisEmptySampleVarrtsSupportsBoundThreadsmergeIOnmergeIOforkOSisCurrentThreadBoundrunInBoundThreadrunInUnboundThreadComplex:+realPartimagPart conjugatemkPolarcispolar magnitudephasePicoE12MicroE6 HasResolution resolutionFixeddiv'divMod'mod' showFixedfixon ArrowLoop ArrowMonad ArrowApply ArrowChoiceleftright ArrowPlus<+> ArrowZero zeroArrowKleisli runKleisliArrowsecond***&&&returnA^>>>>^<<^^<<leftAppstrictToLazySTlazyToStrictSTLastgetLastFirstgetFirstProduct getProductSumgetSumAnygetAnyAllgetAllEndoappEndoDualgetDualMonoidmemptymappendmconcatZipList getZipList WrappedArrow WrapArrow unwrapArrow WrappedMonad WrapMonad unwrapMonadConstgetConst Alternativeempty<|> Applicativepure<*><$><$*><*<**>liftAliftA2liftA3someFoldablefoldfoldMapfoldr'foldrMfoldlM traverse_for_ sequenceA_asumapproxRational modifySTRef Traversabletraverse sequenceAfor fmapDefaultfoldMapDefaultUnique newUnique hashUniquetimeoutVersion versionBranch versionTags showVersion parseVersion putTraceMsgtrace traceShowArgDescrOptArgReqArgNoArgOptDescrOptionArgOrder ReturnInOrderPermute RequireOrder usageInfogetOptgetOpt' getCPUTimecpuTimePrecisiongetArgs getProgNamegetEnvwithArgs withProgNamegetEnvironmentexitWith exitFailure exitSuccesscompilerVersionosarch compilerName performGC StableNamemakeStableNamehashStableName mkWeakPtr addFinalizer mkWeakPairIsChar PrintfArg HPrintfType PrintfTypeprintfhPrintfconcatP concatMapPfoldlPfoldl1PscanlPscanl1PfoldrPfoldr1PscanrPscanr1PtakePdropPsplitAtP takeWhileP dropWhilePspanPbreakPreversePandPorPanyPallPelemPnotElemPlookupPsumPproductPmaximumPminimumPzip3PzipWithP zipWith3PunzipPunzip3PfromPslicePfoldPfold1PpermuteP bpermuteP dpermutePcrossPindexOfPOrderingTrueseqeqString realWorld#unpackCStringUtf8#unpackAppendCString#unpackFoldrCString#unpackCString# unsafeCoerce# nullAddr#Addr#Array#Bool ByteArray#Char#Double#DoubleFloat#Float(->)Int#Int32#Int64#Weak# MutableArray#MutableByteArray#MVar# RealWorld StablePtr#Any1State# StableName#MutVar#Word#Word32#Word64# ThreadId#BCO#TVar# GHC.Generics:*::+:UnitOpaqueC#D#FalseF#I#gtChar#geChar#eqChar#neChar#ltChar#leChar#ord#+#-#*#mulIntMayOflo#quotInt#remInt#gcdInt# negateInt#addIntC#subIntC#>#>=#==#/=#<#<=#chr# int2Word# int2Float# int2Double# int2Integer#uncheckedIShiftL#uncheckedIShiftRA#uncheckedIShiftRL# plusWord# minusWord# timesWord# quotWord#remWord#and#or#xor#not#uncheckedShiftL#uncheckedShiftRL# word2Int# word2Integer#gtWord#geWord#eqWord#neWord#ltWord#leWord# narrow8Int# narrow16Int# narrow32Int# narrow8Word# narrow16Word# narrow32Word#int64ToInteger#word64ToInteger# plusInteger# minusInteger# timesInteger# gcdInteger#gcdIntegerInt#divExactInteger# quotInteger# remInteger# cmpInteger#cmpIntegerInt#quotRemInteger#divModInteger# integer2Int# integer2Word# andInteger# orInteger# xorInteger#complementInteger#>##>=##==##/=##<##<=##+##-##*##/## negateDouble# double2Int# double2Float# expDouble# logDouble# sqrtDouble# sinDouble# cosDouble# tanDouble# asinDouble# acosDouble# atanDouble# sinhDouble# coshDouble# tanhDouble#**## decodeDouble#decodeDouble_2Int#gtFloat#geFloat#eqFloat#neFloat#ltFloat#leFloat# plusFloat# minusFloat# timesFloat# divideFloat# negateFloat# float2Int# expFloat# logFloat# sqrtFloat# sinFloat# cosFloat# tanFloat# asinFloat# acosFloat# atanFloat# sinhFloat# coshFloat# tanhFloat# powerFloat# float2Double# decodeFloat#decodeFloat_Int# newArray#sameMutableArray# readArray# writeArray# indexArray#unsafeFreezeArray#unsafeThawArray# newByteArray#newPinnedByteArray#newAlignedPinnedByteArray#byteArrayContents#sameMutableByteArray#unsafeFreezeByteArray#sizeofByteArray#sizeofMutableByteArray#indexCharArray#indexWideCharArray#indexIntArray#indexWordArray#indexAddrArray#indexFloatArray#indexDoubleArray#indexStablePtrArray#indexInt8Array#indexInt16Array#indexInt32Array#indexInt64Array#indexWord8Array#indexWord16Array#indexWord32Array#indexWord64Array#readCharArray#readWideCharArray# readIntArray#readWordArray#readAddrArray#readFloatArray#readDoubleArray#readStablePtrArray#readInt8Array#readInt16Array#readInt32Array#readInt64Array#readWord8Array#readWord16Array#readWord32Array#readWord64Array#writeCharArray#writeWideCharArray#writeIntArray#writeWordArray#writeAddrArray#writeFloatArray#writeDoubleArray#writeStablePtrArray#writeInt8Array#writeInt16Array#writeInt32Array#writeInt64Array#writeWord8Array#writeWord16Array#writeWord32Array#writeWord64Array# plusAddr# minusAddr#remAddr# addr2Int# int2Addr#gtAddr#geAddr#eqAddr#neAddr#ltAddr#leAddr#indexCharOffAddr#indexWideCharOffAddr#indexIntOffAddr#indexWordOffAddr#indexAddrOffAddr#indexFloatOffAddr#indexDoubleOffAddr#indexStablePtrOffAddr#indexInt8OffAddr#indexInt16OffAddr#indexInt32OffAddr#indexInt64OffAddr#indexWord8OffAddr#indexWord16OffAddr#indexWord32OffAddr#indexWord64OffAddr#readCharOffAddr#readWideCharOffAddr#readIntOffAddr#readWordOffAddr#readAddrOffAddr#readFloatOffAddr#readDoubleOffAddr#readStablePtrOffAddr#readInt8OffAddr#readInt16OffAddr#readInt32OffAddr#readInt64OffAddr#readWord8OffAddr#readWord16OffAddr#readWord32OffAddr#readWord64OffAddr#writeCharOffAddr#writeWideCharOffAddr#writeIntOffAddr#writeWordOffAddr#writeAddrOffAddr#writeFloatOffAddr#writeDoubleOffAddr#writeStablePtrOffAddr#writeInt8OffAddr#writeInt16OffAddr#writeInt32OffAddr#writeInt64OffAddr#writeWord8OffAddr#writeWord16OffAddr#writeWord32OffAddr#writeWord64OffAddr# newMutVar# readMutVar# writeMutVar# sameMutVar#atomicModifyMutVar#catch#raise#raiseIO#blockAsyncExceptions#unblockAsyncExceptions#asyncExceptionsBlocked# atomically#retry# catchRetry# catchSTM#check#newTVar# readTVar# writeTVar# sameTVar#newMVar# takeMVar# tryTakeMVar#putMVar# tryPutMVar# sameMVar# isEmptyMVar#delay# waitRead# waitWrite#fork#forkOn# killThread#yield# myThreadId# labelThread#isCurrentThreadBound# noDuplicate# threadStatus#mkWeak#mkWeakForeignEnv# deRefWeak# finalizeWeak#touch#makeStablePtr#deRefStablePtr# eqStablePtr#makeStableName# eqStableName#stableNameToInt#reallyUnsafePtrEquality#par# parGlobal# parLocal#parAt# parAtAbs# parAtRel# parAtForNow# dataToTag# tagToEnum# addrToHValue# mkApUpd0#newBCO#unpackClosure#getApStackVal#LTEQGTInlInr overflowError divZeroErrorOmapFB unsafeChrzeroIntoneInttwoIntminIntmaxInt compareInt compareInt#getTagdivInt#modInt#plusIntminusInttimesIntquotIntremIntdivIntmodIntgcdInt negateIntgtIntgeInteqIntneIntltIntleInt unpackNBytes#boundedEnumFromboundedEnumFromThentakeUInt_appenderrorEmptyList showList__appPrecappPrec1 showSpace protectEscasciiTab showSignedIntGHC.Integer.InternalsInteger smallInteger plusInteger timesInteger hashIntegercomplementInteger xorInteger orInteger andIntegerfloatFromIntegerdoubleFromIntegerdecodeDoubleIntegerencodeDoubleIntegerdecodeFloatIntegerencodeFloatInteger negateInteger minusInteger signumInteger absIntegercompareInteger geInteger ltInteger gtInteger leInteger neqInteger eqInteger lcmInteger gcdInteger quotInteger remInteger divModIntegerquotRemIntegertoInt#int64ToIntegerintegerToInt64word64ToIntegerintegerToWord64 integerToWord wordToInteger quotRemInt divModIntintegerToStringenumDeltaIntegerFBenumDeltaIntegerenumDeltaToIntegerFBenumDeltaToIntegerup_fbdn_fbup_listdn_list:% ratioPrec ratioPrec1infinity notANumberreducenumericEnumFromnumericEnumFromThennumericEnumFromTonumericEnumFromThenTo gcdInteger'integralEnumFromintegralEnumFromThenintegralEnumFromTointegralEnumFromThenTorunSTRepSTretSTRepliftSTisDoubleNegativeZeroisDoubleDenormalizedisDoubleInfinite isDoubleNaN encodeDouble#isFloatNegativeZeroisFloatDenormalizedisFloatInfinite isFloatNaNint_encodeFloat# encodeFloat#FFFormat FFGenericFFFixed FFExponentformatRealFloatroundTofromRat'scaleRatminExptmaxExptexptexptsintegerLogBase plusFloat minusFloat timesFloat divideFloat negateFloatgtFloatgeFloateqFloatneFloatltFloatleFloat float2Int int2FloatexpFloatlogFloat sqrtFloatsinFloatcosFloattanFloat asinFloat acosFloat atanFloat sinhFloat coshFloat tanhFloat powerFloat plusDouble minusDouble timesDouble divideDouble negateDoublegtDoublegeDoubleeqDoubleneDoubleltDoubleleDouble double2Int int2Double double2Float float2Double expDouble logDouble sqrtDouble sinDouble cosDouble tanDouble asinDouble acosDouble atanDouble sinhDouble coshDouble tanhDouble powerDoubleshowSignedFloatparenlistchoosereadp GHC.IntWord64uncheckedShiftL64#uncheckedShiftRL64#W64#W32#W16#W8# toEnumError fromEnumError succError predErroruncheckedIShiftL64#uncheckedIShiftRA64#I64#I32#I16#I8#IOArrayunsafeDupablePerformIO noDuplicate newIOArrayunsafeReadIOArrayunsafeWriteIOArray readIOArray writeIOArraybindIOreturnIOfailIOthenIO assertError InterruptedResourceVanished TimeExpiredUnsupportedOperation HardwareFaultInappropriateTypeInvalidArgument OtherError ProtocolError SystemErrorUnsatisfiedConstraints UserErrorPermissionDeniedIllegalOperationResourceExhausted ResourceBusy NoSuchThing AlreadyExists ioe_handleioe_type ioe_locationioe_description ioe_filename HandleTypeReadWriteHandle AppendHandle WriteHandle ReadHandleSemiClosedHandle ClosedHandle BufferListBufferListCons BufferListNil BufferState WriteBuffer ReadBufferBufferbufBufbufRPtrbufWPtrbufSizebufState RawBufferHandle__haFDhaTypehaIsBin haIsStream haBufferModehaBuffer haBuffers haOtherSideFD DuplexHandle FileHandleunIOliftIOioToSTunsafeDupableInterleaveIObufferIsWritable bufferEmpty bufferFullisReadableHandleTypeisWritableHandleTypeisReadWriteHandleType boundsIOArray showHandleblockedOnDeadMVarblockedIndefinitely stackOverflow heapOverflow ioExceptioncatchExceptioncatchAnyuntanglewgencatnonEmptySubsequencesreadWideCharOffPtr readIntOffPtrreadWordOffPtr readPtrOffPtrreadFunPtrOffPtrreadFloatOffPtrreadDoubleOffPtrreadStablePtrOffPtrreadInt8OffPtrreadWord8OffPtrreadInt16OffPtrreadWord16OffPtrreadInt32OffPtrreadWord32OffPtrreadInt64OffPtrreadWord64OffPtrwriteWideCharOffPtrwriteIntOffPtrwriteWordOffPtrwritePtrOffPtrwriteFunPtrOffPtrwriteFloatOffPtrwriteDoubleOffPtrwriteStablePtrOffPtrwriteInt8OffPtrwriteWord8OffPtrwriteInt16OffPtrwriteWord16OffPtrwriteInt32OffPtrwriteWord32OffPtrwriteInt64OffPtrwriteWord64OffPtr absentErrweakTcrunFinalizerBatch unpackCString packCString#newConcForeignPtrmallocPlainForeignPtrmallocPlainForeignPtrBytesaddForeignPtrConcFinalizermemcpy c_s_issockptr_c_cc poke_c_lflagc_lflagsizeof_sigset_tsizeof_termiosconst_fd_cloexec const_f_setfd const_f_setfl const_f_getflconst_sig_setmaskconst_sig_block const_sigttou const_vtime const_vmin const_icanon const_tcsanow const_echost_inost_devst_modest_sizest_mtime sizeof_stat c_s_isfifo c_s_isdir c_s_isblk c_s_ischr c_s_isrego_BINARY o_NONBLOCKo_NOCTTYo_TRUNCo_EXCLo_CREATo_APPENDo_RDWRo_WRONLYo_RDONLYd_name end_of_dir freeDirEntreaddir c_waitpidc_utime c_tcsetattr c_tcgetattr c_sigprocmask c_sigaddset c_sigemptysetc_pipec_mkfifoc_linkc_fork c_fcntl_lock c_fcntl_write c_fcntl_readc_getpidc_unlink c_ftruncatec_writec_umaskc_stat c_rewinddirc_readmkdir c_opendirc_openlstatc_lseekc_isattyc_fstatc_dup2c_dupc_creat c_closedirc_closec_chmodc_accessset_saved_termiosget_saved_termiosFDType RawDevice RegularFileStream DirectoryCUtsnameCUtimbufCTmsCTmCTermiosCStatCSigset CSigactionCPasswdCLconvCGroupCFLockCDirentCDir fdFileSizefileTypefdStatfdType statGetTypeioe_unknownfiletype fdGetModefdIsTTYsetEchogetEcho setCooked tcSetAttrsetNonBlockingFDsetCloseOnExecs_isregs_ischrs_isblks_isdirs_isfifos_issockcheckInvstick fdToHandle' hDuplicate hDuplicateTo unlockFileHandlePosition withHandle withHandle' withHandle_wantWritableHandlewantReadableHandlewantSeekableHandleioe_closedHandleioe_EOFioe_notReadableioe_notWritablenewEmptyBufferallocateBufferwriteCharIntoBufferreadCharFromBufferflushWriteBufferOnlyflushReadBufferflushWriteBufferfillReadBufferfillReadBufferWithoutBlocking readRawBufferreadRawBufferPtrreadRawBufferNoBlockreadRawBufferPtrNoBlockwriteRawBufferwriteRawBufferPtrfdToHandle_stat fdToHandle hClose_help hLookAhead' runMainIOrunIO runIOFastExitrunNonIO topHandlertopHandlerFastExitmemcpy_baoff_ptrmemcpy_baoff_bamemcpy_ptr_baoffmemcpy_ba_baoff hGetcBuffered commitBuffer' slurpFileMpQrQiCONSTID mkPrimType