|x       ! " # $ % & ' ( ) * + ,-./0123 4 56 7 8 9 : ;<=>?@ABC DEFG HI JK LMNOPQRSTUVWXYZ [ \]^_`abcdefghij klmnopqrstuvwxyz{|}~   !!!!!!!!!!!!                          ! " # $ % & ' ()*+,-./0123456789:;<=>?@ABCDEFGHIJK"LMNOPQR#S#TUVWXYZ[\]$^$_`abcdefghi%j%k%l%m%n%o%p%q%r&s&t&u&v&w&x&y&z&{&|&}&~&&&&&&"""''''(((()))))))))))))))))))))))))))))))))))****************+++++++++++++++++"""" " " " " """""" !",#,$,%,&,',(,),*,+,,,-,.,/,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.X.Y.Z.[.\.].^._.`.a.bcdefg h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/{/|/}/~//////0000000000000     11111 1!1"1#1$1%1&1'2(2)3*3+3,3-3.3/30123456718191:1;1<4=4>4?4@4A4B4C4D4E4F4G4H4I4J4K4L4M4N4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4\4]4^4_4`4a4b4c4d5e5f5g5h5i5j5k5l5m5n5o6p6q6r6s6t6u6v6w6x6y6z6{6|6}6~7777777777777777#88899999::;;;;;;;;;<<<<<<<<<7=>>>>((( ??????@@@@@@@@@AAAAAAAAAABBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCC C C C C CCCDDDDDDDDDDDDDDDD D!D"D#D$D%D&D'D(D)D*D+D,D-D.D/D0D1D2D3D4D5D6D7D8D9D:D;D<D=D>D?D@DADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZD[D\D]D^D_D`DaDbDcDdDeDfDgDhDiDjDkDlDmDnDoDpDqDrDsDtDuDvDwDxDyDzD{D|D}D~DDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEFGGGGGGGGGGGGGGGGHGHHGGGGGHHHGGGGGGGGGGGGGGGGGGGIIGGGG%%%%%################### # # # # ################JJJ K!K"K#K$L%L&L'L(L)L*L+L,L-L.L/L0L1L2L3L4L5L6L7L8L9L:L;L<L=L>L?L@MAMBMCMDMEMFMGMHMIMJMKMLMM7N7O7PNQNRNSNTNUNVNWNXNYNZN[N\N]N^N_N`NaNbNcNdNeGfGgGhHiGj7k7l7m7n7o7p7q7r7st7u7v7w7x7y7z7{7|7}7~777777777777777777777========OOOOOOOOOOOOO O O O O OOOOOOOOOOOOOOOOOOO O!O"O#O$O%O&O'O(O)O*O+O,O-O.O/O0O1O2O3O4O5O6O7O8O9O:O;O<O=O>O?O@OAOBOCODOEOFOGOHOIOJOKOLOMONOOOPOQOROSOTOUOVOWOXOYOZO[O\O]O^O_O`OaObOcOdOeOfOgOhOiOjOkOlOmOnOoOpOqOrOsOtOuOvOwOxOyOzO{O|O}O~OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPQRRRSSSSSSSSSTTTTUUUUVVVVVVVHHHHHHHHHW X X    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijYkYlYmYnYoYpYqYrZsZtZuZvZwZxZyZzZ{Z|[}[~[[[[[[[[[[[[[[[[[[['\\\\]]]]]]^^^_____________``aaaaaa888bbbbcddd>>>eeeeeeffffffffffffffffffffffffffffffffffffffffff                                           portable experimentallibraries@haskell.orgghnon-portable (GHC extensions)internalcvs-ghc@haskell.orginon-portable (GHC extensions)internalcvs-ghc@haskell.org34CThe C class defines equality (3) and inequality (). ) All the basic datatypes exported by the Prelude are instances of C,  and C= may be derived for any datatype whose constituents are also  instances of C. $Minimal complete definition: either 3 or . KThe K. class is used for totally ordered datatypes.  Instances of K% can be derived for any user-defined ) datatype whose constituent types are in K. The declared order E of the constructors in the data declaration determines the ordering  in derived K instances. The j 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 "and" Boolean "or" Boolean "not" 34CK34C3K4jnon-portable (GHC extensions)internalcvs-ghc@haskell.orgG'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 ~. It helps to make  guards more readable. eg.  f x | x < 0 = ...  | otherwise = ... #If the first argument evaluates to ~, then the result is the  second argument. Otherwise an AssertionFailed exception is raised,  containing a x- 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.  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, ...] 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. 68Fail 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. 7=Sequentially compose two actions, passing any value produced , by the first as an argument to the second. 8@Sequentially compose two actions, discarding any value produced A by the first, like sequencing operators (such as the semicolon)  in imperative languages. 9&Inject a value into the monadic type. GThe G+ 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: 7 and 9.  Instances of G$ should satisfy the following laws:   return a >>= k == k a  m >>= return == m . m >>= (\x -> k x >>= h) == (m >>= k) >>= h Instances of both G and I& should additionally satisfy the law:  " fmap f xs == xs >>= return . f The instances of G for lists, Data.Maybe.Maybe and  System.IO.IO defined in the Prelude satisfy these laws. IThe I2 class is used for types that can be mapped over.  Instances of I$ should satisfy the following laws:   fmap id == id # fmap (f . g) == fmap f . fmap g The instances of I for lists, Data.Maybe.Maybe and  System.IO.IO satisfy these laws. &xA xB is a list of characters. String constants in Haskell are values  of type x. '8Replace all locations in the input with the same value.  The default definition is  . , but this may be + overridden with a more efficient version. (The Prelude.toEnum method restricted to the type Data.Char.Char. )The Prelude.fromEnum method restricted to the type Data.Char.Char. *+,-./0Identity function. Constant function. Function composition.  f9 takes its (first) two arguments in the reverse order of f.  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. 123456789:;<=>?@AB8Shift 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). CD !"E#$F%346789CGIKGH`IJaKbLcMNdOPQRSjTmUVWXYoZ[\]^_`ab&xyz{|}~cdefghijklmnopqrstuvwxyz{|}~                           ! " # $ % & ' ( ) * + , - . / 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 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 { | } ~  '()*+,-./0123456789:;<=>?@ABCG !"#$%6789G7896I&'x'()*+,-./0123456789:;<=>?@ABCportable experimentallibraries@haskell.org@\DClass for string-like datastructures; used by the overloaded string , extension (-foverloaded-strings in GHC). @\\@@\@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. Swap the components of a pair. knon-portable (GHC extensions)internalcvs-ghc@haskell.org!/Used in Haskell's translation of [n..]. 0Used in Haskell's translation of [n,n'..]. 1Used in Haskell's translation of [n..m]. 2Used in Haskell's translation of [n,n'..m]. AThe A7 class is used to name the upper and lower limits of a  type. K is not a superclass of A since types that are not 7 totally ordered may also have upper and lower bounds. The A0 class may be derived for any enumeration type;  ( is the first constructor listed in the data declaration  and  is the last.  A< may also be derived for single-constructor datatypes whose  constituent types are in A. BClass B3 defines operations on sequentially ordered types. The enumFrom... methods are used in Haskell's translation of  arithmetic sequences.  Instances of B0 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 A as well as B,  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 :: ` is an error.  / and 0+ 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 d. Convert to an d. % It is implementation-dependent what  returns when 3 applied to a value that is too large to fit in an d. /012AB /012AB/012 !portablestablelibraries@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 ~ iff its argument is of the  form Just _. The  function returns ~ 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. lnon-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 non-empty. Test whether a list is empty. O(n). + returns the length of a finite list as an d. ' 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  ~, the list must be finite; {, however, results from a { 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  {, the list must be finite; ~, however, results from a ~ 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. For the result to be  {, the list must be finite; ~, however, results from a ~ _ value for the predicate applied to an element at a finite index of a finite or infinite list. #Applied to a predicate and a list,  determines if all elements 9 of the list satisfy the predicate. For the result to be  ~, the list must be finite; {, however, results from a { _ value for the predicate applied to an element at a finite index of a finite or infinite list. B is the list membership predicate, usually written in infix form,  e.g., x `elem` xs. For the result to be  {, the list must be finite; ~,, however, results from an element equal to x7 found at a finite index of a finite or infinite list.  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 . . + mnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgP!Conversion of values to readable xs. Minimal complete definition:  or . Derived instances of P& 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 P 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 x.  should satisfy the law  2 showsPrec d x r ++ s == showsPrec d x (r ++ s) Derived instances of Text.Read.Read and P 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. )the operator precedence of the enclosing  context (a number from 0 to 11). % Function application has precedence 10. the value to be converted to a x A specialised variant of , using precedence context ! zero, and returning an ordinary x.  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 P instance of  the a type, where values of type x should be shown 8 in double quotes, rather than between square brackets. The shows/ functions return a function that prepends the  output x to an existing x. This allows constant-time 6 concatenation of results using function composition. equivalent to  with a precedence of 0. utility function converting a a to a show function that * simply prepends the character unchanged. utility function converting a x to a show function that ' simply prepends the string unchanged. =utility function that surrounds the inner show function with  parentheses when the ` parameter is ~. 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 d in the range 0..15 to the corresponding single  digit a6. This function fails on other inputs, and generates  lower-case hexadecimal digits. P P nnon-portable (GHC Extensions)internalcvs-ghc@haskell.org,Conversion from an i. ? An integer literal represents the application of the function  ," to the appropriate value of type i,  so such literals have type (J a) => a. -5Unary negation. JBasic numeric class. (Minimal complete definition: all except 5 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. < ,-5Ji ,-5J-5, onon-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  m (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 7 and 83 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.    pnon-portable (GHC extensions)internalcvs-ghc@haskell.org9QThe Q9 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 Q)  e!: the element type of the array. 0The type of immutable non-strict (boxed) arrays  with indices in i and elements in e.  ?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 ~/ 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 D list, but non-strict 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.  a pair of bounds, each of the index type 0 of the array. These bounds are the lowest and . highest indices in the array, in that order. , For example, a one-origin vector of length  '10' has bounds '(1,10)', and a one-origin '10'  by '10' matrix has bounds '((1,1),(10,10))'.  a list of  associations of the form  (index, value). Typically, this list will & be expressed as a comprehension. An  association '(i, x)' defines the value of  the array at index i to be x. 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. The  9 function 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   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. accumulating function initial value bounds of the array association list    GConstructs 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.    f8 takes an array and an association list and accumulates C pairs from the list into the array with the accumulating function f.  Thus   can be defined using  : > accumArray f z b = accum f (array b [(i, z) | i <- range b]) ! " # #. 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 I class. $ % & ' ( ) * + , - . / 0 19Q                           ! " # $ % & ' ( ) * + , - . / 0 19Q                                ! " # $ % & ' ( ) * + , - . / 0 1portablestablelibraries@haskell.orgQQportable provisionallibraries@haskell.orgAShow a list (using square brackets and commas), given a function  for showing elements. P P portable provisionallibraries@haskell.org"[-Monads that also support choice and failure. the identity of (. It should also satisfy the equations  mzero >>= f = mzero  v >> mzero = mzero an associative operation  Same as 7', but with the arguments interchanged.  9Evaluate each action in the sequence from left to right,  and collect the results.  9Evaluate each action in the sequence from left to right,  and ignore the results.    f is equivalent to   .  f.    f is equivalent to   .  f.  b is 9 () if b is ~,  and  if b is {.  This generalizes the list-based  function.  is   with its arguments flipped  is   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.  valueN discards or ignores the result of evaluation, such as the return value of an co action. 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 (8) 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 ~, 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 'Direct [ equivalent of    = (mfilter:: (a -> Bool) -> [a] -> [a]  applicable to any [, for example  mfilter odd (Just 1) == Just 1  mfilter odd (Just 2) == Nothing )6789GI[      !"#$%&')IG7896[     ' !"#$%&"[      !"#$%&'qnon-portable (GHC extensions)internalcvs-ghc@haskell.org(Arithmetic exceptions. )*+,-.#This is thrown when the user calls . The String is the  argument given to . /0DAny 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 123The  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. 45:Throw an exception. Exceptions may be thrown from purely 4 functional code, but may only be caught within the co monad. ()*+,-./012345(-,+*))*+,-.//012123445rnon-portable (GHC extensions)internalcvs-ghc@haskell.org0 stops execution and displays an error message. 6A 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 6  appears. 2 3 46 2 3 46 2 3 4snon-portable (GHC Extensions)internalcvs-ghc@haskell.org4.Conversion from a l (that is k i). 1 A floating literal stands for an application of .  to a value of type l, so such literals have type  (E a) => a. E.Fractional numbers, supporting real division. Minimal complete definition: . and (= or (<)) F/Integral numbers, supporting integer division. Minimal complete definition: B and D MO$Extracting components of fractions. Minimal complete definition: 7 k9Rational numbers, with numerator and denominator of some F type. l@Arbitrary-precision rational numbers, represented as a ratio of  two i5 values. A rational number may be constructed using  the F operator. 57 The function 7 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 :, ;, 8  and 9 functions are in terms of 7. 88 x returns the integer nearest x between zero and x 99 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 Ainteger modulus, satisfying " (x `div` y)*y + (x `mod` y) == x B simultaneous > and ? C simultaneous @ and A Dconversion to i EAthe rational equivalent of its real argument with full precision 6 7 8 9 :F)Forms the ratio of two integral numbers. G4Extract the numerator of the ratio in reduced form: I the numerator and denominator have no common factor and the denominator  is positive. H6Extract the denominator of the ratio in reduced form: I the numerator and denominator have no common factor and the denominator  is positive. ; < = >I%general coercion from integral types J%general coercion to fractional types KConverts a possibly-negative M value to a string. )a function that can show unsigned values (the precedence of the enclosing context the value to show LMN0raise a number to a non-negative integral power O$raise a number to an integral power ? @PP x y6 is the greatest (positive) integer that divides both x  and y; for example P (-3) 6 = 3, P (-3) (-6) = 3,  P 0 4 = 4. P 0 0 raises a runtime error. QQ x y, is the smallest positive integer that both x and y divide. A B C D E F4.EFMOkl 5789:;<=>?@ABCDE 6 7 8 9 :FGH ; < = >IJKLMNO ? @PQ A B C D E F4.E<=.F>?@ABCDMEO789:;k 5l 5789:;<=>?@ABCDE 6 7 8 9 :FGH ; < = >IJKLMNO ? @PQ A B C D E Ftnon-portable (GHC Extensions)internalcvs-ghc@haskell.org GU9Describes the behaviour of a thread when an asynchronous  exception is received. Vthe state during gU: asynchronous exceptions are masked, and blocking operations may not be interrupted Wthe state during eW: asynchronous exceptions are masked, but blocking operations may still be interrupted X8asynchronous exceptions are unmasked (the normal state) Y,File and directory names are values of type x, 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. HZ?A monad transformer embedding strict state transformers in the co  monad. The m- parameter indicates that the internal state  used by the . computation is a special one supplied by the co < monad, and thus distinct from those used by invocations of . I[\] This is the " back door" into the co monad, allowing co/ computation to be performed at any time. For this to be safe, the co computation should be 9free of side effects and independent of its environment. If the I/O computation wrapped in ] performs side Beffects, then the relative order in which those side effects take place (relative to the main I/O trunk, or other calls to ]-) is indeterminate. Furthermore, when using ]6 to cause side-effects, you should take the following Fprecautions to ensure the side effects are performed as many times as Fyou expect them to be. Note that these precautions are necessary for @GHC, but may not be sufficient, and other compilers may require different precautions:  Use {-# NOINLINE foo #-} as a pragma on any function foo  that calls ]. 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). 8 Make sure that the either you switch off let-floating (-fno-full-laziness), or that the  call to ]/ 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 ]! 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 ]. Indeed, it is possible to write coerce :: a -> b with the help of ]. So be careful! JThis version of ] is slightly more efficient, Dbecause it omits the check that the IO is only being performed by a &single thread. Hence, when you write  J, 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. ^^ allows co$ computation to be deferred lazily. When passed a value of type IO a, the co will only be performed when the value of the a. is demanded. This is used to implement lazy file reading, see System.IO.hGetContents. K LDEnsures 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  L. ,This operation is used in the definition of ] to Kprevent the IO action from being executed multiple times, which is usually  undesirable. M N_ A variant of 5" that can only be used within the co monad.  Although _/ has a type that is an instance of the type of 5, 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, _ will only cause 6 an exception to be raised when it is used within the co monad.  The _) variant should be used in preference to 5 to  raise an exception within the co monad because it guarantees  ordering with respect to other co operations, whereas 5  does not. `.Note: this function is deprecated, please use e instead.  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 B blocked until asynchronous exceptions are unblocked 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. a.Note: this function is deprecated, please use e instead. 9To re-enable asynchronous exceptions inside the scope of  `, a can be ; used. It scopes in exactly the same way, so on exit from  a& asynchronous exception delivery will  be disabled again. O Pb Returns the U for the current thread. c;returns True if asynchronous exceptions are blocked in the  current thread. QdLike e, but does not pass a restore action to the argument. e-Executes an IO computation with asynchronous  exceptions masked/. That is, any thread which attempts to raise ) an exception in the current thread with Control.Exception.throwTo C will be blocked until asynchronous exceptions are unmasked again. The argument passed to e! is a function that takes as its = argument another function, which can be used to restore the ; prevailing masking state within the context of the masked 0 computation. For example, a common way to use e is to protect  the acquisition of a resource:   mask $ \restore -> do  x <- acquire 9 restore (do_something_with x) `onException` release  release This code guarantees that acquire is paired with release , by masking D asynchronous exceptions for the critical parts. (Rather than write / this code yourself, it would be better to use  Control.Exception.bracket' which abstracts the general pattern). Note that the restore" action passed to the argument to e > does not necessarily unmask asynchronous exceptions, it just D restores the masking state to that of the enclosing context. Thus 0 if asynchronous exceptions are already masked, e cannot be used M to unmask exceptions again. This is so that if you call a library function K with exceptions masked, you can be sure that the library call will not be L able to unmask exceptions again. If you are writing library code and need I to use asynchronous exceptions, the only way is to create a new thread;  see !Control.Concurrent.forkIOUnmasked. BAsynchronous exceptions may still be received while in the masked  state if the masked thread blocks in certain ways; see  Control.Exception#interruptible. Threads created by Control.Concurrent.forkIO inherit the masked D state from the parent; that is, to start a thread in blocked mode,  use mask_ $ forkIO ...+. This is particularly useful if you need C to establish an exception handler in the forked thread before any D asynchronous exceptions are received. To create a a new thread in  an unmasked state use !Control.Concurrent.forkIOUnmasked. fLike g, but does not pass a restore action  to the argument. gLike e7, but the masked computation is not interruptible (see  Control.Exception#interruptible). THIS SHOULD BE USED WITH . GREAT CARE, because if a thread executing in g C blocks for any reason, then the thread (and possibly the program, B if this is the main thread) will be unresponsive and unkillable. < This function should only be necessary if you need to mask E exceptions around an interruptible operation, and you can guarantee E that the interruptible operation will only block for a short period  of time. Rcomputation to run first 3computation to run afterward (even if an exception  was raised) hBForces its argument to be evaluated to weak head normal form when  the resultant co- action is executed. It can be used to order " evaluation with respect to other co 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 " Goc1UVWXY HZ I[\] J^ K L M N_`a Obc Qdefg Rh GUXWVVWXY HZ I[\] J^ K L M N_`a Obc Qdefg Rhunon-portable (GHC Extensions)internalcvs-ghc@haskell.org SAn  T S. is a mutable, boxed, non-strict array in the co monad. $ The type arguments are as follows:  i8: the index type of the array (should be an instance of Q)  e!: the element type of the array. T U Build a new  T S VRead a value from an  T S WWrite a new value into an  T S XRead a value from an  T S YWrite a new value into an  T S Z S T U V W X Y Z S T T U V W X Y Z$portable provisionallibraries@haskell.org]^]^vnon-portable (GHC Extensions)internalcvs-ghc@haskell.org iAn i (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. [j Create an i which is initially empty. k Create an i$ which contains the supplied value. lReturn the contents of the i . If the i is currently  empty, l& will wait until it is full. After a l,  the i is left empty. .There are two further important properties of l:  l3 is single-wakeup. That is, if there are multiple  threads blocked in l , and the i becomes full, 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 i , they are ; woken up in FIFO order. This is useful for providing 5 fairness properties of abstractions built using is. mPut a value into an i . If the i is currently full,  m# will wait until it becomes empty. .There are two further important properties of m:  m3 is single-wakeup. That is, if there are multiple  threads blocked in m , and the i becomes empty, D only one thread will be woken up. The runtime guarantees that $ the woken thread completes its m operation. ) When multiple threads are blocked on an i , they are ; woken up in FIFO order. This is useful for providing 5 fairness properties of abstractions built using is. nA non-blocking version of l. The n function  returns immediately, with  if the i was empty, or   a if the i was full with contents a . After n,  the i is left empty. oA non-blocking version of m. The o function  attempts to put the value a into the i , returning ~ if  it was successful, or { otherwise. pCheck whether a given i 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 n instead if possible. qAdd a finalizer to an i (GHC only). See Foreign.ForeignPtr and  System.Mem.Weak for more about finalizers. i [jklmnopq i [ [jklmnopq&portable experimentallibraries@haskell.orgrThe r7 class defines bitwise operations over integral types. 5 Bits are numbered from 0 with bit 0 being the least  significant bit. Minimal complete definition: s, t, u, v, (w or ( and )), (x or ( and )), ~ and . sBitwise "and" tBitwise "or" uBitwise "xor" v&Reverse all the bits in the argument ww 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 w or  and  8, depending on which is more convenient for the type in  question. xx x i rotates x left by i bits if i is positive,  or right by -i bits otherwise. For unbounded types like i, x is equivalent to w. +An instance can define either this unified x or  and  8, depending on which is more convenient for the type in  question. ybit i is a value with the i$th bit set and all other bits clear zx `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 ~ 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 i. Return ~/ 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  w8, 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  w8, 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  x8, 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  x8, depending on which is more convenient for the type in  question. rstuvwxyz{|}~rstuvwxyz{|}~rstuvwxyz{|}~stuvwxyz{|}~wnon-portable (GHC Extensions)internalcvs-ghc@haskell.orgrD>Trigonometric and hyperbolic functions and related functions. Minimal complete definition:  , , , , , , ,  , , , ,  and  N=Efficient, machine-independent access to the components of a  floating-point number. Minimal complete definition:  all except , ,  and  \ ] ^ _ ` a b c d e f g?a constant function, returning the radix of the representation  (often 2) 7a constant function, returning the number of digits of   in the significand =a constant function, returning the lowest and highest values  the exponent may assume  The function " applied to a real floating-point 0 number returns the significand expressed as an i and an # appropriately scaled exponent (an d). If  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  x. In particular,  0 = (0,0).  performs the inverse of  the second component of . the first component of , scaled to lie in the open  interval (-1,1) Dmultiplies a floating-point number by an integer power of the radix ~ if the argument is an IEEE " not-a-number" (NaN) value ~: if the argument is an IEEE infinity or negative infinity ~3 if the argument is too small to be represented in  normalized format ~* if the argument is an IEEE negative zero ~2 if the argument is an IEEE floating point number Ba version of arctangent taking two real floating-point arguments.  For real floating x and y,  y x computes the angle A (from the positive x-axis) of the vector from the origin to the  point (x,y).  y x returns a value in the range [-pi,  pi]<. It follows the Common Lisp semantics for the origin when  signed zeroes are supported.  y 1, with y in a type  that is N", should return the same value as  y.  A default definition of  is provided, but implementors - can provide a more accurate implementation. Show a signed N value to full precision I using standard decimal notation for arguments whose absolute value lies  between 0.1 and  9,999,999%, and scientific notation otherwise. h i! takes a base and a non-negative N number, / 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-1 Converts a l value into any type in class N. j k l m n o p q r s t u v w x y z { | } ~  )a function that can show unsigned values (the precedence of the enclosing context the value to show xDNKbLcz| \ ] ^ _ ` 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 { | } ~  rDN \ ] ^ _ ` a b c d g f e e f g h i j k l m n o p q r s t u v w x y z { | } ~  xnon-portable (GHC Extensions)internalcvs-ghc@haskell.orga value of type  STRef s a' is a mutable variable in state thread s,  containing a value of type a  Build a new  in the current state thread Read the value of an  Write a new value into an    ynon-portable (GHC Extensions)internalcvs-ghc@haskell.orgA mutable variable in the co monad  Build a new  Read the value of an  Write a new value into an      )-non-portable (local universal quantification) provisionallibraries@haskell.org, A parser for a type a), represented as a function that takes a  x* and returns a list of possible parses as (a,x) 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. (Succeeds iff we are at the end of input )Parses and returns the specified string. CParses the first zero or more characters satisfying the predicate. C Always succeds, exactly once having consumed all the characters , Hence NOT the same as (many (satisfy p)) BParses the first one or more characters satisfying the predicate. P Fails if none, else succeeds exactly once having consumed all the characters - Hence NOT the same as (many1 (satisfy p)) ,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' 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   +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. znon-portable (GHC Extensions)internalcvs-ghc@haskell.orgL Parsing of xs, producing values. Minimal complete definition:  (or, for GHC only, ) Derived instances of L' 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 L0 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 L 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 L. 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 L 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 L 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 operator precedence of the enclosing  context (a number from 0 to 11). % Function application has precedence 10.  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 L instance of  the a type, where values of type x 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 .  ~ p parses what p parses, but surrounded with  parentheses.  { 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 L 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)] 8 We match both Ident and Symbol because the constructor  might be an operator eg (:=:) L  L  {non-portable (GHC Extensions)internalcvs-ghc@haskell.orgpA p5 is an unsigned integral type, with the same size as d. q8-bit unsigned integer type r16-bit unsigned integer type s32-bit unsigned integer type t64-bit unsigned integer type  pqrst  pq r s t  |non-portable (GHC Extensions)internalcvs-ghc@haskell.org e8-bit signed integer type f16-bit signed integer type g32-bit signed integer type h64-bit signed integer type efgh e f g h portable experimentallibraries@haskell.orgdefghdefghportable experimentallibraries@haskell.orgpqrstpqrst} non-portableinternallibraries@haskell.orgSee System.IO.openFile "portable provisionallibraries@haskell.org Reads an unsigned F value in an arbitrary base.  the base 5a predicate distinguishing valid digits in this base 4a function converting a valid digit character to an d +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 O value, + expressed in decimal scientific notation.  Reads a signed M. value, given a reader for an unsigned value.  Show  non-negative F numbers in base 10.  Show a signed N 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 N 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 N 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 F( number using the base specified by the K first argument, and the character representation specified by the second. Show  non-negative F numbers in base 16. Show  non-negative F numbers in base 8. K     K           ~non-portable (GHC Extensions)internalffi@haskell.org uA value of type u 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. vA value of type v 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. a, d, b, c,  `,  Data.Int.Int8, Data.Int.Int16, Data.Int.Int32,  Data.Int.Int64, Data.Word.Word8, Data.Word.Word16,  Data.Word.Word32, Data.Word.Word64, u a, v 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  co t where t# is a marshallable foreign type or (). A value of type v 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 v$ 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 v0 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 u 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 v that is not * associated with a valid memory location. Casts a v to a v of a different type. Casts a v to a u. 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 u to a v. 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. uv uvnon-portable (GHC Extensions)internalffi@haskell.org>Create a stable pointer referring to the given Haskell value. nA 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   . n  !n   !portable provisionalffi@haskell.orgn !n !non-portable (GHC Extensions)internalcvs-ghc@haskell.org  !"C  , non-portableinternallibraries@haskell.org"%A mode that determines the effect of hSeek  hdl mode i. #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. &,Type of a device that can be used to back a  GHC.IO.Handle.Handle (see also GHC.IO.Handle.mkFileHandle). The ( standard libraries provide creation of GHC.IO.Handle.Handles via 2 Posix file operations with file descriptors (see  GHC.IO.Handle.FD.mkHandleFromFD) with FD being the underlying  + instance. &Users may provide custom instances of + 4 which are expected to conform the following rules: 'A raw+ (disk) device which supports block binary 4 read and write operations and may be seekable only - to positions of certain granularity (block-  aligned). (-A file that may be read or written, and also  may be seekable. ),A duplex communications channel (results in  creation of a duplex GHC.IO.Handle.Handle). The . standard libraries use this device type when  creating GHC.IO.Handle.Handles for open sockets. *2The standard libraries do not have direct support 4 for this device type, but a user implementation is - expected to provide a list of file names in + the directory, in any order, separated by '\0'  characters, excluding the . and .. names. See  also %System.Directory.getDirectoryContents. Seek 4 operations are not supported on directories (other  than to the zero position). +I/)O operations required for implementing a Handle. ,ready dev write msecs returns ~ if the device has data  to read (if write is {!) or space to write new data (if  write is ~). msecs specifies how long to wait, in  milliseconds. -<closes the device. Further operations on the device should  produce exceptions. .returns ~) if the device is a terminal or console. /returns ~ if the device supports 0 operations. 0,seek to the specified position in the data. 1)return the current position in the data. 2return the size of the data. 3change the size of the data. 4?for terminal devices, changes whether characters are echoed on  the device. 5$returns the current echoing status. 6(some devices (e.g. terminals) support a raw mode where C characters entered are immediately made available to the program. 1 If available, this operations enables raw mode. 7 returns the & corresponding to this device. 8@duplicates the device, if possible. The new device is expected = to share a file pointer with the original device (like Unix dup). 9dup2 source target, replaces the target device with the source D device. The target device is closed first, if necessary, and then < it is made into a duplicate of the first device (like Unix dup2). : A low-level I/.O provider where the data is bytes in memory. ;?Read up to the specified number of bytes, returning the number C of bytes actually read. This function should only block if there ? is no data available. If there is not enough data available, C then the function should just return the available data. A return C value of zero indicates that the end of the data stream (e.g. end  of file) has been reached. <?Read up to the specified number of bytes, returning the number  of bytes actually read, or  if the end of the stream has  been reached. =%Write the specified number of bytes. >EWrite up to the specified number of bytes without blocking. Returns % the actual number of bytes written. "#$%&'()*+,-./0123456789:;<=>:;<=>+,-./0123456789&*)('"%$#"%$##$%&*)(''()*+,-./0123456789,-./0123456789:;<=>;<=>non-portable (GHC Extensions)internalffi@haskell.org                                                            -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 u a , for some a which is an instance of class ?. The type argument to u= 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 (e, f, g, h), the fixed size Word types (q, r, s, t), n, all types from Foreign.C.Types,  as well as u. Minimal complete definition: @, A , one of F, B and D , and one of G, C and E. @>Computes the storage requirements (in bytes) of the argument. ( The value of the argument is not used. A7Computes 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. B5Read 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. C7Write 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 D4Read 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) E3Write 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 F-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  A is fulfilled. G?Write the given value to the given memory location. Alignment  restrictions might apply; see F. ?@ABCDEFG ?@ABCDEFG ?@ABCDEFG@ABCDEFG.portable provisionalffi@haskell.orgKH I J K L Haskell type representing the C jmp_buf type. M Haskell type representing the C fpos_t type. N Haskell type representing the C FILE type. O Haskell type representing the C time_t type. !P Haskell type representing the C clock_t type. "Q Haskell type representing the C  sig_atomic_t type. #R Haskell type representing the C wchar_t type. $S Haskell type representing the C size_t type. %T Haskell type representing the C  ptrdiff_t type. &U Haskell type representing the C double type. 'V Haskell type representing the C float type. (W Haskell type representing the C unsigned long long type. )X Haskell type representing the C  long long type. *Y Haskell type representing the C  unsigned long type. +Z 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. 0_ Haskell type representing the C  unsigned char type. 1` Haskell type representing the C  signed char type. 2a Haskell type representing the C char type. 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I JHIJKLMNOPQRSTUVWXYZ[\]^_`aa`_^]\[ZYTSRQXWKJIHPOVUNMLHIJKLMNOPQRSTUVWXYZ[\]^_`anon-portable (GHC extensions)internalcvs-ghc@haskell.org8Selects alphabetic or numeric digit Unicode characters. FNote that numeric digits outside the ASCII range are selected by this  function but not by *. Such digits may be part of identifiers B but are not used by the printer and reader to represent numbers. "Selects ASCII hexadecimal digits,  i.e. '0'..'9', 'a'..'f', 'A'..'F'. !Selects ASCII octal digits, i.e. '0'..'7'. Selects ASCII digits, i.e. '0'..'9'. BSelects 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. <Selects lower-case alphabetic Unicode characters (letters). JSelects 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. Returns ~2 for any Unicode space character, and the control  characters \t, \n, \r, \f, \v. %Selects printable Unicode characters = (letters, numbers, marks, punctuation, symbols and spaces). ESelects control characters, which are the non-printing characters of  the Latin-1 subset of Unicode. ?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. K L M N O P Q R S T Ub"Selects ASCII lower-case letters, ! i.e. characters satisfying both  and . c"Selects ASCII upper-case letters, ! i.e. characters satisfying both  and . 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.  Kbcdef Kbcdef portable provisionallibraries@haskell.orggAn infix synonym for . IgIgg/portable experimentallibraries@haskell.orgh8Maybe monoid returning the rightmost non-Nothing value. ijk7Maybe monoid returning the leftmost non-Nothing value. lmnMonoid under multiplication. opqMonoid under addition. rst"Boolean monoid under disjunction. uvw"Boolean monoid under conjunction. xyz/The monoid of endomorphisms under composition. {|}<The dual of a monoid, obtained by swapping the arguments of . ~FThe class of monoids (types with an associative binary operation that A has an identity). Instances should satisfy the following laws:  mappend mempty x = x mappend x mempty = x 1mappend x (mappend y z) = mappend (mappend x y) z  mconcat =  mappend memptyCThe method names refer to the monoid of lists under concatenation, % but there are many other instances. Minimal complete definition:  and . ;Some types can be viewed as a monoid in more than one way, 3 e.g. both addition and multiplication on numbers.  In such cases we often define newtypes and make those instances  of , e.g. rq and on.  Identity of  An associative operation Fold a list using the monoid. , For most types, the default definition for  will be ? used, but the function is included in the class definition so ? that an optimized version can be provided for specific types. VLift a semigroup into  forming a  according to   #http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be 5 turned into a monoid simply by adjoining an element e not in S  and defining e*e = e and  e*s = s = s*e for all s  S." Since  there is no " Semigroup" typeclass providing just , we  use  instead. hijklmnopqrstuvwxyz{|}~}~z{|wxytuvqrsnopklmhijhijijklmlmnopopqrsrstuvuvwxyxyz{|{|}~~portable experimentallibraries@haskell.org`{~`{~portablestablelibraries@haskell.org'?Unicode General Categories (column 2 of the UnicodeData table) 7 in the order they are listed in the Unicode standard. Cn: Other, Not Assigned Co: Other, Private Use Cs: Other, Surrogate Cf: Other, Format Cc: Other, Control Zp: Separator, Paragraph Zl: Separator, Line Zs: Separator, Space So: Symbol, Other Sk: Symbol, Modifier Sc: Symbol, Currency Sm: Symbol, Math Po: Punctuation, Other Pf: Punctuation, Final quote Pi: Punctuation, Initial quote Pe: Punctuation, Close Ps: Punctuation, Open Pd: Punctuation, Dash Pc: Punctuation, Connector No: Number, Other Nl: Number, Letter Nd: Number, Decimal Me: Mark, Enclosing Mc: Mark, Spacing Combining Mn: Mark, Non-Spacing Lo: Letter, Other Lm: Letter, Modifier Lt: Letter, Titlecase Ll: Letter, Lowercase Lu: Letter, Uppercase Convert a single digit a to the corresponding d. 3 This function fails unless its argument satisfies , = but recognises both upper and lower-case hexadecimal digits  (i.e. '0'..'9', 'a'..'f', 'A'..'F'). /The Unicode general category of the character. BSelects 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. BSelects Unicode mark characters, e.g. accents and the like, which ! combine with preceding letters. BSelects Unicode numeric characters, including digits from various  scripts, Roman numerals, etc. @Selects Unicode punctuation characters, including various kinds % of connectors, brackets and quotes. >Selects Unicode symbol characters, including mathematical and  currency symbols. 0Selects Unicode space and separator characters. @axbcdef@axcbedf'portablestablelibraries@haskell.orgIThe . 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 The 1 function returns the index of the first element & in the given list which is equal (by 3) to the query element,  or  if there is no such element. The  function extends , by returning the I indices of all elements equal to the query element, in ascending order. The 7 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. The 3 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. The  function extends , by returning the G indices of all elements satisfying the predicate, in ascending order. The & function takes two lists and returns ~ / iff the first list is a prefix of the second. The & function takes two lists and returns ~ / iff the first list is a suffix of the second.  Both lists must be finite. The & function takes two lists and returns ~ 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 O(n^2). The 2 function removes duplicate elements from a list. D In particular, it keeps only the first occurrence of each element.  (The name  means `essence'.)  It is a special case of (, which allows the programmer to supply  their own equality test. The  function behaves just like , except it uses a < user-supplied equality predicate instead of the overloaded 3  function. W x! removes the first occurrence of x from its list argument.  For example,   delete 'a' "banana" == "bnana" It is a special case of !, which allows the programmer to ! supply their own equality test. The  function behaves like , 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.  . [1,2,2,3,4] `intersect` [6,4,4,2] == [2,2,4] 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) XThe ( 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. Y( 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. ZThe 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 d, it returns any type which is  an instance of J'. It is, however, less efficient than . [The & function is an overloaded version of , which  accepts any F* value as the number of elements to take. The & function is an overloaded version of , which  accepts any F* value as the number of elements to drop. The & function is an overloaded version of , which  accepts any F* value as the position at which to split. The & function is an overloaded version of , which  accepts any F value as the index. The & function is an overloaded version of ,  which accepts any F- 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 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 the non-overloaded version of . 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. ooC portablestablelibraries@haskell.org3CC30portable provisionallibraries@haskell.org? ] ^ _ ` 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 { | } ~  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 eq!: An equality comparison on keys hash: A hash function on keys Returns: an empty hash table 6Creates a new hash table with the given minimum size. eq!: An equality comparison on keys hash: A hash function on keys minSize: initial table size Returns: an empty hash table  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 ~ if there was # already an entry for this key, or { 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 experimentallibraries@haskell.orgnR The class R/ allows a concrete representation of a type to  be calculated. S$Variant for unary type constructors T%Variant for binary type constructors U$Variant for 3-ary type constructors V$Variant for 4-ary type constructors W$Variant for 5-ary type constructors X$Variant for 6-ary type constructors Y$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" 3the name of the type constructor (should be unique 0 in the program, so it might be wise to use the  fully qualified name).  A unique  object 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 R, so that it is safe to pass 6 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 co/ 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 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. For defining a X instance from any Y instance. 9A flexible variation parameterised in a type constructor Cast for * -> * Cast for * -> * -> * 3One Typeable6 instance for all Typeable7 instances 3One Typeable5 instance for all Typeable6 instances 3One Typeable4 instance for all Typeable5 instances 3One Typeable3 instance for all Typeable4 instances 3One Typeable2 instance for all Typeable3 instances 3One Typeable1 instance for all Typeable2 instances 2One Typeable instance for all Typeable1 instances (RSTUVWXY     (R  STUVWXY   (RSTUVWXY     portable experimentallibraries@haskell.orgwThe w; type represents values with two possibilities: a value of type w a b is either  a or  b. The w6 type is sometimes used to represent a value which is /either correct or an error; by convention, the  constructor is $used to hold an error value and the  constructor is used to  hold a correct value (mnemonic: "right" also means "correct"). Case analysis for the w type.  If the value is  a, apply the first function to a;  if it is  b, apply the second function to b. Extracts from a list of w all the  elements  All the " elements are extracted in order. Extracts from a list of w all the  elements  All the " elements are extracted in order. Partitions a list of w into two lists  All the 0 elements are extracted, in order, to the first ) component of the output. Similarly the  elements are extracted ( to the second component of the output. www0non-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. (LLnon-portable (GHC extensions)internalcvs-ghc@haskell.orgGA 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.  The type + 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 s 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 /. Typically, the finalizer will, then, invoke C routines in the foreign language that free the resources bound by  the foreign object. The % is parameterised in the same way as u. The  type argument of # should normally be an instance of  class ?. 8Turns 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 #", 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  #! for more on finalizer ordering. "Allocate some memory and return a  to it. The memory ) will be released automatically when the  is discarded.  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  has been  allocated with Foreign.Marshal.Alloc.malloc.  GHC notes:  has a heavily optimised > implementation in GHC. It uses pinned memory in the garbage  collected heap, so the ! does not require a finalizer to  free the memory. Use of  and associated 4 functions is strongly recommended in preference to  newForeignPtr  with a finalizer. This function is similar to , except that the G size of the memory required is given explicitly as a number of bytes. "Allocate some memory and return a  to it. The memory ) will be released automatically when the  is discarded.  GHC notes:   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. This function is similar to , 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 ! 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 ! ,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, Handles = are finalized objects, so a finalizer should not refer to a Handle  (including stdout, stdin or stderr). "BTurns a plain memory reference into a foreign pointer that may be % associated with finalizers by using  . #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 # after it  executes the user action. CNote that this function should not be used to express dependencies  between finalizers on "s. For example, if the finalizer  for a  F1 calls # on a second   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 $ 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, # 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 $ and  # . However, the latter routines @ are occasionally preferred in tool generated marshalling code. %This function casts a  . parameterised by one type into another type. &BCauses the finalizers associated with a foreign pointer to be run  immediately.    ! "#$%&   ! "#$%&2#non-portable (requires concurrency) provisionalffi@haskell.org'DTurns 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 F foreign object is dropped. There is no guarantee of promptness, and B in fact there is no guarantee that the finalizer will eventually  run at all. (,This function adds a finalizer to the given . 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. '('('(3portable 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 *). Ping 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 R, 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 ,. the dynamically-typed object a default value -returns: the value of the first argument, if 1 it has the correct type, otherwise the value of  the second argument. , Converts a )/ object back into an ordinary Haskell value of  the correct type. See also +. the dynamically-typed object  returns:  a, if the dynamically-typed " object has the correct type (and a is its value),  or  otherwise. -.//RSTUVWXY     )*+,-./)*+,-./)*+,-./portable provisionalffi@haskell.org 0.Release the storage associated with the given v, 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. 1DA signed integral type that can be losslessly converted to and from  Ptr2. This type is also compatible with the C99 type intptr_t, and 1 can be marshalled to and from that type safely. 2GAn unsigned integral type that can be losslessly converted to and from  Ptr1. This type is also compatible with the C99 type  uintptr_t, and 1 can be marshalled to and from that type safely. 3casts a Ptr to a WordPtr 4casts a WordPtr to a Ptr 5casts a Ptr to an IntPtr 6 casts an IntPtr to a Ptr uv0123456uv015623401234561portable provisionalffi@haskell.org7;Turns a plain memory reference into a foreign pointer, and C associates a finalizer with the reference. The finalizer will be E executed after the last reference to the foreign object is dropped. D There is no guarantee of promptness, however the finalizer will be $ executed before the program exits. 85This 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 co 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  8 bracket. The reason for $ this unsafeness is the same as for  $ below: the finalizer > may run earlier than expected, because the compiler can only  track usage of the  object, not  a u object made from it. 7This function is normally used for marshalling data to & or from the object pointed to by the   , using the operations from the  ? class. 9This variant of 7" 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  9. :This 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 , it is not guaranteed that & the block of memory was allocated by Foreign.Marshal.Alloc.malloc. ;This 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 , it is not guaranteed that & the block of memory was allocated by Foreign.Marshal.Alloc.malloc.  !"#$%&789:;7" 9!8&$#%:;789:;4non-portable (GHC Extensions)internalcvs-ghc@haskell.org* <=>?@BA mutable array of bytes that can be passed to foreign functions. AThe buffer is represented by a record, where the record contains  the raw buffer and the start/'end points of the filled portion. The B buffer contents itself is mutable, but the rest of the record is @ immutable. This is a slightly odd mix, but it turns out to be B quite practical: by making all the buffer metadata immutable, we A can have operations on buffer metadata outside of the IO monad. The live. elements of the buffer are those between the E and  F offsets. In an empty buffer, E is equal to F, but E they might not be zero: for exmaple, the buffer might correspond to ( a memory-mapped file and in which case E will point to the E next location to be written, which is not necessarily the beginning  of the file. ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a3slides the contents of the buffer to the beginning bc (<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc(@ABCDEF<>=?H^_`]Z\a[TUVWXYbRScIJKGLMNOPQ(<>==>?@ABCDEFABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc5non-portable (GHC Extensions)internalcvs-ghc@haskell.org dThe purpose of d' is to provide a common interface for I/O F devices that can read and write data through a buffer. Devices that  implement d. include ordinary files, memory-mapped files, 8 and bytestrings. The underlying device implementing a Handle must  provide d. e9allocate a new buffer. The size of the buffer is at the = discretion of the device; e.g. for a memory-mapped file the - buffer will probably cover the entire file. f<reads bytes into the buffer, blocking if there are no bytes > available. Returns the number of bytes read (zero indicates # end-of-file), and the new buffer. g;reads bytes into the buffer without blocking. Returns the C number of bytes read (Nothing indicates end-of-file), and the new  buffer. h=Prepares an empty write buffer. This lets the device decide A how to set up a write buffer: the buffer may need to point to a C specific location in memory, for example. This is typically used ; by the client when switching from reading to writing on a  buffered read/write device. EThere is no corresponding operation for read buffers, because before % reading the client will always call f. iEFlush all the data from the supplied write buffer out to the device. = The returned buffer should be empty, and ready for writing. j<Flush data from the supplied write buffer out to the device @ without blocking. Returns the number of bytes written and the  remaining buffer. klmn defghijklmn defghijklmn defghijefghijklmn6 non-portableinternallibraries@haskell.orgoA po+ is a specification of a conversion scheme A between sequences of bytes and sequences of Unicode characters. HFor example, UTF-8 is an encoding of Unicode characters into a sequence  of bytes. The po for UTF-8 is utf8. pqa string that can be passed to mkTextEncoding to  create an equivalent po. rstuvwxyzThe encode, function translates elements of the buffer from  to the buffer to4. It should translate as many elements as possible E given the sizes of the buffers, including translating zero elements ' if there is either not enough room in to, or from does not ( contain a complete multibyte sequence. encode, should raise an exception if, and only if, from : begins with an illegal sequence, or the first element of from ) is not representable in the encoding of to. That is, if any < elements can be successfully translated before an error is  encountered, then encode$ should translate as much as it can ? and not throw an exception. This behaviour is used by the IO A library in order to report translation errors at the point they < actually occur, rather than when the buffer is translated. {<Resources associated with the encoding may now be released.  The encode0 function may not be called again after calling  close. |'Return the current state of the codec. AMany codecs are not stateful, and in these case the state can be  represented as '()''. Other codecs maintain a state. For A example, UTF-16 recognises a BOM (byte-order-mark) character at A the beginning of the input, and remembers thereafter whether to @ use big-endian or little-endian mode. In this case, the state B of the codec would include two pieces of information: whether we @ are at the beginning of the stream (the BOM only occurs at the A beginning), and if not, whether to use the big or little-endian  encoding. }opqrstuvwxyz{|}xyz{|}opqrstuvwopqrspqrstuvwxyz{|}yz{|} non-portableinternallibraries@haskell.org0~ASpecifies the translation, if any, of newline characters between D internal Strings and the external file or stream. Haskell Strings , are assumed to represent newlines with the '\n' character; the ) newline mode specifies how to translate '\n' on output, and what to  translate into '\n' on input. (the representation of newlines on input )the representation of newlines on output @The representation of a newline in the external file or stream. '\r\n' '\n' 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.         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 P and C 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 3 only to itself; no attempt J is made to compare the internal state of different handles for equality.    <The native newline representation for the current platform:   on Unix systems,  on Windows. Map '\r\n' into '\n' on input, and '\n' to the native newline G represetnation on output. This mode can be used on any platform, and F works with text files using any newline convention. The downside is  that readFile >>= writeFile might yield a different file. 9 universalNewlineMode = NewlineMode { inputNL = CRLF, B outputNL = nativeNewline } ?Use the native newline representation on both input and output = nativeNewlineMode = NewlineMode { inputNL = nativeNewline ? outputNL = nativeNewline } "Do no newline translation at all. F noNewlineTranslation = NewlineMode { inputNL = LF, outputNL = LF } 6xyz{|}~              0~                          non-portableinternallibraries@haskell.org:  R Construct an S+ value with a string describing the error.  The 6 method of the co instance of the G class raises a  R, thus:  instance Monad IO where  ... " fail s = ioError (userError s) S*The Haskell 98 type for exceptions in the co monad.  Any I/O operation may raise an S 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. TExceptions 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. ;An abstract type that contains a value for each variant of S.            ! " # $ % & ' ( ) * + , - .2Defines the exit codes that a program can return. -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.  was applied to {. =There are no runnable threads, so the program is deadlocked.  The Deadlock. exception is raised in the main thread only. DThe thread is waiting 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.  / 0 1 2 3 Raise an S in the co monad. 4:  RST            ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4:  RST ( ) * + , - . ' & % $ # " !                       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 49 non-portableinternallibraries@haskell.org  5 6 7 8: non-portableinternallibraries@haskell.org 9 : ; < = > ? @ A B C D E F G H I J Kbyte to check  lower bound  upper bound L M; non-portableinternallibraries@haskell.org N O P Q R S T U V W X Y Z [ \ ]   < non-portableinternallibraries@haskell.org ^ _ ` a b c d e f g h i j k l m   non-portable (GHC Extensions)internalcvs-ghc@haskell.org n o p q r s t#$ G% oc1()*+,-./012RSTY HZ I[\] J^ K L M N_`ach S T U V W X Yi [                          ! " # $ % & ' ( ) * + , - . 1 2 3 4 n o p q r s t n o o p q q r s tnon-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. u vEstablishes a weak pointer to k , with value v and a finalizer. @This is the most general interface for building a weak pointer. key value  finalizer returns: a weak pointer object >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 co monad. @Causes a the finalizer associated with a weak pointer to be run  immediately. w u v w u u v w(portable experimentallibraries@haskell.orgMake 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.  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) ... 4Kj K4j?portable provisionalffi@haskell.org Execute an co action, throwing a R if the predicate yields  ~, when applied to the result returned by the co action. B If no exception is raised, return the result of the computation. %error condition on the result of the co action 1computes an error message from erroneous results  of the co action the co action to be executed Like , but discarding the result &Guards against negative result values Like , but discarding the result Guards against null pointers Discard the return value of an co action @portable provisionalffi@haskell.org .A pointer to a foreign function equivalent to , which may be  used as a finalizer (cf Foreign.ForeignPtr.ForeignPtr) for storage  allocated with , ,  or . x y zEAllocate 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  or  when  no longer required. 9Allocate 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  or  when  no longer required.  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.  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. -Resize a memory area that was allocated with  or  , 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  is ,  behaves like  . -Resize a memory area that was allocated with  or  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  is ,   behaves like . If the requested size is 0,   behaves like . /Free a block of memory that was allocated with ,  , , , Foreign.Marshal.Utils.new  or any of the newX functions in Foreign.Marshal.Array or  Foreign.C.String. {   Aportable provisionalffi@haskell.org | }+Basic C routines needed for memory copying 7Allocate a block of memory and marshal a value into it  (the combination of  and G). 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.  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  and G). 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 ` to its numeric representation ?Convert a Boolean in numeric representation to a Haskell value =Allocate storage and marshal a storable value wrapped into a   the  is used to represent   Converts a withXXX1 combinator into one marshalling a value wrapped  into a , using  to represent . /Convert a peek combinator into a one returning  if applied to a    Replicates a withXXX7 combinator over a list of objects, yielding a list of  marshalled objects HCopies the given number of bytes from the second area (source) into the + first (destination); the copied areas may not overlap HCopies the given number of bytes from the second area (source) into the ' first (destination); the copied areas may overlap   Bportable provisionalffi@haskell.orgEAllocate storage for the given number of elements of a storable type  (like Foreign.Marshal.Alloc.malloc, but for multiple elements). Like ., but add an extra position to hold a special  termination element. <Temporarily allocate space for the given number of elements  (like Foreign.Marshal.Alloc.alloca, but for multiple elements). Like ., but add an extra position to hold a special  termination element. Adjust the size of an array LAdjust the size of an array including an extra position for the end marker. JConvert an array of given length into a Haskell list. The implementation 5 is tail-recursive and so uses constant stack space. HConvert an array terminated by the given end marker into a Haskell list 0Write the list elements consecutive into memory LWrite the list elements consecutive into memory and terminate them with the  given marker element FWrite a list of storable elements into a newly allocated, consecutive  sequence of storable values  (like Foreign.Marshal.Utils.new, but for multiple elements). FWrite 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 6Temporarily store a list of storable values in memory  (like Foreign.Marshal.Utils.with, but for multiple elements). Like +, but the action gets the number of values  as an additional parameter Like 2, but a terminator indicates where the array ends Like 2, but a terminator indicates where the array ends JCopy the given number of elements from the second array (source) into the 1 first array (destination); the copied areas may not overlap JCopy the given number of elements from the second array (source) into the - first array (destination); the copied areas may overlap DReturn the number of elements in an array, excluding the terminator @Advance a pointer into an array by the given number of elements Cportable provisionalffi@haskell.org$<A wide character string with explicit length information in Rs 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 . - 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.  Convert a C  unsigned char', representing a Latin-1 character, to & the corresponding Haskell character. #Convert a Haskell character to a C  unsigned char. 9 This function is only safe on the first 256 characters.  Convert a C  signed char+, representing a Latin-1 character, to the " corresponding Haskell character. #Convert a Haskell character to a C  signed char. 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.                Dportable provisionalffi@haskell.org Haskell representation for errno values. C The implementation is deliberately exposed, to allow users to add  their own definitions of  values.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuYield ~ if the given  value is valid on the system.  This implies that the C instance of  is also system dependent + as it is only defined for valid values of . vGet the current value of errno in the current thread. wReset the current thread's errno value to . x Throw an S' corresponding to the current value of v. *textual description of the error location y Throw an S' corresponding to the current value of v  if the result value of the co# action meets the given predicate. 'predicate to apply to the result value  of the co operation $textual description of the location the co operation to be executed zas y!, but discards the result of the co action after  error handling. {as y, but retry the co action when it yields the  error code 2/ - this amounts to the standard retry loop for ! interrupted POSIX system calls. |as {%, but additionally if the operation  yields the error code  or s, an alternative % action is executed before retrying. 'predicate to apply to the result value  of the co operation $textual description of the location the co operation to be executed %action to execute before retrying if  an immediate retry would block }as {, but discards the result. ~as |, but discards the result.  Throw an S' corresponding to the current value of v  if the co action returns a result of -1. as , but discards the result.  Throw an S' corresponding to the current value of v  if the co action returns a result of -1, but retries in case of  an interrupted operation. as , but discards the result. as ., but checks for operations that would block. as , but discards the result.  Throw an S' corresponding to the current value of v  if the co action returns .  Throw an S' corresponding to the current value of v  if the co action returns , 0 but retry in case of an interrupted operation. as ., but checks for operations that would block. as x:, but exceptions include the given path when appropriate. as y-, but exceptions include the given path when  appropriate. as z-, but exceptions include the given path when  appropriate. as -, but exceptions include the given path when  appropriate. as -, but exceptions include the given path when  appropriate. as -, but exceptions include the given path when  appropriate.  Construct an S based on the given  value. A The optional information can be used to improve the accuracy of  error messages. &the location where the error occurred the error number *optional handle associated with the error ,optional filename associated with the error  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{}|~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalffi@haskell.orgHIJKLMNOPQRSTUVWXYZ[\]^_`a      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Eportable 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. Fportable provisionalffi@haskell.orgGSometimes an external entity is a pure function, except that it passes  arguments and/'or results via pointers. The function unsafeLocalState0 permits the packaging of such entities as pure  functions. :The only IO operations allowed in the IO action passed to unsafeLocalState are (a) local allocation (alloca,  allocaBytes and derived operations such as  withArray and  withCString ), and (b) pointer operations (Foreign.Storable and  Foreign.Ptr ) on the @pointers to local storage, and (c) foreign functions whose only  observable effect is to read and/or write the locally allocated @memory. Passing an IO operation that does not obey these rules  results in undefined behaviour. +It is expected that this operation will be *replaced in a future revision of Haskell. =portable provisionalffi@haskell.orgdefghnpqrstuv]rstuvwxyz{|}~ !?@ABCDEFG !"#$%&0123456789:;]Inon-portable (GHC extensions)internalcvs-ghc@haskell.orgF AShared memory locations that support atomic memory transactions. /A monad supporting atomic memory transactions. The current status of a thread *the thread received an uncaught exception 'the thread is blocked on some resource the thread has finished ,the thread is currently runnable or running )blocked on some other resource. Without  -threaded,  I/O and  threadDelay show up as , with  -threaded  they show up as . currently in a foreign call  blocked in  in an STM transaction  blocked in  7blocked on a computation in progress by another thread blocked on on i A 8 is an abstract type representing a handle to a thread.  is an instance of C, K and P, where the K6 instance implements an arbitrary total ordering over s. The P/ instance lets you convert an arbitrary-valued  to string form; showing a  value is occasionally Buseful when debugging or diagnosing the behaviour of a concurrent  program. Note: in GHC, if you have a , you essentially have Aa pointer to the thread itself. This means the thread itself can't be %garbage collected until you drop the . =This misfeature will hopefully be corrected at a later date. Note9: Hugs does not provide any operations on other threads;  it defines  as a synonym for ().  #Sparks off a new thread to run the co computation passed as the  first argument, and returns the  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 masked state of the parent (see Control.Exception.mask). 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 ). Like ?, but the child thread is created with asynchronous exceptions  unmasked (see Control.Exception.mask). Like 2, but lets you specify on which CPU the thread is created. Unlike a  thread, a thread created by  3will stay on the same CPU for its entire lifetime ( threads >can migrate between CPUs according to the scheduling policy). 9 is useful for overriding the scheduling policy when you 4know in advance how best to distribute the threads. The d= argument specifies the CPU number; it is interpreted modulo 6 (note that it actually specifies a capability number Crather than a CPU number, but to a first approximation the two are  equivalent). Like ', but the child thread is created with ' asynchronous exceptions unmasked (see Control.Exception.mask). the 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. ?Returns the number of sparks currently in the local spark pool   raises the  exception in the given thread (GHC only). + killThread tid = throwTo tid ThreadKilled @ raises an arbitrary exception in the target thread (GHC only). < 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. AWhatever work the target thread was doing when the exception was Craised is not lost: the computation is suspended until required by another thread. BIf the target thread is currently making a foreign call, then the (exception will not be raised (and hence  will not return) Funtil the call has completed. This is the case regardless of whether the call is inside a e or not. !Important note: the behaviour of  differs from that described in  the paper ""Asynchronous exceptions in Haskell" ( =http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, 8 is non-blocking; but the library implementation adopts #a more synchronous design in which % 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, 0 is therefore interruptible (see Section 5.3 of =the paper). Unlike other interruptible operations, however,  is always4 interruptible, even if it does not actually block. EThere is no guarantee that the exception will be delivered promptly, =although the runtime will endeavour to ensure that arbitrary  delays don'9t occur. In GHC, an exception can only be raised when a thread reaches a  safe point%, where a safe point is where memory Dallocation occurs. Some loops do not perform any memory allocation 9inside the loop and therefore cannot be interrupted by a . Blocked 5 is fair: if multiple threads are trying to throw an Fexception to the same target thread, they will succeed in FIFO order.  Returns the # of the calling thread (GHC only). The 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. 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  for their purposes as well. 1Internal function used by the RTS to run sparks.  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 ] or ^. 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 , which can be called inside ], 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) ECompose 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.  A variant of 5" that can only be used within the  monad. Throwing an exception in STM+ aborts the transaction and propagates the  exception.  Although / has a type that is an instance of the type of 5, the % two functions are subtly different:  " throw e `seq` x ===> throw e  throwSTM e `seq` x ===> x +The first example will cause the exception e to be raised,  whereas the second one won' t. In fact,  will only cause 6 an exception to be raised when it is used within the  monad.  The ) variant should be used in preference to 5 to  raise an exception within the  monad because it guarantees  ordering with respect to other  operations, whereas 5  does not. '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. BalwaysSucceeds 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. @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. +Create a new TVar holding a value supplied IO version of ). This is useful for creating top-level  s using  System.IO.Unsafe.unsafePerformIO, because using   inside  System.IO.Unsafe.unsafePerformIO isn't  possible. +Return the current value stored in a TVar.  This is equivalent to  % readTVarIO = atomically . readTVar 'but works much faster, because it doesn't perform a complete 5 transaction, it just reads the current value of the . *Return the current value stored in a TVar %Write the supplied value into a TVar  666"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 ; to catch exceptions of any type, see the previous section " Catching all  exceptions"3 for an explanation of the problems with doing so. %For catching exceptions in pure (non-co) expressions, see the  function h. 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  co 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 computation to run ,Handler to invoke if an exception is raised  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. Predicate to select exceptions Computation to run Handler  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 w result which is  ( a) if no exception of type e was raised, or ( 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 computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between A specialised variant of  with just a computation to run  afterward. computation to run first 3computation to run afterward (even if an exception  was raised)  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. computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between T ()*+,-./012345TUVWX_`abcdefghT34012T(-,+*)./_5hedgfUXWVb`ac  $ %non-portable (concurrency) experimentallibraries@haskell.orgThis is a combination of l and m; ie. it takes the value  from the i%, puts it back, and also returns it. Take a value from an i, put a new value into the i and F return the value taken. Note that there is a race condition whereby + another process can put something in the i after the take # happens but before the put does. 7 is a safe wrapper for operating on the contents of an  i9. This operation is exception-safe: it will replace the  original contents of the i if an exception is raised (see  Control.Exception). 0A safe wrapper for modifying the contents of an i. Like ,  + will replace the original contents of the i if an , exception is raised during the operation. A slight variation on  that allows a value to be  returned (b+) in addition to the modified value of the i. ijklmnopqijklmnopq#portable provisionallibraries@haskell.org'The 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 S- 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 co operation failed because & one of its arguments already exists. An error indicating that an co operation failed because & one of its arguments does not exist. An error indicating that an co 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 co operation failed because  the device is full. An error indicating that an co operation failed because # the end of file has been reached. An error indicating that an co operation failed because ! the operation was not possible. " Any computation which returns an co 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 co operation failed because > the user does not have sufficient operating system privilege  to perform that operation. 3A programmer-defined error value constructed using R. 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 S, that occurs in the computation and throw a  modified version. BAdds a location description and maybe a file path and file handle  to an S7. If any of the file handle or file path is not given  the corresponding value in the S remains unaltered. The 2 function establishes a handler that receives any S # raised in the action protected by . An S is caught by ( the most recent handler established by . These handlers are  not selective: all S%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.  ) 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 S 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. +RS     +SR     '     J"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)] M()*+,-./012345TUVWX_`abcdefghM34012T(-,+*)./5_hedgfUXWVb`acK  ! "#  !"#! "# !"#Lnon-portable (requires POSIX) provisionallibraries@haskell.org7$%&'()*+,-./0123 4 5 6 7 8 9 : ; < = > ? $%&'()*+,-./0123456789:;<=>??>=<;:9876543120/.-,+&'%*)($$%&'()*+,-./01223456789:;<=>?non-portable (requires POSIX)internalcvs-ghc@haskell.orgq                           ! " # $ % & ' ( ) * + , - . / 0q                           ! " # $ % & ' ( ) * + , - . / 0q                           ! " # $ % & ' ( ) * + , - . / 0 non-portableinternallibraries@haskell.org 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H 9 : ; < = > ? @ A D 9 : ; < = > ? @ A DM non-portableinternallibraries@haskell.org @;The Latin1 (ISO8859-1) encoding. This encoding maps bytes B directly to the first 256 Unicode code points, and is thus not a J complete Unicode encoding. An attempt to write a character greater than  '\255' to a Handle using the @# encoding will result in an error. AThe UTF-8 Unicode encoding BBThe UTF-8 Unicode encoding, with a byte-order-mark (BOM; the byte 7 sequence 0xEF 0xBB 0xBF). This encoding behaves like A, D except that on input, the BOM sequence is ignored at the beginning > of the stream, and on output, the BOM sequence is prepended. =The byte-order-mark is strictly unnecessary in UTF-8, but is 4 sometimes used to identify the encoding of a file. CAThe UTF-16 Unicode encoding (a byte-order-mark should be used to  indicate endianness). D+The UTF-16 Unicode encoding (litte-endian) E)The UTF-16 Unicode encoding (big-endian) FAThe UTF-32 Unicode encoding (a byte-order-mark should be used to  indicate endianness). G+The UTF-32 Unicode encoding (litte-endian) H)The UTF-32 Unicode encoding (big-endian) I+The Unicode encoding of the current locale J4Look up the named Unicode encoding. May fail with  isDoesNotExistError if the encoding is unknown GThe set of known encodings is system-dependent, but includes at least:  UTF-8 UTF-16, UTF-16BE, UTF-16LE  UTF-32, UTF-32BE, UTF-32LE =On systems using GNU iconv (e.g. Linux), there is additional = notation for specifying how illegal characters are handled:  a suffix of //IGNORE, e.g. UTF-8//IGNORE, will cause @ all illegal sequences on input to be ignored, and on output A will drop all code points that have no representation in the  target encoding.  a suffix of //TRANSLIT% will choose a replacement character * for illegal sequences or code points. @On Windows, you can access supported code pages with the prefix  CP; for example, "CP1250". KLopqrstuxyz{|}@ABCDEFGHIJKLxyz{|}opqrstu@KLABCDEFGHIJ @ABCDEFGHIJKL non-portableinternallibraries@haskell.org: I 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 j5syncs the file with the buffer, including moving the E file pointer backwards in the case of a read buffer. This can fail  on a non-seekable read Handle. kBflushes at least the Char buffer, and the byte buffer for a write  Handle. Works on all Handles. l m n o pM makes a new  .the underlying IO device, which must support  +, d and R a string describing the , e.g. the file + path for a file. Used in error messages. Nlike M, except that a  is created with two E independent buffers, one for reading and one for writing. Used for / full-duplex streams, such as network sockets. q r s tO u v w x y z { | } ~ ' I L M N O P Q S T W X [ ] ^ _ ` d e f g j k l m n o pMN r s tO y z { | ~ ' I L M N O P Q S T W X [ ] ^ _ ` d e f g j k l m n o pMN r s tO y z { | ~  >Copy part of the source array into the destination array. The 3 destination array is resized if not large enough. >Copy part of the source array into the destination array. The 3 destination array is resized if not large enough. AComputes the next-highest power of two for a particular integer,  n. If n$ is already a power of two, returns n. If n is = zero, returns zero, even though zero is not a power of two.    8Return the current time, in seconds since Jan. 1, 1970.    =The structure used to tell the IO manager thread what to do. @Create the structure (usually a pipe) used for waking up the IO % manager thread from another thread. ;Close the control structure used by the IO manager thread. ! )     Event notification backend. >Poll backend for new events. The provided callback is called + once per file descriptor with new events. =Register, modify, or unregister interest in the given events  on the given file descriptor. 1A type alias for timeouts, specified in seconds. PAn I/ O event. QR  Throw an IOError' corresponding to the current value of  v if the result value of the co action is -1 and  v is not 2!. If the result value is -1 and  v returns 2& 0 is returned. Otherwise the result  value is returned. PQR   PQR % Create a new epoll backend. ?Change the set of events we are interested in for a given file  descriptor. 6Select a set of file descriptors which are ready for I/O  operations and call f- for all ready file descriptors, passing the  events that are ready. state timeout in milliseconds I/ O callback UCreate a new epoll context, returning a file descriptor associated with the context. @ The fd may be used for subsequent calls to this epoll context. SThe size parameter to epoll_create is a hint about the expected number of handles. IThe file descriptor returned from epoll_create() should be destroyed via - a call to close() after polling is finished   portable provisionallibraries@haskell.org" A map of integers to values a. A Nat- is a natural machine word (an unsigned Int)  O(min(n,W))1 Lookup the value at a key in the map. See also  Data.Map.lookup.  O(min(n,W))". Is the key a member of the map? 0 member 5 (fromList [(5,'a'), (3,'b')]) == True 1 member 1 (fromList [(5,'a'), (3,'b')]) == False O(1) The empty map.  empty == fromList []  size empty == 0  O(min(n,W))5 Insert with a function, combining new value and old  value. insertWith f key value mp will insert the pair (key,  value) into mp4 if key does not exist in the map. If the key does < exist, the function will insert the pair (key, f new_value B old_value). The result is a pair where the first element is the D old value, if one was present, and the second is the modified map.  O(min(n,W))5. Delete a key and its value from the map. When the D key is not a member of the map, the original map is returned. The B result is a pair where the first element is the value associated E with the deleted key, if one existed, and the second element is the  modified map. O(n)1. Fold the keys and values in the map, such that   f z ==  Prelude.foldr (uncurry f) z .  toAscList.  For example,  1 keys map = foldWithKey (\k x ks -> k:ks) [] map A let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")" J foldWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)" O(n)". Convert the map to a list of key/ value pairs. < toList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]  toList empty == []  O(n)1. Return all keys of the map in ascending order. - keys (fromList [(5,"a"), (3,"b")]) == [3,5]  keys empty == []     bin7 assures that we never have empty trees within a tree. highestBitMask. returns a word where only the highest bit is E set. It is found by first setting all bits in lower positions than C the highest bit and than taking an exclusive or with the original A value. Allthough the function may look expensive, GHC compiles C this into excellent C code that subsequently compiled into highly A efficient machine code. The algorithm is derived from Jorg Arndt's  FXT library.    F !"#$%&'()*+,-A mapping from keys k to priorites p. .E k p binds the key k with the priority p. /0123O(1)$ The number of elements in a queue. 4O(1) True if the queue is empty. 5O(log n)6 The priority and value of a given key, or Nothing if  the key is not bound. 67O(1)! Build a queue with one element. 8O(log n)8 Insert a new key, priority and value in the queue. If B the key is already present in the queue, the associated priority > and value are replaced with the supplied priority and value. 9O(log n)2 Delete a key and its priority and value from the A queue. When the key is not a member of the queue, the original  queue is returned. :O(log n)5 Update a priority at a specific key with the result @ of the provided function. When the key is not a member of the ( queue, the original queue is returned. ; O(n*log n)! Build a queue from a list of keypriorityvalue D tuples. If the list contains more than one priority and value for D the same key, the last priority and value for the key is retained. <O(n) Convert to a list of keypriorityvalue tuples. =O(n) Convert to an ascending list. >?O(n) Convert to a descending list. @AO(1)' The element with the lowest priority. BO(log n)7 Delete the element with the lowest priority. Returns ' an empty queue if the queue is empty. CO(log n)7 Retrieve the binding with the least priority, and the - rest of the queue stripped of that binding. DEO(r*(log n - log r))& Return a list of elements ordered by " key whose priorities are at most pt. FGHIJKLMBalance factor NOPQRSTUVWXYZ[\ATake two pennants and returns a new pennant that is the union of B the two with the precondition that the keys in the rst tree are 4 strictly smaller than the keys in the second tree. ] A version of \/ that can be used if the shape of the tree has 5 not changed or if the tree is known to be balanced. ^_`abc),-./0123456789:;<=?ABCE),-./012/0123456789:;<=?ABCE1SThe event manager state. defghijkAn edit to apply to a l. l6A priority search queue, with timeouts as priorities. mnopqT$Callback invoked on timeout events. UrVCallback invoked on I/ O events. W'A file descriptor registration cookie. sXtuvwxyz{YCreate a new event manager. |Z9Asynchronously shuts down the event manager, if running. }~[@Start handling events. This function loops until told to stop. Note%: This loop can only be run once per S, as it 7 closes all of its control resources when it finishes. \]@Register interest in the given events, without waking the event  manager thread. The `$ return value indicates whether the " event manager ought to be woken. ^registerFd mgr cb fd evs" registers interest in the events evs  on the file descriptor fd. cb is called for each event that 1 occurs. Returns a cookie that can be handed to `. Wake up the event manager. _ADrop a previous file descriptor registration, without waking the E event manager thread. The return value indicates whether the event  manager ought to be woken. `.Drop a previous file descriptor registration. aANotify the event manager that a file descriptor has been closed. b8Register a timeout in the given number of microseconds. cd?Call the callbacks corresponding to the given file descriptor. PQRSTUVWX{Y|Z}[\]^_`abcdSTUVWXX{Y|Z}[\]^_`abcdNPQRSTUVWXYZ[\]^_`abcdSY[\ZPQRVWX^]`_aTUbdc ?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. ?Set the value of returned TVar to True after a given number of C microseconds. The caveats associated with threadDelay also apply. BBlock the current thread until data is available to read from the  given file descriptor. =Block the current thread until the given file descriptor can  accept data to write. non-portable (GHC extensions)internalcvs-ghc@haskell.orgef@Block the current thread until data is available to read on the # given file descriptor (GHC only). g:Block the current thread until data can be written to the # given file descriptor (GHC only). h?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. i?Set the value of returned TVar to True after a given number of C microseconds. The caveats associated with threadDelay also apply. efghiehifgefghiGnon-portable (GHC extensions)internalcvs-ghc@haskell.org= !"#efghi=hifg! "#e non-portableinternallibraries@haskell.org3Open a file and make an % for it. Truncates the file to zero  size when the  is . Puts the file descriptor ) into non-blocking mode on Unix systems. Make a 4 from an existing file descriptor. Fails if the FD 5 refers to a directory. If the FD refers to a file,  locks 3 the file according to the Haskell 98 single writer/multiple reader , locking semantics (this is why we need the  argument too). is a socket (on Windows)  is in non-blocking mode on Unix  non-portableinternallibraries@haskell.org&j Computation j hdl t * waits until input is available on handle hdl.  It returns ~" as soon as input is available on hdl,  or {! if no input is available within t milliseconds. Note that  j waits until one or more full  characters are available, > which means that it needs to do decoding, and hence may fail  with a decoding error. If t is less than zero, then  hWaitForInput waits indefinitely. This operation may fail with:  & if the end of file has been reached. E a decoding error, if the input begins with an invalid byte sequence  in this Handle' s encoding. '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. k Computation k 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. l Computation l 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 l9 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. m Computation m 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 m hdl. 5Any operation that fails because a handle is closed, ? also fails if a handle is semi-closed. The only exception is hClose. & A semi-closed handle becomes closed:  if hClose 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. n Computation n 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. o Computation o 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. pp  hdl buf count writes count 8-bit bytes from the  buffer buf to the handle hdl. It returns (). p/ ignores any text encoding that applies to the , > writing the bytes directly to the underlying file or device. p ignores the prevailing  TextEncoding and  ~ on the , and writes bytes directly. 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). qrr  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). r; 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, r$ will behave as if EOF was reached. r ignores the prevailing  TextEncoding and ~  on the , and reads bytes directly. ss  hdl buf count reads data from the handle hdl  into the buffer buf+. If there is any data available to read,  then s1 returns it immediately; it only blocks if there  is no data to be read. CIt 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). s; 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, s$ will behave as if EOF was reached. s ignores the prevailing  TextEncoding and ~  on the , and reads bytes directly. tt  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. t is identical to r, 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 t, use j. 7If the handle is a pipe or socket, and the writing end  is closed, t$ will behave as if EOF was reached. t ignores the prevailing  TextEncoding and  ~ on the , and reads bytes directly. <NOTE: on Windows, this function does not work correctly; it  behaves identically to r.  jklmnopqrst jklmnopqrst7 non-portable provisionallibraries@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:   isFullError if the device is full;  isPermissionError/ 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. uvwx Computation x hdl makes handle hdl closed. Before the  computation finishes, if hdl& is writable its buffer is flushed as  for .  Performing x: 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 x: fails for any reason, any further operations (apart from  x&) on the handle will still fail as if hdl had been successfully  closed. y For a handle hdl$ which attached to a physical file,  y hdl/ returns the size of that file in 8-bit bytes. zz hdl size) truncates the physical file with handle hdl to size bytes. {For a readable handle hdl, { hdl returns  ~' 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 {. NOTE: {3 may block, because it has to attempt to read from D the stream to determine whether there is any more data to be read. | 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:   isEOFError& 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:  isPermissionError1 if the handle has already been used for reading H or writing and the implementation does not allow the buffering mode  to be changed. ~ The action ~ hdl encoding changes the text encoding  for the handle hdl to encoding. The default encoding when a  is  created is I., namely the default encoding for the current  locale.  To create a  with no encoding at all, use openBinaryFile. To 2 stop further encoding or decoding on an existing , use  . ~4 may need to flush buffered data in order to change  the encoding. Return the current po for the specified , or   if the  is in binary mode. Note that the po& remembers nothing about the state of  the encoder/decoder in use on this . For example, if the ' encoding in use is UTF-16, then using  and  ~3 to save and restore the encoding may result in an 2 extra byte-order-mark being written to the file.  The action  hdl flushes all buffered data in hdl, B including any buffered read data. Buffered read data is flushed E by seeking the file position back to the point before the bufferred ( data was read, and hence only works if hdl is seekable (see  ). This operation may fail with:   isFullError if the device is full;  isPermissionError/ 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;  isIllegalOperation if hdl$ has buffered read data, and is not  seekable.  Computation  hdl returns the current I/O position of  hdl! as a value of the abstract type wv.  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:  isPermissionError/ 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:  isIllegalOperationError( if the Handle is not seekable, or does * not support the requested seek mode.  isPermissionError/ if a system resource limit would be exceeded.  Computation  hdl% returns the current position of the  handle hdl/, as the number of bytes from the beginning of = the file. The value returned may be subsequently passed to  3 to reposition the handle to the current position. This operation may fail with:  isIllegalOperationError if the Handle is not seekable.  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 (~) or text mode ({) on a open handle.  (See also openBinaryFile.) $This has the same effect as calling ~ with @ , together  with  with . Set the ~ on the specified . All buffered  data is flushed first. 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 co, monad, and gives more comprehensive output  than the (pure) instance of P for . @"#$%~MNOjklmnopqrtuvwxyz{|}~@MNyz{|}~xOuvw"%$#~jklmnortpquvwwxyz{|}~= non-portableinternallibraries@haskell.org/A handle managing output to the Haskell program's standard output channel. 0A handle managing input from the Haskell program's standard input channel. /A handle managing output to the Haskell program's standard error channel. The computation  is identical to {,  except that it works only on .  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:  isAlreadyInUseError5 if the file is already open and cannot be reopened;  isDoesNotExistError if the file does not exist; or  isPermissionError8 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 ATurn an existing file descriptor into a Handle. This is used by - various external libraries to make Handles. BMakes a binary Handle. This is for historical reasons; it should A probably be a text Handle with the default encoding and newline  translation instead.    non-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. 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 P;  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 n ). -Write a string to the standard output device  (same as o ).  The same as  , but adds a newline character. 0Read a character from the standard input device  (same as k ). +Read a line from the standard input device  (same as l ). The 6 operation returns all user input as a single string, & which is read lazily as it is needed  (same as m ). 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 co+ 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 o , 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 H raising an exception. If closing the handle raises an exception, then " this exception will be raised by  rather than any exception  raised by act.  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. &Directory in which to create the file 'File name template. If the template is "foo.ext" then  the created file will be " fooXXX.ext" where XXX is some  random number. Like ), but opens the file in binary mode. See  for more comments. Like (, but uses the default file permissions Like (, but uses the default file permissions ioY"#$%o~@ABCDEFGHIJjklmnopqrstvxyz{|}~ioYxyz{}v"%$#jkl|mnoprsqt~o@ABCDEFGHIJ~portablestablelibraries@haskell.org8Strict (call-by-value) application, defined in terms of . ,-./0123456789ABCDEFGIJKLMNOP`abcdijlowx{~     6789:;<=>?@ABCDEIJLMNOPQRSY`{~wjaxC3K4B/012AdicblJ-5,MEF>?@ABCDE<=.DO789:;NLMPQNOIJG7896I     6PLoYSR-non-portable (local universal quantification) experimentallibraries@haskell.orgHThe H+ 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 H 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 H.) $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 H: 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 CRepresentation of constructors. Note that equality on constructors @ with different types may not work -- i.e. the constructors for { and   may compare equal. 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. 2defines how nonempty constructor applications are 6 folded. It takes the folded tail of the constructor 7 application and its head, i.e., an immediate subterm,  and combines them in some way. 1defines how the empty constructor application is  folded, like the neutral / start element for list  folding. structure to be folded. (result, with a type defined in terms of a, but 6 variability is achieved by means of type constructor  c1 for the construction of the actual result type. #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 H 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 H 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 9 and 7. ?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 "Gets the string for a constructor "Lookup a constructor via a string Test for an algebraic type =Gets the constructor for an index (algebraic datatypes only) ;Gets the index of a constructor (algebraic datatypes only) <Gets the maximum constructor index of an algebraic datatype Constructs the d type Constructs the c type ,This function is now deprecated. Please use  instead. Constructs the a type  Helper for , ,  ,This function is now deprecated. Please use  instead. ,This function is now deprecated. Please use  instead. ,This function is now deprecated. Please use  instead. Makes a constructor for a. Deprecated version (misnamed) ;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  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGEquality of constructors jHRSTUVWXY     BHBHnon-portable (GHC Extensions)internalcvs-ghc@haskell.org The 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 F type allows you to reverse sort order conveniently. A value of type   a contains a value of type a (represented as  a).  If a has an K0 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  x 9 ensures that all the elements of the list are identical & and then returns that unique element The - function sorts a list of elements using the A user supplied function to project something out of each element HsDEF@\GHIJaKbLcMNdOPQRSTmUVWXYZp[\]^uv_yz|}defghijklmnopqrstuvwxyz{|}~                           ! " # $ % & ' ( ) * + , - . / 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 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 { | } ~  )d}pc|bzayuv\@ O      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Pportable experimentalashley@semantic.orgA class for categories. " id and (.) must form a monoid. the identity morphism morphism composition Right-to-left composition Left-to-right composition QIR non-portable experimentallibraries@haskell.org,An abstract unique object. Objects of type  may be 4 compared for equality and ordering and hashed into d. JKCreates a new object of type . The value returned will . not compare equal to any other value of type  returned by  previous calls to &. There is no limit on the number of  times  may be called.  Hashes a  into an d. Two s may hash to the 9 same value, although in practice this is unlikely. The d ! returned makes a good hash key. portable provisionallibraries@haskell.org6789GIIG7896Snon-portable (concurrency) experimentallibraries@haskell.orgLMN= is an abstract type representing an unbounded FIFO channel. OP$Build and returns a new instance of . Write a value to a . Read the next value from the .  Duplicate a :: 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. JPut a data item back onto a channel, where it will be the next item read. Returns ~ if the supplied  is empty. =Return a lazy list representing the contents of the supplied   , much like System.IO.hGetContents. #Write an entire list of items to a .   Tnon-portable (concurrency) experimentallibraries@haskell.orgA 8 is a simple quantity semaphore, in which the available  "quantity"' is always dealt with in units of one. QR Build a new # with a supplied initial quantity. + The initial quantity must be at least 0. $Wait for a unit to become available Signal that a unit of the  is available Unon-portable (concurrency) experimentallibraries@haskell.orgA 1 is a quantity semaphore, in which the available  "quantity"6 may be signalled or waited for in arbitrary amounts. ST Build a new # with a supplied initial quantity. + The initial quantity must be at least 0. 4Wait for the specified quantity to become available 7Signal that a given quantity is now available from the . Vnon-portable (concurrency) experimentallibraries@haskell.org6Sample variables are slightly different from a normal i:  Reading an empty  causes the reader to block.  (same as l on empty i)  Reading a filled  empties it and returns value.  (same as l)  Writing to an empty  fills it with a value, and 8 potentially, wakes up a blocked reader (same as for m on  empty i).  Writing to a filled  overwrites the current value.  (different from m on full i.) UBuild a new, empty,  Build a  with an initial value. BIf the SampleVar is full, leave it empty. Otherwise, do nothing. ?Wait for a value to become available, then take it and return. Write a value into the &, overwriting any previous value that  was there. Returns ~ if the  is currently empty. ANote that this function is only useful if you know that no other + threads can be modifying the state of the  , because  otherwise the state of the  may have changed by the time  you see the result of . Hnon-portable (concurrency) experimentallibraries@haskell.orgVW~! if bound threads are supported.  If rtsSupportsBoundThreads is {,   will always return { and both  and  will  fail. XYZ[\Like *, this sparks off a new thread to run the co :computation passed as the first argument, and returns the  of the newly created thread.  However,  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  instead of # makes no difference at all to the Dscheduling behaviour of the Haskell runtime system. It is a common #misconception that you need to use  instead of  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. Returns ~ 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. Run the coA 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 co 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. Run the coA computation passed as the first argument. If the calling thread is bound1, an unbound thread is created temporarily using . runInBoundThread doesn't finish until the co 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. @Block the current thread until data is available to read on the # given file descriptor (GHC only). :Block the current thread until data can be written to the # given file descriptor (GHC only). 7ijklmnopqhh W non-portable experimentallibraries@haskell.org]^_Wrap an o$ 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 # 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. Xportable experimentallibraries@haskell.org   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`  = (*) (if (*) "  {",  "}) ((*) `on` f) `on` g = (*) `on` (f . g)  on f .  on g =  on (g . f)      portable experimentallibraries@haskell.org:*The fixed point of a monadic computation.  : f executes the action f only once, with the eventual & output fed back as the input. Hence f should not be strict,  for then : f would diverge. Z"Monads having fixed points with a ' knot-tying' semantics.  Instances of Z$ should satisfy the following laws:  purity  : (9 . h) = 9 (  h) left shrinking (or  tightening)  : (\ x -> a >>= \y -> f x y) = a >>= \y -> : (\ x -> f x y) sliding  : (Control.Monad.liftM h . f) = Control.Monad.liftM h (: (f . h)),  for strict h. nesting  : (\x -> : (\y -> f x y)) = : (\ x -> f x x) 7This class is used in the translation of the recursive do notation  supported by GHC and Hugs. :Z Z: :Z:portable experimentallibraries@haskell.org;Lift 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 G: 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: ; 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 9 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  = #. ;<=>?    !"# ;< !">=  # ?;<=>? ?   =>;< !"#portable experimentallibraries@haskell.org]A functor with application. -Instances should satisfy the following laws:  identity  5  6 v = v  composition  5 (.) 6 u 6 v 6 w = u 6 (v 6 w)  homomorphism  5 f 6 5 x = 5 (f x)  interchange  u 6 5 y = 5 ( y) 6 u ignore left value  u 7 v = 5 ( ) 6 u 6 v ignore right value  u 8 v = 5  6 u 6 v The I instance should satisfy     f x = 5 f 6 x If f is also a G , define 5 = 9 and (6) = &. Minimal complete definition: 5 and 6. $Lists, but with an ]# functor based on zipping, so that f g %$ xs1 6 ... 6 %$ xsn = %$ (zipWithn f xs1 ... xsn)%&'()*+,-./0"A monoid on applicative functors. Minimal complete definition: 1 and 2. 3 and 41 should be the least solutions of the equations:   some v = (:) g v 6 many v many v = some v 2 5 []1The identity of 2 2 An associative binary operation 3 One or more. 4Zero or more. 5Lift a value. 6Sequential application. 7>Sequence actions, discarding the value of the first argument. 8?Sequence actions, discarding the value of the second argument. 9 A variant of 6 with the arguments reversed. :Lift a function to actions. * This function may be used as a value for  in a I instance. ;#Lift a binary function to actions. <$Lift a ternary function to actions. = One or none. ]g$%&'()*+,-./0123456789:;<=]567801234-./*+,'()$%&g9:;<=]5678$%&%&'()()*+,+,-././01234123456789:;<=portable experimentallibraries@haskell.org#^$Data structures that can be folded. Minimal complete definition: ? or @. 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 where  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. Alternatively, one could define foldr:  instance Foldable Tree where  foldr f z Empty = z  foldr f z (Leaf x) = f x z ; foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l >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. @ f z =  f z . PA&Left-associative fold of a structure. A f z =  f z . PB A variant of @ that has no base case, 7 and thus may only be applied to non-empty structures. B f =  f . PC A variant of A that has no base case, 7 and thus may only be applied to non-empty structures. C f =  f . PD'Fold over the elements of a structure, ) associating to the right, but strictly. E/Monadic fold over the elements of a structure, 4 associating to the right, i.e. from right to left. F'Fold over the elements of a structure, ( associating to the left, but strictly. G/Monadic fold over the elements of a structure, 3 associating to the left, i.e. from left to right. H7Map each element of a structure to an action, evaluate ; these actions from left to right, and ignore the results. II is H with its arguments flipped. J>Map each element of a structure to a monadic action, evaluate ; these actions from left to right, and ignore the results. KK is J with its arguments flipped. L:Evaluate each action in the structure from left to right,  and ignore the results. MBEvaluate each monadic action in the structure from left to right,  and ignore the results. N1The sum of a collection of actions, generalizing Q. O1The sum of a collection of actions, generalizing Q. P!List of elements of a structure. Q?The concatenation of all the elements of a container of lists. RDMap a function over all the elements of a container and concatenate  the resulting lists. SS; returns the conjunction of a container of Bools. For the  result to be ~ , the container must be finite; { , however,  results from a {' value finitely far from the left end. TT; returns the disjunction of a container of Bools. For the  result to be { , the container must be finite; ~ , however,  results from a ~' value finitely far from the left end. UIDetermines whether any element of the structure satisfies the predicate. VHDetermines whether all elements of the structure satisfy the predicate. WThe W: function computes the sum of the numbers of a structure. XThe X> function computes the product of the numbers of a structure. Y.The largest element of a non-empty structure. ZAThe 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? ^^ is the negation of ]. _The _8 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. #^>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_#^>?@ABCDFEGHILNJKMOPQRSTUVWXYZ[\]^_#^>?@ABC>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_portable experimentallibraries@haskell.org_AFunctors representing data structures that can be traversed from  left to right. Minimal complete definition: ` or a. Instances are similar to I, 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 where " 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 6  imply a form of associativity. 7The superclass instances should satisfy the following:  In the I instance, # should be equivalent to traversal + with the identity applicative functor (h).  In the ^ instance, Data.Foldable.foldMap should be @ equivalent to traversal with a constant applicative functor  (i). `abcdefgh`7Map each element of a structure to an action, evaluate < these actions from left to right, and collect the results. a:Evaluate each action in the structure from left to right,  and collect the results. b>Map each element of a structure to a monadic action, evaluate < these actions from left to right, and collect the results. cBEvaluate each monadic action in the structure from left to right,  and collect the results. dd is ` with its arguments flipped. ee is b with its arguments flipped. fThe f( 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. gThe g( 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. h)This function may be used as a value for  in a I instance. i)This function may be used as a value for Data.Foldable.foldMap  in a ^ instance. _`abcdefghi _`abcdefghi _`abc`abcdefghinon-portable (GHC extensions)internalcvs-ghc@haskell.orgijklijklijkll:non-portable (requires universal quantification for runST) experimentallibraries@haskell.orgmZ[\mZ[\:non-portable (requires universal quantification for runST) provisionallibraries@haskell.orgmZ[\Y:non-portable (requires universal quantification for runST) provisionallibraries@haskell.org mnj"The lazy state-transformer monad.  A computation of type j 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 k), or  m (inside invocations of q). BIt serves to keep the internal states of different invocations of  k2 separate from each other and from invocations of q. The 7 and 87 operations are not strict in the state. For example, k5 (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2ok>Return the value computed by a state transformer computation.  The forall- ensures that the internal state used by the j 9 computation is inaccessible to the rest of the program. lHAllow the result of a state transformer computation to be used (lazily)  inside the computation.  Note that if f is strict, l f = _|_. mConvert a strict j0 computation into a lazy one. The strict state thread passed to m& is not performed until the result of .the lazy state thread it returns is demanded. nConvert a lazy j computation into a strict one. opq=A monad transformer embedding lazy state transformers in the co  monad. The m- parameter indicates that the internal state  used by the j. computation is a special one supplied by the co < monad, and thus distinct from those used by invocations of k. mjklmnopq jklmnmqopjklmnopqZportable provisionallibraries@haskell.org r'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. s3forms a complex number from its real and imaginary  rectangular components. t,Extracts the real part of a complex number. u1Extracts the imaginary part of a complex number. v#The conjugate of a complex number. wDForm a complex number from polar components of magnitude and phase. xx t# is a complex value with magnitude 1  and phase t (modulo 2*). y The function y takes a complex number and 6 returns a (magnitude, phase) pair in canonical form: : the magnitude is nonnegative, and the phase in the range (-, ]; 1 if the magnitude is zero, then so is the phase. z/The nonnegative magnitude of a complex number. {,The phase of a complex number, in the range (-, ]. 1 If the magnitude is zero, then so is the phase. p rstuvwxyz{ rstuwxyz{v rsstuvwxyz{[portable experimental$Ashley Yakeley <ashley@semantic.org>$|%resolution of 10^-12 = .000000000001 }q~!resolution of 10^-9 = .000000001 rresolution of 10^-6 = .000001 sresolution of 10^-3 = .001 t?resolution of 10^-2 = .01, useful for many monetary currencies uresolution of 10^-1 = .1 v0resolution of 1, this works the same as Integer w,The type parameter should be an instance of . xgeneralisation of @ to any instance of Real generalisation of C to any instance of Real generalisation of A to any instance of Real yz{|}~0First arg is whether to chop off trailing zeros |}~~}||}~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   (G y) <=  (G y'), and  H y <= H y'. 7Any real interval contains a unique simplest rational;  in particular, note that 0/1" is the simplest rational of all. klFGHklFGH'$non-portable (uses Control.Monad.ST) experimentallibraries@haskell.orgMutate the contents of an  +non-portable (uses Control.Monad.ST.Strict) provisionallibraries@haskell.org\)non-portable (uses Control.Monad.ST.Lazy) experimentallibraries@haskell.org]6non-portable (local universal quantification in ReadP) experimentallibraries@haskell.orgA 0 represents the version of a software entity. An instance of C. is provided, which implements exact equality %modulo reordering of the tags in the  field. An instance of K- is also provided, which gives lexicographic ordering on the ( 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  field and compare those. The bottom line is, don't always assume that  and other K )operations are the right thing for every . ASimilarly, concrete representations of versions may differ. One 2possible concrete representation is provided (see  and 9), 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 d, so  version 3.2.1 becomes [3,2,1]. Lexicographic ordering  (i.e. the default instance of K 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 . For  a version with  = [1,2,3] and   = ["tag1","tag2"], the output will be 1.2.3-tag1-tag2. 0A parser for versions in the format produced by . ^portable provisionallibraries@haskell.org3 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, 3 outputs the string in its first argument, before 1returning the second argument as its result. The  function is not Jreferentially transparent, and should only be used for debugging, or for .monitoring execution. Some implementations of  may decorate the string that's output to indicate that you'+re tracing. The function is implemented on top of . Like  , but uses $ on the argument to convert it to a x.  traceShow = trace . show _portable 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  describes a single option. The arguments to  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 )  The option descriptions (see ) 9 The actual command line arguments (presumably got from  System.Environment.getArgs). = 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 , 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.    `portable provisionallibraries@haskell.org Computation , returns the number of picoseconds CPU time ? used by the current program. The precision of this result is  implementation-dependent. The 0 constant is the smallest measurable difference D in CPU time that the implementation can record, and is given as an ! integral number of picoseconds. aportable provisionallibraries@haskell.org Computation  returns a list of the program' s command 2 line arguments (not including the program name).  Computation + 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  will return.  Computation  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.  args act - while executing action act, have  return args.  name act - while executing action act, have  return name. ' 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. 8portable provisionallibraries@haskell.org Computation  code throws  code. 1 Normally this terminates the program, returning code to the  program' s caller. %On program termination, the standard Handles stdout and  stderr/ are flushed automatically; any other buffered Handles B need to be flushed manually, otherwise the buffered data will be  discarded. >A program that fails in any other way is treated as if it had  called . 8 A program that terminates successfully without calling  + explicitly is treated as it it had called  . As an  is not an S,  bypasses  the error handling in the co$ monad and cannot be intercepted by   from the Prelude. However it is a  SomeException , 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 . Note: in GHC, ( should be called from the main program @ thread in order to exit the process. When called from another  thread,  will throw an  ExitException as normal, but the 6 exception will not cause the process itself to exit. The computation  is equivalent to   ( exitfail),  where exitfail is implementation-dependent. The computation  is equivalent to   , It terminates the program  successfully. bportable experimentallibraries@haskell.orgThe version of % 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. cportable provisionallibraries@haskell.org)Triggers an immediate garbage collection d non-portable experimentallibraries@haskell.orgDAn 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  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. Makes a 0 for an arbitrary object. The object passed as ( the first argument is not evaluated by .  Convert a  to an d. The d returned is not  necessarily unique; several s may map to the same d D (in practice however, the chances of this are small, so the result  of  makes a good hash key). > non-portable experimentallibraries@haskell.orgA specialised version of ", where the key and the value are  the same object: 4 mkWeakPtr key finalizer = mkWeak key key finalizer A specialised version of  , 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   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  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). A specialised version of $ where the value is actually a pair  of the key and value passed to :  ? 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. portable provisionallibraries@haskell.orgeportable provisionallennart@augustsson.net#The 0 class provides the variable argument magic for  8. Its implementation is intentionally not visible from  this module. The 0 class provides the variable argument magic for  8. 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  or , then 6 the compiler will report it as a missing instance of . JFormat a variable number of arguments with the C-style formatting string.  The return value is either x or (o 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  Similar to *, except that output is via the specified  $. The return type is restricted to (o a).  non-portableinternallibraries@haskell.org8"#$% L M N T W [ ] ^ _ `O yuvwxyz{|}f"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  x$ 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  x$ 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  x$ argument gives the location of the , record construction in the source program. !A pattern matching failure. The x 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 x  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 MVar. AAsynchronous exceptions (see section on Asynchronous Exceptions: +Control.OldException#AsynchronousExceptions).  This exception is thrown by the   operation when the condition  fails. The x 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-co) expressions, see the  function h. 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 co computation.  Note that 3 catches all types of exceptions, and is generally  used for " cleaning up"' before passing on the exception using  _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 computation to run ,Handler to invoke if an exception is raised  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 . Predicate to select exceptions Computation to run Handler  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 w result which is  ( a) if no exception was raised, or ( 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  R class.  A variant of ) that throws the dynamic exception to an " arbitrary thread (GHC only: c.f. ). :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 computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between A specialised variant of  with just a computation to run  afterward. computation to run first 4computation to run afterward (even if an exception  was raised)  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. computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between A()*+,-5T_`ahAT(-,+*)_5h`a* 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>J !"#$%JCompute a cross of an array and the arrays produced by the given function & for the elements of the first array. &'()*+     9 !"#$%&'()*+     9"+# &*!     $()'%9 !"#$%&'()*+     jjjrjllljjjjjjj nnskkkkiinjjjj kkiwssjjnizswsmp      | |||ss{{{{{~ ~!"j#$%&'()*+,-,.,/,0123456789:;<=>?@iAiBiCiDiEiFiGiHiIiJjKjLjMjNjOjPjQjRjSjTjUjVjWjXjYZ[\k]k^k_k`kakb!c!d!e!f!g!h!i!j!k!l!m!nopqrstlulvlwlxlylzl{l|l}l~llllllllllllllllllllllllllllmmmmmmmmmmnnnnnoooopppp                                 qqqqqqqqqqqqqqrsssssssssssssssssssssssssssttttttttttt t t t t tttttvvvvvvvvv&&&&& &!&"&#&$&%&&&'&(&)&*&+&,&-w.w/w0w1w2w3w4w5w6w7w8w9w:w;w<w=w>w?w@wAwBwCwDwEwFwGwHwIwJwKwLwMwNwOwPxQxRxSxTyUyVyWyX)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){*|*}*~* ****#* *******++++++++[+\+^+_+]+g++++zzzzzzzzzzzzz{}}}}}"""""""""""""~!~ ~~~~~~~~~,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------.......................... ////// / / / / / / //////////////// !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0000000Y0L0000022333333311111444444444444444444444444444444444444444455555555555666666666666666       !"#$$%%&&''(9)9*9+9,9-:.:/;0;1;2;3;4;5;6;7;8<9<:<;<<<=<><?<@<A7B=CDEFG(H(I(J K?L?M?N?O?P?@Q@R@S@T@U@V@W@X@YAAZA[A\A]A^A_A`AaAbBcBdBeBfBgBhBiBjBkBlBmBnBoBpBqBrBsBtBuBvCwCxCyCzC{C|C}C~CCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD D D D D DDDDEEEEEEEEEEEEEEE F!I"I"I#I#I$I%I&I'I(I)I*I+I,I-I.I/I0I0I1I2I3I4I5I6I7I8I9I:I;I<I=I>I?I@IAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITUUVVWWXXYYZZ[[\]^_`abcdefghi%j%k%N%O%l#a#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~####################\JJJKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLM)M.M/M0M4M3M9M=M<MMM,M+777777777777777777777777777777========      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZZ[\]^O_O`OaObOcOdOeOfOgOhOiOjOkOlOmOnOoOpOqOrOsOtOuOvOwOxOyOzO{O|O}O~OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O O O O OOOOOOOOOOOOOOOOOOO O!O"O#O$O%O&O'O(O)O*O+O,O-O.O/O0O1O2O3O4O5O6O7O8O9O:O;O<O=O>O?O@PAPOPQPBPCQDRERFRGSHSISJSKSLSMSNSOSPTQTRTSTTUUUVUWUXVYVZV[V\V]V^V_H`HaHbHcHdHeHfHHWgXhXijkklmno^pqrsttuvwxyz{|}~ml{~|{~[]\^DWXYYYYYYYYZZZZZZZZZZ[[[[[[[[[[[[[[[[[[[[['\R\S\T\]]]]]]^^^_____________``aaaaaa888bbbbcddd>>>eeeeeeffXfZfYf[fVfWfffff%fUffff$fff\f]f^f_f`fafbfffffffffffdfefffgfSfT                            ! " # $ % & ' ( ) * + , - . / 0j1j2j3j4j5j6j7j8j9j:j;j<j=j>j?j@jAjBjCjDjEjFjGjHjIjJjKjLjMjNjOjPjQjRjSjTjUjVWXYZ[\]^_`abcdefghijklmnopqrsrtruvwxyz{|}~                           ! " # $ % & ' ( ) * + , - . / 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 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 { | } ~  rur r rsk k k k k k k k k k k k k k k k k k k k k l l l l l l l l l l l l l l l l l l m m m m m m m m m m m n n n n n n n n n n n                                        o o o o oo p p p p p p p p p p p p p p p 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 8p 9p :p ;p <p =p >r ?r @r As Bs Cs Ds Es Fs Gs Hs Is Js Ks Ls Ms Ns Os Ps Qs Rs St Tt Ut Vt Wt Xt Yt Zt [t \t ]tcteu ^u ^u _u `u au bu cu dvw ew fw gw hw iw jw kw lw mw nw ow pw qw rw sw tw uw vw ww xw yw zw {w |w }w ~w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w xQyUyJ) ) ) ) ) ) ) ) ) * * * * * * * ** * * * * * * * ** * * * * * + z z z z z z z z z z z z { { { { { { { { { { | | | | | | | | "     ,                    ........................... . . . . . . . !. ". #. $. %. &. '. (. ). *. +. ,. -. .. /. 0 1 2 3 4 5 6 7 8 9 : ;/ < = > ? @ A B0 C0 D0 E0 F0 G0 H0 I0 J0 K0 L0 M0 N0 O0 O0 P0 Q0 R00 S0 T0 U0 V0 W0 X0 Y0 Z0 [0I0 \0 ]0 ^0 _0 `0 a0 b0 c0 d0 e0 f0 g0 h0 i0 j0 k0 l0 m0 n0 o0 p0 q r s t t u v w x x y yst z { | } ~                                                               3 33   4 4                             }             9 9 9 9 : : : : : : : : : : : : : : : : : : !:j: ": #; $; %; &; '; (; ); ; ; *; +; ,; -; ; ; .; /< 0< 1< < < < 2< 3< 4< 5< 6< 7< 8< < !< < 9 : ; <D = >@ ?@ @@ A@ BA CA C DC EC FC GC HC IC JD KD LD MEI NI OI PI QI RI SI TI UI VI WI XI YI ZI [I \I ] ^ _ ` a b c dJ eK fK gK hKPLLLLLLLLLLLLLL iL jL kL lL mL nL oL pL qL rL sL tL uL v w x y z { | } ~    :              ).0439=<                             ! " # $ % & ' C  ( (   )g *z + , - . / 0 1 2 3 4E 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 T U V W X Y Z Y [ \ ] ^ _ ` aL b c d e f f g h h i j k k l m m n o pL a ` q r s t u v w x y z { | } y ~       L     pEE   F               y   y YL * no                : :  C       !"#$%&'()*+7,7-7.7/70717273=4=5=6=7=89:;<=>?@ABCD UEFGHIJ  %KLMNO&PQRRSTTUVVWWXYYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~QRERSSSSHSTQTUUUVYHHHHHHHW YW YWCY YYZ[[[[[[[[[[[[[[[^________________`````aaaaaaaabddeeeeeeeeeeeeeeeeeeeeeeeeeeeeef Nfff ]f p a ` } { |     m           baseControl.Exception.BaseGHC.Exts Data.ListPreludeForeign.StablePtr System.IO Data.Tuple Data.BoolGHC.PArrData.EqData.Ord Control.MonadControl.Monad.Fix Control.Arrow Data.String Data.Data Text.Read Text.ShowData.Ix Data.TypeableControl.Applicative Data.FoldableData.Traversable Data.CharData.Int Data.RatioControl.Monad.ST Data.Word Foreign.Ptr Data.Either Unsafe.Coerce Data.Functor Data.MaybeNumericSystem.IO.ErrorSystem.IO.UnsafeControl.Concurrent.MVar Data.Bits Data.STRef Data.IORefText.ParserCombinators.ReadP Text.Read.LexText.ParserCombinators.ReadPrec GHC.IO.DeviceForeign.StorableForeign.C.Types Data.MonoidData.HashTableForeign.ForeignPtrForeign.Concurrent Data.Dynamic GHC.IO.BufferGHC.IO.BufferedIOGHC.IO.Encoding.Types GHC.IO.Handle System.ExitGHC.IO.Encoding.Latin1GHC.IO.Encoding.UTF8GHC.IO.Encoding.UTF16GHC.IO.Encoding.UTF32GHC.IO.Handle.FDSystem.Mem.WeakForeign.Marshal.ErrorForeign.Marshal.AllocForeign.Marshal.UtilsForeign.Marshal.ArrayForeign.C.StringForeign.C.ErrorForeign.Marshal.PoolForeign.MarshalGHC.ConcControl.Concurrent GHC.Conc.SyncControl.ExceptionGHC.Conc.SignalSystem.Posix.TypesGHC.IO.Encoding System.Event GHC.ConstantsControl.CategoryGHC.Environment Data.UniqueControl.Concurrent.ChanControl.Concurrent.QSemControl.Concurrent.QSemNControl.Concurrent.SampleVarSystem.Timeout Data.FunctionControl.Monad.ST.Lazy Data.Complex Data.FixedData.STRef.Lazy Data.Version Debug.TraceSystem.Console.GetOptSystem.CPUTimeSystem.Environment System.Info System.MemSystem.Mem.StableName Text.PrintfControl.OldExceptionGHC.IO.Encoding.CodePageGHC.ConsoleHandler GHC.ClassesGHC.BaseGHC.EnumGHC.ListGHC.ShowGHC.NumGHC.STGHC.Arr GHC.ExceptionGHC.ErrGHC.RealGHC.IO GHC.IOArrayGHC.MVar GHC.Float GHC.STRef GHC.IORefGHC.ReadGHC.WordGHC.Int GHC.IO.IOModeGHC.Ptr GHC.StableGHC.Pack GHC.Storable GHC.UnicodeGHC.ForeignPtrGHC.IO.Handle.TypesGHC.IO.Exception GHC.IOBaseGHC.Weak Foreign.CForeignSystem.Posix.InternalsGHC.IO.Encoding.IconvGHC.IO.Handle.InternalsSystem.Event.ArraySystem.Event.ClockSystem.Event.ControlSystem.Event.InternalSystem.Event.EPollSystem.Event.IntMapSystem.Event.KQueueSystem.Event.UniqueSystem.Event.PSQSystem.Event.ManagerSystem.Event.Thread GHC.Conc.IO GHC.IO.FDGHC.IO.Handle.TextGHC.TopHandlerControl.Monad.Instances GHC.DesugarControl.Monad.ST.StrictData.STRef.StrictText.Show.Functions GHC.HandleSystem.Event.Poll absentErroraugment++builderrorfoldr recSelErrorghc-primGHC.PrimseqirrefutPatErrornoMethodBindingErrornonExhaustiveGuardsError runtimeErrorpatError recConErrorconcatfilterzip newStablePtrprintfstsnd otherwiseassertlazy breakpointbreakpointCond GHC.Magicinlinemap groupWith$ singletonPnullPlengthP replicatePmapPfilterPzipP crossMapP!:toP enumFromToPenumFromThenToPemptyP+:+ fromInteger- fromRationalenumFrom enumFromThen enumFromToenumFromThenTo==>=negatefail>>=>>returnmfixarrfirstapp|||loop fromStringBoundedEnumEqFloating FractionalIntegralMonadDataFunctorNumOrdReadReal RealFloatRealFracShowIxTypeable Typeable1 Typeable2 Typeable3 Typeable4 Typeable5 Typeable6 Typeable7MonadFix MonadPlusIsString ApplicativeFoldable TraversableGHC.BoolBool GHC.TypesCharDoubleFloatIntInt8Int16Int32Int64 integer-gmpGHC.Integer.TypeInteger GHC.OrderingOrderingRatioRational RealWorld StablePtrIOWordWord8Word16Word32Word64PtrFunPtrEitherStringC#D#FalseF#I#TrueLeftRight GHC.IntWord64uncheckedShiftL64#uncheckedShiftRL64#uncheckedIShiftL64#uncheckedIShiftRA64#LTEQGT unsafeCoerce isAlphaNum isHexDigit isOctDigitisDigitisAlphaisLowerisUpperisSpaceisPrint isControlisLatin1isAsciicompare<><=maxmin/=&&||notfmap<$chrordidconst.flipuntilasTypeOfshiftL#shiftRL#iShiftL# iShiftRA# iShiftRL#curryuncurryswapsuccpredtoEnumfromEnumminBoundmaxBoundMaybeJustNothingmaybeisJust isNothingfromJust fromMaybe maybeToList listToMaybe catMaybesmapMaybecast mkTyConAppmkTyContypeOfTyConTypeRepheadtaillastinitnulllengthfoldlscanlscanl1foldr1scanrscanr1iteraterepeat replicatecycle takeWhile dropWhiletakedropsplitAtspanbreakreverseandoranyallelemnotElemlookup concatMap!!zip3zipWithzipWith3unzipunzip3 showsPrecshowshowListShowSshowsshowChar showString showParen showLitChar intToDigit+*abssignumsubtractSTunsafeInterleaveSTfixSTrunSTrangeindexinRange rangeSize showListWithmzeromplus=<<sequence sequence_mapMmapM_guardfilterMforMforM_msum>=><=<forevervoidjoin mapAndUnzipMzipWithM zipWithM_foldMfoldM_ replicateM replicateM_whenunlessliftMliftM2liftM3liftM4liftM5apmfilterArithExceptionDenormal DivideByZeroLossOfPrecision UnderflowOverflow ErrorCall Exception toException fromException SomeExceptionthrow undefinedproperFractiontruncateroundceilingfloor/recipquotremdivmodquotRemdivMod toInteger toRational% numerator denominator fromIntegral realToFrac showSignedevenodd^^^gcdlcm userErrorIOError IOException MaskingStateMaskedUninterruptibleMaskedInterruptibleUnmaskedFilePathstToIO unsafeIOToST unsafeSTToIOunsafePerformIOunsafeInterleaveIOthrowIOblockunblockgetMaskingStateblockedmask_maskuninterruptibleMask_uninterruptibleMaskevaluateMVar newEmptyMVarnewMVartakeMVarputMVar tryTakeMVar tryPutMVar isEmptyMVaraddMVarFinalizerBits.&..|.xor complementshiftrotatebitsetBitclearBit complementBittestBitbitSizeisSignedshiftLshiftRrotateLrotateR floatRadix floatDigits floatRange decodeFloat encodeFloatexponent significand scaleFloatisNaN isInfiniteisDenormalizedisNegativeZeroisIEEEatan2piexpsqrtlog**logBasesintancosasinatanacossinhtanhcoshasinhatanhacosh showFloat floatToDigitsfromRatSTRefnewSTRef readSTRef writeSTRefIORefnewIORef readIORef writeIORefReadPReadSgetlookpfail+++<++gathersatisfychareofstringmunchmunch1choice skipSpacescountbetweenoptionoptionalmanymany1skipMany skipMany1sepBysepBy1endByendBy1chainrchainlchainr1chainl1manyTill readP_to_S readS_to_PLexemeEOFRatSymbolIdentPunclexhsLexlexCharreadIntPreadOctPreadDecPreadHexPPrecReadPrecminPrecliftstepresetprec readPrec_to_P readP_to_Prec readPrec_to_S readS_to_Prec readsPrecreadListreadPrec readListPrec readParenreadListDefaultreadListPrecDefault lexLitChar readLitChar lexDigitslexPparensW#IOMode ReadWriteMode AppendMode WriteModeReadModereadIntreadOctreadDecreadHex readFloat readSignedshowInt showEFloat showFFloat showGFloat showIntAtBaseshowHexshowOctnullPtrcastPtrplusPtralignPtrminusPtr nullFunPtr castFunPtrcastFunPtrToPtrcastPtrToFunPtr freeStablePtrdeRefStablePtrcastStablePtrToPtrcastPtrToStablePtrSeekMode SeekFromEnd RelativeSeek AbsoluteSeek IODeviceType RawDevice RegularFileStream DirectoryIODevicereadyclose isTerminal isSeekableseektellgetSizesetSizesetEchogetEchosetRawdevTypedupdup2RawIOreadreadNonBlockingwritewriteNonBlockingStorablesizeOf alignment peekElemOff pokeElemOff peekByteOff pokeByteOffpeekpokeCUIntMaxCIntMaxCUIntPtrCIntPtrCJmpBufCFposCFileCTimeCClock CSigAtomicCWcharCSizeCPtrdiffCDoubleCFloatCULLongCLLongCULongCLongCUIntCIntCUShortCShortCUCharCSCharCChar isAsciiLower isAsciiUppertoLowertoUppertoTitle<$>LastgetLastFirstgetFirstProduct getProductSumgetSumAnygetAnyAllgetAllEndoappEndoDualgetDualMonoidmemptymappendmconcatGeneralCategory 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 permutationssortsortByunfoldrfoldl'foldl1foldl1'sumproductlinesunlineswordsunwords HashTablehashInt hashStringprimenewnewHintupdatefromListtoList longestChaintypeOf7typeOf6typeOf5typeOf4typeOf3typeOf2typeOf1 typeRepKeymkFunTy splitTyConApp funResultTymkAppTy typeRepTyCon typeRepArgs tyConString showsTypeRep typeOfDefaulttypeOf1DefaulttypeOf2DefaulttypeOf3DefaulttypeOf4DefaulttypeOf5DefaulttypeOf6Defaultgcastgcast1gcast2eitherleftsrightspartitionEithersreadsFinalizerEnvPtr FinalizerPtr ForeignPtrmallocForeignPtrmallocForeignPtrBytesaddForeignPtrFinalizeraddForeignPtrFinalizerEnvnewForeignPtr_touchForeignPtrunsafeForeignPtrToPtrcastForeignPtrfinalizeForeignPtr newForeignPtrDynamictoDynfromDyn fromDynamicdynApplydynApp dynTypeRepfreeHaskellFunPtrIntPtrWordPtr ptrToWordPtr wordPtrToPtr ptrToIntPtr intPtrToPtrwithForeignPtrnewForeignPtrEnvmallocForeignPtrArraymallocForeignPtrArray0 BufferState WriteBuffer ReadBuffer CharBufferBufferbufRawbufStatebufSizebufLbufR RawCharBuffer CharBufElem RawBuffer readWord8Buf writeWord8Buf peekCharBuf readCharBuf writeCharBufreadCharBufPtrwriteCharBufPtrcharSize withBuffer withRawBuffer isEmptyBuffer isFullBufferisFullCharBuffer isWriteBuffer bufferElemsbufferAvailable bufferRemove bufferAdjustL bufferAdd emptyBuffer newByteBuffer newCharBuffer newBuffer slideContents summaryBuffer checkBuffer BufferedIOfillReadBufferfillReadBuffer0emptyWriteBufferflushWriteBufferflushWriteBuffer0readBufreadBufNonBlockingwriteBufwriteBufNonBlocking TextEncodingtextEncodingName mkTextDecoder mkTextEncoder TextEncoder TextDecoder EncodeBuffer DecodeBuffer BufferCodecencodegetStatesetState NewlineModeinputNLoutputNLNewlineCRLFLF BufferModeBlockBuffering LineBuffering NoBufferingHandle nativeNewlineuniversalNewlineModenativeNewlineModenoNewlineTranslation IOErrorTypeExitCode ExitFailure ExitSuccessArrayExceptionUndefinedElementIndexOutOfBoundsAsyncException UserInterrupt ThreadKilled HeapOverflow StackOverflowAssertionFailedDeadlockBlockedIndefinitelyOnSTMBlockedIndefinitelyOnMVarioErrorlatin1latin1_checked latin1_decode latin1_encodelatin1_checked_encodeutf8utf8_bomutf16 utf16_encode utf16_decodeutf16beutf16leutf16be_decodeutf16le_decodeutf16be_encodeutf16le_encodeutf32 utf32_encode utf32_decodeutf32beutf32leutf32be_decodeutf32le_decodeutf32be_encodeutf32le_encodehFlushstdoutWeakmkWeak deRefWeakfinalize mkWeakIORef modifyIORefatomicModifyIORef comparingthrowIfthrowIf_ throwIfNeg throwIfNeg_ throwIfNull finalizerFreemalloc mallocBytesalloca allocaBytesallocaBytesAlignedrealloc reallocBytesfreewithfromBooltoBoolmaybeNew 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 withCStringwithCStringLencharIsRepresentablecastCCharToCharcastCharToCCharcastCUCharToCharcastCharToCUCharcastCSCharToCharcastCharToCSChar 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 pooledNewpooledNewArraypooledNewArray0unsafeLocalStateTVarSTM ThreadStatus ThreadDied ThreadBlockedThreadFinished ThreadRunning BlockReasonBlockedOnOtherBlockedOnForeignCall BlockedOnSTMBlockedOnExceptionBlockedOnBlackHole BlockedOnMVarThreadIdforkIOforkIOUnmaskedforkOnIOforkOnIOUnmaskednumCapabilities numSparks childHandler killThreadthrowTo myThreadIdyield labelThreadpseqpar runSparks threadStatus unsafeIOToSTM atomicallyretryorElsethrowSTMcatchSTMalwaysSucceedsalwaysnewTVar newTVarIO readTVarIOreadTVar writeTVarwithMVar modifyMVar_ sharedCAFreportStackOverflow reportErrorsetUncaughtExceptionHandlergetUncaughtExceptionHandlerNestedAtomicallyNonTermination NoMethodError RecUpdError RecConError RecSelErrorPatternMatchFailcatch catchJusthandle handleJust mapExceptiontrytryJust onExceptionbracketfinallybracket_bracketOnErrornonTerminationnestedAtomicallyreadMVarswapMVar modifyMVar mkIOErrorisAlreadyExistsErrorisDoesNotExistErrorisAlreadyInUseError isFullError isEOFErrorisIllegalOperationisPermissionError isUserErroralreadyExistsErrorTypedoesNotExistErrorTypealreadyInUseErrorType fullErrorType eofErrorTypeillegalOperationErrorTypepermissionErrorType userErrorTypeisAlreadyExistsErrorTypeisDoesNotExistErrorTypeisAlreadyInUseErrorTypeisFullErrorTypeisEOFErrorTypeisIllegalOperationErrorTypeisPermissionErrorTypeisUserErrorTypeioeGetErrorTypeioeGetErrorStringioeGetLocation ioeGetHandleioeGetFileNameioeSetErrorTypeioeSetErrorStringioeSetLocation ioeSetHandleioeSetFileName modifyIOErrorannotateIOErrorHandlercatches HandlerFunSignal setHandler runHandlersLimitProcessGroupID FileOffset ProcessIDFileModeFileIDDeviceID EpochTime ClockTick ByteCountGroupIDUserID LinkCountFdCRLimCTcflagCSpeedCCcCUidCNlinkCGidCSsizeCPidCOffCModeCInoCDevlocaleEncodingmkTextEncoding mkFileHandlemkDuplexHandle hClose_helpEventevtReadevtWrite EventManagerTimeoutCallback TimeoutKey IOCallbackFdKeykeyFdshutdown registerFd_ registerFd unregisterFd_ unregisterFd fdWasClosedregisterTimeoutunregisterTimeout updateTimeoutensureIOManagerIsRunningthreadWaitReadthreadWaitWrite threadDelay registerDelay hWaitForInputhGetCharhGetLine hGetContentshPutCharhPutStrhPutBufhPutBufNonBlockinghGetBuf hGetBufSomehGetBufNonBlockingHandlePosition HandlePosnhClose hFileSize hSetFileSizehIsEOF hLookAhead hSetBuffering hSetEncoding hGetEncoding hFlushAllhGetPosnhSetPosnhSeekhTellhIsOpen hIsClosed hIsReadable hIsWritable hGetBuffering hIsSeekablehSetEchohGetEchohIsTerminalDevicehSetBinaryModehSetNewlineMode hDuplicate hDuplicateTohShowstdinstderrisEOFopenFileopenBinaryFilemkHandleFromFD fdToHandle' fdToHandleputCharputStrputStrLngetChargetLine getContentsinteractreadFile writeFile appendFilereadLnreadIOhReady hPutStrLnhPrintwithFilewithBinaryFilefixIO openTempFileopenBinaryTempFile"openTempFileWithDefaultPermissions(openBinaryTempFileWithDefaultPermissions$!FixityInfixPrefixConIndex ConstrRep CharConstr FloatConstr IntConstr AlgConstrDataRepNoRepCharRepFloatRepIntRepAlgRepConstrDataTypegfoldlgunfoldtoConstr dataTypeOf dataCast1 dataCast2gmapTgmapQlgmapQrgmapQgmapQigmapMgmapMpgmapMo fromConstr fromConstrB fromConstrM dataTypeName dataTypeRep constrType constrRep repConstr mkDataTypemkConstrdataTypeConstrs constrFields constrFixity showConstr readConstr isAlgType indexConstr constrIndexmaxConstrIndex mkIntType mkFloatType mkStringType mkCharType mkIntConstrmkIntegralConstr mkFloatConstr mkRealConstrmkStringConstr mkCharConstr mkNorepType mkNoRepType isNorepType tyconUQname tyconModuleSpecConstrAnnotationForceSpecConstr NoSpecConstrDown maxTupleSizethesortWith traceEvent TargetWord TargetIntmAX_TUPLE_SIZEmAX_CONTEXT_REDUCTION_DEPTHmAX_SPEC_THUNK_SIZEmAX_SPEC_FUN_SIZEmAX_SPEC_CONSTR_SIZEmAX_SPEC_SELECTEE_SIZEmAX_SPEC_AP_SIZEmIN_PAYLOAD_SIZE mIN_INTLIKE mAX_INTLIKE mIN_CHARLIKE mAX_CHARLIKEmUT_ARR_PTRS_CARD_BITSmAX_Vanilla_REG mAX_Float_REGmAX_Double_REG mAX_Long_REGmAX_Real_Vanilla_REGmAX_Real_Float_REGmAX_Real_Double_REGmAX_Real_Long_REG sTD_HDR_SIZE pROF_HDR_SIZE dOUBLE_SIZE wORD64_SIZE iNT64_SIZErESERVED_C_STACK_BYTESrESERVED_STACK_WORDSaP_STACK_SPLIM wORD_SIZEwORD_SIZE_IN_BITStARGET_MIN_INTtARGET_MAX_INTtARGET_MAX_WORDtARGET_MAX_CHARtAG_BITStAG_MASK mAX_PTR_TAG cINT_SIZE bLOCK_SIZE bLOCK_SIZE_WbITMAP_BITS_SHIFToFFSET_StgRegTable_rR1oFFSET_StgRegTable_rR2oFFSET_StgRegTable_rR3oFFSET_StgRegTable_rR4oFFSET_StgRegTable_rR5oFFSET_StgRegTable_rR6oFFSET_StgRegTable_rR7oFFSET_StgRegTable_rR8oFFSET_StgRegTable_rR9oFFSET_StgRegTable_rR10oFFSET_StgRegTable_rF1oFFSET_StgRegTable_rF2oFFSET_StgRegTable_rF3oFFSET_StgRegTable_rF4oFFSET_StgRegTable_rD1oFFSET_StgRegTable_rD2oFFSET_StgRegTable_rL1oFFSET_StgRegTable_rSpoFFSET_StgRegTable_rSpLimoFFSET_StgRegTable_rHpoFFSET_StgRegTable_rHpLimoFFSET_StgRegTable_rCurrentTSO"oFFSET_StgRegTable_rCurrentNurseryoFFSET_StgRegTable_rHpAllocoFFSET_StgRegTable_rRetoFFSET_StgRegTable_rNurseryoFFSET_stgEagerBlackholeInfooFFSET_stgGCEnter1oFFSET_stgGCFunoFFSET_Capability_roFFSET_Capability_lockoFFSET_Capability_mut_lists oFFSET_Capability_context_switchoFFSET_Capability_sparksoFFSET_bdescr_startoFFSET_bdescr_freeoFFSET_bdescr_blocksoFFSET_bdescr_gen_nooFFSET_bdescr_linksIZEOF_generationoFFSET_generation_mut_list$oFFSET_generation_n_new_large_blockssIZEOF_CostCentreStackoFFSET_CostCentreStack_ccsID oFFSET_CostCentreStack_mem_alloc oFFSET_CostCentreStack_scc_count oFFSET_CostCentreStack_prevStackoFFSET_CostCentre_ccIDoFFSET_CostCentre_linkoFFSET_StgHeader_infooFFSET_StgHeader_ccsoFFSET_StgHeader_ldvwsIZEOF_StgSMPThunkHeaderoFFSET_StgClosure_payloadoFFSET_StgEntCounter_allocs oFFSET_StgEntCounter_registeredpoFFSET_StgEntCounter_link oFFSET_StgEntCounter_entry_countsIZEOF_StgUpdateFrame_NoHdrsIZEOF_StgCatchFrame_NoHdrsIZEOF_StgStopFrame_NoHdrsIZEOF_StgMutArrPtrs_NoHdroFFSET_StgMutArrPtrs_ptrsoFFSET_StgMutArrPtrs_sizesIZEOF_StgArrWords_NoHdroFFSET_StgArrWords_bytesoFFSET_StgArrWords_payloadoFFSET_StgTSO__linkoFFSET_StgTSO_global_linkoFFSET_StgTSO_what_nextoFFSET_StgTSO_why_blockedoFFSET_StgTSO_block_info oFFSET_StgTSO_blocked_exceptionsoFFSET_StgTSO_idoFFSET_StgTSO_capoFFSET_StgTSO_saved_errnooFFSET_StgTSO_trecoFFSET_StgTSO_flagsoFFSET_StgTSO_dirtyoFFSET_StgTSO_bqoFFSET_StgTSO_CCCSoFFSET_StgTSO_spoFFSET_StgTSO_stackoFFSET_StgTSO_stack_sizesIZEOF_StgTSOProfInfooFFSET_StgUpdateFrame_updateeoFFSET_StgCatchFrame_handler'oFFSET_StgCatchFrame_exceptions_blockedsIZEOF_StgPAP_NoHdroFFSET_StgPAP_n_argsoFFSET_StgPAP_funoFFSET_StgPAP_arityoFFSET_StgPAP_payloadsIZEOF_StgAP_NoThunkHdrsIZEOF_StgAP_NoHdroFFSET_StgAP_n_argsoFFSET_StgAP_funoFFSET_StgAP_payloadsIZEOF_StgAP_STACK_NoThunkHdrsIZEOF_StgAP_STACK_NoHdroFFSET_StgAP_STACK_sizeoFFSET_StgAP_STACK_funoFFSET_StgAP_STACK_payloadsIZEOF_StgSelector_NoThunkHdrsIZEOF_StgSelector_NoHdroFFSET_StgInd_indirecteesIZEOF_StgMutVar_NoHdroFFSET_StgMutVar_varsIZEOF_StgAtomicallyFrame_NoHdroFFSET_StgAtomicallyFrame_code1oFFSET_StgAtomicallyFrame_next_invariant_to_check oFFSET_StgAtomicallyFrame_result'oFFSET_StgInvariantCheckQueue_invariant*oFFSET_StgInvariantCheckQueue_my_execution.oFFSET_StgInvariantCheckQueue_next_queue_entryoFFSET_StgAtomicInvariant_code#oFFSET_StgTRecHeader_enclosing_trecsIZEOF_StgCatchSTMFrame_NoHdroFFSET_StgCatchSTMFrame_handleroFFSET_StgCatchSTMFrame_codesIZEOF_StgCatchRetryFrame_NoHdr*oFFSET_StgCatchRetryFrame_running_alt_code$oFFSET_StgCatchRetryFrame_first_code"oFFSET_StgCatchRetryFrame_alt_code oFFSET_StgTVarWatchQueue_closure)oFFSET_StgTVarWatchQueue_next_queue_entry)oFFSET_StgTVarWatchQueue_prev_queue_entryoFFSET_StgTVar_current_valuesIZEOF_StgWeak_NoHdroFFSET_StgWeak_linkoFFSET_StgWeak_keyoFFSET_StgWeak_valueoFFSET_StgWeak_finalizeroFFSET_StgWeak_cfinalizersIZEOF_StgDeadWeak_NoHdroFFSET_StgDeadWeak_linksIZEOF_StgMVar_NoHdroFFSET_StgMVar_headoFFSET_StgMVar_tailoFFSET_StgMVar_valuesIZEOF_StgMVarTSOQueue_NoHdroFFSET_StgMVarTSOQueue_linkoFFSET_StgMVarTSOQueue_tsosIZEOF_StgBCO_NoHdroFFSET_StgBCO_instrsoFFSET_StgBCO_literalsoFFSET_StgBCO_ptrsoFFSET_StgBCO_arityoFFSET_StgBCO_sizeoFFSET_StgBCO_bitmapsIZEOF_StgStableName_NoHdroFFSET_StgStableName_snsIZEOF_StgBlockingQueue_NoHdroFFSET_StgBlockingQueue_bhoFFSET_StgBlockingQueue_owneroFFSET_StgBlockingQueue_queueoFFSET_StgBlockingQueue_linksIZEOF_MessageBlackHole_NoHdroFFSET_MessageBlackHole_linkoFFSET_MessageBlackHole_tsooFFSET_MessageBlackHole_bh,oFFSET_RtsFlags_ProfFlags_showCCSOnException oFFSET_RtsFlags_DebugFlags_apply!oFFSET_RtsFlags_DebugFlags_sanityoFFSET_RtsFlags_DebugFlags_weak&oFFSET_RtsFlags_GcFlags_initialStkSize&oFFSET_RtsFlags_MiscFlags_tickIntervalsIZEOF_StgFunInfoExtraFwd$oFFSET_StgFunInfoExtraFwd_slow_apply"oFFSET_StgFunInfoExtraFwd_fun_typeoFFSET_StgFunInfoExtraFwd_arity oFFSET_StgFunInfoExtraFwd_bitmapsIZEOF_StgFunInfoExtraRev+oFFSET_StgFunInfoExtraRev_slow_apply_offset"oFFSET_StgFunInfoExtraRev_fun_typeoFFSET_StgFunInfoExtraRev_arity oFFSET_StgFunInfoExtraRev_bitmapoFFSET_StgLargeBitmap_sizeoFFSET_StgLargeBitmap_bitmapsIZEOF_snEntryoFFSET_snEntry_sn_objoFFSET_snEntry_addrCategory<<<>>> getFullArgsUnique newUnique hashUniqueChannewChan writeChanreadChandupChan unGetChan isEmptyChangetChanContentswriteList2ChanQSemnewQSemwaitQSem signalQSemQSemNnewQSemN waitQSemN signalQSemN SampleVarnewEmptySampleVar newSampleVaremptySampleVar readSampleVarwriteSampleVarisEmptySampleVarrtsSupportsBoundThreadsmergeIOnmergeIOforkOSisCurrentThreadBoundrunInBoundThreadrunInUnboundThreadtimeoutfixon ArrowLoop ArrowMonad ArrowApply ArrowChoiceleftright ArrowPlus<+> ArrowZero zeroArrowKleisli runKleisliArrowsecond***&&&returnA^>>>>^<<^^<<leftAppZipList getZipList WrappedArrow WrapArrow unwrapArrow WrappedMonad WrapMonad unwrapMonadConstgetConst Alternativeempty<|>somepure<*>*><*<**>liftAliftA2liftA3foldfoldMapfoldr'foldrMfoldlM traverse_for_ sequenceA_asumtraverse sequenceAfor fmapDefaultfoldMapDefaultstrictToLazySTlazyToStrictSTComplex:+realPartimagPart conjugatemkPolarcispolar magnitudephasePicoE12NanoE9MicroE6MilliE3CentiE2DeciE1UniE0 HasResolution resolutionFixeddiv'divMod'mod' showFixedapproxRational modifySTRefVersion versionBranch versionTags showVersion parseVersion putTraceMsgtrace traceShowArgDescrOptArgReqArgNoArgOptDescrOptionArgOrder ReturnInOrderPermute RequireOrder usageInfogetOptgetOpt' getCPUTimecpuTimePrecisiongetArgs getProgNamegetEnvwithArgs withProgNamegetEnvironmentexitWith exitFailure exitSuccesscompilerVersionosarch compilerName performGC StableNamemakeStableNamehashStableName mkWeakPtr addFinalizer mkWeakPairIsChar PrintfArg HPrintfType PrintfTypeprintfhPrintf ExitException DynExceptionBlockedIndefinitelyBlockedOnDeadMVarthrowDyn throwDynTocatchDynioErrorsarithExceptions errorCalls assertions dynExceptionsasyncExceptions userErrorsconcatP concatMapPfoldlPfoldl1PscanlPscanl1PfoldrPfoldr1PscanrPscanr1PtakePdropPsplitAtP takeWhileP dropWhilePspanPbreakPreversePandPorPanyPallPelemPnotElemPlookupPsumPproductPmaximumPminimumPzip3PzipWithP zipWith3PunzipPunzip3PfromPslicePfoldPfold1PpermuteP bpermuteP dpermutePcrossPindexOfPeqStringunpackCStringUtf8#unpackAppendCString#unpackFoldrCString#unpackCString#bindIOreturnIOthenIOOpaqueOmapFB unsafeChrzeroIntoneInttwoIntminIntmaxInt compareInt compareInt#unIOgetTagdivInt#modInt#plusIntminusInttimesIntquotIntremIntdivIntmodInt negateIntgtIntgeInteqIntneIntltIntleInt unpackNBytes# realWorld# unsafeCoerce# nullAddr#Addr#Array# ByteArray#Char#Double#Float#(->)Int#Int32#Int64#Weak# MutableArray#MutableByteArray#MVar# StablePtr#State# StableName#MutVar#Word#Word32#Word64# ThreadId#BCO#TVar# GHC.Generics:*::+:UnitgtChar#geChar#eqChar#neChar#ltChar#leChar#ord#+#-#*#mulIntMayOflo#quotInt#remInt# negateInt#addIntC#subIntC#>#>=#==#/=#<#<=#chr# int2Word# int2Float# int2Double#uncheckedIShiftL#uncheckedIShiftRA#uncheckedIShiftRL# plusWord# minusWord# timesWord# quotWord#remWord#and#or#xor#not#uncheckedShiftL#uncheckedShiftRL# word2Int#gtWord#geWord#eqWord#neWord#ltWord#leWord# narrow8Int# narrow16Int# narrow32Int# narrow8Word# narrow16Word# narrow32Word#>##>=##==##/=##<##<=##+##-##*##/## negateDouble# double2Int# double2Float# expDouble# logDouble# sqrtDouble# sinDouble# cosDouble# tanDouble# asinDouble# acosDouble# atanDouble# sinhDouble# coshDouble# tanhDouble#**##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_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#maskAsyncExceptions#maskUninterruptible#unmaskAsyncExceptions#getMaskingState# atomically#retry# catchRetry# catchSTM#check#newTVar# readTVar# readTVarIO# 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# getSpark# numSparks# parGlobal# parLocal#parAt# parAtAbs# parAtRel# parAtForNow# dataToTag# tagToEnum# addrToHValue# mkApUpd0#newBCO#unpackClosure#getApStackVal# traceCcs# traceEvent#InlInrboundedEnumFromboundedEnumFromThen eftCharFBeftChar efdCharFBefdChar efdtCharFBefdtChar go_up_char_fb go_dn_char_fbgo_up_char_listgo_dn_char_listeftInteftIntFBefdIntefdtInt efdtIntFB efdtIntUp efdtIntUpFB efdtIntDn efdtIntDnFBbadHeadfilterFB iterateFBrepeatFB takeFoldr takeConsttakeFBtakeUInttake_unsafe_UInttakeUInt_appendtake_unsafe_UInt_appendfoldr2 foldr2_left foldr2_rightzipFB zipWithFBerrorEmptyList prel_list_str showSignedInt showList__appPrecappPrec1 show_tuple showSpaceisDec protectEscasciiTabtenitos quotRemInt divModIntintegerToStringenumDeltaIntegerFBenumDeltaIntegerenumDeltaToIntegerFBenumDeltaToIntegerup_fbdn_fbup_listdn_list GHC.Integer smallInteger plusInteger timesInteger hashInteger shiftRInteger shiftLIntegercomplementInteger xorInteger orInteger andIntegerfloatFromIntegerdoubleFromIntegerdecodeDoubleIntegerencodeDoubleIntegerencodeFloatInteger negateInteger minusInteger signumInteger absIntegercompareInteger geInteger ltInteger gtInteger leInteger neqInteger eqInteger lcmInteger gcdInteger quotInteger remInteger divModIntegerquotRemIntegertoInt#int64ToIntegerintegerToInt64word64ToIntegerintegerToWord64 integerToWord wordToIntegerrunSTRepSTretSTRepliftSTSTArrayArrayIPr unsafeIndexunsafeRangeSize indexErrorhopelessIndexError arrEleBottomarraybounds unsafeArray unsafeArray'filldone listArray! safeRangeSizenegRange safeIndex lessSafeIndex badSafeIndexunsafeAt numElementsindiceselemsassocs accumArrayunsafeAccumArrayunsafeAccumArray'adjust// unsafeReplaceaccum unsafeAccumamapixmapeqArraycmpArray cmpIntArray newSTArray boundsSTArraynumElementsSTArray readSTArrayunsafeReadSTArray writeSTArrayunsafeWriteSTArray freezeSTArrayunsafeFreezeSTArray thawSTArrayunsafeThawSTArray absentErr divZeroError overflowError:% ratioPrec ratioPrec1infinity notANumberreducenumericEnumFromnumericEnumFromThennumericEnumFromTonumericEnumFromThenTo^%^^^%^^ gcdInteger'gcdIntintegralEnumFromintegralEnumFromThenintegralEnumFromTointegralEnumFromThenTofailIOliftIOioToSTunsafeDupablePerformIOunsafeDupableInterleaveIO noDuplicatecatchExceptioncatchAny unsafeUnmaskblockUninterruptibleIOArray newIOArrayunsafeReadIOArrayunsafeWriteIOArray readIOArray writeIOArray boundsIOArrayisDoubleNegativeZeroisDoubleDenormalizedisDoubleInfinite isDoubleNaNisFloatNegativeZeroisFloatDenormalizedisFloatInfinite isFloatNaNFFFormat 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 powerDoubleshowSignedFloatclampRPFinalResultFailLookGetfinalrunDigitsBaselexTokenlexEOFlexPunc lexSymbollexIdlexCharE lexString lexNumber lexHexOct lexBaseChar lexDecNumberlexFraclexExp lexIntegervalfracvalDig valDecDig readIntP'parenlistchoose readNumber convertInt convertFracwrap_tup read_comma read_tup2 read_tup4 read_tup8readpW64#W32#W16#W8# toEnumError fromEnumError succError predError shiftL64# shiftRL64#I64#I32#I16#I8# divInt64# modInt64# iShiftL64# iShiftRA64# readFloatPMutableByteArray ByteArray unpackCString packCString# packString packStringST packNBytesST new_ps_arraywrite_ps_arrayfreeze_ps_arrayioe_unsupportedOperationreadWideCharOffPtr readIntOffPtrreadWordOffPtr readPtrOffPtrreadFunPtrOffPtrreadFloatOffPtrreadDoubleOffPtrreadStablePtrOffPtrreadInt8OffPtrreadWord8OffPtrreadInt16OffPtrreadWord16OffPtrreadInt32OffPtrreadWord32OffPtrreadInt64OffPtrreadWord64OffPtrwriteWideCharOffPtrwriteIntOffPtrwriteWordOffPtrwritePtrOffPtrwriteFunPtrOffPtrwriteFloatOffPtrwriteDoubleOffPtrwriteStablePtrOffPtrwriteInt8OffPtrwriteWord8OffPtrwriteInt16OffPtrwriteWord16OffPtrwriteInt32OffPtrwriteWord32OffPtrwriteInt64OffPtrwriteWord64OffPtr tyConCChar tyConCSChar tyConCUChar tyConCShort tyConCUShort tyConCInt tyConCUInt tyConCLong tyConCULong tyConCLLong tyConCULLong tyConCFloat tyConCDouble tyConCPtrdiff tyConCSize tyConCWchartyConCSigAtomic tyConCClock tyConCTime tyConCIntPtr tyConCUIntPtr tyConCIntMax tyConCUIntMaxwgencattowtitletowuppertowloweriswupperiswloweriswprintiswspaceiswcntrliswalnumiswalpha $fMonoidMaybeelem_byselect strictMaximum strictMinimumstrictGenericLengthnonEmptySubsequencesInserts Can'tInsert CanInsertHashDataHDtables insertionslookups totBuckets maxEntriesmaxChain maxBucketsHTkcountbmaskbucketscmphash_fntabHTArrayMutArray iNSTRUMENTED newMutArray readHTArray writeMutArrayhashData instrument recordNew recordIns recordResize recordLookupgolden hashInt32mulHi tABLE_MAX tABLE_MINhLOAD hYSTERESISbitTwiddleSameAs powerOvertooBig bucketIndex findBucketupdatingBucketexpandHashTable deleteBucket mapReducegenSymgetOrSetTypeableStoreCachenext_keytc_tblap_tblKeyPrKey isTupleTyConshowArgs showTupleunitTclistTcmaybeTcratioTcfunTcioTcmvarTcarrayTc iOArrayTcstTcstRefTc sTArrayTcpairTctup3Tctup4Tctup5Tctup6Tctup7TcptrTcfunPtrTc stablePtrTciORefTcboolTccharTcfloatTcdoubleTcintTcwordTc integerTc orderingTcint8Tcint16Tcint32Tcint64Tcword8Tcword16Tcword32Tcword64TctyconTc typeRepTc realWorldTchashKPcachenewKey mkTyConKeyappKeyappKeys $fTypeable6s $fTypeable5s $fTypeable4s $fTypeable3s $fTypeable2s $fTypeable1s $fTypeableseitherTc readEitherForeignPtrContentsPlainPtr MallocPtrPlainForeignPtr FinalizersHaskellFinalizers CFinalizers NoFinalizers foreignPtrTcnewConcForeignPtrmallocPlainForeignPtrmallocPlainForeignPtrBytesfinalizeForeignaddForeignPtrConcFinalizeraddForeignPtrConcFinalizer_noMixingforeignPtrFinalizertouchObj dynamicTc tyConWordPtr tyConIntPtrmemcpycheck HandleTypeReadWriteHandle AppendHandle WriteHandle ReadHandleSemiClosedHandle ClosedHandle BufferListBufferListCons BufferListNilHandle__haDevicehaType haByteBuffer haBufferMode haLastDecode haCharBuffer haBuffers haEncoder haDecoderhaCodec haInputNL haOutputNL haOtherSide DuplexHandle FileHandleisReadableHandleTypeisWritableHandleTypeisReadWriteHandleTypecheckHandleInvariants showHandle assertErrorunsupportedOperation InterruptedResourceVanished TimeExpiredUnsupportedOperation HardwareFaultInappropriateTypeInvalidArgument OtherError ProtocolError SystemErrorUnsatisfiedConstraints UserErrorPermissionDeniedIllegalOperationResourceExhausted ResourceBusy NoSuchThing AlreadyExists ioe_handleioe_type ioe_locationioe_description ioe_errno ioe_filenameblockedIndefinitelyOnMVarblockedIndefinitelyOnSTM stackOverflow heapOverflow ioExceptionuntangle latin1_DF latin1_EFlatin1_checked_EFioe_encodingErrorutf8_DFutf8_EF utf8_bom_DF utf8_bom_EFutf8_bom_decodeutf8_bom_encodebom0bom1bom2 utf8_decodeioe_decodingError utf8_encodeord2ord3ord4chr2chr3chr4 validate3 validate4utf16_DFutf16_EFbomBbomLutf16_native_decodeutf16_native_encode utf16be_DF utf16be_EF utf16le_DF utf16le_EF validate1 validate2utf32_DFutf32_EFbom3utf32_native_decodeutf32_native_encode utf32be_DF utf32be_EF utf32le_DF utf32le_EFvalidateFDblockedOnDeadMVarblockedIndefinitelyweakTcrunFinalizerBatch_free_realloc_malloc failWhenNULLmemmovenUL newArrayLenwNULcWcharsToCharscharsToCWcharscastCWcharToCharcastCharToCWcharstrerror set_errno get_errno errorBelchcallStackOverflowHookn_capabilities cmp_thread getThreadIdid2TSO cmpThread real_handlerunSTMstmTcbindSTMthenSTM returnSTMcheckInvtvarTcuncaughtExceptionHandlerpatternMatchFailTc recSelErrorTc recConErrorTc recUpdErrorTcnoMethodErrorTcnonTerminationTcnestedAtomicallyTccatchesHandler'getOrSetGHCConcSignalSignalHandlerStoremaxSigsignal_handlers tyConCDev tyConCIno tyConCMode tyConCOff tyConCPid tyConCSsize tyConCGid tyConCNlink tyConCUidtyConCCc tyConCSpeed tyConCTcflag tyConCRlimtyConFdsEEK_ENDsEEK_SETsEEK_CURdEFAULT_BUFFER_SIZE 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_RDONLY 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_ftruncate c_safe_writec_writec_umaskc_stat c_safe_readc_readc_openlstatc_lseekc_isattyc_fstatc_dup2c_dupc_creatc_closec_chmodc_accessset_saved_termiosget_saved_termios CFilePathCUtsnameCUtimbufCTmsCTmCTermiosCStatCSigset CSigactionCPasswdCLconvCGroupCFLock fdFileSizefileTypefdStatfdType statGetTypeioe_unknownfiletype fdGetMode withFilePath setCooked tcSetAttrsetNonBlockingFDsetCloseOnExecs_isregs_ischrs_isblks_isdirs_isfifos_issockc_localeEncodinghs_iconvhs_iconv_close hs_iconv_openIConv c_DEBUG_DUMP iconv_traceputs haskellChar char_shiftnewIConv iconvDecode iconvEncode iconvRecodeHandleFinalizer newFileHandle withHandle withHandle' withHandle_ withHandle_'withAllHandles__ withHandle__' do_operationaugmentIOErrorwantWritableHandlewantWritableHandle'checkWritableHandlewantReadableHandlewantReadableHandle_wantReadableHandle'checkReadableHandlewantSeekableHandlecheckSeekableHandleioe_closedHandleioe_EOFioe_notReadableioe_notWritableioe_notSeekableioe_cannotFlushNotSeekableioe_invalidCharacterioe_finalizedHandle ioe_bufsizhandleFinalizerdEFAULT_CHAR_BUFFER_SIZE getCharBuffer mkUnBuffer flushBufferflushCharBufferflushWriteBuffer_flushCharReadBufferflushByteReadBuffermkHandleioModeToHandleTypeinitBufferStateopenTextEncodingcloseTextCodecstrymaybehClose_handle_ noCharBuffer noByteBuffer hLookAhead_debugIOwriteTextDevicereadTextDevicereadTextDevice'readTextDeviceNonBlocking decodeByteBufAC allocArray duplicatecapacity unsafeRead unsafeWrite unsafeWrite' unsafeLoadensureCapacityensureCapacity'useAsPtrsnocclearcopycopy'removeAt firstPowerOf2 gettimeofdayCTimevalsecusecgetCurrentTimec_setIOManagerWakeupFdc_setIOManagerControlFd c_eventfdsizeof_siginfo_tW controlReadFdcontrolWriteFdcontrolEventFdControlMessage CMsgSignalCMsgDie CMsgWakeup wakeupReadFd setNonBlock newControl closeControlio_MANAGER_WAKEUPio_MANAGER_DIEreadControlMessage sendWakeupsendDie sendMessageBackend_beState_bePoll _beModifyFd _beDeleteTimeoutForever evtNothingeventIs evtCombine evtConcatbackendpollmodifyFdthrowErrnoIfMinus1NoRetry c_epoll_wait c_epoll_ctlc_epoll_create1 EventType unEventType ControlOp eventTypeseventFdEPollFd fromEPollFdEPollepollFd epollEvents available controlOpAddcontrolOpModifycontrolOpDeleteepollInepollOutepollErrepollHup epollCreate epollControl epollWait fromEventtoEvent fromTimeoutMaskIntMapBinTipNilNat natFromInt intFromNatshiftRLlookupNmember insertWith updateWith foldWithKeykeysequalnequalbinzeronomatchzeroNmaskW branchMaskhighestBitMaskasInt64 UniqueSourceUS newSourceSequTourViewPlaySingleNullLTreeRLoserLLoserStartSizePSQWinnerVoidPrioElemEkeypriovaluesize singleton toAscList toAscLists toDescList toDescListsfindMin deleteMinminView secondBestatMostatMostssize'maxKeylloserrloseromegalbalancerbalance lbalanceLeft lbalanceRight rbalanceLeft rbalanceRight lsingleLeft rsingleLeft lsingleRight rsingleRight ldoubleLeft ldoubleRight rdoubleLeft rdoubleRightplay unsafePlaytourView moduleError emptySequ singleSequ<> seqToList emBackendemFds emTimeoutsemStateemUniqueSource emControl TimeoutEdit TimeoutQueueStateFinishedDyingRunningCreatedTK keyUniqueFdDatafdKeyfdEvents _fdCallbackhandleControlEventnewDefaultBackendnewWithfinishedcleanup wakeManagereventsOf pairEvents onFdEventthreaded-getOrSetSystemEventThreadIOManagerThreadStore*getOrSetSystemEventThreadEventManagerStore threadWait eventManager ioManager unlockFilelockFileunsafe_fdReadyfdReadyfdFDfdIsNonBlockingreadBuf' writeBuf' std_flags output_flags read_flags write_flagsrw_flags append_flagsmkFDstdFDreleasesetNonBlockingModefdReadfdReadNonBlockingfdWritefdWriteNonBlockingreadRawBufferPtrreadRawBufferPtrNoBlockwriteRawBufferPtrwriteRawBufferPtrNoBlock isNonBlockingthrowErrnoIfMinus1RetryOnBlockhGetLineBufferedhGetLineBufferedLoopmaybeFillReadBufferunpack unpack_nllazyReadlazyReadBufferedgetSomeCharacters hPutcBuffered hPutCharsgetSpareBuffer writeBlocks commitBuffer commitBuffer'hPutBuf'bufWrite writeChunkwriteChunkNonBlockingbufReadNonEmpty bufReadEmptyhaFDbufReadNBEmptybufReadNBNonEmptycopyToRawBuffercopyFromRawBufferillegalBufferSizehClose_maybethrowhClose_rethrowhClose' dupHandle dupHandle_ioe_dupHandlesNotCompatible dupHandleTo showHandle'stdHandleFinalizer setBinaryModeaddFilePathToIOError openFile'dEFAULT_OPEN_IN_BINARY_MODE runMainIOstg_exitshutdownHaskellAndExitshutdownHaskellAndSignalstg_sig_installinstall_interrupt_handlermkWeakThreadIdrunIO runIOFastExitrunNonIO topHandlertopHandlerFastExitcleanUpsafeExitexitInterruptedfastExit openTempFile' pathSeparatorconrep constring confields confixitydatatypetycondatarepMpunMpQrunQrQiCONSTunCONSTIDunID mkPrimType mkPrimCon falseConstr trueConstr boolDataTypecharType floatType doubleTypeintType integerTypeint8Type int16Type int32Type int64TypewordType word8Type word16Type word32Type word64Type ratioConstr ratioDataType nilConstr consConstr listDataType nothingConstr justConstr maybeDataTypeltConstreqConstrgtConstrorderingDataType leftConstr rightConstreitherDataType tuple0Constrtuple0DataType tuple2Constrtuple2DataType tuple3Constrtuple3DataType tuple4Constrtuple4DataType tuple5Constrtuple5DataType tuple6Constrtuple6DataType tuple7Constrtuple7DataType $fEqConstr groupByFBgetFullProgArgv uniqSourceChItemchanTcqSemTcqSemNTcforkOS_createThreadforkOS_entry_reimported max_buff_sizesuckIO forkOS_entryfailNonThreaded timeoutTcIdgetIdStateR runStateRStateL runStateLtoAnnotationWrapperAnnotationWrapperS# complexTcMkFixedtyFixed conMkFixedwithTypewithResolution chopZerosshowIntegerZeroswithDot debugBelchOptKindOptErr EndOfOptsNonOptUnreqOptOptfmtOptfmtShortfmtLonggetNextlongOptshortOpterrAmbigerrReqerrUnrecerrNoArgsysconf getrusageCRUsage realToInteger clockTicks getEnvBlock setArgsPrimc_getenv getProgArgvunpackProgNamewithArgvfreeArgvsetArgscompilerVersionRaw stableNameTcUPrintfUDoubleUFloatUIntegerUStringUChartoCharfromChar toUPrintfhsprspruIntegeruprintffmtfmtifmtu integral_prectointtostritosbstoigetSpecsgetStardfmt'dfmtperrorfmterrargerrbaderrCaster exceptionTcc_pollPollFdpfdFd pfdEvents pfdReventsPoll pollChangespollFdreworkFdpollInpollOutpollErrpollHup[::]PArrMPArrmkPArr loopFromTotranspermutenoALmapEFL filterEFLfoldEFLscanEFL indexPArr writeMPArr