h,  f=      ! "#$ %&' ()* +,- . / 0 1 2 3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a b!c!d"e#f$g$hi%j%k%lmno&pqrs'tuvw(xyz{)|*}+~%,-...../00"123333345678899999::;<=22++..........................#0 +++0!0////0/0///0000>?55$@;; A0000.................!?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              B B B                      ? ?        C C D D E E E E E E C C C C  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGGHHBBBBBB4BBBBBBBBBBBBBBBBBBBBBBBIIIIJJJJKKKKL@@MMNO=%%%%%%%OO<<%%%1    @%%%%%%OOPQQRSSSSS555555555))))TTT))))TT1TTTT1T)))TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT)DUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU$$$$$$$$$$$$666$$$$&$$$$$$$$$$$$$$$$$$$$$$$$$$**V**VW*V*VWWWWWWWWWWWWWWWWWWWWWWWWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYYYXXYYYYYCCCCCCCCCCCCCCCC9CCCCCC9CCCCCC99999CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZZZZZZZZZZZZZZZZZZ    [[\\\7\\]]7\\\\\\VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV!!!    &&&&&&&&&&&&&&&&&&&&&&                         &   & &                                                                                       &&&&&&&&&    #0^^^^_`___`aaa@@?????bcbbbbbbbbbcc    11111111111111111111111111111111111111111111111111111RRRRRRdddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffffffff((((((((11&(gg(gggggg((((ggggggggggggggggggggggggggggggggggggg&&&&&&&&&&&&&&&&&&:::::::::hhhhhhiiiiiiiiiiiiiijikkikjjll>>>>>AAAAmm;;;;;;;;;;;;;;;;((((XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnoooooooooooooooooooooooooooooooooooo8888888888888888888888888888ppppppppppppppppppqqqqqqqqqrrrrrrrrrrrrrrrrrrrssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssstt:::::::::::::::::::::::::::::::::::uuuuuu11111vvvvvvvvvvvvvvvvvv////////////////////////000000000000000000000000000000000000000000000000000.................................................................................................................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!!!!!!!!!!!!!!!!!!!!!!O!O!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,!,!,!,!,!,!,!,!,!,!,!,!,!,!,!,!,!,",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",",","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"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#x#y#y#y#y#y#y##+#+#+#+#+#+#+#+#+#+#z###+#+##z#+#+#+#+#+#+#+#+#+##+#+#+##z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z################K#K#K#K#K#K#K#####M###M#M#M#M#M#{$$ ${$$$$$$@$7$@$]$]$@$$@$$@$|$$@$$$$$@$@$$@$@$}$~$}$}$}$~$~$~$~$~$~$}$~$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%L%L%L%L%L%L%L%L%L%L%L%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&L&L&L&L&&&&&&&&&&&&&&&&&&&L&&&&&&&&&&&&&&&&&&&&&&&&&&&{& & & & & & & & & & & & & & & & & & & & & & & & & & &&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & &&& & & && & & & ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))********************************************************************************************************************************++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------------------------------------------------------------------------------------------------.....................................................................................................................}.}.}.}.}......i.i/i/i/k/////j/j/j/i/j/j/i/i/i/j//j/i/i/i/i/i/j/k/j/i/i/i/i/i/i/i/i/i/i/i/i/i/k/ / /i/i/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k///////////////////////////////////////////////////|/|/|/|/|/a//////////000000000000P0P0P0P0P0P0P0P0P0P0P0P0P0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0{0b0b0b0b0b0b0b0b0b0700000000000000000000000000000000L00L00000L00000000L0L0L0L0L0L1L11L1L1L11L111111111111111y1y1y1y1y1y1y1y1y1y1y1y1y1y1y1i11i1i1i1i1i1i1j1i1111111111111111111111111111111111111111111L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L1L11111112222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222%2%2%2%2%2%2%2%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-33333Q3Q3Q3Q3Q3Q3Q3Q3Q3Q333333333333333m3m3m3J3J3J3J3J3J3J33333333333333333444444444444444444444444444444444444444444444444444444444444444 4 4 4 4 4 4 4 4 4 4 4 4 4444444444444444444444444444444444444444444444444444455555555555555555555555555555555555555555555555555555 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 555555555555555555_5_5655555555555555555555555555555555555555556666666666666666666666666666666666666666666666666666=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=6=666666666666666777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 7 7 7 7 7 77777777777777777j7j7j7j7j7j7j7j7j7j7j888888'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9'9999999999999999999999999999O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O:O::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<========================================================================FNonebaseUsed to implement (+) for the Num2 typeclass. This gives the sum of two integers.ExampleplusInteger 3 25(+) 3 25baseUsed to implement (-) for the Num9 typeclass. This gives the difference of two integers.ExampleminusInteger 3 21(-) 3 21baseUsed to implement (*) for the Num6 typeclass. This gives the product of two integers.ExampletimesInteger 3 26(*) 3 26baseUsed to implement negate for the Num typeclass. This changes the sign of whatever integer is passed into it.ExamplenegateInteger (-6)6 negate (-6)6baseUsed to implement abs for the Num typeclass. This gives the absolute value of whatever integer is passed into it.ExampleabsInteger (-6)6abs (-6)6baseUsed to implement signum for the Num typeclass. This gives 1 for a positive integer, and -1 for a negative integer.ExamplesignumInteger 51signum 51baseUsed to implement divMod for the Integral/ typeclass. This gives a tuple equivalent to (div x y, mod x y)ExampledivModInteger 10 2(5,0) divMod 10 2(5,0)baseUsed to implement div for the Integral typeclass. This performs integer division on its two parameters, truncated towards negative infinity.Example10 `divInteger` 25 10 `div` 2baseUsed to implement mod for the Integral= typeclass. This performs the modulo operation, satisfying $((x `div` y) * y) + (x `mod` y) == xExample7 `modInteger` 31 7 `mod` 31baseUsed to implement quotRem for the Integral/ typeclass. This gives a tuple equivalent to (quot x y, mod x y)ExamplequotRemInteger 10 2(5,0) quotRem 10 2(5,0)baseUsed to implement quot for the Integral typeclass. This performs integer division on its two parameters, truncated towards zero.ExamplequotInteger 10 25 quot 10 25baseUsed to implement rem for the Integral typeclass. This gives the remainder after integer division of its two parameters, satisfying %((x `quot` y) * y) + (x `rem` y) == xExampleremInteger 3 21rem 3 21baseUsed to implement (==) for the Eq typeclass. Outputs ) if two integers are equal to each other.Example6 `eqInteger` 6True6 == 6TruebaseUsed to implement (/=) for the Eq typeclass. Outputs - if two integers are not equal to each other.Example6 `neqInteger` 7True6 /= 7TruebaseUsed to implement (<=) for the Ord typeclass. Outputs ; if the first argument is less than or equal to the second.Example3 `leInteger` 5True3 <= 5TruebaseUsed to implement (>) for the Ord typeclass. Outputs 2 if the first argument is greater than the second.Example5 `gtInteger` 3True5 > 3TruebaseUsed to implement (<) for the Ord typeclass. Outputs / if the first argument is less than the second.Example3 `ltInteger` 5True3 < 5TruebaseUsed to implement (>=) for the Ord typeclass. Outputs > if the first argument is greater than or equal to the second.Example5 `geInteger` 3True5 >= 3TruebaseUsed to implement compare for the Integral typeclass. This takes two integers, and outputs whether the first is less than, equal to, or greater than the second.ExamplecompareInteger 2 10LT compare 2 10LT++GNoneHNonebaseThe 8 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 deal with errors or exceptional cases without resorting to drastic measures such as .The  type is also a monad. It is a simple kind of error monad, where all errors are represented by 0. A richer error monad can be built using the ; type.basebaseB Trustworthy( base Construct  value from list of s.base6Test whether all internal invariants are satisfied by  valueThis operation is mostly useful for test-suites and/or code which constructs  values directly.base Additionbase subtraction. May | |.base subtraction. Returns s for non-positive results.base multiplicationbase Compute greatest common divisor.baseCompute least common multiple. base basebase Construct  from  value.baseTry downcasting  to  value. Returns  if value doesn't fit in .base" b e m" computes base b raised to exponent e modulo m." $ I"(c) The University of Glasgow 2015see libraries/ghc-prim/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy/0Ū _ base The empty .` base Push a call-site onto the stack.(This function has no effect on a frozen .bases are a lightweight method of obtaining a partial call-stack at any point in the program..A function can request its call-site with the ( constraint. For example, we can define 9putStrLnWithCallStack :: HasCallStack => String -> IO () as a variant of putStrLn that will get its call-site and print it, along with the string given as argument. We can access the call-stack inside putStrLnWithCallStack with .:{8putStrLnWithCallStack :: HasCallStack => String -> IO ()putStrLnWithCallStack msg = do putStrLn msg& putStrLn (prettyCallStack callStack):}Thus, if we call putStrLnWithCallStack: we will get a formatted call-stack alongside our string.putStrLnWithCallStack "hello"helloCallStack (from HasCallStack): putStrLnWithCallStack, called at :... in interactive:Ghci... GHC solves  constraints in three steps: If there is a 3 in scope -- i.e. the enclosing function has a  constraint -- GHC will append the new call-site to the existing .If there is no  in scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer a  constraint for the enclosing definition (subject to the monomorphism restriction).If there is no  in scope and the enclosing definition has an explicit type signature, GHC will solve the " constraint for the singleton + containing just the current call-site.s do not interact with the RTS and do not require compilation with -prof>. On the other hand, as they are built up explicitly via the  constraints, they will generally not contain as much information as the simulated call-stacks maintained by the RTS.A  is a [(String, SrcLoc)]. The String/ is the name of function that was called, the  is the call-site. The list is ordered with the most recently called function at the head.(NOTE: The intrepid user may notice that - is just an alias for an implicit parameter ?callStack :: CallStack(. This is an implementation detail and  should not be considered part of the  API, we may decide to change the implementation in the future.base%A single location in the source code.baseFreeze the stack at the given  CallStack?, preventing any further call-sites from being pushed onto it. baseRequest a CallStack.NOTE: The implicit parameter ?callStack :: CallStack" is an implementation detail and  should not be considered part of the  API, we may decide to change the implementation in the future.base&Extract a list of call-sites from the .(The list is ordered by most recent call. base"Convert a list of call-sites to a . baseFreeze a call-stack, preventing any further call-sites from being appended.pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack base_`_`N((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthy01Fbase/ stops execution and displays an error message. base A variant of % that does not produce a stack trace.baseA special case of . It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which  appears.baseUsed for compiler-generated error message; encoding saves bytes of string junk.((c) The University of Glasgow, 1992-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)Unsafe 015base'A list producer that can be fused with . This function is merely  augment g xs = g (:) xs?but GHC's 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.base appends two lists, i.e., [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]>If the first list is not finite, the result is the first list.Performance considerationsThis function takes linear time in the number of elements of the first list. Thus it is better to associate repeated applications of 1 to the right (which is the default behaviour): xs ++ (ys ++ zs) or simply xs ++ ys ++ zs , but not (xs ++ ys) ++ zs. For the same reason  =   [] has linear performance, while   [] is prone to quadratic slowdownExamples[1, 2, 3] ++ [4, 5, 6] [1,2,3,4,5,6][] ++ [1, 2, 3][1,2,3][3, 2, 1] ++ [][3,2,1]base'A list producer that can be fused with . This function is merely  build g = g (:) []?but GHC's 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.base, applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left: foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)baseThis  equality predicate is used when desugaring pattern-matches against strings.base is defined as the value /. It helps to make guards more readable. eg. - f x | x < 0 = ... | otherwise = ...base#If the first argument evaluates to 9, then the result is the second argument. Otherwise an |$ exception is raised, containing a 6 with the source file and line number of the call to .Assertions can normally be turned on or off with a compiler flag (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.)base\mathcal{O}(n). ) f xs" is the list obtained by applying f to each element of xs, i.e., map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] map f [x1, x2, ...] == [f x1, f x2, ...]this means that  map id == idExamplesmap (+1) [1, 2, 3][2,3,4]map id [1, 2, 3][1,2,3]map (\n -> 3 * n + 1) [1, 2, 3][4,7,10]*base* is the function application operator. Applying * to a function f and an argument x# gives the same result as applying f to x* directly. The definition is akin to this: (($) :: (a -> b) -> a -> b ($) f x = f x This is  specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->) is the same as (a -> b) -> a -> b.On the face of it, this may appear pointless! But it's actually one of the most useful and important operators in Haskell.2The order of operations is very different between ($) and normal function application. Normal function application has precedence 10 - higher than any operator - and associates to the left. So these two definitions are equivalent: *expr = min 5 1 + 5 expr = ((min 5) 1) + 5 ($) has precedence 0 (the lowest) and associates to the right, so these are equivalent: ,expr = min 5 $ 1 + 5 expr = (min 5) (1 + 5) ExamplesA common use cases of ($)0 is to avoid parentheses in complex expressions.For example, instead of using nested parentheses in the following Haskell function: -- | Sum numbers in a string: strSum "100 5 -7" == 98 strSum ::  ->  strSum s = sum (5 ( (words s)) 0we can deploy the function application operator: -- | Sum numbers in a string: strSum "100 5 -7" == 98 strSum ::  ->  strSum s = sum * 5 ( * words s ($) is also used as a section (a partially applied operator), in order to indicate that we wish to apply some yet-unspecified function to a given value. For example, to apply the argument 5 to a list of functions: applyFive :: [Int] applyFive = map ($ 5) [(+1), (2^)] >>> [6, 32] .Technical Remark (Representation Polymorphism)($) is fully representation-polymorphic. This allows it to also be used with arguments of unlifted and even unboxed kinds, such as unboxed integers: fastMod :: Int -> Int -> Int fastMod (I# x) (I# m) = I# $ remInt# x m >baseSequentially compose two actions, passing any value produced by the first as an argument to the second.'as > bs' can be understood as the do expression do a <- as bs a ?baseSequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.'as ? bs' can be understood as the do expression  do as bs @base@% is used to apply a function of type (a -> b) to a value of type f a4, where f is a functor, to produce a value of type f b. Note that for any type constructor with more than one parameter (e.g., Either6), only the last type parameter can be modified with @ (e.g., b in `Either a b`).:Some type constructors with two parameters or more have a  instance that allows both the last and the penultimate parameters to be mapped over.ExamplesConvert from a 5 Int to a  Maybe String using :fmap show NothingNothingfmap show (Just 3)Just "3"Convert from an ; Int Int to an Either Int String using :fmap show (Left 17)Left 17fmap show (Right 17) Right "17"Double each element of a list:fmap (*2) [1,2,3][2,4,6]Apply ! to the second element of a pair:fmap even (2,2)(2,True)It may seem surprising that the function is only applied to the last element of the tuple compared to the list example above which applies it to every element in the list. To understand, remember that tuples are type constructors with multiple type parameters: a tuple of 3 elements (a,b,c) can also be written  (,,) a b c and its Functor instance is defined for Functor ((,,) a b) (i.e., only the third parameter is free to be mapped over with fmap).It explains why fmap can be used with tuples containing values of different types as in the following example:fmap even ("hello", 1.0, 4)("hello",1.0,True)Abase%Inject a value into the monadic type.[baseAn associative operation.Examples[1,2,3] <> [4,5,6] [1,2,3,4,5,6] Just [1, 2, 3] <> Just [4, 5, 6]Just [1,2,3,4,5,6]%putStr "Hello, " <> putStrLn "World!" Hello, World!\base Identity of ]Examples"Hello world" <> mempty "Hello world"mempty <> [1, 2, 3][1,2,3]]baseAn associative operationNOTE?: This method is redundant and has the default implementation ] = ([) since  base-4.11.0.0,. Should it be implemented manually, since ] is a synonym for ([), it is expected that the two functions are defined the same way. In a future GHC release ] will be removed from .^baseFold 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.&mconcat ["Hello", " ", "Haskell", "!"]"Hello Haskell!"hbaseThe h function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.'h bss' can be understood as the do expression do bs <- bss bs ExamplesA common use of h is to run an  computation returned from an i transaction, since i transactions can't perform  directly. Recall that i :: STM a -> IO a is used to run i< transactions atomically. So, by specializing the types of i and h to i :: STM (IO b) -> IO (IO b) h :: IO (IO b) -> IO b we can compose them as h . i :: STM (IO b) -> IO b  to run an i transaction and the  action it returns.ibaseSequential application.,A few functors support an implementation of i. that is more efficient than the default one.ExampleUsed in combination with (<$>), (i) can be used to build a record.>data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}$produceFoo :: Applicative f => f Foo$produceBar :: Applicative f => f Bar$produceBaz :: Applicative f => f Baz%mkState :: Applicative f => f MyState>mkState = MyState <$> produceFoo <*> produceBar <*> produceBazjbase Lift a value.kbase=Sequence actions, discarding the value of the first argument.Examples9If used in conjunction with the Applicative instance for , you can chain Maybe computations, with a possible "early return" in case of .Just 2 *> Just 3Just 3Nothing *> Just 3NothingOf course a more interesting use case would be to have effectful computations instead of just returning pure values.import Data.Char#import Text.ParserCombinators.ReadP5let p = string "my name is " *> munch1 isAlpha <* eofreadP_to_S p "my name is Simon"[("Simon","")]rbaseThe r+ class defines the basic operations over a monad2, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Instances of r should satisfy the following:  Left identityA a > k = k aRight identitym > A = m Associativitym > (\x -> k x > h) = (m > k) > hFurthermore, the r and % operations should relate as follows: j = A m1 i m2 = m1 > (\x1 -> m2 > (\x2 -> A (x1 x2)))The above laws imply: @ f xs = xs > A . f (?) = (k) and that j and (i') satisfy the applicative functor laws.The instances of r for lists, 5 and  defined in the Prelude satisfy these laws.tbaseA type f( is a Functor if it provides a function fmap which, given any types a and b" lets you apply any function from (a -> b) to turn an f a into an f b, preserving the structure of f. Furthermore f" needs to adhere to the following: Identity@  ==  Composition@ (f . g) == @ f . @ gNote, that the second law follows from the free theorem of the type @ and the first law, so you need only check that the former condition holds. See  :https://www.schoolofhaskell.com/user/edwardk/snippets/fmap or  https://github.com/quchen/articles/blob/master/second_functor_law.md for an explanation.base3A functor with application, providing operations toembed pure expressions (j), and1sequence computations and combine their results (i and ).>A minimal complete definition must include implementations of j and of either i or . If it defines both, then they must behave the same as their default definitions: (i) =    f x y = f  x i y3Further, any definition must satisfy the following: Identity j  i v = v Composition j (.) i u i v i w = u i (v i w) Homomorphism j f i j x = j (f x) Interchange u i j y = j (* y) i uThe other methods have the following default definitions, which may be overridden with equivalent specialized implementations: u k v = (  u) i v u  v =   u v$As a consequence of these laws, the t instance for f will satisfy @ f x = j f i x'It may be useful to note that supposing !forall x y. p (q x y) = f x . g yit follows from the above that  p ( q u v) =  f u .  g vIf f is also a r, it should satisfy j = A m1 i m2 = m1 > (\x1 -> m2 > (\x2 -> A (x1 x2))) (k) = (?)(which implies that j and i' satisfy the applicative functor laws). baseThe class of semigroups (types with an associative binary operation).'Instances should satisfy the following:  Associativityx [ (y [ z) = (x [ y) [ zYou can alternatively define  instead of ([), in which case the laws are: Unit (j x) = xMultiplication (h xss) =  (@  xss)baseThe class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following: Right identityx [ \ = x Left identity\ [ x = x Associativityx [ (y [ z) = (x [ y) [ z ( law) Concatenation^ =  ([) \You can alternatively define ^ instead of \, in which case the laws are: Unit^ (j x) = xMultiplication^ (h xss) = ^ (@ ^ xss)Subclass^ (toList xs) =  xsThe method names refer to the monoid of lists under concatenation, but there are many other instances.Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of , e.g. O and O.NOTE:  is a superclass of  since  base-4.11.0.0.base& is an alias for a list of characters./String constants in Haskell are values of type 1. That means if you write a string literal like  "hello world", it will have the type [Char], which is the same as String.Note: You can ask the compiler to automatically infer different types with the -XOverloadedStrings# language extension, for example "hello world" :: Text. See  for more information.Because String is just a list of characters, you can use normal list functions to do basic string manipulation. See  Data.List for operations on lists.Performance considerations[Char] is a relatively memory-inefficient type. It is a linked list of boxed word-size characters, internally it looks something like: JJJJJJJJJJJJJJ JJJJJJJJJJJJJJ JJJJJJJJJJJJJJ JJJJJJ J (:) J J JJJ>J (:) J J JJJ>J (:) J J JJJ>J [] J JJJJJJJJJJJJJJ JJJJJJJJJJJJJJ JJJJJJJJJJJJJJ JJJJJJ v v v 'a' 'b' 'c'The String "abc" will use  5*3+1 = 16 (in general 5n+1) words of space in memory.Furthermore, operations like  (string concatenation) are O(n) (in the left argument).For historical reasons, the base library uses String in a lot of places for the conceptual simplicity, but library code dealing with user-data should use the  (https://hackage.haskell.org/package/texttext( package for Unicode text, or the the  .https://hackage.haskell.org/package/bytestring bytestring package for binary data.baseUninhabited data type base%Non-empty (and non-strict) list type.base,Monads that also support choice and failure.baseThe identity of '. It should also satisfy the equations +mzero >>= f = mzero v >> mzero = mzeroThe default definition is mzero =  base3An associative operation. The default definition is  mplus = () base!A monoid on applicative functors. If defined,  and 1 should be the least solutions of the equations:  v = (:)  v i  v  v =  v  j []baseThe identity of baseAn associative binary operationbase One or more.base Zero or more.base"Lift a binary function to actions.+Some functors support an implementation of  that is more efficient than the default one. In particular, if @8 is an expensive operation, it is likely better to use  than to @! over the structure and then use i.This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of i and @.ExampleliftA2 (,) (Just 3) (Just 5) Just (3,5)base>Sequence actions, discarding the value of the second argument.baseReplace all locations in the input with the same value. The default definition is @ . <, but this may be overridden with a more efficient version.ExamplesPerform a computation with 8 and replace the result with a constant value if it is : 'a' <$ Just 2Just 'a''a' <$ NothingNothingbaseReduce a non-empty list with [The default definition should be sufficient, but this can be overridden for efficiency.Examples8For the following examples, we will assume that we have:)import Data.List.NonEmpty (NonEmpty (..))*sconcat $ "Hello" :| [" ", "Haskell", "!"]"Hello Haskell!"5sconcat $ Just [1, 2, 3] :| [Nothing, Just [4, 5, 6]]Just [1,2,3,4,5,6].sconcat $ Left 1 :| [Right 2, Left 3, Right 4]Right 2baseRepeat a value n times.The default definition will raise an exception for a multiplier that is <= 0. This may be overridden with an implementation that is total. For monoids it is preferred to use  stimesMonoid.By making this a member of the class, idempotent semigroups and monoids can upgrade this to execute in \mathcal{O}(1) by picking  stimes = O or  stimes = O respectively.Examples stimes 4 [1] [1,1,1,1]stimes 5 (putStr "hi!")hi!hi!hi!hi!hi!stimes 3 (Right ":)") Right ":)"baseSince  values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet".%let x :: Either Void Int; x = Right 5:{ case x of Right r -> r Left l -> absurd l:}5baseIf  is uninhabited then any t! that holds only values of type 6 is holding no values. It is implemented in terms of  fmap absurd.base A variant of i< with the types of the arguments reversed. It differs from  i in that the effects are resolved in the order the arguments are presented.Examples (<**>) (print 1) (id <$ print 2)12$flip (<*>) (print 1) (id <$ print 2)21base5Lift a function to actions. Equivalent to Functor's @ but implemented using only  's methods:  f a = j f i a1As such this function may be used to implement a t instance from an  one.Examples)Using the Applicative instance for Lists:liftA (+1) [1, 2][2,3] Or the Applicative instance for liftA (+1) (Just 3)Just 4base#Lift a ternary function to actions.baseSame as >&, but with the arguments interchanged.baseConditional execution of  expressions. For example, !when debug (putStrLn "Debugging")will output the string  Debugging if the Boolean value debug is , and otherwise do nothing.baseEvaluate each action in the sequence from left to right, and collect the results.base f is equivalent to  . ) f.basePromote a function to a monad.basePromote 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 = NothingbasePromote a function to a monad, scanning the monadic arguments from left to right (cf. ).basePromote a function to a monad, scanning the monadic arguments from left to right (cf. ).basePromote a function to a monad, scanning the monadic arguments from left to right (cf. ).baseIn many situations, the ' operations can be replaced by uses of &, which promotes function application. !return f `ap` x1 `ap` ... `ap` xnis equivalent to liftMn f x1 x2 ... xnbaseThe  method restricted to the type 1.baseIdentity function. id x = xThis function might seem useless at first glance, but it can be very useful in a higher order context.Examples,length $ filter id [True, True, False, True]3Just (Just 3) >>= idJust 3foldr id 0 [(^3), (*5), (+2)]1000base const x y always evaluates to x, ignoring its second argument. const x = \_ -> xThis function might seem useless at first glance, but it can be very useful in a higher order context.Examplesconst 42 "hello"42map (const 42) [0..3] [42,42,42,42]base#Right to left function composition.(f . g) x = f (g x)f . id = f = id . fExamples(map ((*2) . length) [[], [0, 1, 2], [0]][0,6,2]!foldr (.) id [(+1), (*3), (^3)] 225(let (...) = (.).(.) in ((*2)...(+)) 5 1030base f9 takes its (first) two arguments in the reverse order of f.flip f x y = f y xflip . flip = idExamplesflip (++) "hello" "world" "worldhello"'let (.>) = flip (.) in (+1) .> show $ 5"6"baseStrict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.base p f yields the result of applying f until p holds.base! is a type-restricted version of . It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.baseReturns the tag of a constructor application; this function is used by the deriving code for Eq, Ord and Enum.baseUsed to implement quot for the q typeclass. This performs integer division on its two parameters, truncated towards zero.Example quotInt 10 25 quot 10 25baseUsed to implement rem for the q typeclass. This gives the remainder after integer division of its two parameters, satisfying %((x `quot` y) * y) + (x `rem` y) == xExample remInt 3 21rem 3 21baseUsed to implement div for the q typeclass. This performs integer division on its two parameters, truncated towards negative infinity.Example 10 `divInt` 25 10 `div` 25baseUsed to implement mod for the q= typeclass. This performs the modulo operation, satisfying $((x `div` y) * y) + (x `mod` y) == xExample 7 `modInt` 31 7 `mod` 31baseUsed to implement quotRem for the q/ typeclass. This gives a tuple equivalent to (quot x y, mod x y)ExamplequotRemInt 10 2(5,0) quotRem 10 2(5,0)baseUsed to implement divMod for the q/ typeclass. This gives a tuple equivalent to (div x y, mod x y)ExampledivModInt 10 2(5,0) divMod 10 2(5,0)baseThis function is used to implement branchless shifts. If the number of bits to shift is greater than or equal to the type size in bits, then the shift must return 0. Instead of doing a test, we use a mask obtained via this function which is branchless too.shift_mask m b | b < m = 0xFF..FF | otherwise = 0baseShift the argument left by the specified number of bits (which must be non-negative).baseShift the argument right by the specified number of bits (which must be non-negative). The RL means "right, logical" (as opposed to RA for arithmetic) (although an arithmetic right shift wouldn't make sense for Word#)baseShift the argument left by the specified number of bits (which must be non-negative).baseShift the argument right (signed) by the specified number of bits (which must be non-negative). The RA9 means "right, arithmetic" (as opposed to RL for logical)baseShift the argument right (unsigned) by the specified number of bits (which must be non-negative). The RL9 means "right, logical" (as opposed to RA for arithmetic)basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase baseTakes the first non-throwing  action's result.  throws an exception.base>Combines lists by concatenation, starting from the empty list.basePicks the leftmost  value, or, alternatively, . baseTakes the first non-throwing  action's result.  throws an exception.base>Combines lists by concatenation, starting from the empty list.basePicks the leftmost  value, or, alternatively, . base base base base base base base base base basebase base base base base base basebasebasebasebase basebaseFor tuples, the  constraint on a7 determines how the first values merge. For example, s concatenate: <("hello ", (+15)) <*> ("world!", 2002) ("hello world!",2017)baseLift a semigroup into  forming a  according to  #http://en.wikipedia.org/wiki/Monoid: "Any semigroup S= may be 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 D S." Since 4.11.0: constraint on inner a value generalised from  to .basebasebasebasebasebasebasebasebase base basebasebase *h)"== ============ ====  (&= #,%3                                           X                                                                         kijt@r?>A]^\[n ;==v < ~ ==  ==      r?>Ajikt@h\]^*[)" *>?[ik  TrustworthyG/4baseStop heap profiling. Note: This won't do anything unless you also specify a profiling mode on the command line using the normal RTS options.4baseStart heap profiling. This is called normally by the RTS on start-up, but can be disabled using the rts flag `--no-automatic-heap-samples` Note: This won't do anything unless you also specify a profiling mode on the command line using the normal RTS options.4baseRequest a heap census on the next context switch. The census can be requested whether or not the heap profiling timer is running. Note: This won't do anything unless you also specify a profiling mode on the command line using the normal RTS options.4baseStart attributing ticks to cost centres. This is called by the RTS on startup.4baseStop attributing ticks to cost centres. Allocations will still be attributed.4444444444S'(c) The University of Glasgow 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) TrustworthyP" 4baseConversion from an . An integer literal represents the application of the function 4" to the appropriate value of type , so such literals have type (u a) => a.=baseUnary negation.ubaseBasic numeric class.'The Haskell Report defines no laws for u . However, () and () are customarily expected to define a ring and have the following properties: Associativity of () (x + y) + z =  x + (y + z)Commutativity of ()x + y = y + x4 0 is the additive identityx + fromInteger 0 = x= gives the additive inverse x + negate x =  fromInteger 0Associativity of () (x * y) * z =  x * (y * z)4 1 is the multiplicative identityx * fromInteger 1 = x and fromInteger 1 * x = xDistributivity of () with respect to () a * (b + c) = (a * b) + (a * c) and  (b + c) * a = (b * a) + (c * a)Coherence with  toIntegerif the type also implements $, then 4 is a left inverse for $, i.e. fromInteger (toInteger i) == i Note that it isn't3 customarily expected that a type instance of both u and v' implement an ordered ring. Indeed, in base only  and 6 do.baseAbsolute value.base!Sign of a number. The functions  and  should satisfy the law: abs x * signum x == xFor real numbers, the  is either -1 (negative), 0 (zero) or 1 (positive).base the same as  (5).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.base Note that 's u instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.basebasebase===============================>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>??????????????????????u54=?????u54=5c"(c) The University of Glasgow 2008see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe`E baseAn  (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.base Create an  which is initially empty.base Create an # which contains the supplied value.baseReturn the contents of the  . If the  is currently empty, & will wait until it is full. After a , the  is left empty..There are two further important properties of : is single-wakeup. That is, if there are multiple threads blocked in  , and the  becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its  operation.(When multiple threads are blocked on an , they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using s.base#Atomically read the contents of an  . If the  is currently empty,  will wait until it is full. # is guaranteed to receive the next . is multiple-wakeup, so when multiple readers are blocked on an ,, all of them are woken up at the same time.Compatibility note: Prior to base 4.7,  was a combination of  and . This mean that in the presence of other threads attempting to ,  could block. Furthermore,  would not receive the next 3 if there was already a pending thread blocked on . The old behavior can be recovered by implementing 'readMVar as follows:  readMVar :: MVar a -> IO a readMVar m = mask_ $ do a <- takeMVar m putMVar m a return a basePut a value into an  . If the  is currently full, " will wait until it becomes empty..There are two further important properties of : is single-wakeup. That is, if there are multiple threads blocked in  , and the  becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its  operation.(When multiple threads are blocked on an , they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using s.baseA non-blocking version of . The % function returns immediately, with  if the  was empty, or  a if the  was full with contents a . After , the  is left empty.baseA non-blocking version of . The % function attempts to put the value a into the  , returning  if it was successful, or  otherwise.baseA non-blocking version of . The % function returns immediately, with  if the  was empty, or  a if the  was full with contents a.baseCheck whether a given  is empty.Notice that the boolean value returned is just a snapshot of 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  instead if possible.baseAdd a finalizer to an  (GHC only). See Foreign.ForeignPtr and System.Mem.Weak for more about finalizers.base  '(c) The University of Glasgow 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafeqbase!This is the "back door" into the  monad, allowing  computation to be performed at any time. For this to be safe, the  computation should be free of side effects and independent of its environment."If the I/O computation wrapped in  performs side effects, 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  to cause side-effects, you should take the following precautions to ensure the side effects are performed as many times as you 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 elimination being performed on the module, which might combine two side effects that were meant to be separate. A good example is using multiple global variables (like test in the example below).7Make 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: 8 f x = unsafePerformIO (newIORef [])  you may get only one reference cell shared between all calls to f". Better would be 9 f x = unsafePerformIO (newIORef [x]) 7 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])This program will core dump. This problem with polymorphic references is well known in the ML community, and does not arise with normal monadic 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!/WARNING: If you're looking for "a way to get a  from an 'IO String'", then 8 is not the way to go. Learn about do-notation and the <-# syntax element before you proceed.baseThis version of  is more efficient because it omits the check that the IO is only being performed by a single thread. Hence, when you use , there is a possibility that the IO action may be performed multiple times (on a multiprocessor), and you should therefore ensure that it gives the same results each time. It may even happen that one of the duplicated IO actions is only run partially, and then interrupted in the middle without an exception being raised. Therefore, functions like | cannot be used safely within .base allows an  computation to be deferred lazily. When passed a value of type IO a, the . will only be performed when the value of the a is demanded. This is used to implement lazy file reading, see .base allows an  computation to be deferred lazily. When passed a value of type IO a, the . will only be performed when the value of the a is demanded.The computation may be performed multiple times by different threads, possibly at the same time. To ensure that the computation is performed only once, use  instead.baseEnsures that the suspensions under evaluation by the current thread are unique; that is, the current thread is not evaluating anything that is also under evaluation by another thread that has also executed .,This operation is used in the definition of  to prevent the IO action from being executed multiple times, which is usually undesirable.None qW Trustworthyq"(c) The University of Glasgow 2012see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Nones baseA monad that can execute GHCi statements by lifting them out of m into the IO monad. (e.g state monads)4base"A monad that doesn't allow any IO.4base4base4base4base4baseS4S4Z(c) Daniel Fischer 2010see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthys[(c) Daniel Fischer 2010see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthyt?base&Number of trailing zero bits in a byteNonet?????? Trustworthyu.(c) The University of Glasgowsee libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthyu?"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthyxbase&Extract the first component of a pair.base'Extract the second component of a pair.base6 converts an uncurried function to a curried function.Examples curry fst 1 21base4 converts a curried function to a function on pairs.Examplesuncurry (+) (1,2)3uncurry ($) (show, 1)"1"'map (uncurry max) [(1,2), (3,4), (6,8)][2,4,8]baseSwap the components of a pair.      "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable TrustworthyjbaseAn infix synonym for @.,The name of this operator is an allusion to -. Note the similarities between their types:  ($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f bWhereas  is function application, ( is function application lifted over a t.ExamplesConvert from a 5 3 to a 5  using :show <$> NothingNothingshow <$> Just 3Just "3"Convert from an ; 3 3 to an ; 3  using :show <$> Left 17Left 17show <$> Right 17 Right "17"Double each element of a list:(*2) <$> [1,2,3][2,4,6]Apply ! to the second element of a pair:even <$> (2,2)(2,True) baseFlipped version of . () =  @ ExamplesApply (+1) to a list, a 5 and a ;:Just 2 <&> (+1)Just 3[1,2,3] <&> (+1)[2,3,4]Right 3 <&> (+1)Right 4baseFlipped version of .ExamplesReplace the contents of a 5 3 with a constant :Nothing $> "foo"NothingJust 90210 $> "foo" Just "foo"Replace the contents of an ; 3 3 with a constant , resulting in an ; 3 :Left 8675309 $> "foo" Left 8675309Right 8675309 $> "foo" Right "foo"/Replace each element of a list with a constant :[1,2,3] $> "foo"["foo","foo","foo"]5Replace the second element of a pair with a constant :(1,2) $> "foo" (1,"foo")baseGeneralization of  Data.List..base value discards or ignores the result of evaluation, such as the return value of an  action.ExamplesReplace the contents of a 5 3 with unit: void NothingNothing void (Just 3)Just ()Replace the contents of an ; 3 3 with unit, resulting in an ; 3 ():void (Left 8675309) Left 8675309void (Right 8675309)Right ()*Replace every element of a list with unit: void [1,2,3] [(),(),()]/Replace the second element of a pair with unit: void (1,2)(1,())Discard the result of an  action:mapM print [1,2]12[(),()]void $ mapM print [1,2]12t@ t@"(c) The University of Glasgow 2005/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy;n ;n; "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableUnsafe33"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable TrustworthybaseCase analysis for the  type.  x y p evaluates to x when p is , and evaluates to y when p is .This is equivalent to if p then y else x; that is, one can think of it as an if-then-else construct with its arguments reordered.Examples Basic usage:bool "foo" "bar" True"bar"bool "foo" "bar" False"foo" Confirm that  x y p and if p then y else x are equivalent:"let p = True; x = "bar"; y = "foo" bool x y p == if p then y else xTrue let p = False bool x y p == if p then y else xTrue   ^4BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstable not portableSafe 01base1Type-level "not". An injective type family since 4.10.0.0.baseType-level "or"baseType-level "and"base Type-level If.  If True a b ==> a;  If False a b ==> b Nils Anders Danielsson 2006 , Alexander Berntsen 20144BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy0base f* is the least fixed point of the function f, i.e. the least defined x such that f x = x.When f is strict, this means that because, by the definition of strictness, f E = E and such the least defined fixed point of any strict function is E.Examples=We can write the factorial function using direct recursion as8let fac n = if n <= 1 then 1 else n * fac (n-1) in fac 5120"This uses the fact that Haskell@s let introduces recursive bindings. We can rewrite this definition using ,Instead of making a recursive call, we introduce a dummy parameter rec; when used within  , this parameter then refers to 2@s argument, hence the recursion is reintroduced.5fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5120Using , we can implement versions of  as   (:) and  as   (++)take 10 $ fix (0:)[0,0,0,0,0,0,0,0,0,0]map (fix (\rec n -> if n < 2 then n else rec (n - 1) + rec (n - 2))) [1..10][1,1,2,3,5,8,13,21,34,55]Implementation DetailsThe current implementation of  uses structural sharing  f = let x = f x in x>A more straightforward but non-sharing version would look like  f = f ( f)base b u x y runs the binary function b on) the results of applying unary function u to two arguments x and y. From the opposite perspective, it transforms two inputs and combines the outputs. (op `` f) x y = f x `op` f yExamples9sortBy (compare `on` length) [[0, 1, 2], [0, 1], [], [0]][[],[0],[0,1],[0,1,2]] ((+) `on` length) [1, 2, 3] [-1]4((,) `on` (*2)) 2 3(4,6)Algebraic properties  (*) `on`  = (*) -- (if (*) D {E,  E}) &((*) `on` f) `on` g = (*) `on` (f . g)  on f .  on g =  on (g . f)base is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator *, which allows  to be nested in *.This is a version of  , where  is specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->) is (a -> b) -> a -> b. flipping this yields a -> (a -> b) -> b which is the type signature of Examples5 & (+1) & show"6".sqrt $ [1 / n^2 | n <- [1..1000]] & sum & (*6)3.1406380562059946base applies a function to a value if a condition is true, otherwise, it returns the value unchanged.It is equivalent to  ( ).Examples,map (\x -> applyWhen (odd x) (*2) x) [1..10][2,2,6,4,10,6,14,8,18,10]map (\x -> applyWhen (length x > 6) ((++ "...") . take 3) x) ["Hi!", "This is amazing", "Hope you're doing well today!", ":D"]["Hi!","Thi...","Hop...",":D"]Algebraic properties  applyWhen  =   applyWhen  f =  * *(C) 2015 David Luposchainsky, (C) 2015 Herbert Valerio Riedel BSD-style (see the file LICENSE)libraries@haskell.org provisionalportable Trustworthy% baseWhen a value is bound in do1-notation, the pattern on the left hand side of <- might not match. In this case, this class provides a function to recover.A r without a  instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (~pat). Instances of # should satisfy the following law: fail s should be a left zero for , fail s >>= f = fail s If your r is also , a popular definition is fail _ = mzero fail s should be an action that runs in the monad itself, not an exception (except in instances of MonadIO). In particular, fail' should not be implemented in terms of error. base base baseCC5"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy baseThe 3 function takes a default value, a function, and a  value. If the  value is , the function returns the default value. Otherwise, it applies the function to the value inside the  and returns the result.Examples Basic usage:maybe False odd (Just 3)Truemaybe False odd NothingFalse$Read an integer from a string using (;. If we succeed, return twice the integer; that is, apply (*2)8 to it. If instead we fail to parse an integer, return 0 by default:import Text.Read ( readMaybe )maybe 0 (*2) (readMaybe "5")10maybe 0 (*2) (readMaybe "")0Apply  to a  Maybe Int . If we have Just n", we want to show the underlying  n. But if we have , we return the empty string instead of (for example) "Nothing":maybe "" show (Just 5)"5"maybe "" show Nothing""baseThe  function returns " iff its argument is of the form Just _.Examples Basic usage:isJust (Just 3)TrueisJust (Just ())TrueisJust NothingFalse7Only the outer constructor is taken into consideration:isJust (Just Nothing)TruebaseThe  function returns  iff its argument is .Examples Basic usage:isNothing (Just 3)FalseisNothing (Just ())FalseisNothing NothingTrue7Only the outer constructor is taken into consideration:isNothing (Just Nothing)FalsebaseThe ( function extracts the element out of a ) and throws an error if its argument is .Examples Basic usage:fromJust (Just 1)12 * (fromJust (Just 10))202 * (fromJust Nothing)&*** Exception: Maybe.fromJust: Nothing...WARNING: This function is partial. You can use case-matching instead.baseThe & function takes a default value and a  value. If the  is , it returns the default value; otherwise, it returns the value contained in the .Examples Basic usage:#fromMaybe "" (Just "Hello, World!")"Hello, World!"fromMaybe "" Nothing""$Read an integer from a string using (5. If we fail to parse an integer, we want to return 0 by default:import Text.Read ( readMaybe )fromMaybe 0 (readMaybe "5")5fromMaybe 0 (readMaybe "")0baseThe , function returns an empty list when given  or a singleton list when given .Examples Basic usage:maybeToList (Just 7)[7]maybeToList Nothing[] One can use  to avoid pattern matching when combined with a function that (safely) works on lists:import Text.Read ( readMaybe )!sum $ maybeToList (readMaybe "3")3 sum $ maybeToList (readMaybe "")0baseThe  function returns  on an empty list or  a where a" is the first element of the list.Examples Basic usage:listToMaybe []NothinglistToMaybe [9]Just 9listToMaybe [1,2,3]Just 1 Composing  with 2 should be the identity on singleton/empty lists:maybeToList $ listToMaybe [5][5]maybeToList $ listToMaybe [][],But not on lists with more than one element:!maybeToList $ listToMaybe [1,2,3][1]baseThe  function takes a list of !s and returns a list of all the  values.Examples Basic usage:#catMaybes [Just 1, Nothing, Just 3][1,3]When constructing a list of  values,  can be used to return all of the "success" results (if the list is the result of a ), then  would be more appropriate):import Text.Read ( readMaybe )4[readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][Just 1,Nothing,Just 3]catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][1,3]baseThe  function is a version of ) which can throw out elements. In particular, the functional argument returns something of type  b. If this is 8, no element is added on to the result list. If it is  b, then b! is included in the result list.ExamplesUsing  f x is a shortcut for  $ ) f x in most cases:import Text.Read ( readMaybe )3let readMaybeInt = readMaybe :: String -> Maybe Int'mapMaybe readMaybeInt ["1", "Foo", "3"][1,3].catMaybes $ map readMaybeInt ["1", "Foo", "3"][1,3]If we map the 1 constructor, the entire list should be returned:mapMaybe Just [1,2,3][1,2,3]  '(c) The University of Glasgow 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy6baseConcatenate a list of lists.Examples concat [[1,2,3], [4,5], [6], []] [1,2,3,4,5,6] concat [][] concat [[42]][42]base\mathcal{O}(n). , applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., !filter p xs = [ x | x <- xs, p x]Examplesfilter odd [1, 2, 3][1,3]9filter (\l -> length l > 3) ["Hello", ", ", "World", "!"]["Hello","World"]#filter (/= 3) [1, 2, 3, 4, 3, 2, 1] [1,2,4,2,1]base\mathcal{O}(\min(m,n)). < takes two lists and returns a list of corresponding pairs. is right-lazy:zip [] undefined[]zip undefined [] *** Exception: Prelude.undefined... is capable of list fusion, but it is restricted to its first list argument and its resulting list.Exampleszip [1, 2, 3] ['a', 'b', 'c'][(1,'a'),(2,'b'),(3,'c')]If one input list is shorter than the other, excess elements of the longer list are discarded, even if one of the lists is infinite:zip [1] ['a', 'b'] [(1,'a')]zip [1, 2] ['a'] [(1,'a')] zip [] [1..][] zip [1..] [][]base\mathcal{O}(1)?. Extract the first element of a list, which must be non-empty.Exampleshead [1, 2, 3]1 head [1..]1head []'*** Exception: Prelude.head: empty listbase\mathcal{O}(1). Decompose a list into its  and .If the list is empty, returns ."If the list is non-empty, returns  (x, xs) , where x is the  of the list and xs its .Examples uncons []Nothing uncons [1] Just (1,[])uncons [1, 2, 3]Just (1,[2,3])base\mathcal{O}(n). Decompose a list into  and .If the list is empty, returns ."If the list is non-empty, returns  (xs, x) , where xs is the ial part of the list and x is its  element. is dual to : for a finite list xs unsnoc xs = (\(hd, tl) -> (reverse tl, hd)) <$> uncons (reverse xs)Examples unsnoc []Nothing unsnoc [1] Just ([],1)unsnoc [1, 2, 3]Just ([1,2],3)Lazinessfst <$> unsnoc [undefined]Just []%head . fst <$> unsnoc (1 : undefined)%Just *** Exception: Prelude.undefined)head . fst <$> unsnoc (1 : 2 : undefined)Just 1base\mathcal{O}(1). Extract the elements after the head of a list, which must be non-empty.Examplestail [1, 2, 3][2,3]tail [1][]tail []'*** Exception: Prelude.tail: empty listbase\mathcal{O}(n). Extract the last element of a list, which must be finite and non-empty.2WARNING: This function is partial. Consider using  instead.Exampleslast [1, 2, 3]3 last [1..]* Hangs forever *last []'*** Exception: Prelude.last: empty listbase\mathcal{O}(n). Return all the elements of a list except the last one. The list must be non-empty.2WARNING: This function is partial. Consider using  instead.Examplesinit [1, 2, 3][1,2]init [1][]init []'*** Exception: Prelude.init: empty listbase\mathcal{O}(1). Test whether a list is empty.null []Truenull [1]False null [1..]Falsebase\mathcal{O}(n). , returns the length of a finite list as an (. It is an instance of the more general 6, the result type of which may be any kind of number. length []0length ['a', 'b', 'c']3 length [1..]* Hangs forever *base, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnThe list must be finite.foldl (+) 0 [1..4]10foldl (+) 42 []42foldl (-) 100 [1..4]90foldl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd'] "dcbafoo"foldl (+) 0 [1..]* Hangs forever *baseA strict version of .base is a variant of  that has no starting value argument, and thus must be applied to non-empty lists. Note that unlike , the accumulated value must be of the same type as the list elements.foldl1 (+) [1..4]10 foldl1 (+) [])*** Exception: Prelude.foldl1: empty listfoldl1 (-) [1..4]-8%foldl1 (&&) [True, False, True, True]False&foldl1 (||) [False, False, True, True]Truefoldl1 (+) [1..]* Hangs forever *baseA strict version of .baseThe 7 function computes the sum of a finite list of numbers.sum []0sum [42]42 sum [1..10]55sum [4.1, 2.0, 1.7]7.8 sum [1..]* Hangs forever *baseThe ; function computes the product of a finite list of numbers. product []1 product [42]42product [1..10]3628800product [4.1, 2.0, 1.7]13.939999999999998 product [1..]* Hangs forever *base\mathcal{O}(n).  is similar to , but returns a list of successive reduced values from the left: scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] Note that #last (scanl f z xs) == foldl f z xsExamplesscanl (+) 0 [1..4] [0,1,3,6,10]scanl (+) 42 [][42]scanl (-) 100 [1..4][100,99,97,94,90]scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd'])["foo","afoo","bafoo","cbafoo","dcbafoo"]take 10 (scanl (+) 0 [1..])[0,1,3,6,10,15,21,28,36,45]&take 1 (scanl undefined 'a' undefined)"a"base\mathcal{O}(n).  is a variant of & that has no starting value argument: .scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]Examplesscanl1 (+) [1..4] [1,3,6,10] scanl1 (+) [][]scanl1 (-) [1..4] [1,-1,-4,-8]%scanl1 (&&) [True, False, True, True][True,False,False,False]&scanl1 (||) [False, False, True, True][False,False,True,True]take 10 (scanl1 (+) [1..])[1,3,6,10,15,21,28,36,45,55]+take 1 (scanl1 undefined ('a' : undefined))"a"base\mathcal{O}(n). A strict version of .base is a variant of  that begins list reduction from the last element and evaluates the accumulator strictly as it unwinds the stack back to the beginning of the list. The input list must be finite, otherwise  runs out of space (diverges).Note that if the function that combines the accumulated value with each element is strict in the accumulator, other than a possible improvement in the constant factor, you get the same \mathcal{O}(n) space cost as with just .If you want a strict right fold in constant space, you need a structure that supports faster than \mathcal{O}(n), access to the right-most element, such as Seq from the  containers package.(Use of this function is a hint that the [] structure may be a poor fit for the task at hand. If the order in which the elements are combined is not important, use  instead.)foldr' (+) [1..4] -- Use foldl' instead!10;foldr' (&&) [True, False, True, True] -- Use foldr instead!False nextChar : reversedString) "foo" ['a', 'b', 'c', 'd'])["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]force $ scanr (+) 0 [1..]*** Exception: stack overflowbase\mathcal{O}(n).  is a variant of & that has no starting value argument.Examplesscanr1 (+) [1..4] [10,9,7,4] scanr1 (+) [][]scanr1 (-) [1..4] [-2,3,-1,4]%scanr1 (&&) [True, False, True, True][False,False,True,True]&scanr1 (||) [True, True, False, False][True,True,False,False]force $ scanr1 (+) [1..]*** Exception: stack overflowbase 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 programmer to supply their own comparison function. maximum []**** Exception: Prelude.maximum: empty list maximum [42]42maximum [55, -12, 7, 0, -89]55 maximum [1..]* Hangs forever *base 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 programmer to supply their own comparison function. minimum []**** Exception: Prelude.minimum: empty list minimum [42]42minimum [55, -12, 7, 0, -89]-89 minimum [1..]* Hangs forever *base f x7 returns an infinite list of repeated applications of f to x: %iterate f x == [x, f x, f (f x), ...]Laziness Note that  is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See ( for a strict variant of this function.take 1 $ iterate undefined 42[42]Examplestake 10 $ iterate not True8[True,False,True,False,True,False,True,False,True,False]take 10 $ iterate (+3) 42[42,45,48,51,54,57,60,63,66,69]iterate id == :take 10 $ iterate id 1[1,1,1,1,1,1,1,1,1,1]base is the strict version of .It forces the result of each application of the function to weak head normal form (WHNF) before proceeding.take 1 $ iterate' undefined 42 *** Exception: Prelude.undefinedbase x is an infinite list, with x the value of every element.Examplestake 10 $ repeat 17 [17,17,17,17,17,17,17,17,17, 17]repeat undefined![*** Exception: Prelude.undefinedbase n x is a list of length n with x the value of every element. It is an instance of the more general  , in which n may be of any integral type.Examplesreplicate 0 True[]replicate (-1) True[]replicate 4 True[True,True,True,True]base ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.Examplescycle [](*** Exception: Prelude.cycle: empty listtake 10 (cycle [42])[42,42,42,42,42,42,42,42,42,42]take 10 (cycle [2, 5, 7])[2,5,7,2,5,7,2,5,7,2]take 1 (cycle (42 : undefined))[42]base, applied to a predicate p and a list xs2, returns the longest prefix (possibly empty) of xs of elements that satisfy p.Laziness!takeWhile (const False) undefined *** Exception: Prelude.undefined/takeWhile (const False) (undefined : undefined)[]/take 1 (takeWhile (const True) (1 : undefined))[1]Examples!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][]base p xs$ returns the suffix remaining after  p xs.Examples!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]base n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n >=  xs.&It is an instance of the more general  , in which n may be of any integral type.Lazinesstake 0 undefined[]take 2 (1 : 2 : undefined)[1,2]Examplestake 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][]base n xs returns the suffix of xs after the first n elements, or [] if n >=  xs.&It is an instance of the more general  , in which n may be of any integral type.Examplesdrop 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]base n xs( returns a tuple where first element is xs prefix of length n1 and second element is the remainder of the list:$ is an instance of the more general  , in which n may be of any integral type.LazinessIt is equivalent to ( n xs,  n xs) unless n is _|_: splitAt _|_ xs = _|_, not  (_|_, _|_)).4The first component of the tuple is produced lazily:fst (splitAt 0 undefined)[])take 1 (fst (splitAt 10 (1 : undefined)))[1]ExamplessplitAt 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])base, applied to a predicate p and a list xs, returns a tuple where first element is the longest prefix (possibly empty) of xs of elements that satisfy p1 and second element is the remainder of the list: p xs is equivalent to ( p xs,  p xs) , even if p is _|_.Lazinessspan undefined []([],[])"fst (span (const False) undefined) *** Exception: Prelude.undefined0fst (span (const False) (undefined : undefined))[]0take 1 (fst (span (const True) (1 : undefined)))[1]2 produces the first component of the tuple lazily:'take 10 (fst (span (const True) [1..]))[1,2,3,4,5,6,7,8,9,10]Examplesspan (< 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])base, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p1 and second element is the remainder of the list: p is equivalent to  ( . p) and consequently to ( ( . p) xs,  ( . p) xs) , even if p is _|_.Lazinessbreak undefined []([],[])"fst (break (const True) undefined) *** Exception: Prelude.undefined0fst (break (const True) (undefined : undefined))[]2take 1 (fst (break (const False) (1 : undefined)))[1]2 produces the first component of the tuple lazily:)take 10 (fst (break (const False) [1..]))[1,2,3,4,5,6,7,8,9,10]Examplesbreak (> 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],[])base\mathcal{O}(n).  xs returns the elements of xs in reverse order. xs must be finite.Laziness is lazy in its elements.head (reverse [undefined, 1])1reverse (1 : 2 : undefined) *** Exception: Prelude.undefinedExamples reverse [][] reverse [42][42]reverse [2,5,7][7,5,2] reverse [1..]* Hangs forever *base 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.Examplesand []True and [True]True and [False]Falseand [True, True, False]Falseand (False : repeat True) -- Infinite list [False,True,True,True,True,True,True...Falseand (repeat True)* Hangs forever *base 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.Examplesor []False or [True]True or [False]Falseor [True, True, False]Trueor (True : repeat False) -- Infinite list [True,False,False,False,False,False,False...Trueor (repeat False)* Hangs forever *base#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.Examples any (> 3) []Falseany (> 3) [1,2]Falseany (> 3) [1,2,3,4,5]Trueany (> 3) [1..]Trueany (> 3) [0, -1..]* Hangs forever *base#Applied to a predicate and a list,  determines if all elements 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.Examples all (> 3) []Trueall (> 3) [1,2]Falseall (> 3) [1,2,3,4,5]Falseall (> 3) [1..]Falseall (> 3) [4..]* Hangs forever *base 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 x6 found at a finite index of a finite or infinite list.Examples 3 `elem` []False3 `elem` [1,2]False3 `elem` [1,2,3,4,5]True3 `elem` [1..]True3 `elem` [4..]* Hangs forever *base is the negation of .Examples3 `notElem` []True3 `notElem` [1,2]True3 `notElem` [1,2,3,4,5]False3 `notElem` [1..]False3 `notElem` [4..]* Hangs forever *base\mathcal{O}(n).   key assocs? looks up a key in an association list. For the result to be , the list must be finite.Examples lookup 2 []Nothinglookup 2 [(1, "first")]Nothing4lookup 2 [(1, "first"), (2, "second"), (3, "third")] Just "second"baseMap a function returning a list over a list and concatenate the results. # can be seen as the composition of  and ). %concatMap f xs == (concat . map f) xsExamplesconcatMap (\i -> [-i,i]) [][]#concatMap (\i -> [-i, i]) [1, 2, 3][-1,1,-2,2,-3,3]#concatMap ('replicate' 3) [0, 2, 4][0,0,0,2,2,2,4,4,4]baseList index (subscript) operator, starting from 0. It is an instance of the more general -, which takes an index of any integral type.WARNING: This function is partial, and should only be used if you are sure that the indexing will not fail. Otherwise, use .6WARNING: This function takes linear time in the index.Examples['a', 'b', 'c'] !! 0'a'['a', 'b', 'c'] !! 2'c'['a', 'b', 'c'] !! 3**** Exception: Prelude.!!: index too large['a', 'b', 'c'] !! (-1))*** Exception: Prelude.!!: negative indexbase:List index (subscript) operator, starting from 0. Returns  if the index is out of bounds)This is the total variant of the partial  operator.6WARNING: This function takes linear time in the index.Examples['a', 'b', 'c'] !? 0Just 'a'['a', 'b', 'c'] !? 2Just 'c'['a', 'b', 'c'] !? 3Nothing['a', 'b', 'c'] !? (-1)Nothingbase takes three lists and returns a list of triples, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.base\mathcal{O}(\min(m,n)).  generalises  by zipping with the function given as the first argument, instead of a tupling function. zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..] is right-lazy:let f = undefinedzipWith f [] undefined[] is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples  can be applied to two lists to produce the list of corresponding sums:zipWith (+) [1, 2, 3] [4, 5, 6][5,7,9]0zipWith (++) ["hello ", "foo"] ["world!", "bar"]["hello world!","foobar"]base\mathcal{O}(\min(l,m,n)). The  function takes a function which combines three elements, as well as three lists and returns a list of the function applied to corresponding elements, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list. zipWith3 (,,) xs ys zs == zip3 xs ys zs zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]Examples0zipWith3 (\x y z -> [x, y, z]) "123" "abc" "xyz"["1ax","2by","3cz"]>zipWith3 (\x y z -> (x * y) + z) [1, 2, 3] [4, 5, 6] [7, 8, 9] [11,18,27]base transforms a list of pairs into a list of first components and a list of second components.Examplesunzip []([],[])unzip [(1, 'a'), (2, 'b')] ([1,2],"ab")baseThe  function takes a list of triples and returns three lists of the respective components, analogous to .Examples unzip3 [] ([],[],[])(unzip3 [(1, 'a', True), (2, 'b', False)]([1,2],"ab",[True,False])=)=)  T((c) The University of Glasgow, 1992-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy62{base!Conversion of values to readable s.Derived instances of { have the following properties, which are compatible with derived instances of (:The result of  is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.?If the constructor is defined to be an infix operator, then 4 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 surrounded in parentheses, unless it is an atomic expression.8If the constructor is defined using record syntax, then  will produce the record-syntax form, with the fields given in the same order as the original declaration.#For example, given the declarations 8infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree athe derived instance of { 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)".baseConvert a value to a readable . should satisfy the law 0showsPrec d x r ++ s == showsPrec d x (r ++ s)Derived instances of ( and { satisfy the following:(x,"") is an element of (( d ( d x "")). That is, ( parses the string produced by , and delivers the value that  started with.baseA specialised variant of <, using precedence context zero, and returning an ordinary .base The method  is provided to allow the programmer to give a specialised way of showing lists of values. For example, this is used by the predefined { instance of the  type, where values of type  should be shown in double quotes, rather than between square brackets.baseThe shows7 functions return a function that prepends the output  to an existing . This allows constant-time concatenation of results using function composition.baseequivalent to  with a precedence of 0.baseutility function converting a  to a show function that simply prepends the character unchanged.baseutility function converting a ? to a show function that simply prepends the string unchanged.baseutility function that surrounds the inner show function with parentheses when the  parameter is .baseConvert a character to a string using only printable characters, using Haskell source-language escape conventions. For example: !showLitChar '\n' s = "\\n" ++ sbaseSame as , but for strings It converts the string to a string using Haskell escape conventions for non-printable characters. Does not add double-quotes around the whole thing; the caller should do that. The main difference from showLitChar (apart from the fact that the argument is a string not a list) is that we must escape double-quotesbaseLike  (expand escape characters using Haskell escape conventions), but * break the string into multiple lines * wrap the entire thing in double quotes Example: (showMultiLineString "hellongoodbyenblah" returns %[""hello\n\", "\goodbyen\", "\blah""]base Convert an  in the range 0..15$ to the corresponding single digit . This function fails on other inputs, and generates lower-case hexadecimal digits.basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase base base basebasebasebasebasebase base base base basebase base basebasebasebasebasebasebasebasethe operator precedence of the enclosing context (a number from 0 to 11(). Function application has precedence 10.basethe value to be converted to a {{\((c) The University of Glasgow, 1992-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe base The strict  monad. The  monad allows for destructive updates, but is escapable (unlike IO). A computation of type  s a returns a value of type a, and execute in "thread" s. The s parameter is either7an uninstantiated type variable (inside invocations of ), or (inside invocations of ).It serves to keep the internal states of different invocations of 3 separate from each other and from invocations of .The > and ? operations are strict in the state (though not in values stored in the state). For example,  (writeSTRef _|_ v >>= f) = _|_base allows an  computation to be deferred lazily. When passed a value of type ST a, the ; computation will only be performed when the value of the a is demanded. base allows an  computation to be deferred lazily. When passed a value of type ST a, the ; computation will only be performed when the value of the a is demanded.The computation may be performed multiple times by different threads, possibly at the same time. To prevent this, use  instead.base2Return the value computed by a state thread. The forall- ensures that the internal state used by the 9 computation is inaccessible to the rest of the program.base base basebasebasebase  `((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe"basea value of type  STRef s a' is a mutable variable in state thread s, containing a value of type a:{ runST (do ref <- newSTRef "hello" x <- readSTRef ref! writeSTRef ref (x ++ "world") readSTRef ref ):} "helloworld"base Build a new  in the current state threadbaseRead the value of an baseWrite a new value into an basePointer equality. Trustworthy"?base?base?base?base??????D Trustworthy"baseThe  method restricted to the type 1.  U((c) The University of Glasgow, 1992-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthy63,7base!Used in Haskell's translation of [n..] with [n..] = enumFrom n%, a possible implementation being "enumFrom n = n : enumFrom (succ n). For example: 'enumFrom 4 :: [Integer] = [4,5,6,7,...] 3enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]8base!Used in Haskell's translation of [n,n'..] with [n,n'..] = enumFromThen n n'%, a possible implementation being 2enumFromThen n n' = n : n' : worker (f x) (f x n'), worker s v = v : worker s (s v), x = fromEnum n' - fromEnum n and f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = y For example: -enumFromThen 4 6 :: [Integer] = [4,6,8,10...] ;enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]9base!Used in Haskell's translation of [n..m] with [n..m] = enumFromTo n m%, a possible implementation being enumFromTo n m | n <= m = n : enumFromTo (succ n) m | otherwise = []. For example: 'enumFromTo 6 10 :: [Int] = [6,7,8,9,10] !enumFromTo 42 1 :: [Integer] = []:base!Used in Haskell's translation of  [n,n'..m] with ![n,n'..m] = enumFromThenTo n n' m%, a possible implementation being .enumFromThenTo n n' m = worker (f x) (c x) n m, x = fromEnum n' - fromEnum n, c x = bool (>=) ( =)(x 0) f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = y and worker s c v m | c v m = v : worker s c (s v) m | otherwise = [] For example: 5enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6] "enumFromThenTo 6 8 2 :: [Int] = []lbaseThe l? class is used to name the upper and lower limits of a type. v is not a superclass of l since types that are not totally ordered may also have upper and lower bounds.The l1 class may be derived for any enumeration type; ( is the first constructor listed in the data declaration and  is the last. l may also be derived for single-constructor datatypes whose constituent types are in l.mbaseClass m2 defines operations on sequentially ordered types.The enumFrom... methods are used in Haskell's translation of arithmetic sequences. Instances of m may be derived for any enumeration type (types 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 l as well as m, the following should hold: The calls   and  % should result in a runtime error. and  should give a runtime error if the result value is not representable in the result type. For example,  7 ::  is an error.7 and 83 should be defined with an implicit bound, thus:  enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBoundbase.the successor of a value. For numeric types,  adds 1.base0the predecessor of a value. For numeric types,  subtracts 1.baseConvert from an .baseConvert to an '. It is implementation-dependent what  returns when applied to a value that is too large to fit in an .basebasebasebasebasebasebasebasebasebasebase base base base basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebaselm78:9lm789:$((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) TrustworthyO16baseConversion from a  (that is  4). A floating literal stands for an application of 6 to a value of type , so such literals have type (p a) => a.MbaseGeneral coercion from q types.WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.NbaseGeneral coercion to p types.(WARNING: This function goes through the & type, which does not have values for NaN1 for example. This means it does not round-trip.For 1 it also behaves differently with or without -O0: Prelude> realToFrac nan -- With -O0 -Infinity Prelude> realToFrac nan NaNObaseconversion to Pbasethe rational equivalent of its real argument with full precisionpbase-Fractional numbers, supporting real division.'The Haskell Report defines no laws for p . However, () and () are customarily expected to define a division ring and have the following properties: ! gives the multiplicative inverse x * recip x =  recip x * x =  fromInteger 1 Totality of PP is totalCoherence with Pif the type also implements x, then 6 is a left inverse for P, i.e. fromRational (toRational i) = i Note that it isn't/ customarily expected that a type instance of p. implement a field. However, all instances in base do.qbase.Integral numbers, supporting integer division.'The Haskell Report defines no laws for q . However, q instances are customarily expected to define a Euclidean domain and have the following properties for the / and /, pairs, given suitable Euclidean functions f and g:x = y * quot x y + rem x y with rem x y =  fromInteger 0 or  g (rem x y) < g yx = y * div x y + mod x y with mod x y =  fromInteger 0 or  f (mod x y) < f y1An example of a suitable Euclidean function, for 's instance, is . In addition,  toInteger should be total, and 4( should be a left inverse for it, i.e. fromInteger (toInteger i) = i.xbase Real numbers.'The Haskell report defines no laws for x , however x instances are customarily expected to adhere to the following law: Coherence with 6if the type also implements p, then 6 is a left inverse for P, i.e. fromRational (toRational i) = iThe law does not hold for , , s, s, etc., because these types contain non-finite values, which cannot be roundtripped through .zbase#Extracting components of fractions.base9Rational numbers, with numerator and denominator of some q type. Note that 's instances inherit the deficiencies from the type parameter's. For example,  Ratio Natural's u# instance has similar problems to 4's.baseArbitrary-precision rational numbers, represented as a ratio of two : values. A rational number may be constructed using the  operator.base The function  takes a real fractional number x and returns a pair (n,f) such that x = n+f, and:n- is an integral number with the same sign as x; andf. is a fraction with the same type and sign as x', and with absolute value less than 1.The default definitions of the , ,  and  functions are in terms of .base x returns the integer nearest x between zero and xbase x returns the nearest integer to x; the even integer if x$ is equidistant between two integersbase x) returns the least integer not less than xbase x/ returns the greatest integer not greater than xbaseFractional division.baseReciprocal fraction.base&integer division truncated toward zeroWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.baseinteger remainder, satisfying !(x `quot` y)*y + (x `rem` y) == xWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.base3integer division truncated toward negative infinityWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.baseinteger modulus, satisfying  (x `div` y)*y + (x `mod` y) == xWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.base simultaneous  and WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.base simultaneous  and WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.base is a subsidiary function used only in this module. It normalises a ratio by dividing both numerator and denominator by their greatest common divisor.base(Forms the ratio of two integral numbers.baseExtract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.baseExtract the denominator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.baseConverts a possibly-negative x value to a string.base/raise a number to a non-negative integral powerbase#raise a number to an integral powerbase x y$ is the non-negative factor of both x and y" of which every common factor of x and y is also a factor; for example  4 2 = 2,  (-4) 6 = 2,  0 4 = 4.  0 0 = 0. (That is, the common divisor that is "greatest" in the divisibility preordering.)2Note: Since for signed fixed-width integer types,   < 09, the result may be negative if one of the arguments is & (and necessarily is if the other is 0 or ) for such types.base x y, is the smallest positive integer that both x and y divide.basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase(a function that can show unsigned valuesbase'the precedence of the enclosing contextbasethe value to show >MgfNp6qOxPzxPqOp6zMNfgW((c) The University of Glasgow, 1994-2000see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)NoneW|baseThe | class is used to map a contiguous subrange of values in a type onto integers. It is used primarily for array indexing (see the array package).The first argument (l,u) of each of these operations is a pair specifying the lower and upper bounds of a contiguous subrange of values.An implementation is entitled to assume the following laws about these operations: (l,u) i == elem i ( (l,u))   (l,u) !!  (l,u) i == i, when  (l,u) i) ( (l,u)) ( (l,u))) == [0.. (l,u)-1]   (l,u) == length ( (l,u))  base>The list of values in the subrange defined by a bounding pair.base,The position of a subscript in the subrange.baseLike 2, but without checking that the value is in range.baseReturns  the given subscript lies in the range defined the bounding pair.base4The size of the subrange defined by a bounding pair.baselike 9, but without checking that the upper bound is in range.basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase| |V((c) The University of Glasgow, 1994-2000see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)Unsafembase)Mutable, boxed, non-strict arrays in the , monad. The type arguments are as follows:s&: the state variable argument for the  typei8: the index type of the array (should be an instance of |)e : the element type of the array.baseThe type of immutable non-strict (boxed) arrays with indices in i and elements in e.baseConstruct an array with the specified bounds and containing values for given indices within these bounds.The array is undefined (i.e. bottom) if any index in the list is out of bounds. The Haskell 2010 Report further specifies that if any two associations in the list have the same index, the value at that index is undefined (i.e. bottom). However in GHC's implementation, 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 strict in the bounds argument and in the indices of the association 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]])Not every index within the bounds of the array need appear in the association list, but the values associated with indices that do not appear will be undefined (i.e. bottom).If, in any dimension, the lower bound is greater than the upper bound, 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.baseConstruct an array from a pair of bounds and a list of values in index order.base)The value at the given index in an array.base (a,a) -> [a] -> Array a b hist bnds is = accumArray (+) 0 bnds [(i, 1) | i<-is, inRange bnds i] accumArray is strict in each result of applying the accumulating function, although it is lazy in the initial value. Thus, unlike arrays built with 9, accumulated arrays should not in general be recursive.baseConstructs an array identical to the first argument except that it has 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]]4is the same matrix, except with the diagonal zeroed. a -> Maybe b toIntegral x | toInteger x == toInteger y = Just y | otherwise = Nothing where y = fromIntegral x$This version requires going through &, which can be inefficient. However, toIntegralSized is optimized to allow GHC to statically determine the relative type sizes (as measured by  and ) and avoid going through + for many types. (The implementation uses M+, which is itself optimized with rules for base types but may go through  for some type pairs.)?base if the size of a is <= the size of b, where size is measured by  and .basebasebase Interpret  as 1-bit bit-fieldbasebasebasebasebase.  Trustworthy????# Trustworthy01J ebase(Prove anything within a context with an  constraint.This is useful for filling in instance methods when there is an ( constraint in the instance head, e.g.: instance Unsatisfiable (Text "No Eq instance for functions") => Eq (a -> b) where(==) = unsatisfiablesince 4.19.0.0.base(An unsatisfiable constraint. Similar to  when used at the 7 kind, but reports errors in a more predictable manner. See also the e function.since 4.19.0.0. baseThe type-level equivalent of .The polymorphic kind of this type allows it to be used in several settings. For instance, it can be used as a constraint, e.g. to provide a better error message for a non-existent instance, 1-- in a context instance TypeError (Text "Cannot Show functions." :$$: Text "Perhaps there is a missing argument?") => Show (a -> b) where showsPrec = error "unreachable" It can also be placed on the right-hand side of a type-level function to provide an error for an invalid case, type family ByteSize x where ByteSize Word16 = 2 ByteSize Word8 = 1 ByteSize a = TypeError (Text "The type " :<>: ShowType a :<>: Text " is not exportable.") baseShow the text as is.base4Put two pieces of error message next to each other.base8Stack two pieces of error message on top of each other.basePretty print the type. ShowType :: k -> ErrorMessagebaseA type-level assert function.If the first argument evaluates to true, then the empty constraint is returned, otherwise the second argument (which is intended to be something which reduces to  is used).-For example, given some type level predicate P' :: Type -> Bool+, it is possible to write the type synonym 'type P a = Assert (P' a) (NotPError a) where  NotPError reduces to a  TypeError+ which is reported if the assertion fails.base%A description of a custom type error. e e Trustworthy1base0Comparison of type-level symbols, as a function.base$Comparison of type-level characters. Trustworthy1base1Comparison of type-level naturals, as a function.(c) 2020 Andrew Lelechenko (c) 2020 Composewell Technologies BSD-3-Clausestreamly@composewell.cominternalnon-portable (GHC extensions)None ?baselookup64 addr index& looks up the bit stored at bit index index) using a bitmap starting at the address addr. Looks up the 64-bit word containing the bit and then the bit in that word. The caller must make sure that the 64-bit word at the byte address (addr + index / 64) * 8 is legally accessible memory.?baselookupIntN addr index looks up for the index-th 8%-bits word in the bitmap starting at addr, then convert it to an Int.The caller must make sure that:ceiling (addr + (n * 8)) is legally accessible Word8.?baseBitmap addressbase Word indexbaseResulting word as ??2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNone??2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNone?2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNone?2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNone+?2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNone?2(c) 2020 Composewell Technologies and Contributors BSD-3-Clausestreamly@composewell.cominternalNonebase$Version of Unicode standard used by base:  /https://www.unicode.org/versions/Unicode15.1.0/15.1.0.R#(c) The University of Glasgow, 2003see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthya;baseUnicode General Categories (column 2 of the UnicodeData table) in the order they are listed in the Unicode standard (the Unicode Character Database, in particular).Examples Basic usage::t OtherLetterOtherLetter :: GeneralCategoryn instance:"UppercaseLetter == UppercaseLetterTrue"UppercaseLetter == LowercaseLetterFalsev instance:NonSpacingMark <= MathSymbolTruem instance:.enumFromTo ModifierLetter SpacingCombiningMark[ModifierLetter,OtherLetter,NonSpacingMark,SpacingCombiningMark]( instance:)read "DashPunctuation" :: GeneralCategoryDashPunctuationread "17" :: GeneralCategory%*** Exception: Prelude.read: no parse{ instance:show EnclosingMark"EnclosingMark"l instance:minBound :: GeneralCategoryUppercaseLettermaxBound :: GeneralCategory NotAssigned| instance:import Data.Ix ( index )&index (OtherLetter,Control) FinalQuote12"index (OtherLetter,Control) Format#*** Exception: Error in array indexbaseLu: Letter, UppercasebaseLl: Letter, LowercasebaseLt: Letter, TitlecasebaseLm: Letter, ModifierbaseLo: Letter, OtherbaseMn: Mark, Non-SpacingbaseMc: Mark, Spacing CombiningbaseMe: Mark, EnclosingbaseNd: Number, DecimalbaseNl: Number, LetterbaseNo: Number, OtherbasePc: Punctuation, ConnectorbasePd: Punctuation, DashbasePs: Punctuation, OpenbasePe: Punctuation, ClosebasePi: Punctuation, Initial quotebasePf: Punctuation, Final quotebasePo: Punctuation, OtherbaseSm: Symbol, MathbaseSc: Symbol, CurrencybaseSk: Symbol, ModifierbaseSo: Symbol, OtherbaseZs: Separator, SpacebaseZl: Separator, LinebaseZp: Separator, ParagraphbaseCc: Other, ControlbaseCf: Other, FormatbaseCs: Other, SurrogatebaseCo: Other, Private UsebaseCn: Other, Not AssignedbaseThe Unicode general category of the character. This relies on the m instance of , which must remain in the same order as the categories are presented in the Unicode standard.Examples Basic usage:generalCategory 'a'LowercaseLettergeneralCategory 'A'UppercaseLettergeneralCategory '0' DecimalNumbergeneralCategory '%'OtherPunctuationgeneralCategory 'L' OtherSymbolgeneralCategory '\31'ControlgeneralCategory ' 'SpacebaseSelects the first 128 characters of the Unicode character set, corresponding to the ASCII character set.baseSelects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.baseSelects ASCII lower-case letters, i.e. characters satisfying both  and .baseSelects ASCII upper-case letters, i.e. characters satisfying both  and .baseSelects control characters, which are the non-printing characters of the Latin-1 subset of Unicode.baseSelects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces).baseReturns > for any Unicode space character, and the control characters \t, \n, \r, \f, \v.baseSelects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj.Note: this predicate does not+ work for letter-like characters such as: 'I' (U+24B6& circled Latin capital letter A) and 'B' (U+2163 Roman numeral four). This is due to selecting only characters with the   or .See 3 for a more intuitive predicate. Note that unlike ,  does select  title-case characters such as '' (U+01C5< Latin capital letter d with small letter z with caron) or '?' (U+1FAF Greek capital letter omega with dasia and perispomeni and prosgegrammeni).base2Selects upper-case Unicode letter-like characters.Note:> this predicate selects characters with the Unicode property  Uppercase1, which include letter-like characters such as: 'I' (U+24B6& circled Latin capital letter A) and 'B' (U+2163 Roman numeral four).See - for the legacy predicate. Note that unlike ,  does select  title-case characters such as '' (U+01C5< Latin capital letter d with small letter z with caron) or '?' (U+1FAF Greek capital letter omega with dasia and perispomeni and prosgegrammeni).base;Selects lower-case alphabetic Unicode characters (letters).Note: this predicate does not+ work for letter-like characters such as: 'I' (U+24D0$ circled Latin small letter a) and 'B' (U+2173 small Roman numeral four). This is due to selecting only characters with the  .See  for a more intuitive predicate.base2Selects lower-case Unicode letter-like characters.Note:> this predicate selects characters with the Unicode property  Lowercase2, which includes letter-like characters such as: 'I' (U+24D0$ circled Latin small letter a) and 'B' (U+2173 small Roman numeral four).See  for the legacy predicate.baseSelects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to 1.base1Selects alphabetic or numeric Unicode characters.Note that numeric digits outside the ASCII range, as well as numeric characters which aren't digits, are selected by this function but not by . Such characters may be part of identifiers but are not used by the printer and reader to represent numbers.baseSelects ASCII digits, i.e. '0'..'9'.base!Selects ASCII octal digits, i.e. '0'..'7'.base(Selects ASCII hexadecimal digits, i.e. '0'..'9', 'a'..'f', 'A'..'F'.baseSelects Unicode punctuation characters, including various kinds of connectors, brackets and quotes.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Punctuation".Examples Basic usage:isPunctuation 'a'FalseisPunctuation '7'FalseisPunctuation 'L'FalseisPunctuation '"'TrueisPunctuation '?'TrueisPunctuation '@'TruebaseSelects Unicode symbol characters, including mathematical and currency symbols.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Symbol".Examples Basic usage: isSymbol 'a'False isSymbol '6'False isSymbol '='TrueThe definition of "math symbol" may be a little counter-intuitive depending on one's background: isSymbol '+'True isSymbol '-'FalsebaseConvert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.baseConvert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.baseConvert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged.basebasebasebasebasebase66C((c) The University of Glasgow, 1997-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) TrustworthyW7base8-bit unsigned integer typebase16-bit unsigned integer typebase32-bit unsigned integer typebase64-bit unsigned integer typebaseReverse order of bytes in .baseReverse order of bytes in .baseReverse order of bytes in .base#Reverse the order of the bits in a .base#Reverse the order of the bits in a .base#Reverse the order of the bits in a .base#Reverse the order of the bits in a .basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase1 1  (c) The University of Glasgow 1994-2002 Portions obtained from hbc (c) Lennart Augusstsonsee libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy 2-baseConvert an Integer to a Float#.baseConvert an Integer to a Double#/baseConvert a Natural to a Float#0base*Encode a Natural (mantissa) into a Double#obase=Trigonometric and hyperbolic functions and related functions.'The Haskell Report defines no laws for o . However, (), () and  are customarily expected to define an exponential field and have the following properties: exp (a + b) =  exp a * exp bexp (fromInteger 0) =  fromInteger 1ybaseEfficient, machine-independent access to the components of a floating-point number.basea constant function, returning the radix of the representation (often 2)base8a constant function, returning the number of digits of  in the significandbasea constant function, returning the lowest and highest values the exponent may assumebase The function  applied to a real floating-point number returns the significand expressed as an + and an appropriately scaled exponent (an ). If  x yields (m,n), then x is equal in value to m*b^^n, where b7 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).. If the type contains a negative zero, also  (-0.0) = (0,0).  The result of  x is unspecified if either of  x or  x is .base performs the inverse of  in the sense that for finite x with the exception of -0.0,   ( x) = x.  m n is one of the two closest representable floating-point numbers to m*b^^n (or  Infinity2 if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction.base( corresponds to the second component of .  0 = 0 and for finite nonzero x,  x = snd ( x) +  x. If x= is a finite floating-point number, it is equal in value to  x * b ^^  x, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values.baseThe first component of ', scaled to lie in the open interval (-1,1 ), either 0.0 or of absolute value >= 1/b , where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values.basemultiplies a floating-point number by an integer power of the radixbase6 if the argument is an IEEE "not-a-number" (NaN) valuebase9 if the argument is an IEEE infinity or negative infinitybase if the argument is too small to be represented in normalized formatbase) if the argument is an IEEE negative zerobase1 if the argument is an IEEE floating point numberbasea version of arctangent taking two real floating-point arguments. For real floating x and y,  y x computes the angle (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 y", should return the same value as  y. A default definition of  is provided, but implementors can provide a more accurate implementation. base x computes  (1 + x), but provides more precise results for small (absolute) values of x if possible. base x computes  x - 1, but provides more precise results for small (absolute) values of x if possible. base x computes  (1 +  x)1, but provides more precise results if possible. Examples:if x is a large negative number,  (1 +  x)/ will be imprecise for the reasons given in .if  x is close to -1,  (1 +  x)/ will be imprecise for the reasons given in . base x computes  (1 -  x)1, but provides more precise results if possible. Examples:if x is a large negative number,  (1 -  x)/ will be imprecise for the reasons given in .if  x is close to 1,  (1 -  x)/ will be imprecise for the reasons given in .baseDefault implementation for  requiring v to test against a threshold to decide which implementation variant to use.baseShow a signed y value to full precision using standard decimal notation for arguments whose absolute value lies between 0.1 and  9,999,999$, and scientific notation otherwise.base! takes a base and a non-negative y 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-1base6Converts a positive integer to a floating-point value.The value nearest to the argument will be returned. If there are two such values, the one with an even significand will be returned (i.e. IEEE roundTiesToEven).,The argument must be strictly positive, and floatRadix (undefined :: a) must be 2.base Converts a  value into any type in class y.baseUsed to prevent exponent over/underflow when encoding floating point numbers. This is also the same as \(x,y) -> max (-x) (min x y)Example clamp (-10) 510 base w does a bit-for-bit copy from an integral value to a floating-point value. base f does a bit-for-bit copy from a floating-point value to an integral value. base w does a bit-for-bit copy from an integral value to a floating-point value. basecastFloatToWord64 f does a bit-for-bit copy from a floating-point value to an integral value.base? just truncates its argument, beware of all sorts of overflows.?List generators have extremely peculiar behavior, mandated by  https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1310006.3.4Haskell Report 2010:[0..1.5] [0.0,1.0,2.0]base? just truncates its argument, beware of all sorts of overflows.?List generators have extremely peculiar behavior, mandated by  https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1310006.3.4Haskell Report 2010:[0..1.5 :: Float] [0.0,1.0,2.0]basebase9Beware that results for non-finite arguments are garbage:[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0] ] :: [Int][0,0,0,0,0,0,0,0,0]6map properFraction [-1/0, 0/0, 1/0] :: [(Int, Double)][(0,0.0),(0,0.0),(0,0.0)].and get even more non-sensical if you ask for  instead of .baseThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)Falsemap (/ 0) [-1, 0, 1][-Infinity,NaN,Infinity] map (* 0) $ map (/ 0) [-1, 0, 1] [NaN,NaN,NaN]base Beware that P, generates garbage for non-finite arguments:toRational (1/0)&179769313 (and 300 more digits...) % 1toRational (0/0)&269653970 (and 300 more digits...) % 1baseThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:&(0.1 + 0.1) + 0.4 == 0.1 + (0.1 + 0.4)False*(0.1 + 0.2) * 0.3 == 0.1 * 0.3 + 0.2 * 0.3False&(0.1 * 0.1) * 0.3 == 0.1 * (0.1 * 0.3)Falsebasebase9Beware that results for non-finite arguments are garbage:[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0 :: Float] ] :: [Int][0,0,0,0,0,0,0,0,0]5map properFraction [-1/0, 0/0, 1/0] :: [(Int, Float)][(0,0.0),(0,0.0),(0,0.0)].and get even more non-sensical if you ask for  instead of .baseThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)Falsemap (/ 0) [-1, 0, 1 :: Float][-Infinity,NaN,Infinity])map (* 0) $ map (/ 0) [-1, 0, 1 :: Float] [NaN,NaN,NaN]base Beware that P, generates garbage for non-finite arguments:toRational (1/0 :: Float)+340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)+510423550381407695195061911147652317184 % 1baseThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:/(0.1 + 0.1 :: Float) + 0.5 == 0.1 + (0.1 + 0.5)False3(0.1 + 0.2 :: Float) * 0.9 == 0.1 * 0.9 + 0.2 * 0.9False/(0.1 * 0.1 :: Float) * 0.9 == 0.1 * (0.1 * 0.9)Falsebasebasebasebasebase(a function that can show unsigned valuesbase'the precedence of the enclosing contextbasethe value to show .-0/21 oyoy-/1.02  Trustworthy?baseA priority search queue with Int keys and priorities of type p and values of type v.. It is strict in keys, priorities and values.?baseE k p binds the key k with the priority p.?baseWe store masks as the index of the bit that determines the branching.?baseO(1) True if the queue is empty.?baseO(n), The number of elements stored in the queue.?base O(min(n,W))+ The priority and value of a given key, or  if the key is not bound.?baseO(1)& The element with the lowest priority.?baseO(1) The empty queue.?baseO(1) Build a queue with one element.?base O(min(n,W))> Insert a new key that is *not* present in the priority queue.?baseLink?base O(min(n,W)) Delete a key and its priority and value from the queue. When the key is not a member of the queue, the original queue is returned.?base O(min(n,W)) Delete the binding with the least priority, and return the rest of the queue stripped of that binding. In case the queue is empty, the empty queue is returned again.?base O(min(n,W)) The expression alter f k queue alters the value x at k, or absence thereof. ? can be used to insert, delete, or update a value in a queue. It also allows you to calculate an additional value b.?baseSmart constructor for a ?, node whose left subtree could have become ?.?baseSmart constructor for a ?- node whose right subtree could have become ?.?baseO(n) Convert a queue to a list of (key, priority, value) tuples. The order of the list is not specified.?base O(min(n,W)) Delete a key and its priority and value from the queue. If the key was present, the associated priority and value are returned in addition to the updated queue.?base O(min(n,W)) Retrieve the binding with the least priority, and the rest of the queue stripped of that binding.?baseReturn a list of elements ordered by key whose priorities are at most pt, and the rest of the queue stripped of these elements. The returned list of elements can be in any order: no guarantees there.?base-Internal function that merges two *disjoint* ?#s that share the same prefix mask.?????????????????????4(C) 2014 Herbert Valerio Riedel, (C) 2011 Edward Kmettsee libraries/base/LICENSElibraries@haskell.org provisionalportable Trustworthyd"(c) The University of Glasgow 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional-non-portable (local universal quantification) Trustworthy9X.baseA parser for a type a*, represented as a function that takes a * and returns a list of possible parses as (a,) pairs.Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ).baseConsumes and returns the next character. Fails if there is no input left.baseLook-ahead: returns the part of the input that is left, without consuming it.base Always fails.baseSymmetric choice.baseLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.baseTransforms a parser into one that does the same, but in addition returns the exact characters read. IMPORTANT NOTE:  gives a runtime error if its first argument is built using any occurrences of readS_to_P.baseConsumes and returns the next character, if it satisfies the specified predicate.base+Parses and returns the specified character.base'Succeeds iff we are at the end of inputbase(Parses and returns the specified string.baseParses the first zero or more characters satisfying the predicate. Always succeeds, exactly once having consumed all the characters Hence NOT the same as (many (satisfy p))baseParses the first one or more characters satisfying the predicate. Fails if none, else succeeds exactly once having consumed all the characters Hence NOT the same as (many1 (satisfy p))base+Combines all parsers in the specified list.baseSkips all whitespace.base count n p parses n occurrences of p/ in sequence. A list of results is returned.basebetween open close p parses open, followed by p and finally close. Only the value of p is returned.base option x p will either parse p or return x without consuming any input.base optional p optionally parses p and always returns ().base4Parses zero or more occurrences of the given parser.base3Parses one or more occurrences of the given parser.baseLike , but discards the result.baseLike , but discards the result.base sepBy p sep$ parses zero or more occurrences of p, separated by sep*. Returns a list of values returned by p.base sepBy1 p sep# parses one or more occurrences of p, separated by sep*. Returns a list of values returned by p.base endBy p sep$ parses zero or more occurrences of p, separated and ended by sep.base endBy p sep# parses one or more occurrences of p, separated and ended by sep.base chainr p op x$ parses zero or more occurrences of p, separated by op#. Returns a value produced by a right9 associative application of all functions returned by op!. If there are no occurrences of p, x is returned.base chainl p op x$ parses zero or more occurrences of p, separated by op#. Returns a value produced by a left9 associative application of all functions returned by op!. If there are no occurrences of p, x is returned.baseLike (, but parses one or more occurrences of p.baseLike (, but parses one or more occurrences of p.basemanyTill p end$ parses zero or more occurrences of p, until end3 succeeds. Returns a list of values returned by p.baseConverts a parser into a Haskell ReadS-style function. This is the main way in which you can "run" a " parser: the expanded type is 1 readP_to_S :: ReadP a -> String -> [(a,String)] baseConverts a Haskell ReadS-style function into a parser. Warning: This introduces local backtracking in the resulting parser, and therefore a possible inefficiency.base basebasebasebasebasebase basebasebasebasebase##f"(c) The University of Glasgow 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional0non-portable (uses Text.ParserCombinators.ReadP) TrustworthybaseLift a precedence-insensitive  to a .base(Increases the precedence context by one.base&Resets the precedence context to zero.base (prec n p) checks whether the precedence context is less than or equal to n, and if not, failsif so, parses p in context n.baseConsumes and returns the next character. Fails if there is no input left.baseLook-ahead: returns the part of the input that is left, without consuming it.baseSymmetric choice.baseLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.base Always fails.base+Combines all parsers in the specified list.basebase basebasebasebasee"(c) The University of Glasgow 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional0non-portable (uses Text.ParserCombinators.ReadP) TrustworthybasebaseCharacter literalbase(String literal, with escapes interpretedbase%Punctuation or reserved symbol, e.g. (, ::baseHaskell identifier, e.g. foo, BazbaseHaskell symbol, e.g. >>, :%base?base? b is A () if b is , and  if b is .Haskell lexemes.basebasebasebasebasebase?Haskell lexer: returns the lexed string, rather than the lexeme?baseThe special2 character class as defined in the Haskell Report.basebasebasebaseg((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy699wbase Parsing of s, producing values.Derived instances of w= make the following assumptions, which derived instances of ) obey:If the constructor is defined to be an infix operator, then the derived w instance will parse only infix applications of the constructor (not the prefix form).Associativity is not used to reduce the occurrence of parentheses, although precedence may be.?If the constructor is defined using record syntax, the derived w will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration. The derived w instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.#For example, given the declarations 8infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree athe derived instance of w! in Haskell 2010 is equivalent to instance (Read a) => Read (Tree a) where readsPrec d r = readParen (d > app_prec) (\r -> [(Leaf m,t) | ("Leaf",s) <- lex r, (m,t) <- readsPrec (app_prec+1) s]) r ++ readParen (d > up_prec) (\r -> [(u:^:v,w) | (u,s) <- readsPrec (up_prec+1) r, (":^:",t) <- lex s, (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 readPrec = parens $ (prec app_prec $ do Ident "Leaf" <- lexP m <- step readPrec return (Leaf m)) +++ (prec up_prec $ do u <- step readPrec Symbol ":^:" <- lexP v <- step readPrec return (u :^: v)) where app_prec = 10 up_prec = 5 readListPrec = readListPrecDefault Why do both  and + exist, and why does GHC opt to implement  in derived w instances instead of ? The reason is that  is based on the  type, and although  is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.7, on the other hand, is based on a much more efficient  datatype (a.k.a "new-style parsers"), but its definition relies on the use of the  RankNTypes language extension. Therefore,  (and its cousin, ) are marked as GHC-only. Nevertheless, it is recommended to use  instead of > whenever possible for the efficiency improvements it brings.As mentioned above, derived w" instances in GHC will implement  instead of ". The default implementations of  (and its cousin, ) will simply use ' under the hood. If you are writing a w: instance by hand, it is recommended to write it like so:  instance w T where  = ...  =  baseattempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.Derived instances of w and ) satisfy the following:(x,"") is an element of ( d () d x "")). That is,  parses the string produced by ), and delivers the value that ) started with.base The method  is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined w instance of the  type, where values of type  are expected to use double quotes, rather than square brackets.baseProposed replacement for $ using new-style parsers (GHC only).baseProposed replacement for  using new-style parsers (GHC only). The default definition uses . Instances that define  should also define  as .base  p parses what p* parses, but surrounded with parentheses.  p parses what p5 parses, but optionally surrounded with parentheses.base*A possible replacement definition for the  method (GHC only). This is only needed for GHC, and even then only for w instances where  isn't defined as .base*A possible replacement definition for the  method, defined using  (GHC only).baseThe  function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the 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 []).This lexer is not completely faithful to the Haskell lexical syntax in the following respects:(Qualified names are not handled properlyOctal and hexadecimal numerics are not recognized as a single token!Comments are not treated properlybaseRead a string representation of a character, using Haskell source-language escape conventions. For example: -lexLitChar "\\nHello" = [("\\n", "Hello")]baseRead a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example: ,readLitChar "\\nHello" = [('\n', "Hello")]base+Reads a non-empty string of decimal digits.baseParse a single lexemebase (paren p) parses "(P0)" where p' parses "P0" in precedence context zerobase (parens p)0 parses "P", "(P0)", "((P0))", etc, where p parses "P" in the current precedence context and parses "P0" in precedence context zerobase(list p)# parses a list of things parsed by p), using the usual square-bracket syntax.baseParse the specified lexeme and continue as specified. Esp useful for nullary constructors; e.g. )choose [("A", return A), ("B", return B)] We match both Ident and Symbol because the constructor might be an operator eg (:~:)basew( parser for a record field, of the form fieldName=value. The  fieldName must be an alphanumeric identifier; for symbols (operator-style) field names, e.g. (#), use 8). The second argument is a parser for the field value.basew( parser for a record field, of the form fieldName#=value'. That is, an alphanumeric identifier  fieldName followed by the symbol #7. The second argument is a parser for the field value. Note that + does not suffice for this purpose due to  .https://gitlab.haskell.org/ghc/ghc/issues/5041#5041.basew/ parser for a symbol record field, of the form  (###)=value (where ### is the field name). The field name must be a symbol (operator-style), e.g. (#).. For regular (alphanumeric) field names, use 7. The second argument is a parser for the field value.basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase Reading a - value is always a parse error, considering % as a data type with no constructors. basebasebasethe operator precedence of the enclosing context (a number from 0 to 11(). Function application has precedence 10.ww&"(c) The University of Glasgow 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable TrustworthyHObase Reads an unsigned% integral value in an arbitrary base.base+Read an unsigned number in binary notation.readBin "10011" [(19,"")]base*Read an unsigned number in octal notation.readOct "0644" [(420,"")]base,Read an unsigned number in decimal notation.readDec "0644" [(644,"")]baseRead an unsigned number in hexadecimal notation. Both upper or lower case letters are allowed.readHex "deadbeef"[(3735928559,"")]base Reads an unsigned z2 value, expressed in decimal scientific notation.Note that this function takes time linear in the magnitude of its input which can scale exponentially with input size (e.g.  "1e100000000" is a very large number while having a very small textual form). For this reason, users should take care to avoid using this function on untrusted input. Users needing to parse floating point values (e.g.  ) are encouraged to instead use read), which does not suffer from this issue.baseReads a signed x- value, given a reader for an unsigned value.baseShow  non-negative q numbers in base 10.baseShow a signed y6 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.baseShow a signed y. 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.baseShow a signed y value 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.baseShow a signed y. value using standard decimal notation (e.g. 245000, 0.0015).This behaves as , except that a decimal point is always guaranteed, even if not needed.baseShow a signed y value using standard decimal notation for arguments whose absolute value lies between 0.1 and  9,999,999$, and scientific notation otherwise.This behaves as , except that a decimal point is always guaranteed, even if not needed.baseShow a floating-point value in the hexadecimal format, similar to the %a specifier in C's printf. showHFloat (212.21 :: Double) """0x1.a86b851eb851fp7"showHFloat (-12.76 :: Float) """-0x1.9851ecp3"showHFloat (-0 :: Double) "" "-0x0p+0"baseShows a  non-negative q number using the base specified by the first argument, and the character representation specified by the second.baseShow  non-negative q numbers in base 16.baseShow  non-negative q numbers in base 8.baseShow  non-negative q numbers in base 2.basethe basebase4a predicate distinguishing valid digits in this basebase4a function converting a valid digit character to an .o7oh!(c) The FFI Task Force, 2000-2002see libraries/base/LICENSEffi@haskell.orginternalnon-portable (GHC Extensions)UnsafeWbaseA value of type  a represents a pointer to an object, or an 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 o which provides the marshalling operations. However this is not essential, and you can provide your own operations to access the pointer. For example you might write small foreign functions to get or set the fields of a C struct.baseA value of type  a is a pointer to a function callable from foreign code. The type a will normally be a  foreign type4, a function type with zero or more arguments wherethe argument types are marshallable foreign types , i.e. , , , , , 3, 3, 3, 3, 9, 9, 9, 9,  a,  a,  a( or a renaming of any of these using newtype.the return type is either a marshallable foreign type or has the form  t where t# is a marshallable foreign type or ().A value of type  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 # 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  mkCompare2 allocate storage, which should be released with : when no longer required. To convert > 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 -> IntFunctionbase The constant # contains a distinguished value of 6 that is not associated with a valid memory location.baseThe 3 function casts a pointer from one type to another.base8Advances the given address by the given offset in bytes.base9Given an arbitrary address and an alignment constraint,  yields the next higher address that fulfills the alignment constraint. An alignment constraint x+ is fulfilled by any address divisible by x . This operation is idempotent.baseComputes the offset required to get from the second to the first argument. We have %p2 == p1 `plusPtr` (p2 `minusPtr` p1)base The constant $ contains a distinguished value of 6 that is not associated with a valid memory location.baseCasts a  to a  of a different type.baseCasts a  to a .Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption.baseCasts a  to a .Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption.basebasebasebase  '(c) The University of Glasgow 1997-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)UnsafeX`44 44 >(c) GHC Developers/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable TrustworthyZbaseA pointer with the C const/ qualifier. For instance, an argument of type  ConstPtr CInt would be marshalled as  const int*.While const$-ness generally does not matter for ccall imports (since const and non-const pointers typically have equivalent calling conventions), it does matter for capi imports. See GHC #22043.A TrustworthyZbasebasebaseu((c) The University of Glasgow, 1994-2008see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy[baseSee basebasebasebasebasebase9"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe\  t Trustworthy] baseReturn monotonic time in nanoseconds, since some unspecified starting point baseReturn monotonic time in seconds, since some unspecified starting point84BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstable not portable Trustworthy)*016ebase*A type family to compute Boolean equality.baseThis class contains types where you can learn the equality of two types from information contained in terms.The result should be  Just Refl% if and only if the types applied to f are equal: 6testEquality (x :: f a) (y :: f b) = Just Refl O a = bTypically, only singleton types should inhabit this class. In that case type argument equality coincides with term equality: >testEquality (x :: f a) (y :: f b) = Just Refl O a = b O x = y "isJust (testEquality x y) = x == ySingleton types are not required, however, and so the latter two would-be laws are not in fact valid in general.base$Conditionally prove the equality of a and b. base0Kind heterogeneous propositional equality. Like , a :~~: b5 is inhabited by a terminating value if and only if a is the same type as b.basePropositional equality. If a :~: b8 is inhabited by some terminating value, then the type a is the same as the type b:. To use this equality in practice, pattern-match on the a :~: b to get out the Refl constructor; in the body of the pattern-match, the compiler knows that a ~ b.baseSymmetry of equalitybaseTransitivity of equalitybase,Type-safe cast, using propositional equalitybase?Generalized form of type-safe cast using propositional equalitybase+Apply one equality to another, respectivelybaseExtract equality of the arguments from an equality of applied typesbaseExtract equality of type constructors from an equality of applied typesbase base basebase base base base base basebasebasebasebasebasep4BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstable not portableNone)*06jbaseThis class contains types where you can learn the equality of two types from information contained in terms=. Typically, only singleton types should inhabit this class.base5Conditionally prove the representational equality of a and b.baseRepresentational equality. If  Coercion a b8 is inhabited by some terminating value, then the type a4 has the same underlying representation as the type b.7To use this equality in practice, pattern-match on the  Coercion a b to get out the  Coercible a b instance, and then use 3 to apply it.base/Type-safe cast, using representational equality baseGeneralized form of type-safe cast using representational equalitybase%Symmetry of representational equalitybase)Transitivity of representational equalitybaseConvert propositional (nominal) equality to representational equalitybasebase basebasebasebasebasebasebase  q(c) Ashley Yakeley 20074BSD-style (see the LICENSE file in the distribution)ashley@semantic.orgstableportable Trustworthy)*0me base9A class for categories. Instances should satisfy the laws Right identityf   = f Left identity  f = f Associativityf  (g  h) = (f  g)  hbasethe identity morphismbasemorphism compositionbaseRight-to-left compositionbaseLeft-to-right compositionbase basebasebase r4BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy0t'baseA concrete, promotable proxy type, for use at the kind level. There are no instances for this because it is intended at the kind level onlybase is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).Historically,  ::  a is a safer alternative to the  :: a idiom.!Proxy :: Proxy (Void, Int -> Int)Proxy*Proxy can even hold types of higher kinds,Proxy :: Proxy EitherProxyProxy :: Proxy FunctorProxy#Proxy :: Proxy complicatedStructureProxybase! is a type-restricted version of . It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the tag of the second.import Data.Word.:type asProxyTypeOf 123 (Proxy :: Proxy Word8)1asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8Note the lower-case proxy in the definition. This allows any type constructor with just one argument to be passed to the function, for example we could also writeimport Data.Word3:type asProxyTypeOf 123 (Just (undefined :: Word8))6asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8 basebase basebasebasebase basebasebasebasebasebasebasebase;"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy01baseThe  type represents values with two possibilities: a value of type  a b is either  a or  b.The  type is sometimes used to represent a value which is either correct or an error; by convention, the 4 constructor is used to hold an error value and the  constructor is used to hold a correct value (mnemonic: "right" also means "correct").Examples The type   - is the type of values which can be either a  or an . The ! constructor can be used only on  s, and the ! constructor can be used only on s:'let s = Left "foo" :: Either String Ints Left "foo"$let n = Right 3 :: Either String IntnRight 3:type ss :: Either String Int:type nn :: Either String IntThe @ from our t instance will ignore  values, but will apply the supplied function to values contained in a :'let s = Left "foo" :: Either String Int$let n = Right 3 :: Either String Int fmap (*2) s Left "foo" fmap (*2) nRight 6The r instance for  allows us to chain together multiple actions which may fail, and fail overall if any of the individual steps failed. First we'll write a function that can either parse an  from a  , or fail.(import Data.Char ( digitToInt, isDigit ):{0 let parseEither :: Char -> Either String Int parseEither c, | isDigit c = Right (digitToInt c)* | otherwise = Left "parse error":}&The following should work, since both '1' and '2' can be parsed as s.:{* let parseMultiple :: Either String Int parseMultiple = do x <- parseEither '1' y <- parseEither '2' return (x + y):} parseMultipleRight 3But the following should fail overall, since the first operation where we attempt to parse 'm' as an  will fail::{* let parseMultiple :: Either String Int parseMultiple = do x <- parseEither 'm' y <- parseEither '2' return (x + y):} parseMultipleLeft "parse error"baseCase analysis for the  type. If the value is  a, apply the first function to a ; if it is  b, apply the second function to b.ExamplesWe create two values of type   , one using the # constructor and another using the * constructor. Then we apply "either" the  function (if we have a .) or the "times-two" function (if we have an ):'let s = Left "foo" :: Either String Int$let n = Right 3 :: Either String Inteither length (*2) s3either length (*2) n6baseExtracts from a list of  all the  elements. All the ! elements are extracted in order.Examples Basic usage:let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ] lefts list["foo","bar","baz"]baseExtracts from a list of  all the  elements. All the ! elements are extracted in order.Examples Basic usage:let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ] rights list[3,7]basePartitions a list of  into two lists. All the  elements are extracted, in order, to the first component of the output. Similarly the ? elements are extracted to the second component of the output.Examples Basic usage:let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]partitionEithers list(["foo","bar","baz"],[3,7])The pair returned by  x should be the same pair as ( x,  x):let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]2partitionEithers list == (lefts list, rights list)TruebaseReturn  if the given value is a -value,  otherwise.Examples Basic usage:isLeft (Left "foo")TrueisLeft (Right 3)False Assuming a 1 value signifies some sort of error, we can use  to write a very simple error-reporting function that does absolutely nothing in the case of success, and outputs "ERROR" if any error occurred.This example shows how  might be used to avoid pattern matching when one does not care about the value contained in the constructor:import Control.Monad ( when )1let report e = when (isLeft e) $ putStrLn "ERROR"report (Right 1)report (Left "parse error")ERRORbaseReturn  if the given value is a -value,  otherwise.Examples Basic usage:isRight (Left "foo")FalseisRight (Right 3)True Assuming a 1 value signifies some sort of error, we can use  to write a very simple reporting function that only outputs "SUCCESS" when a computation has succeeded.This example shows how  might be used to avoid pattern matching when one does not care about the value contained in the constructor:import Control.Monad ( when )4let report e = when (isRight e) $ putStrLn "SUCCESS"report (Left "parse error")report (Right 1)SUCCESS baseReturn the contents of a $-value or a default value otherwise.Examples Basic usage:fromLeft 1 (Left 3)3fromLeft 1 (Right "foo")1 baseReturn the contents of a $-value or a default value otherwise.Examples Basic usage:fromRight 1 (Right 3)3fromRight 1 (Left "foo")1basebase basebasebasebasebasebase  ("(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional0non-portable (uses Text.ParserCombinators.ReadP) Trustworthybaseequivalent to  with a precedence of 0.baseParse a string using the w> instance. Succeeds if there is exactly one valid result. A  value indicates a parse error.%readEither "123" :: Either String Int Right 123'readEither "hello" :: Either String IntLeft "Prelude.read: no parse"baseParse a string using the w: instance. Succeeds if there is exactly one valid result.readMaybe "123" :: Maybe IntJust 123readMaybe "hello" :: Maybe IntNothingbaseThe  function reads input from a string, which must be completely consumed by the input process.  fails with an  if the parse is unsuccessful, and it is therefore discouraged from being used in real applications. Use  or  for safe alternatives.read "123" :: Int123read "hello" :: Int%*** Exception: Prelude.read: no parse)ww1"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy:baseConvert a single digit  to the corresponding 6. This function fails unless its argument satisfies , but recognises both upper- and lower-case hexadecimal digits (that is, '0'..'9', 'a'..'f', 'A'..'F').Examples Characters '0' through '9' are converted properly to 0..9:map digitToInt ['0'..'9'][0,1,2,3,4,5,6,7,8,9]Both upper- and lower-case 'A' through 'F' are converted as well, to 10..15.map digitToInt ['a'..'f'][10,11,12,13,14,15]map digitToInt ['A'..'F'][10,11,12,13,14,15]"Anything else throws an exception:digitToInt 'G'/*** Exception: Char.digitToInt: not a digit 'G'digitToInt 'L'3*** Exception: Char.digitToInt: not a digit '\9829'baseSelects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to 1.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Letter".Examples Basic usage: isLetter 'a'True isLetter 'A'True isLetter ''True isLetter '0'False isLetter '%'False isLetter 'L'FalseisLetter '\31'False Ensure that  and  are equivalent.let chars = [(chr 0)..] let letters = map isLetter charslet alphas = map isAlpha charsletters == alphasTruebaseSelects Unicode mark characters, for example accents and the like, which combine with preceding characters.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Mark".Examples Basic usage: isMark 'a'False isMark '0'FalseCombining marks such as accent characters usually need to follow another character before they become printable:map isMark "o" [False,True]#Puns are not necessarily supported: isMark 'N'FalsebaseSelects Unicode numeric characters, including digits from various scripts, Roman numerals, et cetera.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Number".Examples Basic usage: isNumber 'a'False isNumber '%'False isNumber '3'TrueASCII '0' through '9' are all numbers:and $ map isNumber ['0'..'9']True-Unicode Roman numerals are "numbers" as well: isNumber 'B'Truebase/Selects Unicode space and separator characters.This function returns + if its argument has one of the following s, or  otherwise:"These classes are defined in the  http://www.unicode.org/reports/tr44/tr44-14.html#GC_Values_TableUnicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Separator".Examples Basic usage:isSeparator 'a'FalseisSeparator '6'FalseisSeparator ' 'TrueWarning: newlines and tab characters are not considered separators.isSeparator '\n'FalseisSeparator '\t'False1But some more exotic characters are (like HTML's  ):isSeparator '\160'TrueX"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable TrustworthyW.base,Monoid under bitwise 'equality'; defined as 1' if the corresponding bits match, and 0 otherwise.&getIff (Iff 0xab <> Iff 0x12) :: Word870baseMonoid under bitwise XOR.&getXor (Xor 0xab <> Xor 0x12) :: Word8185base"Monoid under bitwise inclusive OR.&getIor (Ior 0xab <> Ior 0x12) :: Word8187baseMonoid under bitwise AND.&getAnd (And 0xab <> And 0x12) :: Word82baseA more concise version of complement zeroBits.2complement (zeroBits :: Word) == (oneBits :: Word)True2complement (oneBits :: Word) == (zeroBits :: Word)TrueNoteThe constraint on : is arguably too strong. However, as some types (such as Natural) have undefined  , this is the only safe choice.baseInfix version of .baseInfix version of .baseInfix version of .baseInfix version of .baseInfix version of .baseThis constraint is arguably too strong. However, as some types (such as Natural) have undefined  , this is the only safe choice.basebasebasebasebasebaseThis constraint is arguably too strong. However, as some types (such as Natural) have undefined , this is the only safe choice.baseThis constraint is arguably too strong. However, as some types (such as Natural) have undefined , this is the only safe choice.basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase1E'(c) The University of Glasgow 1997-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy4base8-bit signed integer typebase16-bit signed integer typebase32-bit signed integer typebase64-bit signed integer typebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase- - 3"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthyj)"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafe~baseShow a list (using square brackets and commas), given a function for showing elements. { {!Unsafe )*01cbaseHighly, terribly dangerous coercion from one representation type to another. Misuse of this function can invite the garbage collector to trounce upon your data and then laugh in your face. You don't want this function. Really.baseThis type is treated magically within GHC. Any pattern match of the form .case unsafeEqualityProof of UnsafeRefl -> body gets transformed just into body. This is ill-typed, but the transformation takes place after type-checking is complete. It is used to implement ". You probably don't want to use  in an expression, but you might conceivably want to pattern-match on it. Use b to create one of these.base coerces a value from one type to another, bypassing the type-checker.)There are several legitimate ways to use :  To coerce a lifted type such as Int to Any, put it in a list of Any), and then later coerce it back to Int before using it.To produce e.g. (a+b) :~: (b+a) from unsafeCoerce Refl. Here the two sides really are the same type -- so nothing unsafe is happening -- but GHC is not clever enough to see it.In  Data.Typeable we have  eqTypeRep :: forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) eqTypeRep a b | sameTypeRep a b = Just (unsafeCoerce HRefl) | otherwise = Nothing Here again, the unsafeCoerce HRefl is safe, because the two types really are the same -- but the proof of that relies on the complex, trusted implementation of Typeable. (superseded) The "reflection trick", which takes advantage of the fact that in class C a where { op :: ty }, we can safely coerce between C a and ty (which have different kinds!) because it's really just a newtype. Note: there is no guarantee, at all that this behavior will be supported into perpetuity. It is now preferred to use   in GHC.Magic.Dict, which is type-safe. See Note [withDict] in GHC.Tc.Instance.Class for details.(superseded) Casting between two types which have exactly the same structure: between a newtype of T and T, or between types which differ only in "phantom" type parameters. It is now preferred to use 3 from  Data.Coerce, which is type-safe.Other uses of 5 are undefined. In particular, you should not use  to cast a T to an algebraic data type D, unless T is also an algebraic data type. For example, do not cast -> to  , even if you later cast that  back to -> before applying it. The reasons have to do with GHC's internal representation details (for the cognoscenti, data values can be entered but function closures cannot). If you want a safe type to cast things to, use &, which is not an algebraic data type.cbbcl((c) The University of Glasgow, 1992-2004see libraries/base/LICENSEffi@haskell.orginternalnon-portable (GHC Extensions)Unsafe|base=Create a stable pointer referring to the given Haskell value.baseA stable pointer is a reference to a Haskell expression that is guaranteed not to be affected by garbage collection, i.e., it will neither be deallocated nor will the value of the stable pointer itself change during garbage collection (ordinary references may be relocated during garbage collection). Consequently, stable pointers can be passed to foreign code, which can treat it as an opaque reference to a Haskell value.The  StablePtr5 0 is reserved for representing NULL in foreign code.A value of type  StablePtr a5 is a stable pointer to a Haskell expression of type a.baseDissolve the association between the stable pointer and the Haskell 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 : () value returned by 8, in this case, is undefined (in particular, it may be :). Nevertheless, the call to  is guaranteed not to diverge.baseObtain the Haskell value referenced by a stable pointer, i.e., the same value that was passed to the corresponding call to . If the argument to  has already been freed using , the behaviour of  is undefined.baseCoerce a stable pointer to an address. No guarantees are made about the resulting value, except that the original stable pointer can be recovered by . In particular, the address might not refer to an accessible memory location and any attempt to pass it to the member functions of the class o leads to undefined behaviour.baseThe inverse of , i.e., we have the identity 0sp == castPtrToStablePtr (castStablePtrToPtr sp)for any stable pointer sp on which ( has not been executed yet. Moreover, > may only be applied to pointers that have been produced by .basen!(c) The FFI task force, 2000-2002see libraries/base/LICENSEffi@haskell.orginternalnon-portable (GHC Extensions) Trustworthy4  o(c) The FFI task force 2001see libraries/base/LICENSEffi@haskell.org provisionalportable Trustworthy6baseThe member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.3Memory addresses are represented as values of type  a , for some a which is an instance of class . The type argument to  helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class  facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (, , , ), the fixed size Word types (, , , ), , all types from Foreign.C.Types , as well as .baseComputes the storage requirements (in bytes) of the argument. The value of the argument is not used.baseComputes the alignment constraint of the argument. An alignment constraint x+ is fulfilled by any address divisible by x. The alignment must be a power of two if this instance is to be used with alloca or  allocaArray*. The value of the argument is not used.baseRead a value from a memory area regarded as an array of values of the same kind. The first argument specifies 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, peekElemOff addr idx = IOExts.fixIO $ \result -> peek (addr `plusPtr` (idx * sizeOf result))Note that this is only a specification, not necessarily the concrete implementation of the function.baseWrite a value to a memory area regarded as an array of values of the same kind. The following equality holds: pokeElemOff addr idx x = poke (addr `plusPtr` (idx * sizeOf x)) xbaseRead a value from a memory location given by a base address and offset. The following equality holds: 0peekByteOff addr off = peek (addr `plusPtr` off)baseWrite a value to a memory location given by a base address and offset. The following equality holds: 4pokeByteOff addr off x = poke (addr `plusPtr` off) xbase,Read a value from the given memory location.Note that the peek and poke functions might require properly aligned addresses to function correctly. This is architecture dependent; thus, portable code should ensure that when peeking or poking values of some type a!, the alignment constraint for a, as given by the function  is fulfilled.baseWrite the given value to the given memory location. Alignment restrictions might apply; see .basebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebasebase base :(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthy.baseA signed integral type that can be losslessly converted to and from Ptr2. This type is also compatible with the C99 type intptr_t6, and can be marshalled to and from that type safely.baseAn unsigned integral type that can be losslessly converted to and from Ptr1. This type is also compatible with the C99 type  uintptr_t6, and can be marshalled to and from that type safely.base.Release the storage associated with the given , which must have been obtained from a wrapper stub. This should be called whenever the return value from a foreign import wrapper function is no longer required; otherwise, the storage it uses will leak.basecasts a Ptr to a WordPtrbasecasts a WordPtr to a Ptrbasecasts a Ptr to an IntPtrbase casts an IntPtr to a Ptrs(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthybase Haskell type representing the C jmp_buf type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C fpos_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C FILE type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  suseconds_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  useconds_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C time_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C clock_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  sig_atomic_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.), See Note [Lack of signals on wasm32-wasi].base Haskell type representing the C wchar_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C size_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  ptrdiff_t type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C double type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C float type. (The concrete types of Foreign.C.Types#platform are platform-specific.) base Haskell type representing the C bool type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C unsigned long long type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  long long type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  unsigned long type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C long type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  unsigned int type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C int type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C unsigned short type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C short type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  unsigned char type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C  signed char type. (The concrete types of Foreign.C.Types#platform are platform-specific.)base Haskell type representing the C char type. (The concrete types of Foreign.C.Types#platform are platform-specific.)77"(c) The University of Glasgow 2005/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy?baseThe  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 v instance associated with it then comparing two values thus wrapped will give you the opposite of their normal sort order. This is particularly useful when sorting in generalised list comprehensions, as in: then sortWith by  x.compare True FalseGT compare (Down True) (Down False)LTIf a has a l instance then the wrapped instance also respects the reversed ordering by exchanging the values of  and .minBound :: Int-9223372036854775808minBound :: Down IntDown 9223372036854775807All other instances of  a behave as they do for a.basebase %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) ...base *clamp (low, high) a = min high (max a low) Function for ensuring the value a* is within the inclusive bounds given by low and high . If it is, a1 is returned unchanged. The result is otherwise low if a <= low, or high if  high <= a.When clamp is used at Double and Float, it has NaN propagating semantics in its second argument. That is, clamp (l,h) NaN = NaN, but clamp (NaN, NaN) x = x.clamp (0, 10) 22clamp ('a', 'm') 'x''m' base base basebaseSwaps  and  of the underlying type.baseSwaps  and  of the underlying type.basebaseThis instance would be equivalent to the derived instances of the  newtype if the  field were removedbaseThis instance would be equivalent to the derived instances of the  newtype if the  field were removedbase base base basebasebasebasebasebasebasebasebasebasev < v< v4BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstable not portable Trustworthy )*/016 baseA case statement on .OrdCond c l e g is l when c ~ LT, e when c ~ EQ, and g when c ~ GT.base%Minimum between two comparable types.base%Maximum between two comparable types.base2Comparison (>) of comparable types, as a function.base2Comparison (<) of comparable types, as a function.base3Comparison (>=) of comparable types, as a function.base3Comparison (<=) of comparable types, as a function.base4Comparison (>) of comparable types, as a constraint.base4Comparison (<) of comparable types, as a constraint.base5Comparison (>=) of comparable types, as a constraint.base5Comparison (<=) of comparable types, as a constraint.baseOrdering data type for type literals that provides proof of their ordering.base= branches on the kind of its arguments to either compare by  or Nat./ Trustworthy()*/01baseThis class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.base Addition of type-level naturals.base&Multiplication of type-level naturals.base&Exponentiation of type-level naturals.base#Subtraction of type-level naturals. base+Division (round down) of natural numbers. Div x 0+ is undefined (i.e., it cannot be reduced). baseModulus of natural numbers. Mod x 0+ is undefined (i.e., it cannot be reduced). base-Log base 2 (round down) of natural numbers. Log 0+ is undefined (i.e., it cannot be reduced).baseA value-level witness for a type-level natural number. This is commonly referred to as a  singleton type, as for each n2, there is a single value that inhabits the type  n (aside from bottom).The definition of . is intentionally left abstract. To obtain an " value, use one of the following: The  method of .The SNat pattern synonym.The  function, which creates an  from a  number. base8This type represents unknown type-level natural numbers.baseA type synonym for .Previously, this was an opaque data type, but it was changed to a type synonym.base7A explicitly bidirectional pattern synonym relating an  to a  constraint.As an  expression: Constructs an explicit  n value from an implicit  n constraint:  SNat @n ::  n =>  n As a pattern: Matches on an explicit  n value bringing an implicit  n constraint into scope: f :: ( n -> .. f SNat = {- SNat n in scope -}  base base base6Convert an integer into an unknown type-level natural.baseWe either get evidence that this function was instantiated with the same type-level numbers, or .baseWe either get evidence that this function was instantiated with the same type-level numbers, or that the type-level numbers are distinct.baseLike , but if the numbers aren't equal, this additionally provides proof of LT or GT.base Return the  number corresponding to n in an  n value.baseConvert an explicit  n value into an implicit  n constraint.base Convert a  number into an  n value, where n' is a fresh type-level natural number.basebasebasebasebasebasebasebasebase0 Trustworthy()*/01;0baseThis class gives the string associated with a type-level symbol. There are instances of the class for every concrete literal: "hello", etc.base base$Concatenation of type-level symbols.base9Extending a type-level symbol with a type-level characterbase#This type family yields type-level  storing the first character of a symbol and its tail if it is defined and  otherwise.base3Convert a character to its Unicode code point (cf. 1)base1Convert a Unicode code point to a character (cf. 1)baseA value-level witness for a type-level character. This is commonly referred to as a  singleton type, as for each c2, there is a single value that inhabits the type  c (aside from bottom).The definition of / is intentionally left abstract. To obtain an ! value, use one of the following: The  method of .The SChar pattern synonym.The  function, which creates an  from a .baseA value-level witness for a type-level symbol. This is commonly referred to as a  singleton type, as for each s2, there is a single value that inhabits the type  s (aside from bottom).The definition of / is intentionally left abstract. To obtain an ! value, use one of the following: The  method of .The SSymbol pattern synonym.The  function, which creates an  from a .base0This type represents unknown type-level symbols.basebase7A explicitly bidirectional pattern synonym relating an  to a  constraint.As an  expression: Constructs an explicit  c value from an implicit  c constraint:  SChar @c ::  c =>  c As a pattern: Matches on an explicit  c value bringing an implicit  c constraint into scope: f :: * c -> .. f SChar = {- SChar c in scope -} base7A explicitly bidirectional pattern synonym relating an  to a  constraint.As an  expression: Constructs an explicit  s value from an implicit  s constraint: SSymbol @s ::  s =>  s As a pattern: Matches on an explicit  s value bringing an implicit  s constraint into scope: f :: . s -> .. f SSymbol = {- SSymbol s in scope -} basebasebasebasebase6Convert an integer into an unknown type-level natural.base3Convert a string into an unknown type-level symbol.base4Convert a character into an unknown type-level char.baseWe either get evidence that this function was instantiated with the same type-level symbols, or .baseWe either get evidence that this function was instantiated with the same type-level symbols, or that the type-level symbols are distinct.baseWe either get evidence that this function was instantiated with the same type-level characters, or .baseWe either get evidence that this function was instantiated with the same type-level characters, or that the type-level characters are distinct.baseLike , but if the symbols aren't equal, this additionally provides proof of LT or GT.baseLike , but if the Chars aren't equal, this additionally provides proof of LT or GT.base Return the  corresponding to n in an SNat n value. The returned  is always non-negative..For a version of this function that returns a Natural instead of an , see  in  GHC.TypeNats.baseAttempt to convert an  into an SNat n value, where n/ is a fresh type-level natural number. If the 9 argument is non-negative, invoke the continuation with Just sn, where sn is the SNat n value. If the 5 argument is negative, invoke the continuation with .;For a version of this function where the continuation uses 'SNat n instead of  (SNat n)@, see  in  GHC.TypeNats.base#Return the String corresponding to s in an  s value.baseConvert an explicit  s value into an implicit  s constraint.base Convert a  into an  s value, where s is a fresh type-level symbol.base Return the  corresponding to c in an  c value.baseConvert an explicit  c value into an implicit  c constraint.base Convert a  into an  c value, where c" is a fresh type-level character.basebasebasebasebasebasebasebasebasebasebasebasebasebase.(c) Universiteit Utrecht 2010-2011, University of Oxford 2012-2014see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy)*01369<NbaseRepresentable types of kind *+. This class is derivable in GHC with the  DeriveGeneric flag on.A * instance must satisfy the following laws:  .  D   .  D  baseRepresentable types of kind * -> * (or kind k -> *, when  PolyKinds8 is enabled). This class is derivable in GHC with the  DeriveGeneric flag on.A * instance must satisfy the following laws:  .  D   .  D  base,Class for datatypes that represent datatypesbase4Class for datatypes that represent data constructorsbase*Class for datatypes that represent recordsbase-Void: used for datatypes without constructorsbase-Unit: used for constructors without argumentsbase-Used for marking occurrences of the parameterbaseRecursive calls of kind * -> * (or kind k -> *, when  PolyKinds is enabled)base7Constants, additional parameters and recursion of kind *base*Meta-information (constructor names, etc.)base(Sums: encode choice between constructorsbase3Products: encode multiple arguments to constructorsbaseComposition of functorsbaseTag for K1: recursion (of kind Type)baseTag for M1: datatypebaseTag for M1: constructorbaseTag for M1: record selectorbase-Type synonym for encoding recursion (of kind Type)base8Type synonym for encoding meta-information for datatypesbase;Type synonym for encoding meta-information for constructorsbase?Type synonym for encoding meta-information for record selectorsbaseGeneric representation typebaseGeneric representation type baseConstants of unlifted kinds baseType synonym for   baseType synonym for   baseType synonym for   baseType synonym for   baseType synonym for   baseType synonym for  ?baseThe ? class is essentially a kind class. It classifies all kinds for which singletons are defined. The class supports converting between a singleton type and the base (unrefined) type which it is built from.?baseGet a base type from a proxy for the promoted kind. For example, DemoteRep Bool will be the type Bool.?base-Convert a singleton to its unrefined version.?baseA ?: constraint is essentially an implicitly-passed singleton.?base;Produce the singleton explicitly. You will likely need the ScopedTypeVariables0 extension to use this method the way you want.?base'The singleton kind-indexed data family. base;Datatype to represent metadata associated with a datatype (MetaData), constructor (MetaCons), or field selector (MetaSel).In MetaData n m p nt, n is the datatype's name, m4 is the module in which the datatype is defined, p9 is the package in which the datatype is defined, and nt is 'True if the datatype is a newtype.In MetaCons n f s, n is the constructor's name, f is its fixity, and s is 'True. if the constructor contains record selectors.In MetaSel mn su ss ds(, if the field uses record syntax, then mn is  the record name. Otherwise, mn is . su and ss are the field's unpackedness and strictness annotations, and ds4 is the strictness that GHC infers for the field.base;A type whose instances are defined generically, using the  representation.  is a higher-kinded version of  that uses . V4 a pure a = V4 a a a a liftA2 :: (a -> b -> c) -> (V4 a -> V4 b -> V4 c) liftA2 () (V4 a1 b1 c1 d1) (V4 a2 b2 c2 d2) = V4 (a1  a2) (b1  b2) (c1  c2) (d1  d2) Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like - decouples the instance from the type class.base?A datatype whose instances are defined generically, using the  representation.  is a higher-kinded version of  that uses .%Generic instances can be derived via  A using  -XDerivingVia. {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE DerivingVia #-} import GHC.Generics (Generic) data V4 a = V4 a a a a deriving stock Generic deriving (Semigroup, Monoid) via Generically (V4 a) This corresponds to  and ) instances defined by pointwise lifting: instance Semigroup a => Semigroup (V4 a) where (<>) :: V4 a -> V4 a -> V4 a V4 a1 b1 c1 d1 <> V4 a2 b2 c2 d2 = V4 (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2) instance Monoid a => Monoid (V4 a) where mempty :: V4 a mempty = V4 mempty mempty mempty mempty Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like - decouples the instance from the type class.base/Convert from the datatype to its representationbase/Convert from the representation to the datatypebase/Convert from the datatype to its representationbase/Convert from the representation to the datatypebaseThe name of the selector base/The selector's unpackedness annotation (if any) base-The selector's strictness annotation (if any) base:The strictness that the compiler inferred for the selector baseThe strictness that GHC infers for a field during compilation. Whereas there are nine different combinations of  and , the strictness that GHC decides will ultimately be one of lazy, strict, or unpacked. What GHC decides is affected both by what the user writes in the source code and by GHC flags. As an example, consider this data type: 9data E = ExampleConstructor {-# UNPACK #-} !Int !Int Int If compiled without optimization or other language extensions, then the fields of ExampleConstructor will have ,  , and , respectively.If compiled with  -XStrictData' enabled, then the fields will have , , and , respectively.If compiled with -O2$ enabled, then the fields will have , , and , respectively. baseThe strictness of a field as the user wrote it in the source code. For example, in the following data type: *data E = ExampleConstructor Int ~Int !Int The fields of ExampleConstructor have , , and , respectively. baseThe unpackedness of a field as the user wrote it in the source code. For example, in the following data type: data E = ExampleConstructor Int {-# NOUNPACK #-} Int {-# UNPACK #-} Int The fields of ExampleConstructor have , , and , respectively.base8Datatype to represent the associativity of a constructor baseThis variant of  appears at the type level.baseDatatype to represent the fixity of a constructor. An infix | declaration directly corresponds to an application of .baseThe name of the constructorbaseThe fixity of the constructorbase%Marks if this constructor is a recordbase&The name of the datatype (unqualified)baseThe fully-qualified name of the module where the type is declared base9The package name of the module where the type is declaredbase+Marks if the datatype is actually a newtypebase%Get the precedence of a fixity value.? base Used for marking occurrences of ? base Used for marking occurrences of ? base Used for marking occurrences of @ base Used for marking occurrences of @ base Used for marking occurrences of @ base Used for marking occurrences of  base base base base base base base base base base base base base base base base base base base basebase base basebasebasebasebasebasebasebase base base base base base base base base base base base base base base base base base base base base base basebase base base base base base base basebasebasebasebase base base base base base basebasebasebasebase basebasebasebasebase base base base base base  base base base base base  base base base base base  base base base base base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base base base base base base base base base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base  base! base! base! base! base! base! base! base! base! base! base! base! base! base! base! base! base! base! base@ base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@ base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@ base@ base@ base@base@ base@base@ base@base@ base@base@ base@base@ base@base@ base@base@ base@ base@ base@ base@ base@ base@ base@ base@ base@ base@ base@ base@base@base@ base@ base@ baseNone0<]1baseThis is a valid definition of  for an idempotent .When  x <> x = x<, this definition should be preferred, because it works in \mathcal{O}(1) rather than \mathcal{O}(\log n)!base Monoid under . Alt l <> Alt r == Alt (l <|> r)ExamplesAlt (Just 12) <> Alt (Just 24)Alt {getAlt = Just 12}Alt Nothing <> Alt (Just 24)Alt {getAlt = Just 24}!baseMonoid under multiplication. )Product x <> Product y == Product (x * y)Examples Product 3 <> Product 4 <> memptyProduct {getProduct = 12}%mconcat [ Product n | n <- [2 .. 10]]Product {getProduct = 3628800}!baseMonoid under addition. Sum a <> Sum b = Sum (a + b)ExamplesSum 1 <> Sum 2 <> memptySum {getSum = 3} mconcat [ Sum n | n <- [3 .. 9]]Sum {getSum = 42}!base!Boolean monoid under disjunction  . Any x <> Any y = Any (x || y)ExamplesAny True <> mempty <> Any FalseAny {getAny = True}.mconcat (map (\x -> Any (even x)) [2,4,6,7,8])Any {getAny = True}Any False <> memptyAny {getAny = False}!base!Boolean monoid under conjunction  . All x <> All y = All (x && y)Examples All True <> mempty <> All False)All {getAll = False}.mconcat (map (\x -> All (even x)) [2,4,6,7,8])All {getAll = False}All True <> memptyAll {getAll = True}!base.The monoid of endomorphisms under composition.  Endo f <> Endo g == Endo (f . g)Examples6let computation = Endo ("Hello, " ++) <> Endo (++ "!")appEndo computation "Haskell""Hello, Haskell!"(let computation = Endo (*3) <> Endo (+1)appEndo computation 16!baseThe dual of a (, obtained by swapping the arguments of [. !Dual a <> Dual b == Dual (b <> a)ExamplesDual "Hello" <> Dual "World"Dual {getDual = "WorldHello"}*Dual (Dual "Hello") <> Dual (Dual "World").Dual {getDual = Dual {getDual = "HelloWorld"}}!baseThis is a valid definition of  for an idempotent .When  x <> x = x<, this definition should be preferred, because it works in \mathcal{O}(1) rather than \mathcal{O}(\log n).!baseThis is a valid definition of  for a .!Unlike the default definition of , it is defined for 0 and so it should be preferred where possible.@base@base@base@base@ base@base@ base@base@ base@base@ base@base@base@base@base@ base@base@base@base@base@ base@base@ base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@base@baseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseAbaseA!AA!!!!!!!!!!!!!!!!!!!!!!(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy0<h*! base*This data type witnesses the lifting of a  into an  pointwise.Examples!Ap (Just [1, 2, 3]) <> Ap NothingAp {getAp = Nothing}(Ap [Sum 10, Sum 20] <> Ap [Sum 1, Sum 2]Ap {getAp = [Sum {getSum = 11},Sum {getSum = 12},Sum {getSum = 21},Sum {getSum = 22}]}!base)Maybe monoid returning the rightmost non- value.! a is isomorphic to ! (! a), and thus to ! (!  a)Data.Semigroup.O". The former returns the last non-, so !x <> Data.Monoid.Last Nothing = x2. The latter simply returns the last value, thus >x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing.Examples:Last (Just "hello") <> Last Nothing <> Last (Just "world")Last {getLast = Just "world"}Last Nothing <> memptyLast {getLast = Nothing}!base(Maybe monoid returning the leftmost non- value.! a is isomorphic to !  a , but precedes it historically. Beware that  Data.Monoid.! is different from Data.Semigroup.O#. The former returns the first non-, so "Data.Monoid.First Nothing <> x = x3. The latter simply returns the first value, thus Data.Semigroup.First Nothing <> x = Data.Semigroup.First Nothing.Examples=First (Just "hello") <> First Nothing <> First (Just "world")First {getFirst = Just "hello"}First Nothing <> memptyFirst {getFirst = Nothing}!base! base!base! base! base!Note that even if the underlying u and ! instances are lawful, for most s, this instance will not be lawful. If you use this instance with the list ., the following customary laws will not hold:Commutativity:Ap [10,20] + Ap [1,2]Ap {getAp = [11,12,21,22]}Ap [1,2] + Ap [10,20]Ap {getAp = [11,21,12,22]}Additive inverse:Ap [] + negate (Ap [])Ap {getAp = []}fromInteger 0 :: Ap [] IntAp {getAp = [0]}Distributivity:Ap [1,2] * (3 + 4)Ap {getAp = [7,14]}(Ap [1,2] * 3) + (Ap [1,2] * 4)Ap {getAp = [7,11,10,14]}! base! base! base! base! base! base! base! base! base! base! base! base! base! base!base!base!base!base!base!base!base!base!base!base!base!base!base!baseA baseA baseAbaseAbaseAbaseAbase#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]^\[&\]^[!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy"baseThe " function drops the largest suffix of a list in which the given predicate holds for all elements.LazinessThis function is lazy in spine, but strict in elements, which makes it different from    p  , which is strict in spine, but lazy in elements. For instance:+take 1 (dropWhileEnd (< 0) (1 : undefined))[1] 10) [1..20][1,2,3,4,5,6,7,8,9,10]"base\mathcal{O}(\min(m,n)). The ": function drops the given prefix from a list. It returns 6 if the list did not start with the prefix given, or ' the list after the prefix, if it does.ExamplesstripPrefix "foo" "foobar" Just "bar"stripPrefix "foo" "foo"Just ""stripPrefix "foo" "barfoo"NothingstripPrefix "foo" "barfoobaz"Nothing"baseThe " function returns the index of the first element in the given list which is equal (by ;) to the query element, or 4 if there is no such element. For the result to be , the list must be finite.ExampleselemIndex 4 [0..]Just 4elemIndex 'o' "haskell"NothingelemIndex 0 [1..]* hangs forever *"baseThe " function extends ", by returning the indices of all elements equal to the query element, in ascending order.ExampleselemIndices 'o' "Hello World"[4,7] elemIndices 1 [1, 2, 3, 1, 2, 3][0,3]"baseThe " function takes a predicate and a list and returns the first element in the list matching the predicate, or 5 if there is no such element. For the result to be , the list must be finite.Examplesfind (> 4) [1..]Just 5find (< 0) [1..10]Nothing,find ('a' `elem`) ["john", "marcus", "paul"] Just "marcus""baseThe " function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or 4 if there is no such element. For the result to be , the list must be finite.Examples findIndex isSpace "Hello World!"Just 5findIndex odd [0, 2, 4, 6]NothingfindIndex even [1..]Just 1findIndex odd [0, 2 ..]* hangs forever *"baseThe " function extends ", by returning the indices of all elements satisfying the predicate, in ascending order.Examples+findIndices (`elem` "aeiou") "Hello World!"[1,4,7]findIndices (\l -> length l > 3) ["a", "bcde", "fgh", "ijklmnop"][1,3]"base\mathcal{O}(\min(m,n)). The "' function takes two lists and returns . iff the first list is a prefix of the second.Examples#"Hello" `isPrefixOf` "Hello World!"True#"Hello" `isPrefixOf` "Wello Horld!"FalseFor the result to be ", the first list must be finite; %, however, results from any mismatch:[0..] `isPrefixOf` [1..]False[0..] `isPrefixOf` [0..99]False[0..99] `isPrefixOf` [0..]True[0..] `isPrefixOf` [0..]* Hangs forever *", shortcuts when the first argument is empty:isPrefixOf [] undefinedTrue"baseThe "& function takes two lists and returns / iff the first list is a suffix of the second.Examples!"ld!" `isSuffixOf` "Hello World!"True#"World" `isSuffixOf` "Hello World!"FalseThe second list must be finite; however the first list may be infinite:[0..] `isSuffixOf` [0..99]False[0..99] `isSuffixOf` [0..]* Hangs forever *"baseThe "& function takes two lists and returns  iff the first list is contained, wholly and intact, anywhere within the second.Examples,isInfixOf "Haskell" "I really like Haskell."True(isInfixOf "Ial" "I really like Haskell."FalseFor the result to be 7, the first list must be finite; for the result to be !, the second list must be finite:[20..50] `isInfixOf` [0..]True[0..] `isInfixOf` [20..50]False[0..] `isInfixOf` [0..]* Hangs forever *"base\mathcal{O}(n^2). The " function removes duplicate elements from a list. 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.If there exists instance Ord a, it's faster to use nubOrd from the  containers package ( https://hackage.haskell.org/package/containers/docs/Data-Containers-ListUtils.html#v:nubOrd'link to the latest online documentation), which takes only \mathcal{O}(n \log d) time where d1 is the number of distinct elements in the list.Another approach to speed up " is to use ) Data.List.NonEmpty.= . Data.List.NonEmpty.= . #, which takes \mathcal{O}(n \log n) time, requires instance Ord a! and doesn't preserve the order.Examplesnub [1,2,3,4,3,2,1,2,4,3,5] [1,2,3,4,5]nub "hello, world!" "helo, wrd!""baseThe " function behaves just like ", except it uses a user-supplied equality predicate instead of the overloaded ; function.Examples.nubBy (\x y -> mod x 3 == mod y 3) [1,2,4,5,6][1,2,6])nubBy (/=) [2, 7, 1, 8, 2, 8, 1, 8, 2, 8][2,2,2](nubBy (>) [1, 2, 3, 2, 1, 5, 4, 5, 3, 2] [1,2,3,5,5]"base\mathcal{O}(n). " x! removes the first occurrence of x from its list argument.It is a special case of ", which allows the programmer to supply their own equality test.Examplesdelete 'a' "banana""bnana"0delete "not" ["haskell", "is", "not", "awesome"]["haskell","is","awesome"]"base\mathcal{O}(n). The " function behaves like "0, but takes a user-supplied equality predicate.ExamplesdeleteBy (<=) 4 [1..10][1,2,3,5,6,7,8,9,10]"deleteBy (/=) 5 [5, 5, 4, 3, 5, 2] [5,5,3,5,2]"baseThe " 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.Examples"Hello World!" \\ "ell W" "Hoorld!">The second list must be finite, but the first may be infinite.take 5 ([0..] \\ [2..4]) [0,1,5,6,7]take 5 ([0..] \\ [2..])* Hangs forever *"baseThe " function returns the list union of the two lists. It is a special case of ", which allows the programmer to supply their own equality test.Examples"dog" `union` "cow""dogcw"If equal elements are present in both lists, an element from the first list will be used. If the second list contains equal elements, only the first one will be retained:import Data.Semigroup(Arg(..))#union [Arg () "dog"] [Arg () "cow"][Arg () "dog"]%union [] [Arg () "dog", Arg () "cow"][Arg () "dog"]However if the first list contains duplicates, so will the result:"coot" `union` "duck" "cootduk""duck" `union` "coot""duckot""3 is productive even if both arguments are infinite.[0, 2 ..] `union` [1, 3 ..][0,2,4,6,8,10,12.."baseThe "+ function is the non-overloaded version of "". Both arguments may be infinite.Examples(unionBy (>) [3, 4, 5] [1, 2, 3, 4, 5, 6] [3,4,5,4,5,6]import Data.Semigroup (Arg(..))+unionBy (/=) [Arg () "Saul"] [Arg () "Kim"][Arg () "Saul", Arg () "Kim"]"baseThe " function takes the list intersection of two lists. It is a special case of ", which allows the programmer to supply their own equality test.Examples[1,2,3,4] `intersect` [2,4,6,8][2,4]If equal elements are present in both lists, an element from the first list will be used, and all duplicates from the second list quashed:import Data.Semigroup5intersect [Arg () "dog"] [Arg () "cow", Arg () "cat"][Arg () "dog"]However if the first list contains duplicates, so will the result."coot" `intersect` "heron""oo""heron" `intersect` "coot""o" If the second list is infinite, " either hangs or returns its first argument in full. Otherwise if the first list is infinite, " might be productive:intersect [100..] [0..][100,101,102,103...intersect [0] [1..]* Hangs forever *intersect [1..] [0]* Hangs forever *intersect (cycle [1..3]) [2] [2,2,2,2..."baseThe "+ function is the non-overloaded version of ". It is productive for infinite arguments only if the first one is a subset of the second."base\mathcal{O}(n). The " function takes an element and a list and `intersperses' that element between the elements of the list.Laziness" has the following properties0take 1 (intersperse undefined ('a' : undefined))"a"*take 2 (intersperse ',' ('a' : undefined))""a*** Exception: Prelude.undefinedExamplesintersperse ',' "abcde" "a,b,c,d,e"intersperse 1 [3, 4, 5] [3,1,4,1,5]"base" xs xss is equivalent to ( (" xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.Laziness" has the following properties:4take 5 (intercalate undefined ("Lorem" : undefined))"Lorem"/take 6 (intercalate ", " ("Lorem" : undefined))&"Lorem*** Exception: Prelude.undefinedExamples,intercalate ", " ["Lorem", "ipsum", "dolor"]"Lorem, ipsum, dolor"*intercalate [0, 1] [[2, 3], [4, 5, 6], []][2,3,0,1,4,5,6,0,1]intercalate [1, 2, 3] [[], []][1,2,3]"baseThe ": function transposes the rows and columns of its argument.Laziness" is lazy in its elements5take 1 (transpose ['a' : undefined, 'b' : undefined])["ab"]Examplestranspose [[1,2,3],[4,5,6]][[1,4],[2,5],[3,6]]If some of the rows are shorter than the following rows, their elements are skipped:&transpose [[10,11],[20],[],[30,31,32]][[10,20,30],[11,31],[32]]9For this reason the outer list must be finite; otherwise " hangs:transpose (repeat [])* Hangs forever *"baseThe " function takes a predicate and a list, and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e., 4partition p xs == (filter p xs, filter (not . p) xs)Examples)partition (`elem` "aeiou") "Hello World!"("eoo","Hll Wrld!")partition even [1..10]([2,4,6,8,10],[1,3,5,7,9])partition (< 5) [1..10]([1,2,3,4],[5,6,7,8,9,10])"baseThe "( function behaves like a combination of ) and ; it applies a function to each element of a list, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.", does not force accumulator if it is unused:take 1 (snd (mapAccumL (\_ x -> (undefined, x)) undefined ('a' : undefined)))"a""baseThe "( function behaves like a combination of ) and ; it applies a function to each element of a list, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new list."base\mathcal{O}(n). The " function takes an element and a list and inserts the element into the list at the first position where it is 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.Examplesinsert (-1) [1, 2, 3] [-1,1,2,3]insert 'd' "abcefg" "abcdefg"insert 4 [1, 2, 3, 5, 6, 7][1,2,3,4,5,6,7]"base\mathcal{O}(n) . The non-overloaded version of ".ExamplesinsertBy (\x y -> compare (length x) (length y)) [1, 2] [[1], [1, 2, 3], [1, 2, 3, 4]][[1],[1,2],[1,2,3],[1,2,3,4]]"baseThe "+ function is the non-overloaded version of , which takes a comparison function and a list and returns the greatest element of the list by the comparison function. The list must be finite and non-empty.Examples4We can use this to find the longest entry of a list:maximumBy (\x y -> compare (length x) (length y)) ["Hello", "World", "!", "Longest", "bar"] "Longest"minimumBy (\(a, b) (c, d) -> compare (abs (a - b)) (abs (c - d))) [(10, 15), (1, 2), (3, 5)](10, 15)"baseThe "+ function is the non-overloaded version of , which takes a comparison function and a list and returns the least element of the list by the comparison function. The list must be finite and non-empty.Examples5We can use this to find the shortest entry of a list:minimumBy (\x y -> compare (length x) (length y)) ["Hello", "World", "!", "Longest", "bar"]"!"minimumBy (\(a, b) (c, d) -> compare (abs (a - b)) (abs (c - d))) [(10, 15), (1, 2), (3, 5)](1, 2)"base\mathcal{O}(n). The "' function is an overloaded version of ). In particular, instead of returning an /, it returns any type which is an instance of u'. It is, however, less efficient than .ExamplesgenericLength [1, 2, 3] :: Int3 genericLength [1, 2, 3] :: Float3.0Users should take care to pick a return type that is wide enough to contain the full length of the list. If the width is insufficient, the overflow behaviour will depend on the (+) implementation in the selected u instance. The following example overflows because the actual list length of 200 lies outside of the Int8 range of  -128..127.genericLength [1..200] :: Int8-56"baseThe "& function is an overloaded version of , which accepts any q) value as the number of elements to take."baseThe "& function is an overloaded version of , which accepts any q) value as the number of elements to drop."baseThe "& function is an overloaded version of , which accepts any q) value as the position at which to split."baseThe "& function is an overloaded version of , which accepts any q value as the index.#baseThe #& function is an overloaded version of , which accepts any q, value as the number of repetitions to make.#baseThe # function takes four lists and returns a list of quadruples, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes five lists and returns a list of five-tuples, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes six lists and returns a list of six-tuples, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes seven lists and returns a list of seven-tuples, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes a function which combines four elements, as well as four lists and returns a list of their point-wise combination, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes a function which combines five elements, as well as five lists and returns a list of their point-wise combination, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes a function which combines six elements, as well as six lists and returns a list of their point-wise combination, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes a function which combines seven elements, as well as seven lists and returns a list of their point-wise combination, analogous to . It is capable of list fusion, but it is restricted to its first list argument and its resulting list.#baseThe # function takes a list of quadruples and returns four lists, analogous to .#baseThe # function takes a list of five-tuples and returns five lists, analogous to .#baseThe # function takes a list of six-tuples and returns six lists, analogous to .#baseThe # function takes a list of seven-tuples and returns seven lists, analogous to .#baseThe # function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed. This is the non-overloaded version of ". (\\) == deleteFirstsBy (==)>The second list must be finite, but the first may be infinite.Examples$deleteFirstsBy (>) [1..10] [3, 4, 5][4,5,6,7,8,9,10]%deleteFirstsBy (/=) [1..10] [1, 3, 5][4,5,6,7,8,9,10]#baseThe # function takes a list and returns a list of lists such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result is non-empty and all elements are equal to the first one.# is a special case of #, which allows the programmer to supply their own equality test.It's often preferable to use Data.List.NonEmpty.=, which provides type-level guarantees of non-emptiness of inner lists.Examplesgroup "Mississippi"$["M","i","ss","i","ss","i","pp","i"]!group [1, 1, 1, 2, 2, 3, 4, 5, 5][[1,1,1],[2,2],[3],[4],[5,5]]#baseThe #+ function is the non-overloaded version of #.When a supplied relation is not transitive, it is important to remember that equality is checked against the first element in the group, not against the nearest neighbour:#groupBy (\a b -> b - a < 5) [0..19];[[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14],[15,16,17,18,19]]It's often preferable to use Data.List.NonEmpty.=, which provides type-level guarantees of non-emptiness of inner lists.Examples(groupBy (/=) [1, 1, 1, 2, 3, 1, 4, 4, 5][[1],[1],[1,2,3],[1,4,4,5]]'groupBy (>) [1, 3, 5, 1, 4, 2, 6, 5, 4][[1],[3],[5,1,4,2],[6,5,4]]groupBy (const not) [True, False, True, False, False, False, True].[[True,False],[True,False,False,False],[True]]#baseThe # function returns all initial segments of the argument, shortest first.# is semantically equivalent to )  .  ( (:)) []8, but under the hood uses a queue to amortize costs of .Laziness Note that #) has the following strictness property: #inits (xs ++ _|_) = inits xs ++ _|_In particular, inits _|_ = [] : _|_Examples inits "abc"["","a","ab","abc"]inits [][[]]&inits is productive on infinite lists:take 5 $ inits [1..] [[],[1],[1,2],[1,2,3],[1,2,3,4]]#base\mathcal{O}(n). The # function returns all final segments of the argument, longest first.Laziness Note that #) has the following strictness property: tails _|_ = _|_ : _|_tails undefined![*** Exception: Prelude.undefined drop 1 (tails [undefined, 1, 2])[[1, 2], [2], []]Examples tails "abc"["abc","bc","c",""]tails [1, 2, 3][[1,2,3],[2,3],[3],[]]tails [][[]]#baseThe #? function returns the list of all subsequences of the argument.Laziness#$ does not look ahead unless it must:take 1 (subsequences undefined)[[]]'take 2 (subsequences ('a' : undefined))["","a"]Examplessubsequences "abc"%["","a","b","ab","c","ac","bc","abc"]/This function is productive on infinite inputs:take 8 $ subsequences ['a'..]%["","a","b","ab","c","ac","bc","abc"]AbaseThe A function returns the list of all subsequences of the argument, except for the empty list.nonEmptySubsequences "abc""["a","b","ab","c","ac","bc","abc"]#baseThe #? function returns the list of all permutations of the argument.Note that the order of permutations is not lexicographic. It satisfies the following property: map (take n) (take (product [1..n]) (permutations ([1..n] ++ undefined))) == permutations [1..n]LazinessThe #' function is maximally lazy: for each n, the value of # xs. starts with those permutations that permute  n xs and keep  n xs.Examplespermutations "abc"%["abc","bac","cba","bca","cab","acb"]permutations [1, 2] [[1,2],[2,1]]permutations [][[]]/This function is productive on infinite inputs:,take 6 $ map (take 3) $ permutations ['a'..]%["abc","bac","cba","bca","cab","acb"]#baseThe # function implements a stable sorting algorithm. It is a special case of #, which allows the programmer to supply their own comparison function.Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.The argument must be finite.Examplessort [1,6,4,3,2,5] [1,2,3,4,5,6]sort "haskell" "aehklls"import Data.Semigroup(Arg(..))sort [Arg ":)" 0, Arg ":D" 0, Arg ":)" 1, Arg ":3" 0, Arg ":D" 1]8[Arg ":)" 0,Arg ":)" 1,Arg ":3" 0,Arg ":D" 0,Arg ":D" 1]#baseThe #+ function is the non-overloaded version of #. The argument must be finite.The supplied comparison relation is supposed to be reflexive and antisymmetric, otherwise, e. g., for  _ _ -> GT, the ordered list simply does not exist. The relation is also expected to be transitive: if it is not then #? might fail to find an ordered permutation, even if it exists.ExamplessortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")]![(1,"Hello"),(2,"world"),(4,"!")]#baseSort a list by comparing the results of a key function applied to each element. # f is equivalent to # ( f)8, but has the performance advantage of only evaluating f once for each element in the input list. This is called the decorate-sort-undecorate paradigm, or  3https://en.wikipedia.org/wiki/Schwartzian_transformSchwartzian transform.Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.The argument must be finite.Examples1sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]![(1,"Hello"),(2,"world"),(4,"!")]sortOn length ["jim", "creed", "pam", "michael", "dwight", "kevin"]0["jim","pam","creed","kevin","dwight","michael"]#base'Construct a list from a single element.Examplessingleton True[True]singleton [1, 2, 3] [[1,2,3]] singleton 'c'"c"#baseThe # 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) == xsif the following holds: ,f' (f x y) = Just (x,y) f' z = NothingLaziness0take 1 (unfoldr (\x -> Just (x, undefined)) 'a')"a"Examples if b == 0 then Nothing else Just (b, b-1)) 10[10,9,8,7,6,5,4,3,2,1]:take 10 $ unfoldr (\(x, y) -> Just (x, (y, x + y))) (0, 1)[0,1,1,2,3,5,8,13,21,54]#base#Splits the argument into a list of lines stripped of their terminating \n characters. The \n terminator is optional in a final non-empty line of the argument string.0When the argument string is empty, or ends in a \n: character, it can be recovered by passing the result of # to the # function. Otherwise, #! appends the missing terminating \n. This makes unlines . lines  idempotent: 9(unlines . lines) . (unlines . lines) = (unlines . lines)Examples3lines "" -- empty input contains no lines[]'lines "\n" -- single empty line[""].lines "one" -- single unterminated line["one"]+lines "one\n" -- single non-empty line["one"]*lines "one\n\n" -- second line is empty ["one",""]1lines "one\ntwo" -- second line is unterminated ["one","two"])lines "one\ntwo\n" -- two non-empty lines ["one","two"]#base Appends a \n character to each input string, then concatenates the results. Equivalent to foldMap (s -> s  "\n").Examplesunlines ["Hello", "World", "!"]"Hello\nWorld\n!\n" Note that #  #    when the input is not \n -terminated:unlines . lines $ "foo\nbar" "foo\nbar\n"#base# breaks a string up into a list of words, which were delimited by white space (as defined by ). This function trims any white spaces at the beginning and at the end.Exampleswords "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]words " foo bar " ["foo","bar"]#base#3 joins words with separating spaces (U+0020 SPACE).#& is neither left nor right inverse of #:words (unwords [" "])[]unwords (words "foo\nbar") "foo bar"Examples#unwords ["Lorem", "ipsum", "dolor"]"Lorem ipsum dolor"!unwords ["foo", "bar", "", "baz"]"foo bar baz""""#"""""""""#""###"""""""""#"""""""#####"##"#""###############)"x"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafeҜ"""#"""""""""#""###"""""""""#"""""""#####"##"#""###############)#""""#)"""##""#""##"""""""################"""""##"""#""##""""""#(c) Tamar Christina 2018/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portableNoneBAbase4A type alias for timeouts, specified in nanoseconds.AbaseA pair of an event and lifetimeHere we encode the event in the bottom three bits and the lifetime in the fourth bit.#base&The lifetime of an event registration.#base3the registration will be active for only one event#base,the registration will trigger multiple times#base An I/O event.#baseData is available to be read.#base/The file descriptor is ready to accept a write.Abase*Another thread closed the file descriptor.AbaseThe longer of two lifetimes.AbaseA baseAbaseAbasemappend# takes the longer of two lifetimes.A baseAbaseA baseAbaseAbaseAbaseAbaseAbaseAbaseAAAAAA###A###AAA,Ross Paterson 20054BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy6;0<baseThe Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.7Instances can be derived automatically by enabling the DeriveFoldable extension. For example, a derived instance for a binary tree might be: {-# LANGUAGE DeriveFoldable #-} data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving Foldable0A more detailed description can be found in the Overview section of Data.Foldable#overview.For the class laws see the Laws section of Data.Foldable#laws.!base0Given a structure with elements whose type is a !, combine them via the monoid's ([) operator. This fold is right-associative and lazy in the accumulator. When you need a strict left-associative fold, use ! instead, with  as the map.Examples Basic usage:!fold [[1, 2, 3], [4, 5], [6], []] [1,2,3,4,5,6]1fold $ Node (Leaf (Sum 1)) (Sum 3) (Leaf (Sum 5))Sum {getSum = 9}Folds of unbounded structures do not terminate when the monoid's ([) operator is strict:fold (repeat Nothing)* Hangs forever *8Lazy corecursive folds of unbounded structures are fine:+take 12 $ fold $ map (\i -> [i..i+2]) [0..][0,1,2,1,2,3,2,3,4,3,4,5]6sum $ take 4000000 $ fold $ map (\i -> [i..i+2]) [0..] 2666668666666!baseMap each element of the structure into a monoid, and combine the results with ([). This fold is right-associative and lazy in the accumulator. For strict left-associative folds consider ! instead.Examples Basic usage:foldMap Sum [1, 3, 5]Sum {getSum = 9}foldMap Product [1, 3, 5]Product {getProduct = 15}foldMap (replicate 3) [1, 2, 3][1,1,1,2,2,2,3,3,3]When a Monoid's ([)! is lazy in its second argument, ! can return a result even from an unbounded structure. For example, lazy accumulation enables Data.ByteString.Builder to efficiently serialise large data structures and produce the output incrementally:*import qualified Data.ByteString.Lazy as L-import qualified Data.ByteString.Builder as B?let bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x200let lbs = B.toLazyByteString $ foldMap bld [0..] L.take 64 lbs"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"! baseA left-associative variant of ! that is strict in the accumulator. Use this method for strict reduction when partial results are merged via ([).Examples Define a  over finite bit strings under xor#. Use it to strictly compute the xor of a list of  values. !:set -XGeneralizedNewtypeDeriving2import Data.Bits (Bits, FiniteBits, xor, zeroBits)import Data.Foldable (foldMap')import Numeric (showHex)newtype X a = X a deriving (Eq, Bounded, Enum, Bits, FiniteBits)instance Bits a => Semigroup (X a) where X a <> X b = X (a `xor` b)instance Bits a => Monoid (X a) where mempty = X zeroBitslet bits :: [Int]; bits = [0xcafe, 0xfeed, 0xdeaf, 0xbeef, 0x5411]?(\ (X a) -> showString "0x" . showHex a $ "") $ foldMap' X bits"0x42"!base?Right-associative fold of a structure, lazy in the accumulator.In the case of lists, , when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left: foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)Note that since the head of the resulting expression is produced by an application of the operator to the first element of the list, given an operator lazy in its right argument, > can produce a terminating expression from an unbounded list.For a general 5 structure this should be semantically identical to,  foldr f z =  f z . !Examples Basic usage:%foldr (||) False [False, True, False]Truefoldr (||) False []False7foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd'] "foodcba"Infinite structures M Applying 2 to infinite structures usually doesn't terminate.=It may still terminate under one of the following conditions:(the folding function is short-circuiting3the folding function is lazy on its second argumentShort-circuiting( ) short-circuits on 9 values, so the following terminates because there is a ' value finitely far from the left side:&foldr (||) False (True : repeat False)True$But the following doesn't terminate:)foldr (||) False (repeat False ++ [True])* Hangs forever *Laziness in the second argument Applying  to infinite structures terminates when the operator is lazy in its second argument (the initial accumulator is never used in this case, and so could be left , but [] is more clear)::take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1) [1,4,7,10,13]!base! is a variant of ! that performs strict reduction from right to left, i.e. starting with the right-most element. The input structure must be finite, otherwise ! runs out of space (diverges).If you want a strict right fold in constant space, you need a structure that supports faster than O(n), access to the right-most element, such as Seq from the  containers package.This method does not run in constant space for structures such as lists that don't support efficient right-to-left iteration and so require O(n) space to perform right-to-left reduction. Use of this method with such a structure is a hint that the chosen structure may be a poor fit for the task at hand. If the order in which the elements are combined is not important, use ! instead.!baseLeft-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.In the case of lists, , when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnNote that to produce the outermost application of the operator the entire input list must be traversed. Like all left-associative folds, ( will diverge if given an infinite list.If you want an efficient strict left-fold, you probably want to use ! instead of >. The reason for this is that the latter does not force the inner results (e.g. z `f` x1 in the above example) before applying them to the operator (e.g. to (`f` x2)"). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.For a general 5 structure this should be semantically identical to:  foldl f z =  f z . !ExamplesThe first example is a strict fold, which in practice is best performed with !.foldl (+) 42 [1,2,3,4]52Though the result below is lazy, the input is reversed before prepending it to the initial accumulator, so corecursion begins only after traversing the entire input string.'foldl (\acc c -> c : acc) "abcd" "efgh" "hgfeabcd"A left fold of a structure that is infinite on the right cannot terminate, even when for any finite input the fold just returns the initial accumulator:foldl (\a _ -> a) 0 $ repeat 1* Hangs forever *?WARNING: When it comes to lists, you always want to use either ! or ! instead.!baseLeft-associative fold of a structure but with strict application of the operator.This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result (e.g. !).For a general 5 structure this should be semantically identical to,  foldl' f z =  f z . !!base A variant of ! that has no base case, and thus may only be applied to non-empty structures.This function is non-total and will raise a runtime exception if the structure happens to be empty.Examples Basic usage:foldr1 (+) [1..4]10 foldr1 (+) []%Exception: Prelude.foldr1: empty listfoldr1 (+) Nothing&*** Exception: foldr1: empty structurefoldr1 (-) [1..4]-2%foldr1 (&&) [True, False, True, True]False&foldr1 (||) [False, False, True, True]Truefoldr1 (+) [1..]* Hangs forever *!base A variant of ! that has no base case, and thus may only be applied to non-empty structures.This function is non-total and will raise a runtime exception if the structure happens to be empty.  f =  f . !Examples Basic usage:foldl1 (+) [1..4]10 foldl1 (+) [])*** Exception: Prelude.foldl1: empty listfoldl1 (+) Nothing&*** Exception: foldl1: empty structurefoldl1 (-) [1..4]-8%foldl1 (&&) [True, False, True, True]False&foldl1 (||) [False, False, True, True]Truefoldl1 (+) [1..]* Hangs forever *!baseList of elements of a structure, from left to right. If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.Examples Basic usage:toList Nothing[]toList (Just 42)[42]toList (Left "foo")[]2toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8))) [5,17,12,8] For lists, ! is the identity:toList [1, 2, 3][1,2,3]!baseTest whether the structure is empty. The default implementation is Left-associative and lazy in both the initial element and the accumulator. Thus optimised for structures where the first element can be accessed in constant time. Structures where this is not the case should have a non-default implementation.Examples Basic usage:null []Truenull [1]False! is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element). null [1..]False!base4Returns the size/length of a finite structure as an . The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.Examples Basic usage: length []0length ['a', 'b', 'c']3 length [1..]* Hangs forever *!base(Does the element occur in the structure?Note: ! is often used in infix form.Examples Basic usage: 3 `elem` []False3 `elem` [1,2]False3 `elem` [1,2,3,4,5]True7For infinite structures, the default implementation of ! terminates if the sought-after value exists at a finite distance from the left side of the structure:3 `elem` [1..]True3 `elem` ([4..] ++ [3])* Hangs forever *!base-The largest element of a non-empty structure.This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the maximum in faster than linear time.Examples Basic usage:maximum [1..10]10 maximum []**** Exception: Prelude.maximum: empty listmaximum Nothing'*** Exception: maximum: empty structureWARNING: This function is partial for possibly-empty structures like lists.!base+The least element of a non-empty structure.This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the minimum in faster than linear time.Examples Basic usage:minimum [1..10]1 minimum []**** Exception: Prelude.minimum: empty listminimum Nothing'*** Exception: minimum: empty structureWARNING: This function is partial for possibly-empty structures like lists.!baseThe !9 function computes the sum of the numbers of a structure.Examples Basic usage:sum []0sum [42]42 sum [1..10]55sum [4.1, 2.0, 1.7]7.8 sum [1..]* Hangs forever *!baseThe !> function computes the product of the numbers of a structure.Examples Basic usage: product []1 product [42]42product [1..10]3628800product [4.1, 2.0, 1.7]13.939999999999998 product [1..]* Hangs forever *!base m b and f2 :: b -> m c, their Kleisli composition (f1 >=> f2) :: a -> m c is defined by: (f1 >=> f2) a = f1 a >>= f2Another way of thinking about foldrM* is that it amounts to an application to z of a Kleisli composition: 6foldrM f z t = f y >=> f x >=> ... >=> f b >=> f a $ zThe monadic effects of foldrM are sequenced from right to left, and e.g. folds of infinite lists will diverge."If at some step the bind operator (>)! short-circuits (as with, e.g.,  in a ), the evaluated effects will be from a tail of the element sequence. If you want to evaluate the monadic effects in left-to-right order, or perhaps be able to short-circuit after an initial sequence of elements, you'll need to use " instead.If the monadic effects don't short-circuit, the outermost application of f is to the leftmost element a, so that, ignoring effects, the result looks like a right fold: .a `f` (b `f` (c `f` (... (x `f` (y `f` z))))).Examples Basic usage:/let f i acc = do { print i ; return $ i : acc }foldrM f [] [0..3]3210 [0,1,2,3]"base m b and f2 :: b -> m c, their Kleisli composition (f1 >=> f2) :: a -> m c is defined by: (f1 >=> f2) a = f1 a >>= f2Another way of thinking about foldlM* is that it amounts to an application to z of a Kleisli composition: foldlM f z t = flip f a >=> flip f b >=> ... >=> flip f x >=> flip f y $ zThe monadic effects of foldlM" are sequenced from left to right."If at some step the bind operator (>)! short-circuits (as with, e.g.,  in a ), the evaluated effects will be from an initial segment of the element sequence. If you want to evaluate the monadic effects in right-to-left order, or perhaps be able to short-circuit after processing a tail of the sequence of elements, you'll need to use ! instead.If the monadic effects don't short-circuit, the outermost application of f is to the rightmost element y, so that, ignoring effects, the result looks like a left fold: +((((z `f` a) `f` b) ... `f` w) `f` x) `f` yExamples Basic usage:+let f a e = do { print e ; return $ e : a }foldlM f [] [0..3]0123 [3,2,1,0]"base&Map each element of a structure to an  action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see -." is just like ", but generalised to  actions.Examples Basic usage:'traverse_ print ["Hello", "world", "!"]"Hello""world""!""base" is " with its arguments flipped. For a version that doesn't ignore the results see - . This is " generalised to  actions." is just like ", but generalised to  actions.Examples Basic usage:for_ [1..4] print1234"baseMap each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see -." is just like "%, but specialised to monadic actions."base" is " with its arguments flipped. For a version that doesn't ignore the results see -." is just like "%, but specialised to monadic actions."baseEvaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see -." is just like ", but generalised to  actions.Examples Basic usage:4sequenceA_ [print "Hello", print "world", print "!"]"Hello""world""!""baseEvaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see -." is just like "&, but specialised to monadic actions."base)The sum of a collection of actions using , generalizing "." is just like ", but generalised to .Examples Basic usage:*asum [Just "Hello", Nothing, Just "World"] Just "Hello""base)The sum of a collection of actions using , generalizing "." is just like ", but specialised to .ExamplesBasic usage, using the  instance for :*msum [Just "Hello", Nothing, Just "World"] Just "Hello""base>The concatenation of all the elements of a container of lists.Examples Basic usage:concat (Just [1, 2, 3])[1,2,3]concat (Left 42)[]#concat [[1, 2, 3], [4, 5], [6], []] [1,2,3,4,5,6]"baseMap a function over all the elements of a container and concatenate the resulting lists.Examples Basic usage:5concatMap (take 3) [[1..], [10..], [100..], [1000..]]+[1,2,3,10,11,12,100,101,102,1000,1001,1002]concatMap (take 3) (Just [1..])[1,2,3]"base" 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.Examples Basic usage:and []True and [True]True and [False]Falseand [True, True, False]Falseand (False : repeat True) -- Infinite list [False,True,True,True,...Falseand (repeat True)* Hangs forever *"base" 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.Examples Basic usage:or []False or [True]True or [False]Falseor [True, True, False]Trueor (True : repeat False) -- Infinite list [True,False,False,False,...Trueor (repeat False)* Hangs forever *"baseDetermines whether any element of the structure satisfies the predicate.Examples Basic usage: any (> 3) []Falseany (> 3) [1,2]Falseany (> 3) [1,2,3,4,5]Trueany (> 3) [1..]Trueany (> 3) [0, -1..]* Hangs forever *"baseDetermines whether all elements of the structure satisfy the predicate.Examples Basic usage: all (> 3) []Trueall (> 3) [1,2]Falseall (> 3) [1,2,3,4,5]Falseall (> 3) [1..]Falseall (> 3) [4..]* Hangs forever *"baseThe largest element of a non-empty structure with respect to the given comparison function.Examples Basic usage:maximumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"] "Longest"WARNING: This function is partial for possibly-empty structures like lists."baseThe least element of a non-empty structure with respect to the given comparison function.Examples Basic usage:minimumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]"!"WARNING: This function is partial for possibly-empty structures like lists."base" is the negation of !.Examples Basic usage:3 `notElem` []True3 `notElem` [1,2]True3 `notElem` [1,2,3,4,5]FalseFor infinite structures, " terminates if the value exists at a finite distance from the left side of the structure:3 `notElem` [1..]False3 `notElem` ([4..] ++ [3])* Hangs forever *"baseThe " function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or  if there is no such element.Examples Basic usage:find (> 42) [0, 5..]Just 45find (> 12) [1..7]Nothing" base" base" base"base"base"base"base"base"base"base"base"base" base"base"base" base" base" base" base" base" base" base" base" base" base" base" base" base" base" base"base"""""""""""""""""&""""""""!"""""""""""!!!!!!!!!!!!!!!!!7!!!!!!!!!!!!!!!!!"""""""""""""""""!"""""""""""""""""""!"w$Conor McBride and Ross Paterson 20054BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy0<4"baseThe " functor."base"base"base"baseThis instance would be equivalent to the derived instances of the " newtype if the " field were removed"baseThis instance would be equivalent to the derived instances of the " newtype if the " field were removed" base" base" base" base" base" base" base" base" base" base" base" base" base" base" base" base" baseA baseA base"""""""(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthy5(see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy 1:*3baseCreate a new mutable array of arrays with the specified number of elements, in the specified state thread, with each element recursively referring to the newly created array.3base:Make a mutable array of arrays immutable, without copying.3base+Return the number of elements in the array.3base+Return the number of elements in the array.4baseCopy a range of the 3 to the specified region in the 3. Both arrays must fully contain the specified ranges, but this is not checked. The two arrays must not be the same array in different states, but this is not checked either.4baseCopy a range of the first MutableArrayArray# to the specified region in the second MutableArrayArray#. Both arrays must fully contain the specified ranges, but this is not checked. The regions are allowed to overlap, although this is only possible when the same array is provided as both the source and the destination.4base8Compare the underlying pointers of two arrays of arrays.4baseCompare the underlying pointers of two mutable arrays of arrays.44333333344333334333333333333333333333344444-(c) The University of Glasgow, CWI 2001--2011/BSD-style (see the file libraries/base/LICENSE) Trustworthy ()*/015N&YbaseConstruct a representation for a type constructor applied at a monomorphic kind.Note that this is unsafe as it allows you to construct ill-kinded types.AbaseConstruct a representation for a type application that is NOT a saturated arrow type. This is not checked!AbaseUsed to make `} instance for things of kind NatAbaseUsed to make `}# instance for things of kind SymbolAbaseUsed to make `}! instance for things of kind CharAbaseFor compiler use.}base The class }> allows a concrete representation of a type to be calculated.base?TypeRep is a concrete representation of a (monomorphic) type.  supports reasonably efficient equality. See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeablebase"A non-indexed type representation.AbaseA A wraps up a } instance for explicit handling. For internal use: for defining  pattern.Abase:Invariant: Saturated arrow types (e.g. things of the form a -> b) are represented with A a b, not TrApp (TrApp funTyCon a) b.AbaseTrFun fpr m a b represents a function type  a % m -> b. We use this for the sake of efficiency as functions are quite ubiquitous. A TrFun can represent `t1 -> t2` or `t1 -= t2`; but not (a => b) or (a ==> b). See Note [No Typeable for polytypes or qualified types] in GHC.Tc.Instance.Class and Note [Function type constructors and FunTy] in GHC.Builtin.Types.Prim We do not represent the function TyCon (i.e. (->) vs (-=>)) explicitly; instead, the TyCon is implicit in the kinds of the arguments.#basePattern match on a type constructor including its instantiated kind variables. For instance, 8App (Con' proxyTyCon ks) intRep = typeRep @(Proxy @Int) will bring into scope, /proxyTyCon :: TyCon ks == [someTypeRep -Type] :: [SomeTypeRep] intRep == typeRep Int #base#Pattern match on a type constructor#baseA type application. For instance, =typeRep @(Maybe Int) === App (typeRep @Maybe) (typeRep @Int) /Note that this will also match a function type, typeRep @(Int# -> Char) === App (App arrow (typeRep @Int#)) (typeRep @Char) where 6arrow :: TypeRep ((->) :: TYPE IntRep -> Type -> Type).#baseThe function type constructor. For instance, >typeRep @(Int -> Char) === Fun (typeRep @Int) (typeRep @Char) #baseA explicitly bidirectional pattern synonym to construct a concrete representation of a type.As an  expression: Constructs a singleton  TypeRep a+ given a implicit 'Typeable a' constraint: &TypeRep @a :: Typeable a => TypeRep a As a pattern: Matches on an explicit  TypeRep a witness bringing an implicit  Typeable a constraint into scope. ;f :: TypeRep a -> .. f TypeRep = {- Typeable a in scope -} #baseHelper to fully evaluate  for use as  NFData(rnf) implementationAbaseGet a reified } instance from an explicit .For internal use: for defining  pattern.#base Observe the  of a type representationAbaseConstruct a representation for a type application that may be a saturated arrow type. This is renamed to mkTrApp in Type.Reflection.Unsafe#baseUse a  as } evidence.The  pattern synonym brings a }4 constraint into scope and can be used in place of #. f :: TypeRep a -> .. f rep = withTypeable {- Typeable a in scope -} f :: TypeRep a -> .. f TypeRep = {- Typeable a in scope -} #baseObserve the type constructor of a quantified type representation.#base5Observe the type constructor of a type representation# base Type equality#baseType equality decision#baseObserve the kind of a type.AbaseIs a type of the form TYPE rep?#baseTakes a value of type a5 and returns a concrete representation of that type.Abase2See Note [Small Ints parsing] in GHC.Builtin.Types#baseHelper to fully evaluate  for use as  NFData(rnf) implementation# baseHelper to fully evaluate  for use as  NFData(rnf) implementationAbaseExquisitely unsafe.#baseExquisitely unsafe.AbaseAn internal function, to make representations for type literals.A baseAbaseAbaseAbase package namebase module namebase the name of the type constructorbasenumber of kind variablesbasekind representationbase A unique  object#base package namebase module namebase the name of the type constructorbasenumber of kind variablesbasekind representationbase A unique  object Used when the strings are dynamically allocated, eg from binary deserialisationAbase package namebase module namebase tycon name>#######AAYAA#A#################AA#####A#}A#+-(c) The University of Glasgow, CWI 2001--2017/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable2non-portable (requires GADTs and compiler support) TrustworthyP"########################}"}########################z-(c) The University of Glasgow, CWI 2001--2004/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy )*/0V#base!A quantified type representation.#base6Observe a type representation for the type of a value.#baseTakes a value of type a5 and returns a concrete representation of that type.#baseShow a type representation#baseThe type-safe cast operation#base*Extract a witness of equality of two types#baseDecide an equality of two types#base8Extract a witness of heterogeneous equality of two types#base+Decide heterogeneous equality of two types.#base8A flexible variation parameterised in a type constructor#base Cast over k1 -> k2#base Cast over k1 -> k2 -> k3#base,Applies a type to a function type. Returns: Just u6 if the first argument represents a function of type t -> u8 and the second argument represents a function of type t. Otherwise, returns Nothing.#baseBuild a function type.#baseSplits a type constructor application. Note that if the type constructor is polymorphic, this will not return the kinds that were used.#base3Observe the argument types of a type representation#baseObserve the type constructor of a quantified type representation.#baseTakes a value of type a5 and returns a concrete representation of that type.#baseForce a # to normal form.(################################}(}################################K((c) The University of Glasgow, 1998-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthyf2 baseThe  SomeException type is the root of the exception type hierarchy. When an exception of type e6 is thrown, behind the scenes it is encapsulated in a  SomeException.#baseArithmetic exceptions.#base#baseAny 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: data MyException = ThisException | ThatException deriving Show 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 In more complicated examples, you may wish to define a whole hierarchy of exceptions:  --------------------------------------------------------------------- -- Make the root exception type for all the exceptions in a compiler data SomeCompilerException = forall e . Exception e => SomeCompilerException e instance Show SomeCompilerException where show (SomeCompilerException e) = show e instance Exception SomeCompilerException compilerExceptionToException :: Exception e => e -> SomeException compilerExceptionToException = toException . SomeCompilerException compilerExceptionFromException :: Exception e => SomeException -> Maybe e compilerExceptionFromException x = do SomeCompilerException a <- fromException x cast a --------------------------------------------------------------------- -- Make a subhierarchy for exceptions in the frontend of the compiler data SomeFrontendException = forall e . Exception e => SomeFrontendException e instance Show SomeFrontendException where show (SomeFrontendException e) = show e instance Exception SomeFrontendException where toException = compilerExceptionToException fromException = compilerExceptionFromException frontendExceptionToException :: Exception e => e -> SomeException frontendExceptionToException = toException . SomeFrontendException frontendExceptionFromException :: Exception e => SomeException -> Maybe e frontendExceptionFromException x = do SomeFrontendException a <- fromException x cast a --------------------------------------------------------------------- -- Make an exception type for a particular frontend compiler exception data MismatchedParentheses = MismatchedParentheses deriving Show instance Exception MismatchedParentheses where toException = frontendExceptionToException fromException = frontendExceptionFromExceptionWe 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 #base7Render this exception value in a human-friendly manner.Default implementation: .#base#base#base#base#base#base#base##############################M((c) The University of Glasgow, 1998-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthy %&01iU#base#This is thrown when the user calls  . The first String is the argument given to  , second String is the location.#baseThrow an exception. Exceptions may be thrown from purely functional code, but may only be caught within the  monad.WARNING: You may want to use throwIO6 instead so that your pure code stays exception-free.# basePretty print a .# basePretty print a .#base#base#base#base'#############################(c) Tamar Christina 2019see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafeq"AbaseAn A is a synchronising variable, used for communication between concurrent threads, where one of the threads is controlled by an external state. e.g. by an I/O action that is serviced by the runtime. It can be thought of as a box, which may be empty or full.(It is mostly similar to the behavior of b except A doesn't block if the variable is full and the GC won't forcibly release the lock if it thinks there's a deadlock.The properties of IOPorts are: * Writing to an empty IOPort will not block. * Writing to an full IOPort will not block. It might throw an exception. * Reading from an IOPort for the second time might throw an exception. * Reading from a full IOPort will not block, return the value and empty the port. * Reading from an empty IOPort will block until a write. * Reusing an IOPort (that is, reading or writing twice) is not supported and might throw an exception. Even if reads and writes are interleaved.This type is very much GHC internal. It might be changed or removed without notice in future releases.Abase Create an A which is initially empty.Abase Create an A# which contains the supplied value.Abase$Atomically read the contents of the A . If the A is currently empty, A' will wait until it is full. After a A, the A is left empty.#There is one important property of A:+Only a single threads can be blocked on an A.AbasePut a value into an A . If the A is currently full, A will throw an exception.#There is one important property of A:*Only a single thread can be blocked on an A.AbaseAAAAAAA Safe-Inferredr.base2Indicates a mode in which a file should be locked.. baseException thrown by hLock. on non-Windows platforms that don't support flock.A base.....@'(c) The University of Glasgow 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe7$baseDescribes the behaviour of a thread when an asynchronous exception is received.$base7asynchronous exceptions are unmasked (the normal state)$basethe state during $: asynchronous exceptions are masked, but blocking operations may still be interrupted$basethe state during $: asynchronous exceptions are masked, and blocking operations may not be interrupted$base,File and directory names are values of type , whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.$base"Embed a strict state thread in an  action. The : parameter indicates that the internal state used by the . computation is a special one supplied by the = monad, and thus distinct from those used by invocations of .$base Convert an  action into an 9 action. The type of the result is constrained to use a = state thread, and therefore the result cannot be passed to .$base Convert an  action to an  action. This relies on  and  having the same representation modulo the constraint on the state thread type parameter.$base Convert an  action to an  action. This relies on  and  having the same representation modulo the constraint on the state thread type parameter.6For an example demonstrating why this is unsafe, see https://mail.haskell.org/pipermail/haskell-cafe/2009-April/060719.html$baseCatch an exception in the  monad.Note that this function is strict in the action. That is, !catchException undefined b == _|_. See exceptions_and_strictness for details.$baseThis is the simplest of the exception-catching functions. It 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 argument. Otherwise, the result is returned as normal. For example:  catch (readFile f) (\e -> do let err = show (e :: IOException) hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err) return "").Note that we have to give a type signature to e, or the program will not typecheck as the type is ambiguous. While it is possible to catch exceptions of any type, see the section "Catching all exceptions" (in Control.Exception3) for an explanation of the problems with doing so.%For catching exceptions in pure (non-!) expressions, see the function $.Note that due to Haskell's unspecified evaluation order, an 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 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" exception may be propagated further up. If you call it again, you might get the opposite behaviour. This is ok, because $ is an  computation.$base Catch any # type in the  monad.Note that this function is strict in the action. That is, catchAny undefined b == _|_. See exceptions_and_strictness for details.$base A variant of #" that can only be used within the  monad. Although $/ has a type that is an instance of the type of #*, the two functions are subtly different:  throw e throwIO e `seq` () ===> ()+The first example will cause the exception e8 to be raised, whereas the second one won't. In fact, $ will only cause an exception to be raised when it is used within the  monad.The $) variant should be used in preference to ## to raise an exception within the  monad because it guarantees ordering with respect to other operations, whereas # does not. We say that $" throws *precise* exceptions and #, 5, etc. all throw *imprecise* exceptions. For example throw e + error "boom" ===> error "boom" throw e + error "boom" ===> throw eare both valid reductions and the compiler may pick any (loop, even), whereas (throwIO e >> error "boom" ===> throwIO ewill always throw e when executed.See also the  https://gitlab.haskell.org/ghc/ghc/-/wikis/exceptions/precise-exceptions#GHC wiki page on precise exceptions for a more technical introduction to how GHC optimises around precise vs. imprecise exceptions.$ base7Allow asynchronous exceptions to be raised even inside $, making the operation interruptible (see the discussion of "Interruptible operations" in ).When called outside $ , or inside $, this function has no effect.$base Returns the $ for the current thread.$baseLike $, but does not pass a restore action to the argument.$base9Executes an IO computation with asynchronous exceptions masked. That is, any thread which attempts to raise an exception in the current thread with | will be blocked until asynchronous exceptions are unmasked again.The argument passed to $ 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 computation. For example, a common way to use $. is to protect the acquisition of a resource: mask $ \restore -> do x <- acquire restore (do_something_with x) `onException` release releaseThis code guarantees that acquire is paired with release, by masking asynchronous exceptions for the critical parts. (Rather than write this code yourself, it would be better to use |& which abstracts the general pattern).Note that the restore" action passed to the argument to $ does not necessarily unmask asynchronous exceptions, it just restores the masking state to that of the enclosing context. Thus if asynchronous exceptions are already masked, $ cannot be used to unmask exceptions again. This is so that if you call a library function with exceptions masked, you can be sure that the library call will not be able to unmask exceptions again. If you are writing library code and need to use asynchronous exceptions, the only way is to create a new thread; see j.Asynchronous 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 j inherit the $5 from the parent; that is, to start a thread in the $ state, use mask_ $ forkIO .... This is particularly useful if you need to establish an exception handler in the forked thread before any asynchronous exceptions are received. To create a new thread in an unmasked state use j.$baseLike $, but does not pass a restore action to the argument.$baseLike $8, but the masked computation is not interruptible (see Control.Exception#interruptible). THIS SHOULD BE USED WITH GREAT CARE, because if a thread executing in $ blocks for any reason, then the thread (and possibly the program, if this is the main thread) will be unresponsive and unkillable. This function should only be necessary if you need to mask exceptions around an interruptible operation, and you can guarantee that the interruptible operation will only block for a short period of time.$base/Evaluate the argument to weak head normal form.$ is typically used to uncover any exceptions that a lazy value may contain, and possibly handle them.$ only evaluates to weak head normal form'. If deeper evaluation is needed, the force function from Control.DeepSeq may be handy: evaluate $ force x%There is a subtle difference between $ x and A  x', analogous to the difference between $ and #. If the lazy value x throws an exception, A  x will fail to return an - action and will throw an exception instead. $ x), on the other hand, always produces an 3 action; that action will throw an exception upon  execution iff x throws an exception upon  evaluation.The practical implication of this difference is that due to the imprecise exceptions semantics, &(return $! error "foo") >> error "bar"may throw either "foo" or "bar", depending on the optimizations performed by the compiler. On the other hand, %evaluate (error "foo") >> error "bar"is guaranteed to throw "foo".The rule of thumb is to use $ to force or handle exceptions in lazy values. If, on the other hand, you are forcing a lazy value for efficiency reasons only and do not care about exceptions, you may use A  x.$base$base$baseThe computation to runbase+Handler to invoke if an exception is raised$base-computation to run first ("acquire resource")base,computation to run last ("release resource")basecomputation to run in-between$basecomputation to run firstbase?computation to run afterward (even if an exception was raised)#$$$$$$$$$$$$$$$$$$$$$$$$$#$$$$$$$$$$$$$$$$$$$$$$$$$~"(c) The University of Glasgow 2008see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe $baseA mutable variable in the  monad. import Data.IORefr <- newIORef 0 readIORef r0writeIORef r 1 readIORef r1atomicWriteIORef r 2 readIORef r2modifyIORef' r (+ 1) readIORef r3(atomicModifyIORef' r (\a -> (a + 1, ())) readIORef r4 See also _ and b.$base Build a new $$baseRead the value of an $.Beware that the CPU executing a thread can reorder reads or writes to independent locations. See Data.IORef#memmodel for more details.$baseWrite a new value into an $.This function does not create a memory barrier and can be reordered with other independent reads and writes within a thread, which may cause issues for multithreaded execution. In these cases, consider using } instead. See Data.IORef#memmodel for more details.$base2Atomically apply a function to the contents of an $), installing its first component in the $ and returning the old contents and the result of applying the function. The result of the function application (the pair) is not forced. As a result, this can lead to memory leaks. It is generally better to use $.$base2Atomically apply a function to the contents of an $), installing its first component in the $ and returning the old contents and the result of applying the function. The result of the function application (the pair) is forced, but neither of its components is.$base A version of }0 that forces the (pair) result of the function.$base3Atomically apply a function to the contents of an $ and return the old and new values. The result of the function is not forced. As this can lead to a memory leak, it is usually better to use $.$base3Atomically apply a function to the contents of an $ and return the old and new values. The result of the function is forced.$base&Atomically replace the contents of an $, returning the old contents.$baseA strict version of }-. This forces both the value stored in the $ and the value returned. Conceptually, ?atomicModifyIORef' ref f = do -- Begin atomic block old <- $) ref let r = f old new = fst r $ ref new -- End atomic block case r of (!_new, !res) -> pure res The actions in the "atomic block" are not subject to interference by other threads. In particular, the value in the $ cannot change between the $ and $ invocations."The new value is installed in the $# before either value is forced. So .atomicModifyIORef' ref (x -> (x+1, undefined))will increment the $4 and then throw an exception in the calling thread. ,atomicModifyIORef' ref (x -> (undefined, x))and 'atomicModifyIORef' ref (_ -> undefined)=will each raise an exception in the calling thread, but will also% install the bottoming value in the $), where it may be read by other threads.This function imposes a memory barrier, preventing reordering around the "atomic block"; see Data.IORef#memmodel for details.$basePointer equality. $$$$$$$$$$$$ $$$$$$$$$$$$((c) The University of Glasgow, 1992-2003see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)Unsafe4!Abase+A box around Weak#, private to this module.$baseA finalizer is represented as a pointer to a foreign function that, at finalisation time, gets as an argument a plain pointer variant of the foreign pointer that the finalizer is associated with.Note that the foreign function must use the ccall calling convention.$baseControls finalization of a $&, that is, what should happen if the $ becomes unreachable. Visually, these data constructors are appropriate in these scenarios:  Memory backing pointer is GC-Managed Unmanaged Finalizer functions are: +------------+-----------------+ Allowed | MallocPtr | PlainForeignPtr | +------------+-----------------+ Prohibited | PlainPtr | FinalPtr | +------------+-----------------+$baseThe pointer refers to unmanaged memory that was allocated by a foreign function (typically using malloc2). The finalizer frequently calls the C function free or some variant of it.$baseThe pointer refers to unmanaged memory that should not be freed when the $: becomes unreachable. Functions that add finalizers to a $ throw exceptions when the $ is backed by $!Most commonly, this is used with Addr#$ literals. See Note [Why FinalPtr].$base)The pointer refers to a byte array. The  field means that the $ is reachable (by GC) whenever the $ is reachable. When the $ becomes unreachable, the runtime's normal GC recovers the memory backing it. Here, the finalizer function intended to be used to free()5 any ancillary *unmanaged* memory pointed to by the  . See the zlib$ library for an example of this use. Invariant: The  in the parent $& is an interior pointer into this .Invariant: The  is pinned, so the > does not get invalidated by the GC moving the byte array. Invariant: A  must not be associated with more than one set of finalizers. For example, this is sound: incrGood :: ForeignPtr Word8 -> ForeignPtr Word8 incrGood (ForeignPtr p (MallocPtr m f)) = ForeignPtr (plusPtr p 1) (MallocPtr m f)But this is unsound: incrBad :: ForeignPtr Word8 -> IO (ForeignPtr Word8) incrBad (ForeignPtr p (MallocPtr m _)) = do f <- newIORef NoFinalizers pure (ForeignPtr p (MallocPtr m f))$baseThe pointer refers to a byte array. Finalization is not supported. This optimizes  MallocPtr" by avoiding the allocation of a MutVar#: when it is known that no one will add finalizers to the  ForeignPtr%. Functions that add finalizers to a $ throw exceptions when the $ is backed by $ . The invariants that apply to $ apply to $ as well.$baseFunctions called when a $ is finalized. Note that C finalizers and Haskell finalizers cannot be mixed.$baseNo finalizer. If there is no intent to add a finalizer at any point in the future, consider $ or $0 instead since these perform fewer allocations.$baseFinalizers are all C functions.$base%Finalizers are all Haskell functions.$base The type $ represents references to objects that are maintained in a foreign language, i.e., that are not part of the 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  finalizers. A finalizer is a routine that is invoked when the Haskell storage manager detects that - within the Haskell heap and stack - there are no more references left that are pointing to the $. Typically, the finalizer will, then, invoke routines in the foreign language that free the resources bound by the foreign object.The $% is parameterised in the same way as . The type argument of $* should normally be an instance of class .$baseTurns a plain memory reference into a foreign object by associating a finalizer - given by the monadic operation - with the reference.When finalization is triggered by GC, the storage manager will start the finalizer, in a separate thread, some time after the last reference to the  ForeignPtr is dropped. There is no guarantee of promptness, and in fact there is no guarantee that the finalizer will eventually run at all for GC-triggered finalization.5When finalization is triggered by explicitly calling finalizeForeignPtr, the finalizer will run immediately on the current Haskell thread.Note 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 are unreachable, then both finalizers will start together. See $ for more on finalizer ordering.$base"Allocate some memory and return a $= to it. The memory will be released automatically when the $ is discarded.$ is equivalent to 4 do { p <- malloc; newForeignPtr finalizerFree p }although it may be implemented differently internally: you may not assume that the memory returned by $ has been allocated with . 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 functions is strongly recommended in preference to  with a finalizer.$baseThis function is similar to $, except that the size of the memory required is given explicitly as a number of bytes.$baseThis function is similar to $, except that the size and alignment of the memory required is given explicitly as numbers of bytes.$base"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 collected heap, as for mallocForeignPtr. Unlike mallocForeignPtr, a ForeignPtr created with mallocPlainForeignPtr carries no finalizers. It is not possible to add a finalizer to a ForeignPtr created with mallocPlainForeignPtr. This is useful for ForeignPtrs that will live only inside Haskell (such as those created for packed strings). Attempts to add a finalizer to a ForeignPtr created this way, or to finalize such a pointer, will throw an exception.$baseThis 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.$baseThis 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.$baseThis 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.$baseLike $ but the finalizer is passed an additional environment parameter.$base,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 finalization is triggered by GC, the finalizer will run in a new thread. When finalization is triggered by explicitly calling finalizeForeignPtr, the finalizer will run immediately on the current Haskell thread.NB. Be very careful with these finalizers. One common trap is that if a finalizer references another finalized value, it does not prevent that value from being finalized. In particular, s are finalized objects, so a finalizer should not refer to a  (including , , or ).$baseTurns a plain memory reference into a foreign pointer that may be associated with finalizers by using $.$baseThis 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  action is then executed. The foreign object is kept alive at least during 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 $? 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  object made from it.This function is normally used for marshalling data to or from the object pointed to by the $!, using the operations from the  class.$baseThis is similar to $ but comes with an important caveat: the user must guarantee that the continuation does not diverge (e.g. loop or throw an exception). In exchange for this loss of generality, this function offers the ability of GHC to optimise more aggressively.)Specifically, applications of the form:  unsafeWithForeignPtr fptr ( something) See GHC issue #17760 for more information about the unsoundness behavior that this function can result in.$baseThis function ensures that the foreign object in question is alive at the given place in the sequence of IO actions. However, this comes with a significant caveat: the contract above does not hold if GHC can demonstrate that the code preceding touchForeignPtr diverges (e.g. by looping infinitely or throwing an exception). For this reason, you are strongly advised to use instead $ where possible.Also, note 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 $ F25, then the only guarantee is that the finalizer for F2, is never started before the finalizer for F17. They might be started together if for example both F1 and F2 are otherwise unreachable, and in that case the scheduler might end up running the finalizer for F2 first.In general, it is not recommended to use finalizers on separate objects with ordering constraints between them. To express the ordering robustly requires explicit synchronisation using MVars between the finalizers, but even then the runtime sometimes runs multiple finalizers sequentially in a single thread (for performance reasons), so synchronisation between finalizers could result in artificial deadlock. Another alternative is to use explicit reference counting.$baseThis function extracts the pointer component of a foreign pointer. This is a potentially dangerous operations, as if the argument to $ is the last usage 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 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  rather than combinations of $ and $. However, the latter routines are occasionally preferred in tool generated marshalling code.$baseThis function casts a $. parameterised by one type into another type.$ base8Advances the given address by the given offset in bytes.The new $ shares the finalizer of the original, equivalent from a finalization standpoint to just creating another reference to the original. That is, the finalizer will not be called before the new $ is unreachable, nor will it be called an additional time due to this call, and the finalizer will be called with the same address that it would have had this call not happened, *not* the new address.$baseCauses the finalizers associated with a foreign pointer to be run immediately. The foreign pointer must not be used again after this function is called. If the foreign pointer does not support finalizers, this is a no-op.$base$base$base$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableUnsafe;$baseTurns a plain memory reference into a foreign pointer, and associates a finalizer with the reference. The finalizer will be executed after the last reference to the foreign object is dropped. There is no guarantee of promptness, however the finalizer will be executed before the program exits.$baseThis variant of $ adds a finalizer that expects an environment in addition to the finalized pointer. The environment that will be passed to the finalizer is fixed by the second argument to $.$baseThis function is similar to , 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 .$baseThis function is similar to , 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 .$$$$$$$$$$$$$$$$$$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableUnsafe$$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthy$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthyy$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"(c) The University of Glasgow 2008see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy$baseA mutable array of bytes that can be passed to foreign functions.The buffer is represented by a record, where the record contains the raw buffer and the start/end points of the filled portion. The 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 quite practical: by making all the buffer metadata immutable, we can have operations on buffer metadata outside of the IO monad.8The "live" elements of the buffer are those between the $ and $ offsets. In an empty buffer, $ is equal to $, but they might not be zero: for example, the buffer might correspond to a memory-mapped file and in which case $ will point to the next location to be written, which is not necessarily the beginning of the file.On Posix systems the I/O manager has an implicit reliance on doing a file read moving the file pointer. However on Windows async operations the kernel object representing a file does not use the file pointer offset. Logically this makes sense since operations can be performed in any arbitrary order. OVERLAPPED operations don't respect the file pointer offset as their intention is to support arbitrary async reads to anywhere at a much lower level. As such we should explicitly keep track of the file offsets of the target in the buffer. Any operation to seek should also update this entry.In order to keep us sane we try to uphold the invariant that any function being passed a Handle is responsible for updating the handles offset unless other behaviour is documented.$base2slides the contents of the buffer to the beginning$base,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$((c) The University of Glasgow, 2008-2009see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy(?$base$baseStopped because the input contains insufficient available elements, or all of the input sequence has been successfully translated.%base>Stopped because the output contains insufficient free elements%baseStopped because there are sufficient free elements in the output to output at least one encoded ASCII character, but the input contains an invalid or unrepresentable sequence%baseA % is a specification of a conversion scheme between sequences of bytes and sequences of Unicode characters.For example, UTF-8 is an encoding of Unicode characters into a sequence of bytes. The % for UTF-8 is .%baseCreates a means of encode characters into bytes: the result must not be shared between several character sequences or simultaneously across threads%baseCreates a means of decoding bytes into characters: the result must not be shared between several byte sequences or simultaneously across threads%basea string that can be passed to  to create an equivalent %.%base&Return the current state of the codec.Many codecs are not stateful, and in these case the state can be represented as (). Other codecs maintain a state. For example, UTF-16 recognises a BOM (byte-order-mark) character at the beginning of the input, and remembers thereafter whether to use big-endian or little-endian mode. In this case, the state of the codec would include two pieces of information: whether we are at the beginning of the stream (the BOM only occurs at the beginning), and if not, whether to use the big or little-endian encoding.%baseResources associated with the encoding may now be released. The encode1 function may not be called again after calling close.%baseThe recover function is used to continue decoding in the presence of invalid or unrepresentable sequences. This includes both those detected by encode returning InvalidSequence and those that occur because the input byte sequence appears to be truncated.Progress will usually be made by skipping the first element of the from buffer. This function should only be called if you are certain that you wish to do this skipping and if the to buffer has at least one element of free space. Because this function deals with decoding failure, it assumes that the from buffer has at least one element.recover6 may raise an exception rather than skipping anything.#Currently, some implementations of recover may mutate the input buffer. In particular, this feature is used to implement transliteration.%baseThe encode, function translates elements of the buffer from to the buffer to. It should translate as many elements as possible given the sizes of the buffers, including translating zero elements if there is either not enough room in to, or from1 does not contain a complete multibyte sequence.If multiple CodingProgress returns are possible, OutputUnderflow must be preferred to InvalidSequence. This allows GHC's IO library to assume that if we observe InvalidSequence there is at least a single element available in the output buffer.The fact that as many elements as possible are translated is used by the IO library in order to report translation errors at the point they actually occur, rather than when the buffer is translated.%base%base%base%%%%%%%%%%%%%%$$%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%$$%%%%%%"(c) The University of Glasgow 2008see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe&baseAn &. is a mutable, boxed, non-strict array in the + monad. The type arguments are as follows:i8: the index type of the array (should be an instance of |)e : the element type of the array.&base Build a new &&baseRead a value from an &&baseWrite a new value into an &&baseRead a value from an &&baseWrite a new value into an &&base&&&&&&&&&&&&&&&&((c) The University of Glasgow, 1994-2008see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy $%base%A mode that determines the effect of   hdl mode i.%basethe position of hdl is set to i.%basethe position of hdl is set to offset i from the current position.%basethe position of hdl is set to offset i from the end of the file.%base-Type of a device that can be used to back a L (see also L/). The standard libraries provide creation of L9s via Posix file operations with file descriptors (see  ) with FD being the underlying  instance.&Users may provide custom instances of 4 which are expected to conform the following rules:%baseThe standard libraries do not have direct support 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 . Seek operations are not supported on directories (other than to the zero position).%baseA duplex communications channel (results in creation of a duplex L?). The standard libraries use this device type when creating Ls for open sockets.%base>A file that may be read or written, and also may be seekable.%baseA "raw" (disk) device which supports block binary read and write operations and may be seekable only to positions of certain granularity (block- aligned).%base+I/O operations required for implementing a .%baseready 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.%basecloses the device. Further operations on the device should produce exceptions.%basereturns ( if the device is a terminal or console.%basereturns  if the device supports % operations.%base+seek to the specified position in the data.%base(return the current position in the data.%basereturn the size of the data.%basechange the size of the data.%basefor terminal devices, changes whether characters are echoed on the device.%base#returns the current echoing status.%basesome devices (e.g. terminals) support a "raw" mode where characters entered are immediately made available to the program. If available, this operation enables raw mode.%base returns the % corresponding to this device.%baseduplicates the device, if possible. The new device is expected to share a file pointer with the original device (like Unix dup).%basedup2 source target replaces the target device with the source device. The target device is closed first, if necessary, and then it is made into a duplicate of the first device (like Unix dup2).%baseA low-level I/O provider where the data is bytes in memory. The Word64 offsets currently have no effect on POSIX system or consoles where the implicit behaviour of the C runtime is assumed to move the file pointer on every read/write without needing an explicit seek.%baseRead up to the specified number of bytes starting from a specified offset, returning the number of bytes actually read. This function should only block if there is no data available. If there is not enough data available, then the function should just return the available data. A return value of zero indicates that the end of the data stream (e.g. end of file) has been reached.%baseRead up to the specified number of bytes starting from a specified offset, returning the number of bytes actually read, or , if the end of the stream has been reached.%base?Write the specified number of bytes starting at a given offset.%baseWrite up to the specified number of bytes without blocking starting at a given offset. Returns the actual number of bytes written.%base%base%base%base%base%base%base %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"(c) The University of Glasgow 2008see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) TrustworthyZ%baseThe purpose of % is to provide a common interface for I/O devices that can read and write data through a buffer. Devices that implement % include ordinary files, memory-mapped files, and bytestrings. The underlying device implementing a  must provide %.%baseallocate 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.%basereads 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.%basereads bytes into the buffer without blocking. Returns the number of bytes read (Nothing indicates end-of-file), and the new buffer.%basePrepares an empty write buffer. This lets the device decide how to set up a write buffer: the buffer may need to point to a 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.There is no corresponding operation for read buffers, because before reading the client will always call %.%baseFlush all the data from the supplied write buffer out to the device. The returned buffer should be empty, and ready for writing.%baseFlush data from the supplied write buffer out to the device without blocking. Returns the number of bytes written and the remaining buffer.% %%%%%%%%%%% %%%%%%%%%%%%((c) The University of Glasgow, 1994-2009see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy(baseHaskell 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 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;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 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. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the { and n classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to ; only to itself; no attempt is made to compare the internal state of different handles for equality.%baseSpecifies the translation, if any, of newline characters between internal Strings and the external file or stream. Haskell Strings are assumed to represent newlines with the '\n'9 character; the newline mode specifies how to translate '\n'( on output, and what to translate into '\n' on input.%base(the representation of newlines on output%base'the representation of newlines on input%base?The representation of a newline in the external file or stream.%base '\n'%base '\r\n'%baseThree kinds of buffering are supported: line-buffering, block-buffering or no-buffering. These modes have the following effects. For output, items are written out, or flushed9, from the internal buffer according to the buffer mode:line-buffering: the entire output buffer is flushed whenever a newline is output, the buffer overflows, a $ is issued, or the handle is closed.block-buffering: the entire buffer is written out whenever it overflows, a $ is issued, or the handle is closed. no-buffering: output is written immediately, and never stored in the buffer.An implementation is free to flush the buffer more frequently, but not less frequently, than specified above. The output buffer is emptied as soon as it has been written out.Similarly, input occurs according to the buffer mode for the handle:line-buffering: when the buffer for the handle is not empty, the next item is obtained from the buffer; otherwise, when the buffer is empty, characters up to and including the next newline character are read into the buffer. No characters are available until the newline character is available or the buffer is full.block-buffering: when the buffer for the handle becomes empty, the next block of data is read into the buffer. no-buffering4: the next input item is read and returned. The  operation implies that even a no-buffered handle may require a one-character buffer.The default buffering mode when a handle is opened is implementation-dependent and may depend on the file system object which is attached to that handle. For most implementations, physical files will normally be block-buffered and terminals will normally be line-buffered.%base"buffering is disabled if possible.%base-line-buffering should be enabled if possible.%baseblock-buffering should be enabled if possible. The size of the buffer is n items if the argument is  n+ and is otherwise implementation-dependent.%base?The byte buffer just before we did our last batch of decoding.&base>= writeFile might yield a different file. universalNewlineMode = NewlineMode { inputNL = CRLF, outputNL = nativeNewline }&base>Use the native newline representation on both input and output nativeNewlineMode = NewlineMode { inputNL = nativeNewline outputNL = nativeNewline }&base!Do no newline translation at all. noNewlineTranslation = NewlineMode { inputNL = LF, outputNL = LF }&base&base&base&base&base&base&base&base&base&base&base&base&base&base&base>&&&&&&&&&&%%%%%%%%%%%%%%%%%%%%&&%%%%%%%%%%%%%%%&%%%%%&%%%%%%%?&&%%&&%%%%%%%%%%%&&%%%%%%%%%%&&&&%%%%%%%%%%%%%%%%%%%%%%%%%&&&&None)AbaseNo-op implementation.AbaseNo-op implementation.AA #(c) The University of Glasgow, 2009see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy<98#base,The Haskell 2010 type for exceptions in the ( monad. Any I/O operation may raise an # instead of returning a result. For a more general type of exception, including also those that arise in pure code, see |.(In Haskell 2010, this is an opaque type.$baseExceptions that occur in the IO monad. An  IOException records a more specific error type, a descriptive string and maybe the handle that was used when the error was flagged.$base Construct an #0 value with a string describing the error. The fail method of the  instance of the r class raises a $, thus: >instance Monad IO where ... fail s = ioError (userError s)&base;An abstract type that contains a value for each variant of #.&base1Defines the exit codes that a program can return.&base!indicates successful termination;&baseindicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).& baseConvert a Boolean in numeric representation to a Haskell value'base=Allocate storage and marshal a storable value wrapped into a the  is used to represent 'base Converts a withXXX9 combinator into one marshalling a value wrapped into a , using  to represent .'base/Convert a peek combinator into a one returning  if applied to a 'base Replicates a withXXX combinator over a list of objects, yielding a list of marshalled objects'baseCopies the given number of bytes from the second area (source) into the first (destination); the copied areas may not overlap'baseCopies the given number of bytes from the second area (source) into the first (destination); the copied areas may overlap'base>Fill a given number of bytes in memory area with a byte value.'base DestinationbaseSourcebase Size in bytes'base DestinationbaseSourcebase Size in bytes ''''''''''' '''''''''''(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthyf'baseAllocate storage for the given number of elements of a storable type (like , but for multiple elements).'baseLike ', but add an extra position to hold a special termination element.'baseLike ':, but allocated memory is filled with bytes of value zero.'baseLike ';, but allocated memory is filled with bytes of value zero.'baseTemporarily allocate space for the given number of elements (like , but for multiple elements).'baseLike ', but add an extra position to hold a special termination element.'baseAdjust the size of an array'baseAdjust the size of an array including an extra position for the end marker.'baseConvert an array of given length into a Haskell list. The implementation is tail-recursive and so uses constant stack space.'baseConvert an array terminated by the given end marker into a Haskell list'base/Write the list elements consecutive into memory'baseWrite the list elements consecutive into memory and terminate them with the given marker element'baseWrite a list of storable elements into a newly allocated, consecutive sequence of storable values (like , but for multiple elements).'baseWrite a list of storable elements into a newly allocated, consecutive sequence of storable values, where the end is fixed by the given end marker'base=Temporarily store a list of storable values in memory (like , but for multiple elements).'baseLike ', but the action gets the number of values as an additional parameter'baseLike '1, but a terminator indicates where the array ends'baseLike '1, but a terminator indicates where the array ends'baseCopy the given number of elements from the second array (source) into the first array (destination); the copied areas may not overlap'baseCopy the given number of elements from the second array (source) into the first array (destination); the copied areas may overlap'baseReturn the number of elements in an array, excluding the terminator'base?Advance a pointer into an array by the given number of elements''''''''''''''''''''''''''''''''''''''''''''((c) The University of Glasgow, 2008-2011see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthyt= 'baseA string with explicit length information in bytes instead of a terminating NUL (allowing NUL characters in the middle of the string).'baseA C string is a reference to an array of C characters terminated by NUL.'base8Marshal a NUL terminated C string into a Haskell string.'base>Marshal a C string with explicit length into a Haskell string.'base8Marshal a Haskell string into a NUL terminated C string.the Haskell string may not contain any NUL charactersnew storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a C string (ie, character array) with explicit length information.;Note that this does not NUL terminate the resulting string.new storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a NUL terminated C string using temporary storage.the Haskell string may not contain any NUL charactersthe memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.;Note that this does not NUL terminate the resulting string.the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a Haskell string into a NUL-terminated C string (ie, character array) with explicit length information.new storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a NUL-terminated C string (ie, character array) in temporary storage, with explicit length information.the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a list of Haskell strings into an array of NUL terminated C strings using temporary storage.the Haskell strings may not contain any NUL charactersthe memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'base?Determines whether a character can be accurately encoded in a .Pretty much anyone who uses this function is in a state of sin because whether or not a character is encodable will, in general, depend on the context in which it occurs.AbaseEncoding of CStringbaseString in Haskell termsAbaseEncoding of CString to createbaseNull-terminate?baseString to encodebase/Worker that can safely use the allocated memoryAbaseEncoding of CString to createbaseNull-terminate?baseString to encode ''''''''''''((c) The University of Glasgow, 2008-2011see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthyt '''''''''''' ''''''''''''(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthy'baseMarshal a C string with explicit length into a Haskell string.'base8Marshal a Haskell string into a NUL terminated C string.the Haskell string may not contain any NUL charactersnew storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a C string (ie, character array) with explicit length information.new storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a NUL terminated C string using temporary storage.the Haskell string may not contain any NUL charactersthe memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseConvert a C byte, representing a Latin-1 character, to the corresponding Haskell character.'baseConvert a Haskell character to a C character. This function is only safe on the first 256 characters.'base Convert a C  unsigned char, representing a Latin-1 character, to the corresponding Haskell character.'base#Convert a Haskell character to a C  unsigned char:. This function is only safe on the first 256 characters.'base Convert a C  signed char, representing a Latin-1 character, to the corresponding Haskell character.'base#Convert a Haskell character to a C  signed char:. This function is only safe on the first 256 characters.'base8Marshal a NUL terminated C string into a Haskell string.'base>Marshal a C string with explicit length into a Haskell string.'base8Marshal a Haskell string into a NUL terminated C string.the Haskell string may not contain any NUL charactersnew storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a C string (ie, character array) with explicit length information.new storage is allocated for the C string and must be explicitly freed using  or .'baseMarshal a Haskell string into a NUL terminated C string using temporary storage.the Haskell string may not contain any NUL charactersthe memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'base=Marshal a NUL terminated C wide string into a Haskell string.'baseMarshal a C wide string with explicit length into a Haskell string.'base=Marshal a Haskell string into a NUL terminated C wide string.the Haskell string may not contain any NUL charactersnew storage is allocated for the C wide string and must be explicitly freed using  or .'baseMarshal a Haskell string into a C wide string (ie, wide character array) with explicit length information.new storage is allocated for the C wide string and must be explicitly freed using  or .'baseMarshal a Haskell string into a NUL terminated C wide string using temporary storage.the Haskell string may not contain any NUL charactersthe memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.'baseMarshal a Haskell string into a C wide string (i.e. wide character array) in temporary storage, with explicit length information.the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''(c) Tamar Christina 2018/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portableNonea&baseA timeout registration cookie.&baseAn edit to apply to a &.&baseWarning: since the & is called from the I/O manager, it must not throw an exception or block for a long period of time. In particular, be wary of | and j: if the target thread is making a foreign call, these functions will block until the call completes.&base5A priority search queue, with timeouts as priorities.&&&&&&&&&&NoneAbaseDecode a single codepoint from a byte buffer indexed by the given indexing function.&base'Decode a single character at the given .&base0Decode a single codepoint starting at the given .&baseDecode a single codepoint starting at the given byte offset into a . &&&&&&&&&& &&&&&&&&&&UnsafeAbaseThe label we use for finalization threads. We manually float this to the top-level to ensure that the ByteArray# can be shared..baseRun a batch of finalizers from the garbage collector. We're given an array of finalizers and the length of the array, and we just call each one in turn..baseGet the global action called to report exceptions thrown by weak pointer finalizers to the user..baseSet the global action called to report exceptions thrown by weak pointer finalizers to the user..baseAn exception handler for 2 finalization that prints the error to the given , but doesn't rethrow it.........((c) The University of Glasgow, 1998-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)Unsafe}.baseA weak pointer object with a key and a value. The value has type v.A weak pointer expresses a relationship between two objects, the key and the value: if the key is considered to be alive by the garbage 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, then the finalizer will be run at most once, at a time after the key has become unreachable by the program ("dead"). The storage manager attempts to run the finalizer(s) for an object soon after the object dies, but promptness is not guaranteed.It is not guaranteed that a finalizer will eventually run, and no attempt is made to run outstanding finalizers when the program exits. Therefore finalizers should not be relied on to clean up resources - other methods (eg. exception handlers) should be employed, possibly in addition to finalizers.References from the finalizer to the key are treated in the same way as references from the value to the key: they do not keep the key alive. A finalizer may therefore resurrect the key, perhaps by storing it in the same data structure.The finalizer, and the relationship between the key and the value, exist 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 case, the finalizers for each of these weak pointers will all be run in some arbitrary order, or perhaps concurrently, when the key dies. If the programmer specifies a finalizer that assumes it has the only reference to an object (for example, a file that it wishes to close), then the programmer must ensure that there is only one such finalizer.If there are no other threads to run, the runtime system will check for runnable finalizers before declaring the system to be deadlocked.WARNING: weak pointers to ordinary non-primitive Haskell types are particularly fragile, because the compiler is free to optimise away or duplicate the underlying data structure. Therefore attempting to place a finalizer on an ordinary Haskell type may well result in the finalizer running earlier than you expected. This is not a problem for caches and memo tables where early finalization is benign. Finalizers can be used reliably for types that are created explicitly and have identity, such as IORef, MVar, and TVar. However, to place a finalizer on one of these types, you should use the specific operation provided for that type, e.g.  mkWeakIORef,  mkWeakMVar and  mkWeakTVar respectively. These operations attach the finalizer to the primitive object inside the box (e.g. MutVar# in the case of IORef), because attaching the finalizer to the box itself fails when the outer box is optimised away by the compiler..baseEstablishes a weak pointer to k , with value v and a finalizer.?This is the most general interface for building a weak pointer..base>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  monad..baseCauses a the finalizer associated with a weak pointer to be run immediately..basekeybasevaluebase finalizerbasereturns: a weak pointer object................}"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy.baseMake a . pointer to an $8, using the second argument as a finalizer to run when $ is garbage-collected.baseMutate the contents of an $ , combining $ and $0. This is not an atomic update, consider using .0 when operating in a multithreaded environment.Be warned that . does not apply the function strictly. This means if the program calls . many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. This is a common mistake made when using an IORef as a counter. For example, the following will likely produce a stack overflow: ref <- newIORef 0 replicateM_ 1000000 $ modifyIORef ref (+1) readIORef ref >>= printTo avoid this problem, use . instead..baseStrict version of .0. This is not an atomic update, consider using $0 when operating in a multithreaded environment..base'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 .7 to access and modify it will prevent race conditions.$Extending the atomicity to multiple $s is problematic, so it is recommended that if you need to do anything more complicated then using b instead is a good idea. Conceptually, >atomicModifyIORef ref f = do -- Begin atomic block old <- $) ref let r = f old new = fst r $ ref new -- End atomic block case r of (_new, res) -> pure res The actions in the section labeled "atomic block" are not subject to interference from other threads. In particular, it is impossible for the value in the $ to change between the $ and $ invocations.The user-supplied function is applied to the value stored in the $(, yielding a new value to store in the $ and a value to return. After the new value is (lazily) stored in the $, atomicModifyIORef forces the result pair, but does not force either component of the result. To force both components, use $. Note that &atomicModifyIORef ref (_ -> undefined)8will raise an exception in the calling thread, but will also% install the bottoming value in the $), where it may be read by other threads.This function imposes a memory barrier, preventing reordering around the "atomic block"; see Data.IORef#memmodel for details..base Variant of $. The prefix "atomic" relates to a fact that it imposes a reordering barrier, similar to .. Such a write will not be reordered with other reads or writes even on CPUs with weak memory model. .....$$$$$ $$$$...$.. Trustworthy%&AbaseinsertWith f k v table inserts k into table with value v. If k already appears in table with value v0, the value is updated to f v0 v and Just v0 is returned.Abase.Used to undo the effect of a prior insertWith.AbaseRemove the given key from the table and return its associated value.AAAAAAA TrustworthyAbase;Precondition: continuation must not diverge due to use of $.AbaseReads n elements from the pointer and copies them into the array.AbaseCopy part of the source array into the destination array. The destination array is resized if not large enough.AbaseCopy part of the source array into the destination array. The destination array is resized if not large enough.AbaseComputes 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.AAAAAAAAAAAABBAABBBB(c) The FFI task force 2003/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableUnsafe4baseSometimes an external entity is a pure function, except that it passes arguments and/or results via pointers. The function unsafeLocalState< 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.44"(c) The University of Glasgow 2003/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisional#non-portable (requires concurrency) Trustworthy4baseTurns a plain memory reference into a foreign object by associating a finalizer - given by the monadic operation - with the reference.When finalization is triggered by GC, the storage manager will start the finalizer, in a separate thread, some time after the last reference to the  ForeignPtr is dropped. There is no guarantee of promptness, and in fact there is no guarantee that the finalizer will eventually run at all for GC-triggered finalization.5When finalization is triggered by explicitly calling finalizeForeignPtr, the finalizer will run immediately on the current Haskell thread.Note 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 are unreachable, then both finalizers will start together. See  for more on finalizer ordering.4base,This function adds a finalizer to the given $. The finalizer will run before all other finalizers for the same object which have already been registered.This is a variant of ', where the finalizer is an arbitrary  action. When it is invoked, the finalizer will run in a new thread.NB. Be very careful with these finalizers. One common trap is that if a finalizer references another finalized value, it does not prevent that value from being finalized. In particular, s are finalized objects, so a finalizer should not refer to a  (including , , or ).4444(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportable Trustworthy'baseHaskell representation for errno values. The implementation is deliberately exposed, to allow users to add their own definitions of ' values.(base(baseYield  if the given '6 value is valid on the system. This implies that the n instance of ' is also system dependent as it is only defined for valid values of '.(baseGet the current value of errno in the current thread.On GHC, the runtime will ensure that any Haskell thread will only see "its own" errno, by saving and restoring the value when Haskell threads are scheduled across OS threads.(baseReset the current thread's errno value to '.(base Throw an #' corresponding to the current value of (.(base Throw an #' corresponding to the current value of ( if the result value of the " action meets the given predicate.(baseas (!, but discards the result of the  action after error handling.(baseas (, but retry the ' action when it yields the error code ( - this amounts to the standard retry loop for interrupted POSIX system calls.(baseas (;, but additionally if the operation yields the error code ( or (5, an alternative action is executed before retrying.(baseas (, but discards the result.(baseas (, but discards the result.(base Throw an #' corresponding to the current value of ( if the  action returns a result of -1.(baseas (, but discards the result.(base Throw an #' corresponding to the current value of ( if the  action returns a result of -13, but retries in case of an interrupted operation.(baseas (, but discards the result.(baseas (-, but checks for operations that would block.(baseas (, but discards the result.(base Throw an #' corresponding to the current value of ( if the  action returns .(base Throw an #' corresponding to the current value of ( if the  action returns 1, but retry in case of an interrupted operation.(baseas (-, but checks for operations that would block.(baseas (9, but exceptions include the given path when appropriate.(baseas (<, but exceptions include the given path when appropriate.(baseas (<, but exceptions include the given path when appropriate.(baseas (<, but exceptions include the given path when appropriate.(baseas (<, but exceptions include the given path when appropriate.(baseas (<, but exceptions include the given path when appropriate.(base Construct an # based on the given ' value. The optional information can be used to improve the accuracy of error messages.(base(base)textual description of the error location(base/predicate to apply to the result value of the  operationbase#textual description of the locationbasethe  operation to be executed(base/predicate to apply to the result value of the  operationbase#textual description of the locationbasethe  operation to be executedbaseaction to execute before retrying if an immediate retry would block(base%the location where the error occurredbasethe error numberbase)optional handle associated with the errorbase+optional filename associated with the error''''((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('(((((((((((((((((((((((((((((((((((((((((((((((((((((((('''''''''((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableSafea''''((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('(((((((((((((((((((((((((((((((((((((((((((((((((((((((('''''''''''''''''''''''''''''''(c) Sven Panne 2002-2004/BSD-style (see the file libraries/base/LICENSE)sven.panne@aedion.de provisionalportable Trustworthy+)baseA memory pool.)baseAllocate a fresh memory pool.)baseDeallocate a memory pool and everything which has been allocated in the pool itself.)baseExecute an action with a fresh memory pool, which gets automatically deallocated (including its contents) after the action has finished.)baseAllocate 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.)base:Allocate the given number of bytes of storage in the pool.)baseAdjust the storage area for an element in the pool to the given size of the required type.)baseAdjust the storage area for an element in the pool to the given size. Note that the previously allocated space is still retained in the same )) and will only be freed when the entire ) is freed.)baseAllocate storage for the given number of elements of a storable type in the pool.)baseAllocate storage for the given number of elements of a storable type in the pool, but leave room for an extra element to signal the end of the array.)base.Adjust the size of an array in the given pool.)baseAdjust the size of an array with an end marker in the given pool.)baseAllocate storage for a value in the given pool and marshal the value into this storage.)baseAllocate consecutive storage for a list of values in the given pool and marshal these values into it.)baseAllocate consecutive storage for a list of values in the given pool and marshal these values into it, terminating the end with the given marker.))))))))))))))))))))))))))))))(c) The FFI task force 2003/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableSafe'''''''''''''''''''''''''''''''''''''''))))))))))))))''''''''''')(c) The FFI task force 2003/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableSafe '''''''''''''''''''''''''''''''''''''''))))))))))))))''''''''''')(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableSafe$$$$'''''''''''''''''''''''''''''''''''''''))))))))))))))'''''''''''$$$$$$$$$$)$$$(c) The FFI task force 2001/BSD-style (see the file libraries/base/LICENSE)ffi@haskell.org provisionalportableSafe$$$$'''''''''''''''''''''''''''''''''''''''))))))))))))))'''''''''''$$$$$$$$$$)$$$"(c) The University of Glasgow 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalnon-portable (requires POSIX) Trustworthy )base)base) base) base) base) base) base) base) base) base=)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))=)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))Unsafe;BbaseEvent notification backend.BbaseRegister interest in new events on a given file descriptor, set to be deactivated after the first event.BbaseRegister, modify, or unregister interest in the given events on the given file descriptor.BbasePoll backend for new events. The provided callback is called once per file descriptor with new events.BbaseReturns ) if the modification succeeded. Returns  if this backend does not support event notifications on this type of file.BbaseReturns ) if the modification succeeded. Returns  if this backend does not support event notifications on this type of file.Bbase Throw an ( corresponding to the current value of ( if the result value of the  action is -1 and ( is not (". If the result value is -1 and ( returns (9 0 is returned. Otherwise the result value is returned.BbaseexchangePtr pptr x! swaps the pointer pointed to by pptr with the value x, returning the old value.BBBBBBBAAAAAA##B#A###AAA Trustworthy BB((c) The University of Glasgow, 1992-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (requires POSIX) Trustworthy k,base,base-baseCheck an encoded $ for internal NUL octets as these are disallowed in POSIX filepaths. See #13660.-base The same as - , but an interruptible operation as described in Control.Exception @it respects $ but not $.We want to be able to interrupt an openFile call if it's expensive (NFS, FUSE, etc.), and we especially need to be able to interrupt a blocking open call. See #17912.-base/Consult the RTS to find whether it is threaded.,,,,,,,,,,,,,-,,,,,,,,,,,,,,,-,,,,,,,,,,,,,,-,,,,,,,,,,,,,,-----,--,-,,,,,,,,,,--,,,,,,,----------,,,,,,,,,----,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----------------,,--,---,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----,,,,,,,,,,,,,,,,,,,,,,,-,,,,, Trustworthy BbaseCreate a new epoll backend.BbaseChange the set of events we are interested in for a given file descriptor.BbaseSelect 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.BbaseCreate a new epoll context, returning a file descriptor associated with the context. The fd may be used for subsequent calls to this epoll context.The size parameter to epoll_create is a hint about the expected number of handles.The file descriptor returned from epoll_create() should be destroyed via a call to close() after polling is finishedBbaseBbaseBbaseBbaseBbaseBbaseBbasestatebasetimeout in millisecondsbase I/O callbackBBNone<p-base Parameters of the runtime system-base$Parameters pertaining to parallelism-base-Parameters pertaining to ticky-ticky profiler-base&Parameters pertaining to event tracing-base-trace user events (emitted from Haskell code)-base"trace spark events 100% accurately-base&trace spark events by a sampled method-base&trace nonmoving GC heap census samples-basetrace GC events-basetrace scheduler events-baseshow timestamp in stderr output-baseIs event tracing enabled?-base no tracing-base$send tracing events to the event log-basesend tracing events to stderr-base&Parameters of the cost-center profiler-baseticks between samples (derived)-basetime between samples-base,What sort of heap profile are we collecting?-base2Parameters pertaining to the cost-center profiler.-base-Should the RTS produce a cost-center summary?-baseFlags to control debugging output & extra checking in various subsystems.-base r-basec coverage-basez# stack squeezing & lazy blackholing-base m-base a-basel the object linker-base p-base t-base S-base b-base n-base g-base G-base w-base i-base s-baseMiscellaneous parameters-base:address to ask the OS for memory for the linker, 0 ==> off.base'Parameters concerning context switching.base$Parameters of the garbage collector..base address to ask the OS for memory.baseuse "mostly mark-sweep" instead of copying for the oldest generation.baseTrue  = "compact all the time". base(The I/O SubSystem to use in the program..baseUse a POSIX I/O Sub-System.baseUse platform native Sub-System. For unix OSes this is the same as IoPOSIX, but on Windows this means use the Windows native APIs for I/O, including IOCP and RIO..baseShould we produce a summary of the garbage collector statistics after the program has exited?.base. is defined as a  StgWord64 in  stg/Types.hBbaseRead a NUL terminated string. Return Nothing in case of a NULL pointer..baseNeeded to optimize support for different IO Managers on Windows. See Note [The need for getIoManagerFlag].base. base. base.base.base.base.base.base.base.base.base.base.base.base.base.base.base.base.base.baseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbaseBbase...........-----....--------------------------------------.......................................--......-.-.-.---------------------------------------.--------------.-----------........................................--.........----------------------------------------------------------------------------------------..............#(c) The University of Glasgow, 2017see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy.baseConditionally execute an action depending on the configured I/O subsystem. On POSIX systems always execute the first action. On Windows execute the second action if WINIO as active, otherwise fall back to the first action..baseInfix version of . . posix  !% windows == conditional posix windows .......... ..........."(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy)*'Zbase3Converts an arbitrary value into an object of type 1..The type of the object must be an instance of }, which ensures that only monomorphically-typed objects may be converted to 1(. To convert a polymorphic object into 16, give it a monomorphic type signature. For example:  toDyn (id :: Int -> Int)1baseA value of type 12 is an object encapsulated together with its type.A 1 may only represent a monomorphic value; an attempt to create a value of type 1 from a polymorphically-typed expression will result in an ambiguity error (see Z).{ing a value of type 1 returns a pretty-printed representation of the object's type; useful for debugging.1base Converts a 1 object back into an ordinary Haskell value of the correct type. See also 1.1base Converts a 1 object back into an ordinary Haskell value of the correct type. See also 1.1base1base1basethe dynamically-typed objectbasea default valuebasereturns: the value of the first argument, if it has the correct type, otherwise the value of the second argument.1basethe dynamically-typed objectbase returns:  a=, if the dynamically-typed object has the correct type (and a is its value), or  otherwise. 11111Z11} 11Z11111}k((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)Unsafe EbaseThe current status of a threadbase+the thread is currently runnable or runningbasethe thread has finishedbase&the thread is blocked on some resourcebase)the thread received an uncaught exceptionbase blocked on base6blocked on a computation in progress by another threadbase blocked in /base blocked in / in an STM transactionbasecurrently in a foreign callbase)blocked on some other resource. Without  -threaded , I/O and j show up as , with  -threaded they show up as .baseShared memory locations that support atomic memory transactions.baseA 8 is an abstract type representing a handle to a thread.  is an instance of n, v and { , where the v6 instance implements an arbitrary total ordering over s. The {/ instance lets you convert an arbitrary-valued  to string form; showing a  value is occasionally useful when debugging or diagnosing the behaviour of a concurrent program.Note: in GHC, if you have a , you essentially have a pointer to the thread itself. This means the thread itself can't be garbage collected until you drop the . This misfeature would be difficult to correct while continuing to support .base sets the label of a thread to the given UTF-8 encoded string contained in a .base/Query the current execution status of a thread.base Returns the " of the calling thread (GHC only).base Creates a new thread to run the ; computation passed as the first argument, and returns the  of the newly created thread.&The new thread will be a lightweight, unbound thread. Foreign calls made by this thread are not guaranteed to be made by any particular OS thread; if you need foreign calls to be made by a particular OS thread, then use j instead.The new thread inherits the masked state of the parent (see |).The newly created thread has an exception handler that discards the exceptions &, &, and &, and passes all other exceptions to the uncaught exception handler.WARNING: Exceptions in the new thread will not be rethrown in the thread that created it. This means that you might be completely unaware of the problem if/when this happens. You may want to use the  )https://hackage.haskell.org/package/asyncasync library instead..base.A monad supporting atomic memory transactions./baseMap a thread to an integer identifier which is unique within the current process./baseEvery thread has an allocation counter that tracks how much memory has been allocated by the thread. The counter is initialized to zero, and / sets the current value. The allocation counter counts *down*, so in the absence of a call to / its value is the negation of the number of bytes of memory allocated by the thread.7There are two things that you can do with this counter:0Use it as a simple profiling mechanism, with /.!Use it as a resource limit. See /.8Allocation accounting is accurate only to about 4Kbytes./baseReturn the current value of the allocation counter for the current thread./baseEnables the allocation counter to be treated as a limit for the current thread. When the allocation limit is enabled, if the allocation counter counts down below zero, the thread will be sent the & asynchronous exception. When this happens, the counter is reinitialised (by default to 100K, but tunable with the +RTS -xq option) so that it can handle the exception and perform any necessary clean up. If it exhausts this additional allowance, another & exception is sent, and so forth. Like other asynchronous exceptions, the &3 exception is deferred while the thread is inside $ or an exception handler in $.,Note that memory allocation is unrelated to  live memory, also known as heap residency. A thread can allocate a large amount of memory and retain anything between none and all of it. It is better to think of the allocation limit as a limit on CPU time , rather than a limit on memory.Compared to using timeouts, allocation limits don't count time spent blocked or in foreign calls./base;Disable allocation limit processing for the current thread./baseLike , but the child thread is passed a function that can be used to unmask asynchronous exceptions. This function is typically used in the following way  ... mask_ $ forkIOWithUnmask $ \unmask -> catch (unmask ...) handlerso that the exception handler in the child thread is established with asynchronous exceptions masked, meanwhile the main body of the child thread is executed in the unmasked state.Note that the unmask function passed to the child thread should only be used in that thread; the behaviour is undefined if it is invoked in a different thread./baseLike , but lets you specify on which capability the thread should run. Unlike a  thread, a thread created by /; will stay on the same capability for its entire lifetime ( threads can migrate between capabilities according to the scheduling policy). / is useful for overriding the scheduling policy when you know in advance how best to distribute the threads.The  argument specifies a capability number (see /). Typically capabilities correspond to physical processors, but the exact behaviour is implementation-dependent. The value passed to / is interpreted modulo the total number of capabilities as returned by /.9GHC note: the number of capabilities is specified by the +RTS -N option when the program is started. Capabilities can be fixed to actual processor cores with +RTS -qa if the underlying operating system supports that, although in practice this is usually unnecessary (and may actually degrade performance in some cases - experimentation is recommended)./baseLike /<, but the child thread is pinned to the given CPU, as with /./basethe value passed to the +RTS -N flag. This is the number of Haskell threads that can run truly simultaneously at any given time, and is typically set to the number of physical processor cores on the machine.&Strictly speaking it is better to use /<, because the number of capabilities might vary at runtime./baseReturns the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. To change this value, use /./baseSet the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. The number passed to / is interpreted modulo this value. The initial value is given by the +RTS -N runtime flag.This is also the number of threads that will participate in parallel garbage collection. It is strongly recommended that the number of capabilities is not set larger than the number of physical processor cores, and it may often be beneficial to leave one or more cores free to avoid contention with other processes in the machine./base/Returns the number of CPUs that the machine has/base>Returns the number of sparks currently in the local spark pool/base/ raises the &* exception in the given thread (GHC only). )killThread tid = throwTo tid ThreadKilled/base/? raises an arbitrary exception in the target thread (GHC only).Exception delivery synchronizes between the source and target thread: / does not return until the exception has been raised in the target thread. The calling thread can thus be certain that the target thread has received the exception. Exception delivery is also atomic with respect to other exceptions. Atomicity is a useful property to have when dealing with race conditions: e.g. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other.Whatever work the target thread was doing when the exception was raised is not lost: the computation is suspended until required by another thread.If the target thread is currently making a foreign call, then the exception will not be raised (and hence / will not return) until the call has completed. This is the case regardless of whether the call is inside a $= or not. However, in GHC a foreign call can be annotated as  interruptible, in which case a / will cause the RTS to attempt to cause the call to return; see the GHC documentation for more details.!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, / is non-blocking; but the library implementation adopts a more synchronous design in which / does not return until the exception is received by the target thread. The trade-off is discussed in Section 9 of the paper. Like any blocking operation, / is therefore interruptible (see Section 5.3 of the paper). Unlike other interruptible operations, however, / is always3 interruptible, even if it does not actually block.There is no guarantee that the exception will be delivered promptly, although the runtime will endeavour to ensure that arbitrary delays don't occur. In GHC, an exception can only be raised when a thread reaches a  safe point, where a safe point is where memory allocation occurs. Some loops do not perform any memory allocation inside the loop and therefore cannot be interrupted by a /.If the target of /: is the calling thread, then the behaviour is the same as |, except that the exception is thrown as an asynchronous exception. This means that if there is an enclosing pure computation, which would be the case if the current IO operation is inside  or , that computation is not permanently replaced by the exception, but is suspended as if it had received an asynchronous exception. Note that if / is called with the current thread as the target, the exception will be thrown even if the thread is currently inside $ or $./baseThe / action allows (forces, in a co-operative multitasking implementation) a context-switch to any other currently runnable threads (if any), and is occasionally useful when implementing concurrency abstractions./base/ stores a string as identifier for this thread. This identifier will be used in the debugging output to make distinction of different threads easier (otherwise you only have the thread state object's address in the heap). It also emits an event to the RTS eventlog./base0Internal function used by the RTS to run sparks./base0List the Haskell threads of the current process./baseReturns the number of the capability on which the thread is currently running, and a boolean indicating whether the thread is locked to that capability or not. A thread is locked to a capability if it was created with forkOn./base%Query the label of thread, returning ) if the thread's label has not been set./baseMake a weak pointer to a . It can be important to do this if you want to hold a reference to a 1 while still allowing the thread to receive the BlockedIndefinitely family of exceptions (e.g. &). Holding a normal ) reference will prevent the delivery of BlockedIndefinitely exceptions because the reference could be used as the target of /. at any time, which would unblock the thread. Holding a  Weak ThreadId, on the other hand, will not prevent the thread from receiving BlockedIndefinitely? exceptions. It is still possible to throw an exception to a  Weak ThreadId, but the caller must use  deRefWeak5 first to determine whether the thread still exists./baseMake a ' that can be passed to the C function hs_try_putmvar(). The RTS wants a  to the underlying , but a  can only refer to lifted types, so we have to cheat by coercing./baseUnsafely performs IO in the STM monad. Beware: this is a highly dangerous thing to do.The STM implementation will often run transactions multiple times, so you need to be prepared for this if your IO has any side effects.The STM implementation will abort transactions that are known to be invalid and need to be restarted. This may happen in the middle of /, so make sure you don't acquire any resources that need releasing (exception handlers are ignored when aborting the transaction). That includes doing any IO using Handles, for example. Getting this wrong will probably lead to random deadlocks.The transaction may have seen an inconsistent view of memory when the IO runs. Invariants that you expect to be true throughout 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./base+Perform a series of STM actions atomically.Using / inside an  or  subverts some of guarantees that STM provides. It makes it possible to run a transaction inside of another transaction, depending on when the thunk is evaluated. If a nested transaction is attempted, an exception is thrown by the runtime. It is possible to safely use / inside  or , but the typechecker does not rule out programs that may attempt nested transactions, meaning that the programmer must take special care to prevent these.However, there are functions for creating transactional variables that can always be safely called in . See: /, , , , , and .Using  inside of /3 is also dangerous but for different reasons. See / for more on this./baseRetry execution of the current memory transaction because it has seen values in 3s which mean that it should not continue (e.g. the s represent a shared buffer that is now empty). The implementation may block the thread until one of the 5s that it has read from has been updated. (GHC only)/base/Compose two alternative STM actions (GHC only).If the first action completes without retrying then it forms the result of the /. Otherwise, if the first action retries, then the second action is tried in its place. If both actions retry then the / as a whole retries./base A variant of #" that can only be used within the . monad.Throwing an exception in STM aborts the transaction and propagates the exception. If the exception is caught via /, only the changes enclosed by the catch are rolled back; changes made outside of / persist.-If the exception is not caught inside of the ., it is re-thrown by /, and the entire . is rolled back. Although // has a type that is an instance of the type of #*, the two functions are subtly different: ;throw e `seq` x ===> throw e throwSTM e `seq` x ===> x+The first example will cause the exception e8 to be raised, whereas the second one won't. In fact, / will only cause an exception to be raised when it is used within the . monad. The /) variant should be used in preference to ## to raise an exception within the .= monad because it guarantees ordering with respect to other . operations, whereas # does not./base&Exception handling within STM actions./ m f! catches any exception thrown by m using /, using the function f to handle the exception. If an exception is thrown, any changes made by m( are rolled back, but changes prior to m persist./base Create a new  holding a value supplied/baseIO version of /*. This is useful for creating top-level s using a, because using / inside a isn't possible./base%Return the current value stored in a . This is equivalent to # readTVarIO = atomically . readTVarbut works much faster, because it doesn't perform a complete transaction, it just reads the current value of the ./base%Return the current value stored in a ./base Write the supplied value into a ./base Provide an % action with the current value of an . The < will be empty for the duration that the action is running./baseModify the value of an ./base/base/base/baseTakes the first non-/ing . action./baseTakes the first non-/ing . action./base/base/base/base/base/base/base/base/base/base/base/base/////////////////////////////////////////////..///////////////////////////..////////////////////"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable"non-portable (extended exceptions) Trustworthy_&/baseThrown when the program attempts a continuation capture, but no prompt with the given prompt tag exists in the current continuation./base)Thrown when the program attempts to call  atomically , from the stm" package, inside another call to  atomically./baseThrown when the runtime system detects that the computation is guaranteed not to terminate. Note that there is no guarantee that the runtime system will notice whether any given computation is guaranteed to terminate or not./ baseAn expression that didn't typecheck during compile time was called. This is only possible with -fdefer-type-errors. The String, gives details about the failed type check./baseA 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./baseA record update was performed on a constructor without the appropriate field. This can only happen with a datatype with multiple constructors, where some fields are in one constructor but not another. The String gives information about the source location of the record update./base,An uninitialised record field was used. The String gives information about the source location where the record was constructed./baseA record selector was applied to a constructor without the appropriate field. This can only happen with a datatype with multiple constructors, where some fields are in one constructor but not another. The String gives information about the source location of the record selector./baseA pattern match failed. The String= gives information about the source location of the pattern./base 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) (\_ -> do hPutStrLn stderr ("No such file: " ++ show f) return "")Any other exceptions which are not matched by the predicate are re-raised, and may be caught by an enclosing $, /, etc./base A version of $ with the arguments swapped around; useful in situations where the code for the handler is shorter. For example:  do handle (\NonTermination -> exitWith (ExitFailure 1)) $ .../base A version of /) with the arguments swapped around (see /)./baseThis function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions"./base Similar to $, but returns an  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. If any other type of exception is raised then it will be propagated up to the next enclosing exception handler. 0 try a = catch (Right `liftM` a) (return . Left)/base A variant of / that takes an exception predicate to select which exceptions are caught (c.f. /). If the exception does not match the predicate, it is re-thrown./baseLike /, but only performs the final action if there was an exception raised by the computation./baseWhen you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use / , because / 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 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 /< are in this order so that we can partially apply it, e.g.: 8withFile name mode = bracket (openFile name mode) hClose&Bracket wraps the release action with $, which is sufficient to ensure that the release action executes to completion when it does not invoke any interruptible actions, even in the presence of asynchronous exceptions. For example, hClose is uninterruptible when it is not racing other uses of the handle. Similarly, closing a socket (from "network" package) is also uninterruptible under similar conditions. An example of an interruptible action is /. Completion of interruptible release actions can be ensured by wrapping them in $7, but this risks making the program non-responsive to  Control-C, or timeouts. Another option is to run the release action asynchronously in its own thread: 1void $ uninterruptibleMask_ $ forkIO $ do { ... }The resource will be released as soon as possible, but the thread that invoked bracket will not block in an uninterruptible state./baseA specialised variant of /+ with just a computation to run afterward./base A variant of / where the return value from the first computation is not required./baseLike /, but only performs the final action if there was an exception raised by the in-between computation./base/base/base/base/base/base/base/base/base/base/ base/ base/base/base/base/base/base/base/basePredicate to select exceptionsbaseComputation to runbaseHandler/base-computation to run first ("acquire resource")base,computation to run last ("release resource")basecomputation to run in-between/basecomputation to run firstbase?computation to run afterward (even if an exception was raised)/base-computation to run first ("acquire resource")base,computation to run last ("release resource")basecomputation to run in-between///////////////#$$$$$$$$&&&  //////////////////###############$$$$&&&&&&&&&&&&&&&&&&&&&&$&&########$#######&&&&&&&&&&&&&&////&&&&&&&&&&&&//////////####////$#&/$//////$/$$$$$$$$$////  ///{"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthyu 0baseThe construct 0 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 | from Control.Exception.0base Construct an # of the given type where the second argument describes the error location and the third and fourth argument contain the file handle and file path of the file involved in the error if applicable.0baseAn error indicating that an ? operation failed because one of its arguments already exists.0baseAn error indicating that an ? operation failed because one of its arguments does not exist.0baseAn error indicating that an  operation failed because one of its arguments is a single-use resource, which is already being used (for example, opening the same file twice for writing might give this error).0baseAn error indicating that an . operation failed because the device is full.0baseAn error indicating that an < operation failed because the end of file has been reached.0baseAn error indicating that an  operation failed because the operation was not possible. Any computation which returns an  result may fail with 0. In some cases, an implementation will not be able to distinguish between the possible error causes. In this case it should fail with 0.0baseAn error indicating that an  operation failed because the user does not have sufficient operating system privilege to perform that operation.0base3A programmer-defined error value constructed using $.0baseAn error indicating that the operation failed because the resource vanished. See 0.0baseI/O error where the operation failed because one of its arguments already exists.0baseI/O error where the operation failed because one of its arguments does not exist.0baseI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.0baseI/O error where the operation failed because the device is full.0baseI/O error where the operation failed because the end of file has been reached.0base.I/O error where the operation is not possible.0baseI/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.0base%I/O error that is programmer-defined.0baseI/O error where the operation failed because the resource vanished. This happens when, for example, attempting to write to a closed socket or attempting to write to a named pipe that was deleted.0baseI/O error where the operation failed because one of its arguments already exists.0baseI/O error where the operation failed because one of its arguments does not exist.0baseI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.0baseI/O error where the operation failed because the device is full.0baseI/O error where the operation failed because the end of file has been reached.0base.I/O error where the operation is not possible.0baseI/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.0base%I/O error that is programmer-defined.0baseI/O error where the operation failed because the resource vanished. See 0.0base Catch any #> that occurs in the computation and throw a modified version.0baseAdds a location description and maybe a file path and file handle to an #. If any of the file handle or file path is not given the corresponding value in the # remains unaltered.0baseThe 03 function establishes a handler that receives any ## raised in the action protected by 0. An # is caught by the most recent handler established by one of the exception handling functions. These handlers are not selective: all #s are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in f = catchIOError 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 exception is propagated to the next outer handler.When an exception propagates outside the main program, the Haskell system prints the associated # value and exits the program.Non-I/O exceptions are not caught by this variant; to catch all exceptions, use | from Control.Exception..&$000000000000000000000000000000000000000000#&.#$000000000000000000000&000000000000000000&000"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable:non-portable (requires universal quantification for runST)Unsafew00baseAllow the result of an 9 computation to be used (lazily) inside the computation. Note that if f is strict, 0 f = _|_. 0$$$|"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable"non-portable (extended exceptions) Trustworthy|/baseYou need this when using /./baseSometimes 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 exHowever, there are a couple of problems with this approach. The first is that having two exception handlers is inefficient. However, the more serious issue is that the second exception handler will catch exceptions in the first, e.g. in the example above, if  handleArith throws an  IOException1 then the second exception handler will catch it.Instead, we provide a function /, which would be used thus: f = expr `catches` [Handler (\ (ex :: ArithException) -> handleArith ex), Handler (\ (ex :: IOException) -> handleIO ex)]/baseWhen invoked inside $, this function allows a masked asynchronous exception to be raised, if one exists. It is equivalent to performing an interruptible operation (see #interruptible), but does not involve any actual blocking.When called outside $ , or inside $, this function has no effect./base//////////////#$$$$$$$$$&&&//////////////////###############$$$$&&&&&&&&&&&&&&&&&&&&$&&########$#######&&&&&&&&&&&&&&////&&&&&&&&&&//////////####//#$&/$////////$/$$$$$$$$$$//////a"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableUnsafe)/baseA slightly faster version of  that may not be safe to use with multiple threads. The unsafety arises when used like this: = unsafeFixIO $ \r -> do forkIO (print r) return (...).In this case, the child thread will receive a NonTermination0 exception instead of waiting for the value of r to be computed.//((c) The University of Glasgow, 2008-2009see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy/baseConstruct an iconv-based %" for the given character set and (.As iconv is missing in some minimal environments (e.g. #10298), this checks to ensure that iconv is working properly before returning the encoding, returning  if not.//////((c) The University of Glasgow, 2008-2009see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy%base*The Unicode encoding of the current locale%baseThe encoding of the current locale, but allowing arbitrary undecodable bytes to be round-tripped through it.Do not expect the encoding to be Unicode-compatible: it could appear to be ASCII or anything else.This % is used to decode and encode command line arguments and environment variables on non-Windows platforms.On Windows, this encoding *should not* be used if possible because the use of code pages is deprecated: Strings should be retrieved via the "wide" W-family of UTF-16 APIs instead%baseThe Unicode encoding of the current locale, but where undecodable bytes are replaced with their closest visual match. Used for the  marshalling functions in Foreign.C.String/baseThe Latin1 (ISO8859-1) encoding. This encoding maps bytes directly to the first 256 Unicode code points, and is thus not a complete Unicode encoding. An attempt to write a character greater than '\255' to a  using the /# encoding will result in an error./baseThe UTF-8 Unicode encoding/baseThe UTF-8 Unicode encoding, with a byte-order-mark (BOM; the byte sequence 0xEF 0xBB 0xBF). This encoding behaves like /, 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 sometimes used to identify the encoding of a file./baseThe UTF-16 Unicode encoding (a byte-order-mark should be used to indicate endianness)./base+The UTF-16 Unicode encoding (little-endian)/base(The UTF-16 Unicode encoding (big-endian)/baseThe UTF-32 Unicode encoding (a byte-order-mark should be used to indicate endianness).0base+The UTF-32 Unicode encoding (little-endian)0base(The UTF-32 Unicode encoding (big-endian)0base>Set locale encoding for your program. The locale affects how s are encoded and decoded when serialized to bytes: e. g., when you read or write files (, !) or use standard input/output (, ). For instance, if your program prints non-ASCII characters, it is prudent to execute setLocaleEncoding utf8This is necessary, but not enough on Windows, where console is a stateful device, which needs to be configured using 'System.Win32.Console.setConsoleOutputCP and restored back afterwards. These intricacies are covered by  -https://hackage.haskell.org/package/code-page code-page( package, which offers a crossplatform System.IO.CodePage.withCodePage bracket.Wrong locale encoding typically causes error messages like "invalid argument (cannot decode byte sequence starting from ...)" or "invalid argument (cannot encode character ...)".0base0base0baseBbaseBbase0baseInternal encoding of argv0baseAn encoding in which Unicode code points are translated to bytes by taking the code point modulo 256. When decoding, bytes are translated directly into the equivalent code point.This encoding never fails in either direction. However, encoding discards information, so encode followed by decode is not the identity.0base2Look up the named Unicode encoding. May fail with{ if the encoding is unknownThe set of known encodings is system-dependent, but includes at least: UTF-8UTF-16, UTF-16BE, UTF-16LEUTF-32, UTF-32BE, UTF-32LEThere is additional notation (borrowed from GNU iconv) 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 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. a suffix of  //ROUNDTRIP will use a PEP383-style escape mechanism to represent any invalid bytes in the input as Unicode codepoints (specifically, as lone surrogates, which are normally invalid in UTF-32). Upon output, these special codepoints are detected and turned back into the corresponding original byte.In theory, this mechanism allows arbitrary data to be roundtripped via a  with no loss of data. In practice, there are two limitations to be aware of: This only stands a chance of working for an encoding which is an ASCII superset, as for security reasons we refuse to escape any bytes smaller than 128. Many encodings of interest are ASCII supersets (in particular, you can assume that the locale encoding is an ASCII superset) but many (such as UTF-16) are not.If the underlying encoding is not itself roundtrippable, this mechanism can fail. Roundtrippable encodings are those which have an injective mapping into Unicode. Almost all encodings meet this criterion, but some do not. Notably, Shift-JIS (CP932) and Big5 contain several different encodings of the same Unicode codepoint.On Windows, you can access supported code pages with the prefix CP; for example, "CP1250".-00%%%0/000000////00//%%%%%%%%%%%%%$$%%%%%%%%%.%%%%%%%%%%%%%%%%%%%%%$$%%/00//////000%%%000000P"(c) The University of Glasgow 2011see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy base Returns a [String] representing the current call stack. This can be useful for debugging.The implementation uses the call-stack simulation maintained by the profiler, so it only works if the program was compiled with -prof7 and contains suitable SCC annotations (e.g. by using  -fprof-auto). Otherwise, the list returned is likely to be empty or uninformative.0base.A cost-centre from GHC's cost-center profiler.0base4A cost-centre stack from GHC's cost-center profiler.0baseReturns the current 0 (value is nullPtr if the current program was not compiled with profiling support). Takes a dummy argument which can be used to avoid the call to  getCurrentCCS being floated out by the simplifier, which would result in an uninformative stack (CAF).0baseGet the 0! associated with the given value.0baseRun a computation with an empty cost-center stack. For example, this is used by the interpreter to run an interpreted computation without the call stack showing that it was invoked from GHC.0baseGet the 0 at the head of a 0.0baseGet the tail of a 0.0baseGet the label of a 0.0baseGet the module of a 0.0baseGet the source span of a 0.0base Format a 0 as a list of lines.0base*Get the stack trace attached to an object.00000000000000000000000000"(c) The University of Glasgow 2011see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy4baseLike the function , but appends a stack trace to the error message if one is available.4 base&Pop the most recent call-site off the .This function, like `, has no effect on a frozen .4 baseReturn the current .$Does *not* include the call-site of 4.4 base;Perform some computation without adding new entries to the .$##444400000000000_`00$404_4#`4#000000000000"(c) The University of Glasgow 2011see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy4baseGet information about where a value originated from. This information is stored statically in a binary when `-finfo-table-map` is enabled. The source positions will be greatly improved by also enabled debug information with `-g3`. Finally you can enable `-fdistinct-constructor-tables` to get more precise information about data constructor allocations.The information is collect by looking at the info table address of a specific closure and then consulting a specially generated map (by `-finfo-table-map`) to find out where we think the best source position to describe that info table arose from.4444444444444444444444444444((c) The University of Glasgow, 1994-2001see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy%& 0baseAdd a finalizer to a 4. Specifically, the finalizer will be added to the % of a file handle or the write-side 7 of a duplex handle. See Handle Finalizers for details.Bbase Just like %, but interleaves calls to % with calls to %. in order to make as much progress as possible0basesyncs the file with the buffer, including moving the file pointer backwards in the case of a read buffer. This can fail on a non-seekable read Handle.0base4flushes the Char buffer only. Works on all Handles.BbaseMake an  % for use in a . This function does not install a finalizer; that must be done by the caller.0base makes a new  without a finalizer.0base makes a new 0baselike 0, except that a  is created with two independent buffers, one for reading and one for writing. Used for full-duplex streams, such as network sockets.0baselike 0, except that a  is created with two independent buffers, one for reading and one for writing. Used for full-duplex streams, such as network sockets.0baseThis function exists temporarily to avoid an unused import warning in  bytestring.0base.the underlying IO device, which must support %, % and }basea string describing the :, e.g. the file path for a file. Used in error messages.0base.the underlying IO device, which must support %, % and }basea string describing the :, e.g. the file path for a file. Used in error messages.-000000000000000000000000000000000000000000000-000000000000000000000000000000000000000000000 Trustworthy4base Computation 4 is the "raw" version of  , similar to argv in other languages. It returns a list of the program's command line arguments, starting with the program name, and including those normally eaten by the RTS (+RTS ... -RTS).44((c) The University of Glasgow, 1992-2008see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy%&ȳ base The same as 1, but adds a newline character.0base Computation 0 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 0 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:0% if the end of file has been reached.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 hdl 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.0base Computation 0 hdl8 reads a character from the file or channel managed by hdl*, blocking until a character is available.This operation may fail with:0% if the end of file has been reached.0base Computation 0 hdl3 reads a line from the file or channel managed by hdl. 03 does not return the newline as part of the result.-A line is separated by the newline set with  or & by default. The read newline character(s) are not returned as part of the result.If 0 encounters end-of-file at any point while reading in the middle of a line, it is treated as a line terminator and the (partial) line is returned.This operation may fail with:08 if the end of file is encountered when reading the first character of the line.Examples8withFile "/home/user/foo" ReadMode hGetLine >>= putStrLn%this is the first line of the file :O, as it closes all of its control resources when it finishes.BbaseWake up the event manager.1baseRegister a timeout in the given number of microseconds. The returned & can be used to later unregister or update the timeout. The timeout is automatically unregistered after the given time has passed.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes.1baseUnregister an active timeout.1baseUpdate an active timeout to fire in the given number of microseconds.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes.BbaseBbaseBBBBBB1BB11B&&1B Trustworthy%&1baseThe event manager state.1baseCallback invoked on I/O events.1base&A file descriptor registration cookie.1baseCreate a new event manager.Bbase Create a new 1 with the given polling backend.Bbase8Asynchronously shuts down the event manager, if running.BbaseAsynchronously tell the thread executing the event manager loop to exit.BbaseStart handling events. This function loops until told to stop, using B.Note%: This loop can only be run once per 1>, as it closes all of its control resources when it finishes.BbaseTo make a step, we first do a non-blocking poll, in case there are already events ready to handle. This improves performance because we can make an unsafe foreign C call, thereby avoiding forcing the current Task to release the Capability and forcing a context switch. If the poll fails to find events, we yield, putting the poll loop thread at end of the Haskell run queue. When it comes back around, we do one more non-blocking poll, in case we get lucky and have ready events. If that also returns no events, then we do a blocking poll.BbaseRegister interest in the given events, without waking the event manager thread. The  return value indicates whether the event manager ought to be woken.Note that the event manager is generally implemented in terms of the platform's select or epoll system call, which tend to vary in what sort of fds are permitted. For instance, waiting on regular files is not allowed on many platforms.1baseregisterFd mgr cb fd evs lt" registers interest in the events evs on the file descriptor fd for lifetime lt. cb is called for each event that occurs. Returns a cookie that can be handed to 1.BbaseWake up the event manager.1baseDrop a previous file descriptor registration, without waking the event manager thread. The return value indicates whether the event manager ought to be woken.1base-Drop a previous file descriptor registration.1baseClose a file descriptor in a race-safe way. It might block, although for a very short time; and thus it is interruptible by asynchronous exceptions.BbaseClose a file descriptor in a race-safe way. It assumes the caller will update the callback tables and that the caller holds the callback table lock for the fd. It must hold this lock because this command executes a backend command on the fd.Bbase>Call the callbacks corresponding to the given file descriptor.BbaseBbaseBbaseBbase##BB1BBB1BB1BBB11B####1BB111 Trustworthy BbaseSuspends the current thread for a given number of microseconds (GHC only).There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes.BbaseSet the value of returned TVar to True after a given number of microseconds. The caveats associated with threadDelay also apply.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes.BbaseBlock the current thread until data is available to read from the given file descriptor.This will throw an  if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with B, use B.BbaseBlock the current thread until the given file descriptor can accept data to write.This will throw an  if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with B, use B.Bbase2Close a file descriptor in a concurrency-safe way.9Any threads that are blocked on the file descriptor via B or B3 will be unblocked by having IO exceptions thrown.BbaseAllows a thread to use an STM action to wait for a file descriptor to be readable. The STM action will retry until the file descriptor has data ready. The second element of the return value pair is an IO action that can be used to deregister interest in the file descriptor.The STM action will throw an  if the file descriptor was closed while the STM action is being executed. To safely close a file descriptor that has been used with B, use B.BbaseAllows a thread to use an STM action to wait until a file descriptor can accept a write. The STM action will retry while the file until the given file descriptor can accept a write. The second element of the return value pair is an IO action that can be used to deregister interest in the file descriptor.The STM action will throw an  if the file descriptor was closed while the STM action is being executed. To safely close a file descriptor that has been used with B, use B.1baseRetrieve the system event manager for the capability on which the calling thread is running.This function always returns  the current thread's event manager when using the threaded RTS and  otherwise.BbaseThe ioManagerLock protects the B value: Only one thread at a time can start or shutdown event managers.BbaseAction that performs the close.baseFile descriptor to close. BBB11BBBBBBB((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Trustworthy 1baseInterrupts the current wait of the I/O manager if it is currently blocked. This instructs it to re-read how much it should wait and to process any pending events.1baseBlock the current thread until data is available to read on the given file descriptor (GHC only).This will throw an  if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with 1, use 1.1baseBlock the current thread until data can be written to the given file descriptor (GHC only).This will throw an  if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with 1, use 1.1baseReturns an STM action that can be used to wait for data to read from a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.1baseReturns an STM action that can be used to wait until data can be written to a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.1baseClose a file descriptor in a concurrency-safe way (GHC only). If you are using 1 or 1 to perform blocking I/O, you must use this function to close file descriptors, or blocked threads may not be woken.9Any threads that are blocked on the file descriptor via 1 or 13 will be unblocked by having IO exceptions thrown.1baseSuspends the current thread for a given number of microseconds (GHC only).There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes. Consider using %Control.Concurrent.Thread.Delay.delay from unbounded-delays package.1baseSwitch the value of returned  from initial value  to  after a given number of microseconds. The caveats associated with 1 also apply.Be careful not to exceed maxBound :: Int, which on 32-bit machines is only 2147483647 s, less than 36 minutes.1base.Low-level action that performs the real close.baseFile descriptor to close. 1111111111 1111111111((c) The University of Glasgow, 1994-2008see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthyb1baseOpen a file and make an 13 for it. Truncates the file to zero size when the  is .1 takes two actions, act1 and act2%, to perform after opening the file.act1 is passed a file descriptor and I/O device type for the newly opened file. If an exception occurs in act1!, then the file will be closed. act1 must not close the file itself. If it does so and then receives an exception, then the exception handler will attempt to close it again, which is impermissible.act2 is performed with asynchronous exceptions masked. It is passed a function to restore the masking state and the result of act1. It /must not/ throw an exception (or deliver one via an interruptible operation) without first closing the file or arranging for it to be closed. act2 may3 close the file, but is not required to do so. If act2 leaves the file open, then the file will remain open on return from 1. Code calling 1 that wishes to install a finalizer to close the file should do so in act2. Doing so in act1 could potentially close the file in the finalizer first and then in the exception handler. See  for an example of this use. Regardless, the caller is responsible for ensuring that the file is eventually closed, perhaps using |.1baseOpen a file and make an 14 for it. Truncates the file to zero size when the  is . This function is difficult to use without potentially leaking the file descriptor on exception. In particular, it must be used with exceptions masked, which is a bit rude because the thread will be uninterruptible while the file path is being encoded. Use 1 instead.1baseMake a 1 from an existing file descriptor. Fails if the FD refers to a directory. If the FD refers to a file, 1 locks the file according to the Haskell 2010 single writer/multiple reader locking semantics (this is why we need the  argument too).1base1base1base1base1base file to openbasemode in which to open the filebase#open the file in non-blocking mode?baseact1: An action to perform on the file descriptor with the masking state restored and an exception handler that closes the file on exception.baseact2: An action to perform with async exceptions masked and no exception handler.1base file to openbasemode in which to open the filebase#open the file in non-blocking mode?1baseis a socket (on Windows)baseis in non-blocking mode on Unix111111111111111111111111111111((c) The University of Glasgow, 1994-2008see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy&baseA handle managing output to the Haskell program's standard output channel.1baseA handle managing input from the Haskell program's standard input channel.1baseA handle managing output to the Haskell program's standard error channel.1base Computation 1  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 .If 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. Some operating systems delete empty files, so there is no guarantee that the file will exist following an 1 with mode  unless it is subsequently written to successfully. The handle is positioned at the end of the file if mode is , and otherwise at the beginning (in which case its internal position is 0). The initial buffer mode is implementation-dependent.This operation may fail with:{8 if the file is already open and cannot be reopened;{ if the file does not exist or (on POSIX systems) is a FIFO without a reader and  was requested; or{< if the user does not have permission to open the file.On POSIX systems, 1 is an interruptible operation as described in Control.Exception.Note: if you will be working with files containing binary data, you'll want to be using 1.1base1 name mode act opens a file like 15 and passes the resulting handle to the computation act+. The handle will be closed on exit from 1, whether by normal termination or by raising an exception. If closing the handle raises an exception, then this exception will be raised by 1& rather than any exception raised by act.1baseLike 1, but opens the file in ordinary blocking mode. This can be useful for opening a FIFO for writing: if we open in non-blocking mode then the open will fail if there are no readers, whereas a blocking open will block until a reader appear.Note: when blocking happens, an OS thread becomes tied up with the processing, so the program must have at least another OS thread if it wants to unblock itself. By corollary, a non-threaded runtime will need a process-external trigger in order to become unblocked.On POSIX systems, 1 is an interruptible operation as described in Control.Exception.1base1 name mode act opens a file like 15 and passes the resulting handle to the computation act+. The handle will be closed on exit from 1, whether by normal termination or by raising an exception. If closing the handle raises an exception, then this exception will be raised by 1& rather than any exception raised by act.1baseLike 1, but open the file in binary mode. On Windows, reading a file in text mode (which is the default) will translate CRLF to LF, and writing will translate LF to CRLF. This is usually what you want with text files. With binary files this is undesirable; also, as usual under Microsoft operating systems, text mode treats control-Z as EOF. Binary mode turns off all special treatment of end-of-line and end-of-file characters. (See also .)1base A version of 1 that takes an action to perform with the handle. If an exception occurs in the action, then the file will be closed automatically. The action should close the file when finished with it so the file does not remain open until the garbage collector collects the handle.BbaseOpen a file and perform an action with it. If the action throws an exception, then the file will be closed. If the last argument is , then the file will be closed on successful completion as well. We use this to implement both the 1 family of functions (via B ) and the 1 family (via B).BbaseOpen a file and perform an action with it. When the action completes or throws/receives an exception, the file will be closed.1base&Old API kept to avoid breaking clients1baseTurn an existing file descriptor into a Handle. This is used by various external libraries to make Handles.Makes a binary Handle. This is for historical reasons; it should probably be a text Handle with the default encoding and newline translation instead.1baseTurn an existing Handle into a file descriptor. This function throws an IOError if the Handle does not reference a file descriptor. 111111111&111 1&11111111111#(c) The University of Glasgow, 2017see libraries/base/LICENSElibraries@haskell.orginternal non-portable Trustworthy 11111&111 1&1111111None  BBBBBBBCCCNone 1 baseIf a  references a file descriptor, attempt to lock contents of the underlying file in appropriate mode. If the file is already locked in incompatible mode, this function blocks until the lock is established. The lock is automatically released upon closing a .Things to be aware of:1) This function may block inside a C call. If it does, in order to be able to interrupt it with asynchronous exceptions and/or for other threads to continue working, you MUST use threaded version of the runtime system.2) The implementation uses  LockFileEx on Windows and flock8 otherwise, hence all of their caveats also apply here./3) On non-Windows platforms that don't support flock& (e.g. Solaris) this function throws FileLockingNotImplemented. We deliberately choose to not provide fcntl based locking instead because of its broken semantics.1 baseNon-blocking version of 1.Returns ' if taking the lock was successful and  otherwise.1 baseRelease a lock taken with 1 or 1.111..........111L((c) The University of Glasgow, 1994-2009see libraries/base/LICENSElibraries@haskell.org provisional non-portable Trustworthy%&=&base The action & hdl1 causes any items buffered for output in handle hdl0 to be sent immediately to the operating system.This operation may fail with:{ if the device is full;{ if a system resource limit would be exceeded. It is unspecified whether the characters in the buffer are discarded or retained under these circumstances.1base Computation 1 hdl makes handle hdl/ closed. Before the computation finishes, if hdl+ is writable its buffer is flushed as for &. Performing 1 on a handle that has already been closed has no effect; doing so is not an error. All other operations on a closed handle will fail. If 1; fails for any reason, any further operations (apart from 1&) on the handle will still fail as if hdl had been successfully closed.1 is an interruptible operation in the sense described in Control.Exception. If 1 is interrupted by an asynchronous exception in the process of flushing its buffers, then the I/O device (e.g., file) will be closed anyway.1base For a handle hdl% which attached to a physical file, 1 hdl. returns the size of that file in 8-bit bytes.1base1 hdl size) truncates the physical file with handle hdl to size bytes.1baseFor a readable handle hdl, 1 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: 1 may block, because it has to attempt to read from the stream to determine whether there is any more data to be read.1baseThe computation 1 is identical to 1 , except that it works only on 1.1base Computation 1 returns the next character from the handle without removing it from the input buffer, blocking until a character is available.This operation may fail with:{% if the end of file has been reached.1base Computation 1 hdl mode( sets the mode of buffering for handle hdl on subsequent reads and writes.#If the buffer mode is changed from % or % to %, thenif hdl+ is writable, the buffer is flushed as for &;if hdl; is not writable, the contents of the buffer are discarded.This operation may fail with:{ if the handle has already been used for reading or writing and the implementation does not allow the buffering mode to be changed.1base The action 1 hdl encoding+ changes the text encoding for the handle hdl to encoding. The default encoding when a  is created is 6, namely the default encoding for the current locale. To create a  with no encoding at all, use 18. To stop further encoding or decoding on an existing , use 1.1 may need to flush buffered data in order to change the encoding.1baseReturn the current % for the specified , or  if the  is in binary mode.Note that the % 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 1 and 1 to save and restore the encoding may result in an extra byte-order-mark being written to the file.1base The action 1 hdl flushes all buffered data in hdl, including any buffered read data. Buffered read data is flushed by seeking the file position back to the point before the buffered data was read, and hence only works if hdl is seekable (see 1).This operation may fail with:{ if the device is full;{ if a system resource limit would be exceeded. It is unspecified whether the characters in the buffer are discarded or retained under these circumstances;{ if hdl1 has buffered read data, and is not seekable.1base Computation 1 hdl& returns the current I/O position of hdl! as a value of the abstract type 1.1base If a call to 1 hdl returns a position p, then computation 1 p sets the position of hdl5 to the position it held at the time of the call to 1.This operation may fail with:{2 if a system resource limit would be exceeded.1base Computation 1  hdl mode i sets the position of handle hdl depending on mode. The offset i" is given in terms of 8-bit bytes.If hdl is block- or line-buffered, then seeking to a position which is not in the current buffer will first cause any items in the output buffer to be written to the device, and then cause the input buffer to be discarded. Some handles may not be seekable (see 1), or only support a subset of the possible positioning operations (for instance, it may only be possible to seek to the end of a tape, or to a positive offset from the beginning or current position). It is not possible to set a negative I/O position, or for a physical file, an I/O position beyond the current end-of-file.This operation may fail with:{ if the Handle is not seekable, or does not support the requested seek mode.{2 if a system resource limit would be exceeded.1base Computation 1 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 12 to reposition the handle to the current position.This operation may fail with:{ if the Handle is not seekable.1base Computation 1 hdl) returns the current buffering mode for hdl.1base;Set the echoing status of a handle connected to a terminal.1base;Get the echoing status of a handle connected to a terminal.1base&Is the handle connected to a terminal?On Windows the result of hIsTerminalDevide might be misleading, because non-native terminals, such as MinTTY used in MSYS and Cygwin environments, are implemented via redirection. Use System.Win32.Types.withHandleToHANDLE System.Win32.MinTTY.isMinTTYHandle! to recognise it. Also consider  ansi-terminal- package for crossplatform terminal support.1baseSelect binary mode () or text mode () on a open handle. (See also 1.)$This has the same effect as calling 1 with 0, together with 1 with &.1baseSet the % on the specified '. All buffered data is flushed first.1baseReturns a duplicate of the original handle, with its own buffer. 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.1baseMakes the second handle a duplicate of the first handle. The second handle 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 stdout1base1 is in the  monad, and gives more comprehensive output than the (pure) instance of { for .1base1base1111&1111111111111111111111110001111000011010&&&&%%%%111...%%%%%%%%%%%%%%%00111111111&11110...1111111%%%%111111111111%%%%%%%&&&&100000011111"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy QbaseThe  function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class {; 2 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]])1base:Write a character to the standard output device (same as 0 &).1base7Write a string to the standard output device (same as 1 &).1base The same as 1, but adds a newline character.1base:Read a character from the standard input device (same as 0 1).1base5Read a line from the standard input device (same as 0 1).1baseThe 1 operation returns all user input as a single string, which is read lazily as it is needed (same as 0 1).1baseThe 1 operation returns all user input as a single string, which is fully read before being returned (same as 0 1).2baseThe 2# function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.2baseThe 2 function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with 1.2baseThe 2 function reads a file and returns the contents of the file as a string. The file is fully read before being returned, as with 1.2baseThe computation 2 file str function writes the string str, to the file file.2baseThe computation 2 file str function appends the string str, to the file file. Note that 2 and 2 write a literal string to a file. To write a value of any printable type, as with  , use the 1 function to convert the value to a string first. >main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])2baseThe 2 function combines 1 and 2.2baseThe 2 function is similar to . except that it signals parse failure to the * monad instead of terminating the program.2base*The Unicode encoding of the current localeThis is the initial locale encoding: if it has been subsequently changed by ) this value will not reflect that change.2base Computation 2 hdl indicates whether at least one item is available for input from handle hdl.This operation may fail with:{% if the end of file has been reached.2base Computation 2 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:{ if the device is full; or{8 if another system resource limit would be exceeded.2baseThe implementation of  for . If the function passed to 29 inspects its argument, the resulting action will throw &.2baseThe 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 created with permissions such that only the current user can read/write it.With some exceptions (see below), the file will be created securely in the sense that an attacker should not be able to cause openTempFile to overwrite another file on the filesystem using your credentials, by putting symbolic links (on Unix) in the place where the temporary file is to be created. On Unix the O_CREAT and O_EXCL7 flags are used to prevent this attack, but note that O_EXCL is sometimes not supported on NFS filesystems, so if you rely on this behaviour it is best to use local filesystems only.2baseLike 2), but opens the file in binary mode. See 1 for more comments.2baseLike 2', but uses the default file permissions2baseLike 2', but uses the default file permissions2base%Directory in which to create the filebaseFile name template. If the template is "foo.ext" then the created file will be "fooXXX.ext" where XXX is some random number. Note that this should not contain any path separator characters. On Windows, the template prefix may be truncated to 3 chars, e.g. "foobar.ext" will be "fooXXX.ext".0/0////00//11&11111111111111111111111111000011010&&&&1111&112211112222222211122222$%%%%%1%%%%%%%%%%%2$1&111122221111%%%%11&1111%%%%11111111110200100012211111112211111111222211%///////002001%%%&%%%%&&&m TrustworthyT 3baseComputes the hash of a given file. This function loops over the handle, running in constant memory.333333(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2002/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable TrustworthyYLBbase+The fixed point of a monadic computation. B f executes the action f only once, with the eventual output fed back as the input. Hence f! should not be strict, for then B f would diverge.baseMonads having fixed points with a 'knot-tying' semantics. Instances of # should satisfy the following laws: PurityB ( . h) =  ( h)Left shrinking (or Tightening)B+ (\x -> a >>= \y -> f x y) = a >>= \y -> B (\x -> f x y)SlidingB ( h . f) =  h (B (f . h)), for strict h.NestingB (\x -> B (\y -> f x y)) = B (\x -> f x x)7This class is used in the translation of the recursive do% notation supported by GHC and Hugs.2 base2 base2 base2 base2 base2 base2base2base2base2base2base2base2base2base2base2base2 base2base2base2baseBB(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.ukstableportable Trustworthy<\2base0Identity functor and monad. (a non-strict monad)2base2base2base2base2base2baseThis instance would be equivalent to the derived instances of the 2 newtype if the 2 field were removed2baseThis instance would be equivalent to the derived instances of the 2 newtype if the 2 field were removed2 base2 base2 base2base2 base2 base2 base2 base2 base2 base2 base2 base2base2 base2 base2 base2 baseCbaseCbase222222(c) Ross Paterson 20024BSD-style (see the LICENSE file in the distribution)libraries@haskell.org provisionalportable Trustworthy69<q3.EbaseLift a function to an arrow.GbaseSend the first component of the input through the argument arrow, and copy the rest unchanged to the output.IbaseFanin: 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.2baseThe J operator expresses computations in which an output value is fed back as input, although the computation occurs only once. It underlies the rec/ value recursion construct in arrow notation. J# should satisfy the following laws:  extensionJ (E f) = E (\ b ->  ( (\ (c,d) -> f (b,d))))left tighteningJ (G h >>> f) = h >>> J fright tighteningJ (f >>> G h) = J f >>> hslidingJ (f >>> E ( *** k)) = J (E ( *** k) >>> f) vanishingJ (J f) = J (E unassoc >>> f >>> E assoc) superposing2 (J f) = J (E assoc >>> 2 f >>> E unassoc)where 9assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)2baseThe 2 class is equivalent to r: any monad gives rise to a 2 arrow, and any instance of 2 defines a monad.2baseSome arrows allow application of arrow inputs to other inputs. Instances should satisfy the following laws: G (E (\x -> E (\y -> (x,y)))) >>> H =  G (E (g >>>)) >>> H = 2 g >>> H G (E (>>> h)) >>> H = H >>> h*Such arrows are equivalent to monads (see 2).2base?Choice, for arrows that support it. This class underlies the if and case constructs in arrow notation.,Instances should satisfy the following laws: 2 (E f) = E (2 f) 2 (f >>> g) = 2 f >>> 2 g f >>> E  = E  >>> 2 f 2 f >>> E ( +++ g) = E ( +++ g) >>> 2 f 2 (2 f) >>> E assocsum = E assocsum >>> 2 fwhere assocsum (Left (Left x)) = Left x assocsum (Left (Right y)) = Right (Left y) assocsum (Right z) = Right (Right z)The other combinators have sensible default definitions, which may be overridden for efficiency.2baseFeed marked inputs through the argument arrow, passing the rest through unchanged to the output.2baseA mirror image of 2.The default definition may be overridden with a more efficient version if desired.2baseSplit 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.2baseA monoid on arrows.2base'An associative operation with identity 2.2baseKleisli arrows of a monad.2baseThe basic arrow class.,Instances should satisfy the following laws: E id =  E (f >>> g) = E f >>> E g G (E f) = E (G f) G (f >>> g) = G f >>> G g G f >>> E  = E  >>> f G f >>> E ( *** g) = E ( *** g) >>> G f G (G f) >>> E assoc = E assoc >>> G fwhere assoc ((a,b),c) = (a,(b,c))The other combinators have sensible default definitions, which may be overridden for efficiency.2baseA mirror image of G.The default definition may be overridden with a more efficient version if desired.2baseSplit 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.2baseFanout: send the input to both argument arrows and combine their output.The default definition may be overridden with a more efficient version if desired.2base,The identity arrow, which plays the role of A in arrow notation.2base$Precomposition with a pure function.2base%Postcomposition with a pure function.2base* operation is strict) this instance will not3 satisfy the right-tightening law required by the 2 class.2base2baseCbaseCbase22222222 222222222EG22H2222I2J222222222(2EG22222222222222222222222I22222H2222J I22222222%$Conor McBride and Ross Paterson 20054BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy<w2baseLists, but with an  functor based on zipping.3base One or none.It is useful for modelling any computation that is allowed to fail.Examples Using the  instance of Control.Monad.Except, the following functions:import Control.Monad.Except5canFail = throwError "it failed" :: Except String Int5final = return 42 :: Except String Int7Can be combined by allowing the first function to fail:runExcept $ canFail *> finalLeft "it failed"%runExcept $ optional canFail *> finalRight 423base3base3base3base3base3base3 base3base f <$> ZipList xs1 <*> ... <*> ZipList xsN = ZipList (zipWithN f xs1 ... xsN)where zipWithN refers to the zipWith% function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example: (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..] = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..]) = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}3base3base3base3base3base3 base3baseCbaseCbaseCbaseCbaseCbaseCbase3"222223222"""kij$jik"""2232222223"-$Conor McBride and Ross Paterson 20054BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstableportable Trustworthy 69:;/baseFunctors representing data structures that can be transformed to structures of the  same shape by performing an  (or, therefore, r,) action on each element from left to right.$A more detailed description of what  same shape means, the various methods, how traversals are constructed, and example advanced use-cases can be found in the Overview section of Data.Traversable#overview.For the class laws see the Laws section of Data.Traversable#laws.3baseMap each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see ,.Examples Basic usage:In the first two examples we show each evaluated action mapping to the output structure.traverse Just [1,2,3,4]Just [1,2,3,4]0traverse id [Right 1, Right 2, Right 3, Right 4]Right [1,2,3,4]#In the next examples, we show that  and - values short circuit the created structure."traverse (const Nothing) [1,2,3,4]Nothing=traverse (\x -> if odd x then Just x else Nothing) [1,2,3,4]Nothing8traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]Left 03baseEvaluate each action in the structure from left to right, and collect the results. For a version that ignores the results see ,.Examples Basic usage:For the first two examples we show sequenceA fully evaluating a a structure and collecting the results."sequenceA [Just 1, Just 2, Just 3] Just [1,2,3]%sequenceA [Right 1, Right 2, Right 3] Right [1,2,3]The next two example show  and  will short circuit the resulting structure if present in the input. For more context, check the  instances for  and .+sequenceA [Just 1, Just 2, Just 3, Nothing]Nothing-sequenceA [Right 1, Right 2, Right 3, Left 4]Left 43baseMap each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see ,.Examples3 is literally a 3& with a type signature restricted to r. Its implementation may be more efficient due to additional power of r.3baseEvaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see ,.Examples Basic usage:The first two examples are instances where the input and and output of 3 are isomorphic.sequence $ Right [1,2,3,4]![Right 1,Right 2,Right 3,Right 4],sequence $ [Right 1,Right 2,Right 3,Right 4]Right [1,2,3,4]?The following examples demonstrate short circuit behavior for 3.sequence $ Left [1,2,3,4]Left [1,2,3,4]4sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]Left 03base3 is 3 with its arguments flipped. For a version that ignores the results see ,.3base3 is 3 with its arguments flipped. For a version that ignores the results see ,.3baseThe 3( function behaves like a combination of @ and ,; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.Examples Basic usage:(mapAccumL (\a b -> (a + b, a)) 0 [1..10] (55,[0,1,3,6,10,15,21,28,36,45])/mapAccumL (\a b -> (a <> show b, a)) "0" [1..5]*("012345",["0","01","012","0123","01234"])3baseThe 3( function behaves like a combination of @ and ,; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.Examples Basic usage:(mapAccumR (\a b -> (a + b, a)) 0 [1..10]#(55,[54,52,49,45,40,34,27,19,10,0])/mapAccumR (\a b -> (a <> show b, a)) "0" [1..5]*("054321",["05432","0543","054","05","0"])3baseThe 3( function behaves like a combination of 3 and 3 that traverses the structure while evaluating the actions and passing an accumulating parameter from left to right. It returns a final value of this accumulator together with the new structure. The accummulator is often used for caching the intermediate results of a computation.Examples Basic usage:let expensiveDouble a = putStrLn ("Doubling " <> show a) >> pure (2 * a):{ -mapAccumM (\cache a -> case lookup a cache of Nothing -> expensiveDouble a >>= \double -> pure ((a, double):cache, double)' Just double -> pure (cache, double) ) [] [1, 2, 3, 1, 2, 3]:} Doubling 1 Doubling 2 Doubling 3#([(3,6),(2,4),(1,2)],[2,4,6,2,4,6])3base3 is 3 with the arguments rearranged.3base)This function may be used as a value for @ in a t instance, provided that 3 is defined. (Using 3 with a  instance defined only by 3$ will result in infinite recursion.) 3 f D 2 . 3 (2 . f) 3base)This function may be used as a value for , in a  instance. 3 f D " . 3 (" . f) 3 base3 base3 base3 base3base3base3base3base3base3base3base3base3base3base3 base3base3base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3 base3base3333 3333333333333333333333333333"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy3baseThe 3& function takes two lists and returns  if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively.3 x y is equivalent to x `!` (# y).Note: 3 is often used in infix form.Examples7"GHC" `isSubsequenceOf` "The Glorious Haskell Compiler"True+['a','d'..'z'] `isSubsequenceOf` ['a'..'z']True#[1..10] `isSubsequenceOf` [10,9..0]FalseFor the result to be 7, the first list must be finite; for the result to be !, the second list must be finite:![0,2..10] `isSubsequenceOf` [0..]True![0..] `isSubsequenceOf` [0,2..10]False[0,2..] `isSubsequenceOf` [0..]* Hangs forever*""""""""""3"""#""""""""#""###"""""""""#"""#####"##"#""###############33)!!!!!!!!!!!!#!!)"""##!!!!!""""""!!!!33#""###"""3!"""""""################"""""##"""#""##""""""""# "(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableUnsafez'baseThe ' function outputs the trace message given as its first argument, before returning the second argument as its result.'For example, this returns the value of f x and outputs the message to stderr. Depending on your terminal (settings), they may or may not be mixed.let x = 123; f = show-trace ("calling f with x = " ++ show x) (f x)calling f with x = 123"123"The ' function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.5baseThe 5 function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. Compared to 5, 57 sequences the event with respect to other IO actions.5baseThe 5 function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. The String is the name of the marker. The name is just used in the profiling tools to help you keep clear which marker is which.This function is suitable for use in pure code. In an IO context use 5 instead.Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses 5.5baseThe 5 function emits a message to the eventlog, if eventlog profiling is available and enabled at runtime. Compared to 5, 57 sequences the event with respect to other IO actions.5baseThe 5 function behaves like ' with the difference that the message is emitted to the eventlog, if eventlog profiling is available and enabled at runtime.:It is suitable for use in pure code. In an IO context use 5 instead.Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses 5.5baselike '<, but additionally prints a call stack if one is available.In the current GHC implementation, the call stack is only available if the program was compiled with -prof ; otherwise 5 behaves exactly like ',. Entries in the call stack correspond to SCC+ annotations, so it is a good idea to use  -fprof-auto or -fprof-auto-calls& to add SCC annotations automatically.5baseLike 5 , but uses $ on the argument to convert it to a .:{ do x <- Just 3 traceShowM x y <- pure 12 traceShowM y pure (x*2 + y):}312Just 185baseLike '$ but returning unit in an arbitrary 3 context. Allows for convenient use in do-notation.Note that the application of 5 is not an action in the  context, as 5 is in the  type. While the fresh bindings in the following example will force the 5* expressions to be reduced every time the do-block is executed, traceM "not crashed" would only be reduced once, and the message would only be printed once. If your monad is in ,  . 5 may be a better option.:{ do x <- Just 3 traceM ("x: " ++ show x) y <- pure 12 traceM ("y: " ++ show y) pure (x*2 + y):}x: 3y: 12Just 185baseLike 56 but returns the shown value instead of a third value.'traceShowId (1+2+3, "hello" ++ "world")(6,"helloworld")(6,"helloworld")5baseLike ' , but uses $ on the argument to convert it to a .This makes it convenient for printing the values of interesting variables or expressions inside a function. For example here we print the value of the variables x and y:0let f x y = traceShow (x,y) (x + y) in f (1+2) 5(3,5)85baseLike '2 but returns the message instead of a third value.traceId "hello"hello"hello"5baseThe 5 function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.5baseLike '?, but outputs the result of calling a function on the argument.traceWith fst ("hello","world")hello("hello","world")5baseLike 5 , but uses 2 on the result of the function to convert it to a .traceShowWith length [1,2,3]3[1,2,3]5baseLike 5>, but emits the result of calling a function on its argument.5base,Immediately flush the event log, if enabled.55'55555555555555'5555555555555555"(c) The University of Glasgow 2007/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy 06base! is used in combination with the -XOverloadedStrings language extension to convert the literals to different string types.For example, if you use the  (https://hackage.haskell.org/package/texttext package, you can say {-# LANGUAGE OverloadedStrings #-} myText = "hello world" :: Text Internally, the extension will convert this to the equivalent of 4myText = fromString @Text ("hello world" :: String) Note: You can use  fromString in normal code as well, but the usual performance/memory efficiency problems with  apply.3base (a ~ Char) context was introduced in 4.9.0.03 base3 base####KK####Q"(c) The University of Glasgow 2004/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable6non-portable (local universal quantification in ReadP)Safe<, baseA - represents the version of a software entity.An instance of n is provided, which implements exact equality modulo reordering of the tags in the 3 field.An instance of v= is also provided, which gives lexicographic ordering on the 3 fields (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.). This is expected to be sufficient for many uses, but note that you may need to use a more specific ordering for your versioning scheme. For example, some versioning schemes may include pre-releases which have tags "pre1", "pre2", and so on, and these would need to be taken into account when determining ordering. In some cases, date ordering may be more appropriate, so the application would have to look for date tags in the 3 field and compare those. The bottom line is, don't always assume that   and other v* operations are the right thing for every .Similarly, concrete representations of versions may differ. One possible concrete representation is provided (see 3 and 3), but depending on the application a different concrete representation may be more appropriate.baseConstruct tag-less 3baseA 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.3baseThe 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 version 3 is 3.1, the second branch off the trunk after 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 , so version 3.2.1 becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of v for [Int]*) gives the natural ordering of branches.3base2Provides one possible concrete representation for . For a version with 3  = [1,2,3] and 3 = ["tag1","tag2"], the output will be 1.2.3-tag1-tag2.3base0A parser for versions in the format produced by 3.3base3base3base3baseC base3333333333"(c) The University of Glasgow 2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy TbaseThe T class and its methods are intended to be used in conjunction with the OverloadedLists extension.UbaseThe U# function constructs the structure l from the given list of Item lVbaseThe V function takes the input list's length and potentially uses it to construct the structure l! more efficiently compared to U. If the given number does not equal to the input list's length the behaviour of V is not specified.'fromListN (length xs) xs == fromList xsWbaseThe W function extracts a list of Item l from the structure l.. It should satisfy fromList . toList = id.5baseThe 5= type function returns the type of items of the structure l.5 base9Be aware that 'fromList . toList = id' only for unfrozen  s, since W removes frozenness information.5base5 base5base5base5T5UVWTUW5V5"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy QbaseConditional failure of  computations. Defined by guard True = j () guard False =  ExamplesCommon uses of Q include conditionally signalling an error in an error monad and conditionally rejecting the current choice in an -based parser.8As an example of signalling an error in the error monad %, consider a safe division function  safeDiv x y that returns  when the denominator y is zero and  (x `div` y) otherwise. For example: safeDiv 4 0Nothing safeDiv 4 2Just 2A definition of safeDiv using guards, but not Q: safeDiv :: Int -> Int -> Maybe Int safeDiv x y | y /= 0 = Just (x `div` y) | otherwise = Nothing A definition of safeDiv using Q and r do -notation: safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x `div` y) 3base This generalizes the list-based  function.3base,Left-to-right composition of Kleisli arrows.'(bs 3 cs) a' can be understood as the do expression do b <- bs a cs b 3base-Right-to-left composition of Kleisli arrows. (3), with the arguments flipped.6Note how this operator resembles function composition (): (.) :: (b -> c) -> (a -> b) -> a -> c (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c3baseRepeat an action indefinitely.ExamplesA common use of 3, is to process input from network sockets, s, and channels (e.g. b and )./For example, here is how we might implement an  +https://en.wikipedia.org/wiki/Echo_Protocol echo server , using 3 both to listen for client connections on a network socket and to echo client input on client connection handles: 2echoServer :: Socket -> IO () echoServer socket = 3" $ do client <- accept socket j (echo client) (\_ -> hClose client) where echo :: Handle -> IO () echo client = 3. $ hGetLine client >>= hPutStrLn client Note that "forever" isn't necessarily non-terminating. If the action is in a ; and short-circuits after some number of iterations. then 3 actually returns *, effectively short-circuiting its caller.3baseThe 3 function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state monad.3baseThe 3 function generalizes # to arbitrary applicative functors.3base3 is the extension of 3 which ignores the final result.3baseThe 3 function is analogous to ,?, except that its result is encapsulated in a monad. Note that 3 works from left-to-right over the list arguments. This could be an issue where (?)/ and the `folded function' are not commutative. foldM f a1 [x1, x2, ..., xm] == do a2 <- f a1 x1 a3 <- f a2 x2 ... f am xmIf right-to-left evaluation is required, the input list should be reversed.Note: 3 is the same as "3baseLike 3, but discards the result.3base3 n act performs the action act n. times, and then returns the list of results:Examplesimport Control.Monad.State4runState (replicateM 3 $ state $ \s -> (s, s + 1)) 1 ([1,2,3],4)3baseLike 3, but discards the result.ExamplesreplicateM_ 3 (putStrLn "a")aaa3baseThe reverse of .3baseStrict version of .3baseDirect  equivalent of .ExamplesThe  function is just 3 specialized to the list monad:  = ( 3 :: (a -> Bool) -> [a] -> [a] ) An example using 3 with the  monad:mfilter odd (Just 1)Just 1mfilter odd (Just 2)Nothing,3333333Q3333333""""3hC33t@r?>A1t@r>?AC3"3"3"333h"333333333Q33333"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthyj"""""""""####*)&$MN211121112222  C!!!!!!!!!!!!3333kijt@r?>A]^\[lm78:9oy$#u54=wp6qOxPz{n ;v <  n; v < m789:lu5=4xPqOp6ozyMN[\]^t@jikr>?AC""!!!!!!!!!!""""""""""33333333*)!!"""""""####{w1111112$22222#&$-(c) The University of Glasgow, CWI 2001--2015/BSD-style (see the file libraries/base/LICENSE)Unsafe01[4base2Construct a representation for a type application.Y######4#4#####Y###"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafea4base+(c) Lennart Augustsson and Bart Massey 20135BSD-style (see the file LICENSE in this distribution)Bart Massey  provisionalportableSafe;4baseType of a function that will parse modifier characters from the format string.4baseThis is the type of a field formatter reified over its argument.4baseThe "format parser" walks over argument-type-specific modifier characters to find the primary format character. This is the type of its result.4baseRest of the format string.4basePrimary format character.4baseAny modifiers found.4base$Description of field formatting for 4 . See UNIX  printf(3)2 for a description of how field formatting works.4baseThe format character 4 was invoked with. 4 should fail unless this character matches the type. It is normal to handle many different format characters for a single type.4base6Characters that appeared immediately to the left of 41 in the format and were accepted by the type's 4. Normally the empty string.4base'Indicates an "alternate format". See  printf(3)0 for the details, which vary by argument spec.4base8Whether to insist on a plus sign for positive numbers.4base)Kind of filling or padding to be done.4base Secondary field width specifier.4baseTotal width of the field.4baseHow to handle the sign of a numeric field. These are mutually exclusive, with 4 taking precedence.4baseWhether to left-adjust or zero-pad a field. These are mutually exclusive, with 4 taking precedence.4baseThis class, with only the one instance, is used as a workaround for the fact that , as a concrete type, is not allowable as a typeclass instance. 4) is exported for backward-compatibility.4base4base4base Typeclass of 4-formattable values. The 4 method takes a value and a field format descriptor and either fails due to a bad descriptor or produces a  as the result. The default 4 expects no modifiers: this is the normal case. Minimal instance: 4.4base4base4baseThe 41 class provides the variable argument magic for 4. Its implementation is intentionally not visible from this module.4baseThe 41 class provides the variable argument magic for 4. Its implementation is intentionally not visible from this module. If you attempt to pass an argument of a type which is not an instance of this class to 4 or 4=, then the compiler will report it as a missing instance of 4.4baseFormat a variable number of arguments with the C-style formatting string.$printf "%s, %d, %.4f" "hello" 123 pihello, 123, 3.1416The return value is either  or ( a) (which should be ( ())., but Haskell's type system makes this hard).7The format string consists of ordinary characters and conversion specifications7, which specify how to format one of the arguments to 4 in the output string. A format specification is introduced by the % character; this character can be self-escaped into the format string using %%&. A format specification ends with a format character that provides the primary information about how to format the value. The rest of the conversion specification is optional. In order, one may have flag characters, a width specifier, a precision specifier, and type-specific modifier characters. Unlike C  printf(3), the formatting of this 4 is driven by the argument type; formatting is type specific. The types formatted by 4 "out of the box" are:q types, including y types46 is also extensible to support other types: see below.6A conversion specification begins with the character %2, followed by zero or more of the following flags: - left adjust (default is right adjust) + always use a sign (+ or -) for signed conversions space leading space for positive numbers in signed conversions 0 pad with zeros rather than spaces # use an \"alternate form\": see belowWhen both flags are given, - overrides 0 and +3 overrides space. A negative width specifier in a * conversion is treated as positive but implies the left adjust flag.The "alternate form" for unsigned radix conversions is as in C  printf(3): %o prefix with a leading 0 if needed %x prefix with a leading 0x if nonzero %X prefix with a leading 0X if nonzero %b prefix with a leading 0b if nonzero %[eEfFgG] ensure that the number contains a decimal point3Any flags are followed optionally by a field width: >num field width * as num, but taken from argument listThe field width is a minimum, not a maximum: it will be expanded as needed to avoid mutilating a value.6Any field width is followed optionally by a precision: .num precision . same as .0 .* as num, but taken from argument listNegative precision is taken as 0. The meaning of the precision depends on the conversion type. Integral minimum number of digits to show RealFloat number of digits after the decimal point String maximum number of charactersThe precision for Integral types is accomplished by zero-padding. If both precision and zero-pad are given for an Integral field, the zero-pad is ignored.Any precision is followed optionally for Integral types by a width modifier; the only use of this modifier being to set the implicit size of the operand for conversion of a negative operand to unsigned: ?hh Int8 h Int16 l Int32 ll Int64 L Int64/The specification ends with a format character: c character Integral d decimal Integral o octal Integral x hexadecimal Integral X hexadecimal Integral b binary Integral u unsigned decimal Integral f floating point RealFloat F floating point RealFloat g general format float RealFloat G general format float RealFloat e exponent format float RealFloat E exponent format float RealFloat s string String v default format any typeThe "%v" specifier is provided for all built-in types, and should be provided for user-defined type formatters as well. It picks a "best" representation for the given type. For the built-in types the "%v" specifier is converted as follows: c Char u other unsigned Integral d other signed Integral g RealFloat s StringMismatch between the argument types and the format string, as well as any other syntactic or semantic errors in the format string, will cause an exception to be thrown at runtime.Note that the formatting for y4 types is currently a bit different from that of C  printf(3), conforming instead to &, & and & (and their alternate versions & and &). This is hard to fix: the fixed versions would format in a backward-incompatible way. In any case the Haskell behavior is generally more sensible than the C behavior. A brief summary of some key differences:Haskell 4 never uses the default "6-digit" precision used by C printf.Haskell 4 treats the "precision" specifier as indicating the number of digits after the decimal point.Haskell 4 prints the exponent of e-format numbers without a gratuitous plus sign, and with the minimum possible number of digits.Haskell 4: will place a zero after a decimal point when possible.4base Similar to 4+, except that output is via the specified $. The return type is restricted to ( a).4baseSubstitute a 'v' format character with the given default format character in the 4. A convenience for user-implemented types, which should support "%v".4baseFormatter for  values.4baseFormatter for  values.4baseFormatter for  values.4baseFormatter for  values.4baseFormatter for y values.4base Raises an 6 with a printf-specific prefix on the message string.4baseCalls 48 to indicate an unknown format letter for a given type.4baseCalls 41 to indicate that the format string ended early.4baseCalls 4 to indicate that there is a missing argument in the argument list.4baseCalls 4 to indicate that there is a type error or similar in the given argument.4base4base4base4base4base4base4base4base5base5base5base5base5base5base5base5base5base5base5base5base5base5base4+4444444444444444444444444444444444444444444,44444444444444444444444444444444444444444444"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portable Trustworthyi4baseA specialised version of .3, where the key and the value are the same object: 2mkWeakPtr key finalizer = mkWeak key key finalizer4baseA specialised version of 4 , 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  using 4+ won't work; use the specialised version $ instead. For discussion see the . type. .4baseA specialised version of . where the value is actually a pair of the key and value passed to 4: =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. ......444. ....444..."(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy4base/Triggers an immediate minor garbage collection.4base/Triggers an immediate major garbage collection.4base/Triggers an immediate major garbage collection.////444444////"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe  5baseThe version of 5> with which the program was compiled or is being interpreted.Example ghci> compilerVersion Version {versionBranch = [8,8], versionTags = []}5baseThe full version of 5 with which the program was compiled or is being interpreted. It includes the major, minor, revision and an additional identifier, generally in the form " year month day".5baseThe operating system on which the program is running. Common values include:"darwin" @ macOS "freebsd""linux""linux-android""mingw32" @ Windows"netbsd" "openbsd"5baseThe machine architecture on which the program is running. Common values include: "aarch64""alpha""arm""hppa" "hppa1_1""i386""ia64""m68k""mips""mipseb""mipsel""nios2" "powerpc" "powerpc64" "powerpc64le" "riscv32" "riscv64" "loongarch32" "loongarch64""rs6000""s390""s390x""sh4""sparc" "sparc64""vax""x86_64"5baseThe Haskell implementation with which the program was compiled or is being interpreted. On the GHC platform, the value is "ghc".5555555555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy Y4base Computation 4 code throws & code3. Normally this terminates the program, returning code to the program's caller.%On program termination, the standard s & and 1/ are flushed automatically; any other buffered s 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 4:. A program that terminates successfully without calling 4, explicitly is treated as if it had called 4 &.As an & is an |+, it can be caught using the functions of Control.Exception4. This means that cleanup computations added with | (from Control.Exception ) are also executed properly on 4.Note: in GHC, 4 should be called from the main program thread in order to exit the process. When called from another thread, 4 will throw an & as normal, but the exception will not cause the process itself to exit.4baseThe computation 4 is equivalent to 4 (& exitfail) , where exitfail is implementation-dependent.4baseThe computation 4 is equivalent to 4 &*, It terminates the program successfully.4baseWrite given error message to 1 and terminate with 4.4444&&&&&&4444"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafe 3Cbase Reads the FilePath1 pointed to by the symbolic link and returns it.See readlink(2)5base=Returns the absolute pathname of the current executable, or argv[0] if the operating system does not provide a reliable way query the current executable.Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)Since base 4.11.0.0, 5 resolves symlinks on Windows. If an executable is launched through a symlink, 57 returns the absolute path of the original executable.If the executable has been deleted, behaviour is ill-defined and varies by operating system. See 5: for a more reliable way to query the current executable.5baseGet an action to query the absolute pathname of the current executable.If the operating system provides a reliable way to determine the current executable, return the query action, otherwise return Nothing. The action is defined on FreeBSD, Linux, MacOS, NetBSD, Solaris, and Windows.Even where the query action is defined, there may be situations where no result is available, e.g. if the executable file was deleted while the program is running. Therefore the result of the query action is a Maybe FilePath.Note that for scripts and interactive sessions, the result is the path to the interpreter (e.g. ghci.)3Note also that while most operating systems return Nothing if the executable file was deleted/unlinked, some (including NetBSD) return the original path.55"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafe  5base Computation 5 returns a list of the program's command line arguments (not including the program name).5base Computation 53 returns the name of the program as it was invoked.However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, and that is what 5 will return.5base Computation 5 var0 returns the value of the environment variable var. For the inverse, the  function can be used.This computation may fail with:{0 if the environment variable does not exist.5base-Return the value of the environment variable var, or Nothing if there is no such value.'For POSIX users, this is equivalent to .5basesetEnv name value, sets the specified environment variable to value.Early versions of this function operated under the mistaken belief that setting an environment variable to the  empty string on Windows removes that environment variable from the environment. For the sake of compatibility, it adopted that behavior on POSIX. In particular setEnv name "" has the same effect as 5 name If you'd like to be able to set environment variables to blank strings, use .Throws | if name1 is the empty string or contains an equals sign.5base unsetEnv name removes the specified environment variable from the environment of the current process.Throws | if name1 is the empty string or contains an equals sign.5base5 args act - while executing action act, have 5 return args.5base5 name act - while executing action act, have 5 return name.5base50 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. 55555555555 55555555555(c) Habib Alamin 2017/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafe 5base Similar to .5base,Get an environment value or a default value.5baseLike , but allows blank environment values and mimics the function signature of  from the unix package.5baseLike , but allows for the removal of blank environment variables. May throw an exception if the underlying platform doesn't support unsetting of environment variables.5base!variable name base!fallback value base!variable value or fallback value 5basevariable name basevariable value baseoverwrite 5555555555 5555555555(c) Sven Panne 2002-2005/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe "U5baseDescribes whether an option takes an argument or not, and if so how the argument is injected into a value of type a.5baseno argument expected5baseoption requires argument5baseoptional argument5baseEach 5 describes a single option.The arguments to 5 are:list of short option characters*list of long option strings (without "--")argument descriptorexplanation of option for user5base-What to do with options following non-options5base+no option processing after first non-option5base*freely intersperse options and non-options5basewrap non-options into options5baseReturn a string describing the usage of a command, derived from the header (first argument) and the options described by the second argument.5baseProcess the command-line, and return the list of values that matched (and those that didn't). The arguments are:The order requirements (see 5)The option descriptions (see 5):The actual command line arguments (presumably got from ).5 returns a triple consisting of the option arguments, a list of non-options, and a list of error messages.5baseThis is almost the same as 5, but returns a quadruple consisting of the option arguments, a list of non-options, a list of unrecognized options, and a list of error messages.5base5base5base 5555555555555 5555555555555 Safe-Inferred "CCC Safe-Inferred "CCNone $ #Cbase&Perform the given action to fill in a struct timespec;, returning the result of the action and the value of the timespec in picoseconds.CC"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy %4baseThe 4 constant is the smallest measurable difference in CPU time that the implementation can record, and is given as an integral number of picoseconds.4base Computation 4 returns the number of picoseconds CPU time used by the current program. The precision of this result is implementation-dependent.4444 (C) 2014 I/O Tweagsee libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)None *baseA reference to a value of type a.4base;Miscellaneous information available for debugging purposes.4base>Source location of the definition of the static pointer as a (Line, Column) pair.4base6Name of the module where the static pointer is defined4base>Package key of the package where the static pointer is defined4base2A class for things buildable from static pointers.GHC wraps each use of the static keyword with a. Because the static5 keyword requires its argument to be an instance of }, a carries a } constraint as well.4base A key for (s that can be serialized and used with 4.4baseDereferences a static pointer.4baseThe 4' that can be used to look up the given .4base Looks up a  by its 4.If the  is not found returns Nothing.This function is unsafe because the program behavior is undefined if the type of the returned ! does not match the expected one.4base4 of the given .4baseA list of all known keys.4 base4base444444a4444444444444444a(C) 2016 I/O Tweagsee libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)None +C"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portable Trustworthy 24baseAn 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.The reverse is not necessarily true: if two stable names are not equal, then the objects they name may still be equal. Note in particular that 4 may return a different 4 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. 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 a stable name to the original Haskell object. The reason for this is that the existence of a stable name for an object does not guarantee the existence of the object itself; it can still be garbage collected.4baseMakes a 4 for an arbitrary object. The object passed as the first argument is not evaluated by 4.4base Convert a 4 to an . The . returned is not necessarily unique; several 4s may map to the same  (in practice however, the chances of this are small, so the result of 4 makes a good hash key).4base Equality on 4> that does not require that the types of the arguments match.4base4444444444"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portableSafe 3444444444 BSD-style (see the file LICENSE)libraries@haskell.orginternalportable Safe-Inferred =5baseLike 5:, but can also read arguments supplied via response files. For example, consider a program foo: main :: IO () main = do args <- getArgsWithResponseFiles putStrLn (show args) And a response file args.txt: --one 1 --'two' 2 --"three" 3 Then the result of invoking foo with args.txt is: 9> ./foo @args.txt ["--one","1","--two","2","--three","3"]5baseGiven a string of concatenated strings, separate each by removing a layer of quoting and/or escaping of certain characters.These characters are: any whitespace, single quote, double quote, and the backslash character. The backslash character always escapes (i.e., passes through without further consideration) the character which follows. Characters can also be escaped in blocks by quoting (i.e., surrounding the blocks with matching pairs of either single- or double-quotes which are not themselves escaped).Any whitespace which appears outside of either of the quoting and escaping mechanisms, is interpreted as having been added by this special concatenation process to designate where the boundaries are between the original, un-concatenated list of strings. These added whitespace characters are removed from the output. =unescapeArgs "hello\\ \\\"world\\\"\n" == ["hello \"world\""]5baseGiven a list of strings, concatenate them into a single string with escaping of certain characters, and the addition of a newline between each string. The escaping is done by adding a single backslash character before any whitespace, single quote, double quote, or backslash character, so this escaping character must be removed. Unescaped whitespace (in this case, newline) is part of this "transport" format to indicate the end of the previous string and the start of a new string.While 5 allows using quoting (i.e., convenient escaping of many characters) by having matching sets of single- or double-quotes,5 does not use the quoting mechanism, and thus will always escape any whitespace, quotes, and backslashes. ;escapeArgs ["hello \"world\""] == "hello\\ \\\"world\\\"\n"5baseArguments which look like @foo- will be replaced with the contents of file foo. A gcc-like syntax for response files arguments is expected. This must re-constitute the argument list by doing an inverse of the escaping mechanism done by the calling-program side.We quit if the file is not found or reading somehow fails. (A convenience routine for haddock or possibly other clients)55555555"(c) Adam Gundry 2015-2016see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Safe-Inferred0 ?dbase7Selector function to extract the field from the record.base0Constraint representing the fact that the field x belongs to the record type r and has field type a. This will be solved automatically, but manual instances may be provided as well.dd(c) Adam Gundry 2015-2016see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)None 1 @S4D4D(c) The GHC Developerssee libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Safe-Inferred @555555J((c) The University of Glasgow, 1994-2000see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions) Safe-Inferred< B baseByte ordering.base/most-significant-byte occurs in lowest address.base0least-significant-byte occurs in lowest address.base(The byte ordering of the target machine.3 base3 base3 base3 base3 base3 baseCbase<(C) 2008-2014 Edward Kmett/BSD-style (see the file libraries/base/LICENSE)Edward Kmett  provisionalportable Trustworthy C"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portable Trustworthy F5base,An abstract unique object. Objects of type 5< may be compared for equality and ordering and hashed into .:{do x <- newUnique print (x == x) y <- newUnique print (x == y):}TrueFalse5baseCreates a new object of type 5. The value returned will not compare equal to any other value of type 5 returned by previous calls to 5-. There is no limit on the number of times 5 may be called.5base Hashes a 5 into an . Two 5s may hash to the same value, although in practice this is unlikely. The ! returned makes a good hash key.555555_"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable$non-portable (uses Control.Monad.ST) Trustworthy J5baseMutate the contents of an .:{ runST (do ref <- newSTRef ""# modifySTRef ref (const "world") modifySTRef ref (++ "!")" modifySTRef ref ("Hello, " ++) readSTRef ref ):}"Hello, world!"Be warned that 5 does not apply the function strictly. This means if the program calls 5 many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. This is a common mistake made when using an  as a counter. For example, the following will leak memory and may produce a stack overflow:"import Control.Monad (replicateM_):{print (runST (do ref <- newSTRef 0+ replicateM_ 1000 $ modifySTRef ref (+1) readSTRef ref )):}1000To avoid this problem, use 5 instead.5baseStrict version of 55555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional+non-portable (uses Control.Monad.ST.Strict)Safe K556"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe M5base5), applied to two real fractional numbers x and epsilon/, returns the simplest rational number within epsilon of x. A rational number y is said to be simpler than another y' if ( y) <=  ( y'), and y <=  y'.Any real interval contains a unique simplest rational; in particular, note that 0/1! is the simplest rational of all.55None $ N8CCNone $ N_CC24BSD-style (see the LICENSE file in the distribution)libraries@haskell.orgstable not portable Trustworthy N*"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportable Trustworthy O||]"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable:non-portable (requires universal quantification for runST)Unsafe Pu$$$$7"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable:non-portable (requires universal quantification for runST) Trustworthy QU0$0$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable:non-portable (requires universal quantification for runST) Trustworthy R:0$0$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional:non-portable (requires universal quantification for runST)Safe S0$"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional:non-portable (requires universal quantification for runST)Unsafe Z 5base The lazy 5 monad. The ST monad allows for destructive updates, but is escapable (unlike IO). A computation of type 5 s a returns a value of type a, and executes in "thread" s. The s parameter is either7an uninstantiated type variable (inside invocations of 5), or (inside invocations of 5).It serves to keep the internal states of different invocations of 52 separate from each other and from invocations of 5.The > and ?6 operations are not strict in the state. For example, 55 (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2CbaseThis is a terrible hack to prevent a thunk from being entered twice. Simon Peyton Jones would very much like to be rid of it.5base Return the value computed by an 5 computation. The forall- ensures that the internal state used by the 59 computation is inaccessible to the rest of the program.5baseAllow the result of an 5 computation to be used (lazily) inside the computation. Note that if f is strict, 5 f = _|_.5baseConvert a strict 5 computation into a lazy one. The strict state thread passed to 5 is not performed until the result of the lazy state thread it returns is demanded.5baseConvert a lazy 5 computation into a strict one.5base#A monad transformer embedding lazy 5 in the  monad. The : parameter indicates that the internal state used by the 5. computation is a special one supplied by the = monad, and thus distinct from those used by invocations of 5.CbaseCbaseCbaseCbase 55555555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional:non-portable (requires universal quantification for runST)Unsafe [5555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional:non-portable (requires universal quantification for runST) Trustworthy \555555555555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisional:non-portable (requires universal quantification for runST) Trustworthy ]555555555555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable)non-portable (uses Control.Monad.ST.Lazy)Safe ^_55555555"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportableSafe _t@r?>A t@r?>A(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.ukstableportableSafe d5baseMonads in which  computations may be embedded. Any monad built by applying a sequence of monad transformers to the ) monad will be an instance of this class.>Instances should satisfy the following laws, which state that 5 is a transformer of monads: 5 . A = A 5 (m >>= f) = 5 m >>= (5 . f)5baseLift a computation from the  monad. This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations (i.e. " is the base monad for the stack).Example import Control.Monad.Trans.State -- from the "transformers" library printState :: Show s => StateT s IO () printState = do state <- get liftIO $ print stateHad we omitted 5), we would have ended up with this error: @ Couldn't match type @IO@ with @StateT s IO@ Expected type: StateT s IO () Actual type: IO ()0The important part here is the mismatch between StateT s IO () and  ().-Luckily, we know of a function that takes an  a and returns an (m a): 5?, enabling us to run the program and see the expected results: > evalStateT printState "hello" "hello" > evalStateT printState 3 3 5 base5555 Trustworthy%&< t85baseTime values from the RTS, using a fixed resolution of nanoseconds.5base9Statistics about a single GC. This is a mirror of the C struct GCDetails in RtsAPI.h, with the field prefixed with gc_ to avoid collisions with 5.5baseThe time elapsed during the post-mark pause phase of the concurrent nonmoving GC.5baseThe CPU time used during the post-mark pause phase of the concurrent nonmoving GC.5base!The time elapsed during GC itself5base"The CPU time used during GC itself5base1The time elapsed during synchronisation before GC5baseThe amount of memory lost due to block fragmentation in bytes. Block fragmentation is the difference between the amount of blocks retained by the RTS and the blocks that are in use. This occurs when megablocks are only sparsely used, eg, when data that cannot be moved retains a megablock.5baseIn parallel GC, the amount of balanced data copied by all threads5baseIn parallel GC, the max amount of data copied by any one thread. Deprecated.5base*Total amount of data copied during this GC5base(Total amount of memory in use by the RTS5base$Total amount of slop (wasted memory)5base,Total amount of live data in compact regions5base*Total amount of live data in large objects5baseTotal amount of live data in the heap (includes large + compact data). Updated after every GC. Data in uncollected generations (in minor GCs) are considered live.5base/Number of bytes allocated since the previous GC5base!Number of threads used in this GC5base The generation number of this GC5 baseStatistics about runtime activity since the start of the program. This is a mirror of the C struct RTSStats in RtsAPI.h5base Details about the most recent GC5base7The maximum time elapsed during any nonmoving GC cycle.5baseThe total time elapsed during which there is a nonmoving GC active.6base,The total CPU time used by the nonmoving GC.6baseThe maximum elapsed length of any post-mark pause phase of the concurrent nonmoving GC.6baseThe total time elapsed during the post-mark pause phase of the concurrent nonmoving GC.6baseThe total CPU time used during the post-mark pause phase of the concurrent nonmoving GC.6base'Total elapsed time (at the previous GC)6base#Total CPU time (at the previous GC)6base!Total elapsed time used by the GC6baseTotal CPU time used by the GC6base&Total elapsed time used by the mutator6base"Total CPU time used by the mutator6base:Total elapsed time used by the init phase @since 4.12.0.06base6Total CPU time used by the init phase @since 4.12.0.06base8Sum of par_balanced_copied bytes across all parallel GCs6baseSum of par_max_copied_bytes across all parallel GCs. Deprecated.6base+Sum of copied_bytes across all parallel GCs6base"Sum of copied_bytes across all GCs6baseSum of live bytes across all major GCs. Divided by major_gcs gives the average live data over the lifetime of the program.6base Maximum memory in use by the RTS6base Maximum slop6base$Maximum live data in compact regions6base"Maximum live data in large objects6baseMaximum live data (including large objects + compact regions) in the heap. Updated after a major GC.6baseTotal bytes allocated6base-Total number of major (oldest generation) GCs6baseTotal number of GCs6 base1Returns whether GC stats have been enabled (with +RTS -T, for example).6 base&Get current runtime system statistics.6 base6 base6 base6 baseCbaseCbase4665555555555555555555556666666566666666666666556666545556666666666666666666666666555555555555555555555566'(c) The University of Glasgow 2013-2015see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)None xaCbase&A LibdwSession from the runtime systemCbase An address6base The state of the execution stackCbaseA chunk of backtrace frames6base7Location information about an address from a backtrace.6base*A location in the original program source.6base#How many stack frames in the given 6CbaseReturn a list of the chunks of a backtrace, from the outer-most to inner-most chunk.CbaseUnpack the given 6 in the Haskell representationCbaseThe size in bytes of a C6base!List the frames of a stack trace.6baseGet an execution stack.6baseFree the cached debug data.6baseRender a stacktrace as a stringCbase Render a 6 as a string66666666666666666666666666666666'(c) The University of Glasgow 2013-2015see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)None z6base1Get a trace of the current execution stack state.Returns Nothing8 if stack trace support isn't available on host machine.6baseGet a string representation of the current execution stack state. 666666666666 666666666666=(C) 2011-2015 Edward Kmett, (C) 2010 Tony Morris, Oliver Taylor, Eelis van der Weegen BSD-style (see the file LICENSE)libraries@haskell.org provisionalportable Trustworthy ?6baseNumber of elements in  list.6base.Compute n-ary logic exclusive OR operation on  list.6base6 produces a new stream by repeatedly applying the unfolding function to the seed value to produce an element of type b= and a new seed value. When the unfolding function returns / instead of a new seed value, the stream ends.6base6( efficiently turns a normal list into a  stream, producing  if the input is empty.6base6 produces the first element of the stream, and a stream of the remaining elements, if any.6baseThe 6 function is analogous to  Data.List's  operation.6base(Extract the first element of the stream.6base.Extract the possibly-empty tail of the stream.6base'Extract the last element of the stream.6base9Extract everything except the last element of the stream.6base Construct a  list from a single element.6base!Prepend an element to the stream.6base Synonym for 6.6baseSort a stream.6baseConverts a normal list to a  stream.'Raises an error if given an empty list.6base.Convert a stream to a normal list efficiently.Cbase"Lift list operations to work on a  stream.Beware: If the provided function returns an empty list, this will raise an error.6baseMap a function over a  stream.6baseThe 6 function takes a stream xs) and returns all the finite prefixes of xs-, starting with the shortest. The result is  because the result always contains the empty list as the first element. inits [1,2,3] == [] :| [[1], [1,2], [1,2,3]] inits [1] == [] :| [[1]] inits [] == [] :| []6baseThe 6 function takes a  stream xs and returns all the  finite prefixes of xs, starting with the shortest. inits1 (1 :| [2,3]) == (1 :| []) :| [1 :| [2], 1 :| [2,3]] inits1 (1 :| []) == (1 :| []) :| []6baseThe 6 function takes a stream xs" and returns all the suffixes of xs+, starting with the longest. The result is  because the result always contains the empty list as the last element. tails [1,2,3] == [1,2,3] :| [[2,3], [3], []] tails [1] == [1] :| [[]] tails [] == [] :| []6baseThe 6 function takes a  stream xs, and returns all the non-empty suffixes of xs, starting with the longest. tails1 (1 :| [2,3]) == (1 :| [2,3]) :| [2 :| [3], 3 :| []] tails1 (1 :| []) == (1 :| []) :| []6base6 x xs inserts x into the last position in xs where it is still less than or equal to the next element. In particular, if the list is sorted beforehand, the result will also be sorted.6base6 x sequences x one or more times.6base6 is similar to !, but returns a stream of successive reduced values from the left: 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.6base6 is the right-to-left dual of 6 . Note that $head (scanr f z xs) == foldr f z xs.6base6 is a variant of 6% that has no starting value argument: scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...]6base6 is a variant of 6% that has no starting value argument.6base'intersperse x xs' alternates elements of the list with copies of x. ,intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3]6base6 f x= produces the infinite sequence of repeated applications of f to x. %iterate f x = x :| [f x, f (f x), ..]6base6 xs$ returns the infinite repetition of xs: )cycle (1 :| [2,3]) = 1 :| [2,3,1,2,3,...]6base6 a finite NonEmpty stream.6base6 x= returns a constant stream, where all elements are equal to x.6base6 n xs returns the first n elements of xs.6base6 n xs drops the first n) elements off the front of the sequence xs.6base6 n xs, returns a pair consisting of the prefix of xs of length n< and the remaining stream immediately following this prefix. 'splitAt' n xs == ('take' n xs, 'drop' n xs) xs == ys ++ zs where (ys, zs) = 'splitAt' n xs6base6 p xs+ returns the longest prefix of the stream xs for which the predicate p holds.6base6 p xs% returns the suffix remaining after 6 p xs.6base6 p xs returns the longest prefix of xs that satisfies p,, together with the remainder of the stream. 'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs) xs == ys ++ zs where (ys, zs) = 'span' p xs6baseThe 6 p function is equivalent to 6 (not . p).6base6 p xs removes any elements from xs that do not satisfy p.6baseThe 6 function takes a predicate p and a stream xs, and returns a pair of lists. The first list corresponds to the elements of xs for which p3 holds; the second corresponds to the elements of xs for which p does not hold. 9'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)6baseThe 6 function takes a stream and returns a list of streams such that flattening the resulting list is equal to the argument. Moreover, each stream in the resulting list contains only equal elements. For example, in list notation: 'group' $ 'cycle' "Mississippi" = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ...6base6 operates like 67, but uses the provided equality predicate instead of ;.6base6 operates like 6?, but uses the provided projection when comparing for equality6base6 operates like 6, but sorts the list first so that each equivalence class has, at most, one list in the output6base6 operates like 6, but uses the knowledge that its input is non-empty to produce guaranteed non-empty output.6base6 is to 6 as 6 is to 6.6base6 is to 6 as 6 is to 66base6 is to 6 as 6 is to 66baseThe 6 function returns 2 if the first argument is a prefix of the second.6basexs !! n# returns the element of the stream xs at index n/. Note that the head of the stream has index 0.Beware8: a negative or out-of-bounds index will cause an error.6baseThe 6 function takes two streams and returns a stream of corresponding pairs.6baseThe 6 function generalizes 6. Rather than tupling the elements, the elements are combined using the function passed as the first argument.6baseThe 6 function is the inverse of the 6 function.6baseThe 6 function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. (The name 6, means 'essence'.) It is a special case of 6, which allows the programmer to supply their own inequality test.6baseThe 6 function behaves just like 6, except it uses a user-supplied equality predicate instead of the overloaded ; function.6base6 for , behaves the same as  The rows/columns need not be the same length, in which case > transpose . transpose /= id6base6 for , behaves the same as 6base6 for , behaves the same as: sortBy . comparing6baseA monomorphic version of [ for .append (1 :| []) (2 :| [3]) 1 :| [2,3]6baseAttach a list at the end of a .appendList (1 :| [2,3]) [] 1 :| [2,3]appendList (1 :| [2,3]) [4,5]1 :| [2,3,4,5]6base$Attach a list at the beginning of a .prependList [] (1 :| [2,3]) 1 :| [2,3]'prependList [negate 1, 0] (1 :| [2, 3])-1 :| [0,1,2,3]666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 (c) Nils Schweinsberg 2011, (c) George Giorgidze 2011 (c) University Tuebingen 2011/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe B6base"Instances should satisfy the laws:  Naturality  (f  g) (R ma mb) = R ( f ma) ( g mb)Information Preservation ( ()) ma =  ( ()) mb implies 6 (R ma mb) = (ma, mb)6 base6 base6 base6 base6 base6 base6 base6base6base7base7base7base7base7base7base7base7 base7base66666R666R6666(C) 2008-2014 Edward Kmett, BSD-style (see the file LICENSE)libraries@haskell.org provisionalportableSafe h 7baseA bifunctor is a type constructor that takes two type arguments and is a functor in both" arguments. That is, unlike with t, a type constructor such as . does not need to be partially applied for a 7 instance, and the methods in this class permit mapping functions over the  value or the " value, or both at the same time.Formally, the class 7 represents a bifunctor from Hask -> Hask.Intuitively it is a bifunctor where both the first and second arguments are covariant.You can define a 7 by either defining 7 or by defining both 7 and 7. A partially applied 7 must be a t and the 7 method must agree with @. From this it follows that: 7  = If you supply 7, you should ensure that: 7   D If you supply 7 and 7 , ensure: 7  D  7  D  +If you supply both, you should also ensure: 7 f g D 7 f  7 gThese ensure by parametricity: 7 (f  g) (h  i) D 7 f h  7 g i 7 (f  g) D 7 f  7 g 7 (f  g) D 7 f  7 g Since 4.18.0.0 t is a superclass of 'Bifunctor.7base)Map over both arguments at the same time. 7 f g D 7 f  7 gExamplesbimap toUpper (+1) ('j', 3)('J',4)bimap toUpper (+1) (Left 'j')Left 'J'bimap toUpper (+1) (Right 3)Right 47base(Map covariantly over the first argument. 7 f D 7 f Examplesfirst toUpper ('j', 3)('J',3)first toUpper (Left 'j')Left 'J'7base)Map covariantly over the second argument. 7 D 7 Examplessecond (+1) ('j', 3)('j',4)second (+1) (Right 3)Right 47 base7base7base7base7base7base7base7base7base6Class laws for tuples hold only up to laziness. Both 7  and 7  are lazier than  (and @ ):,first id (undefined :: (Int, Word)) `seq` ()()-second id (undefined :: (Int, Word)) `seq` ()()&id (undefined :: (Int, Word)) `seq` () *** Exception: Prelude.undefined77777777777777(C) 2011-2016 Edward Kmett BSD-style (see the file LICENSE)libraries@haskell.org provisionalportableSafe .7 base7 identifies foldable structures with two different varieties of elements (as opposed to :, which has one variety of element). Common examples are  and (,): instance Bifoldable Either where bifoldMap f _ (Left a) = f a bifoldMap _ g (Right b) = g b instance Bifoldable (,) where bifoldr f g z (a, b) = f a (g b z)Some examples below also use the following BiList to showcase empty Bifoldable behaviors when relevant ( and (,)4 containing always exactly resp. 1 and 2 elements): data BiList a b = BiList [a] [b] instance Bifoldable BiList where bifoldr f g z (BiList as bs) = foldr f (foldr g z bs) as A minimal 7 definition consists of either 7 or 7. When defining more than this minimal set, one should ensure that the following identities hold: 7 D 7   7 f g D 7 (] . f) (] . g) \ 7 f g z t D ! (7 (Endo . f) (Endo . g) t) z If the type is also a  instance, it should satisfy: 7 f g D 7 .  f g which implies that 7 f g .  h i D 7 (f . h) (g . i) 7 base4Combines the elements of a structure using a monoid. 7 D 7  Examples Basic usage:bifold (Right [1, 2, 3])[1,2,3]bifold (Left [5, 6])[5,6]bifold ([1, 2, 3], [4, 5]) [1,2,3,4,5]bifold (Product 6, Product 7)Product {getProduct = 42}bifold (Sum 6, Sum 7)Sum {getSum = 13}7 baseCombines the elements of a structure, given ways of mapping them to a common monoid. 7 f g D 7 (] . f) (] . g) \Examples Basic usage:2bifoldMap (take 3) (fmap digitToInt) ([1..], "89") [1,2,3,8,9]1bifoldMap (take 3) (fmap digitToInt) (Left [1..])[1,2,3]1bifoldMap (take 3) (fmap digitToInt) (Right "89")[8,9]7 baseCombines the elements of a structure in a right associative manner. Given a hypothetical function %toEitherList :: p a b -> [Either a b] yielding a list of all elements of a structure in order, the following would hold: 7 f g z D ! ( f g) z . toEitherListExamples Basic usage: > bifoldr (+) (*) 3 (5, 7) 26 -- 5 + (7 * 3) > bifoldr (+) (*) 3 (7, 5) 22 -- 7 + (5 * 3) > bifoldr (+) (*) 3 (Right 5) 15 -- 5 * 3 > bifoldr (+) (*) 3 (Left 5) 8 -- 5 + 3 7 baseCombines the elements of a structure in a left associative manner. Given a hypothetical function %toEitherList :: p a b -> [Either a b] yielding a list of all elements of a structure in order, the following would hold: 7 f g z D ! (acc -> " (f acc) (g acc)) z . toEitherListNote that if you want an efficient left-fold, you probably want to use 7 instead of 7. The reason is that the latter does not force the "inner" results, resulting in a thunk chain which then must be evaluated from the outside-in.Examples Basic usage: > bifoldl (+) (*) 3 (5, 7) 56 -- (5 + 3) * 7 > bifoldl (+) (*) 3 (7, 5) 50 -- (7 + 3) * 5 > bifoldl (+) (*) 3 (Right 5) 15 -- 5 * 3 > bifoldl (+) (*) 3 (Left 5) 8 -- 5 + 3 7 baseAs 7, but strict in the result of the reduction functions at each step.7 base A variant of 7 that has no base case, and thus may only be applied to non-empty structures.Examples Basic usage:bifoldr1 (+) (5, 7)12bifoldr1 (+) (Right 7)7bifoldr1 (+) (Left 5)5 >> bifoldr1 (+) (BiList [1, 2] [3, 4]) 10 -- 1 + (2 + (3 + 4)) bifoldr1 (+) (BiList [1, 2] [])37On empty structures, this function throws an exception:bifoldr1 (+) (BiList [] [])(*** Exception: bifoldr1: empty structure...7 base2Right associative monadic bifold over a structure.7 baseAs 7, but strict in the result of the reduction functions at each step.This ensures that each step of the bifold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single, monolithic result (e.g., 7).7 base A variant of 7 that has no base case, and thus may only be applied to non-empty structures.Examples Basic usage:bifoldl1 (+) (5, 7)12bifoldl1 (+) (Right 7)7bifoldl1 (+) (Left 5)5 >> bifoldl1 (+) (BiList [1, 2] [3, 4]) 10 -- ((1 + 2) + 3) + 4 bifoldl1 (+) (BiList [1, 2] [])37On empty structures, this function throws an exception:bifoldl1 (+) (BiList [] [])(*** Exception: bifoldl1: empty structure...7 base1Left associative monadic bifold over a structure.Examples Basic usage:bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 ("Hello", True)"Hello""True"42bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 (Right True)"True"42bifoldlM (\a b -> print b >> pure a) (\a c -> print (show c) >> pure a) 42 (Left "Hello")"Hello"427 baseMap each element of a structure using one of two actions, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results, see .Examples Basic usage:0bitraverse_ print (print . show) ("Hello", True)"Hello""True"-bitraverse_ print (print . show) (Right True)"True"/bitraverse_ print (print . show) (Left "Hello")"Hello"7 baseAs 7, but with the structure as the primary argument. For a version that doesn't ignore the results, see .Examples Basic usage:+bifor_ ("Hello", True) print (print . show)"Hello""True"(bifor_ (Right True) print (print . show)"True"*bifor_ (Left "Hello") print (print . show)"Hello"7 base Alias for 7.7 base Alias for 7.7 base Alias for 7.7 baseEvaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results, see .Examples Basic usage:*bisequence_ (print "Hello", print "World")"Hello""World""bisequence_ (Left (print "Hello"))"Hello"#bisequence_ (Right (print "World"))"World"7 base1The sum of a collection of actions, generalizing 7.Examples Basic usage:biasum (Nothing, Nothing)Nothingbiasum (Nothing, Just 42)Just 42biasum (Just 18, Nothing)Just 18biasum (Just 18, Just 42)Just 187 base Alias for 7.7 baseCollects the list of elements of a structure, from left to right.Examples Basic usage:biList (18, 42)[18,42]biList (Left 18)[18]7 base$Test whether the structure is empty.Examples Basic usage:binull (18, 42)Falsebinull (Right 42)Falsebinull (BiList [] [])True7 base4Returns the size/length of a finite structure as an .Examples Basic usage:bilength (True, 42)2bilength (Right 42)1bilength (BiList [1,2,3] [4,5])5bilength (BiList [] [])0,On infinite structures, this function hangs: /> bilength (BiList [1..] []) * Hangs forever * 7 base(Does the element occur in the structure?Examples Basic usage:bielem 42 (17, 42)Truebielem 42 (17, 43)Falsebielem 42 (Left 42)Truebielem 42 (Right 13)False"bielem 42 (BiList [1..5] [1..100])True!bielem 42 (BiList [1..5] [1..41])False7 baseReduces a structure of lists to the concatenation of those lists.Examples Basic usage:biconcat ([1, 2, 3], [4, 5]) [1,2,3,4,5]biconcat (Left [1, 2, 3])[1,2,3]4biconcat (BiList [[1, 2, 3, 4, 5], [6, 7, 8]] [[9]])[1,2,3,4,5,6,7,8,9]7 base-The largest element of a non-empty structure.Examples Basic usage:bimaximum (42, 17)42bimaximum (Right 42)42)bimaximum (BiList [13, 29, 4] [18, 1, 7])29!bimaximum (BiList [13, 29, 4] [])297On empty structures, this function throws an exception:bimaximum (BiList [] []))*** Exception: bimaximum: empty structure...7 base+The least element of a non-empty structure.Examples Basic usage:biminimum (42, 17)17biminimum (Right 42)42)biminimum (BiList [13, 29, 4] [18, 1, 7])1!biminimum (BiList [13, 29, 4] [])47On empty structures, this function throws an exception:biminimum (BiList [] []))*** Exception: biminimum: empty structure...7 baseThe 79 function computes the sum of the numbers of a structure.Examples Basic usage:bisum (42, 17)59bisum (Right 42)42%bisum (BiList [13, 29, 4] [18, 1, 7])72bisum (BiList [13, 29, 4] [])46bisum (BiList [] [])07 baseThe 7> function computes the product of the numbers of a structure.Examples Basic usage:biproduct (42, 17)714biproduct (Right 42)42)biproduct (BiList [13, 29, 4] [18, 1, 7])190008!biproduct (BiList [13, 29, 4] [])1508biproduct (BiList [] [])17 baseGiven a means of mapping the elements of a structure to lists, computes the concatenation of all such lists in order.Examples Basic usage:4biconcatMap (take 3) (fmap digitToInt) ([1..], "89") [1,2,3,8,9]3biconcatMap (take 3) (fmap digitToInt) (Left [1..])[1,2,3]3biconcatMap (take 3) (fmap digitToInt) (Right "89")[8,9]7 base7 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.Examples Basic usage:biand (True, False)Falsebiand (True, True)Truebiand (Left True)TrueEmpty structures yield :biand (BiList [] [])TrueA - value finitely far from the left end yields  (short circuit):6biand (BiList [True, True, False, True] (repeat True))FalseA . value infinitely far from the left end hangs: 9> biand (BiList (repeat True) [False]) * Hangs forever * An infinitely  value hangs: 4> biand (BiList (repeat True) []) * Hangs forever * 7 base7 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.Examples Basic usage:bior (True, False)Truebior (False, False)Falsebior (Left True)TrueEmpty structures yield :bior (BiList [] [])FalseA - value finitely far from the left end yields  (short circuit):8bior (BiList [False, False, True, False] (repeat False))TrueA . value infinitely far from the left end hangs: 8> bior (BiList (repeat False) [True]) * Hangs forever * An infinitely  value hangs: 4> bior (BiList (repeat False) []) * Hangs forever * 7 baseDetermines whether any element of the structure satisfies its appropriate predicate argument. Empty structures yield .Examples Basic usage:biany even isDigit (27, 't')Falsebiany even isDigit (27, '8')Truebiany even isDigit (26, 't')Truebiany even isDigit (Left 27)Falsebiany even isDigit (Left 26)True/biany even isDigit (BiList [27, 53] ['t', '8'])TrueEmpty structures yield :!biany even isDigit (BiList [] [])False7 baseDetermines whether all elements of the structure satisfy their appropriate predicate argument. Empty structures yield .Examples Basic usage:biall even isDigit (27, 't')Falsebiall even isDigit (26, '8')Truebiall even isDigit (Left 27)Falsebiall even isDigit (Left 26)True/biall even isDigit (BiList [26, 52] ['3', '8'])TrueEmpty structures yield :!biall even isDigit (BiList [] [])True7 baseThe largest element of a non-empty structure with respect to the given comparison function.Examples Basic usage:bimaximumBy compare (42, 17)42bimaximumBy compare (Left 17)172bimaximumBy compare (BiList [42, 17, 23] [-5, 18])427On empty structures, this function throws an exception:"bimaximumBy compare (BiList [] [])(*** Exception: bifoldr1: empty structure...7 baseThe least element of a non-empty structure with respect to the given comparison function.Examples Basic usage:biminimumBy compare (42, 17)17biminimumBy compare (Left 17)172biminimumBy compare (BiList [42, 17, 23] [-5, 18])-57On empty structures, this function throws an exception:"biminimumBy compare (BiList [] [])(*** Exception: bifoldr1: empty structure...7 base7 is the negation of 7.Examples Basic usage:binotElem 42 (17, 42)FalsebinotElem 42 (17, 43)TruebinotElem 42 (Left 42)FalsebinotElem 42 (Right 13)True%binotElem 42 (BiList [1..5] [1..100])False$binotElem 42 (BiList [1..5] [1..41])True7 baseThe 7 function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or  if there is no such element.Examples Basic usage:bifind even (27, 53)Nothingbifind even (27, 52)Just 52bifind even (26, 52)Just 26Empty structures always yield :bifind even (BiList [] [])Nothing7 base7 base7 base7 base7 base7 base7 base7 base7 base7777%7777777777777777777777777777777777777)77777777777777777777777777777777777777777(C) 2011-2016 Edward Kmett BSD-style (see the file LICENSE)libraries@haskell.org provisionalportable Trustworthy 7 base7 identifies bifunctorial data structures whose elements can be traversed in order, performing  or r actions at each element, and collecting a result structure with the same shape.As opposed to  data structures, which have one variety of element on which an action can be performed, 76 data structures have two such varieties of elements.A definition of 7! must satisfy the following laws:  Naturality7 (t . f) (t . g) D t . 7 f g) for every applicative transformation tIdentity7 2 2 D 2 Composition . @ (7 g1 g2) . 7 f1 f2 D 7 ( . @ g1 . f1) ( . @ g2 . f2) where an applicative transformation is a function t :: ( f,  g) => f a -> g apreserving the  operations: t (j x) = j x t (f i x) = t f i t x and the identity functor 2 and composition functors  are from Data.Functor.Identity and Data.Functor.Compose.Some simple examples are  and (,): instance Bitraversable Either where bitraverse f _ (Left x) = Left <$> f x bitraverse _ g (Right y) = Right <$> g y instance Bitraversable (,) where bitraverse f g (x, y) = (,) <$> f x <*> g y73 relates to its superclasses in the following ways: 7 f g D 2 . 7 (2 . f) (2 . g) 7 f g = " . 7 (" . f) (" . g) These are available as 7 and 7 respectively.7 baseEvaluates the relevant functions at each element in the structure, running the action, and builds a new structure with the same shape, using the results produced from sequencing the actions. 7 f g D 7 . 7 f g,For a version that ignores the results, see 7.Examples Basic usage:+bitraverse listToMaybe (find odd) (Left [])Nothing2bitraverse listToMaybe (find odd) (Left [1, 2, 3]) Just (Left 1)0bitraverse listToMaybe (find odd) (Right [4, 5])Just (Right 5)5bitraverse listToMaybe (find odd) ([1, 2, 3], [4, 5]) Just (1,5).bitraverse listToMaybe (find odd) ([], [4, 5])Nothing7 base Alias for 7.7 base Alias for 7.7 baseSequences all the actions in a structure, building a new structure with the same shape using the results of the actions. For a version that ignores the results, see 7. 7 D 7  Examples Basic usage:bisequence (Just 4, Nothing)Nothingbisequence (Just 4, Just 5) Just (4,5)bisequence ([1, 2, 3], [4, 5])%[(1,4),(1,5),(2,4),(2,5),(3,4),(3,5)]7 base7 is 7 with the structure as the first argument. For a version that ignores the results, see 7.Examples Basic usage:'bifor (Left []) listToMaybe (find even)Nothing.bifor (Left [1, 2, 3]) listToMaybe (find even) Just (Left 1),bifor (Right [4, 5]) listToMaybe (find even)Just (Right 4)1bifor ([1, 2, 3], [4, 5]) listToMaybe (find even) Just (1,4)*bifor ([], [4, 5]) listToMaybe (find even)Nothing7 base Alias for 7.7 baseThe 7( function behaves like a combination of 7 and 7; it traverses a structure from left to right, threading a state of type a and using the given actions to compute new elements for the structure.Examples Basic usage:bimapAccumL (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")(8,("True","oof"))7 baseThe 7( function behaves like a combination of 7 and 7; it traverses a structure from right to left, threading a state of type a and using the given actions to compute new elements for the structure.Examples Basic usage:bimapAccumR (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")(7,("True","oof"))7 baseA default definition of 7 in terms of the 7 operations. 7 f g D 2 . 7 (2 . f) (2 . g)7 baseA default definition of 7 in terms of the 7 operations. 7 f g D " . 7 (" . f) (" . g)7 base7 base7 base7 base7 base7 base7 base7 base7 base 77777777777 77777777777None (CCCy Trustworthy U##1111111111####1111&&111111###111###1111&&111i((c) The University of Glasgow, 1994-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC extensions)Unsafe Q11111111111/////////////////////////////////////////11/../////////////////////1111111////..////////////111111///// ((c) The University of Glasgow, 2001-2002see libraries/base/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions) Trustworthy /!base! is wrapped around  (or whatever main is called in the program). It catches otherwise uncaught exceptions, and also flushes stdout/stderr before exiting.7base7 is wrapped around every foreign export and foreign import "wrapper" to mop up any uncaught exceptions. Thus, the result of running  in a foreign-exported function is the same as in the main thread: it terminates the program.7baseLike 7, but in the event of an exception that causes an exit, we don't shut down the system cleanly, we just exit. This is 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, trymain = forkIO (runIO (exitWith (ExitFailure 1))) >> threadDelay 10000This will sometimes exit with "interrupted" and code 0, because the main thread is given a chance to shut down when the child thread calls safeExit. There is a race to shut down between the main and child threads.7base The same as 73, but for non-IO computations. Used for wrapping foreign export and foreign import "wrapper" when these are used to export Haskell functions with non-IO types. //777!777 !77777//7"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstablenon-portable (concurrency) Trustworthy %7base7 is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked 7 calls. The pattern . bracket_ (waitQSemN n) (signalQSemN n) (...),is safe; it never loses any of the resource.7base Build a new 7 with a supplied initial quantity. The initial quantity must be at least 0.7base3Wait for the specified quantity to become available7base7Signal that a given quantity is now available from the 7.77777777"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstablenon-portable (concurrency)Safe 7base7 is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked 7 calls. The pattern $ bracket_ waitQSem signalQSem (...)/is safe; it never loses a unit of the resource.7base Build a new 7 with a supplied initial quantity. The initial quantity must be at least 0.7base#Wait for a unit to become available7baseSignal that a unit of the 7 is available77777777"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstablenon-portable (concurrency) Trustworthy 7base7< is an abstract type representing an unbounded FIFO channel.7base$Build and returns a new instance of 7.7baseWrite a value to a 7.7baseRead the next value from the 7. Blocks when the channel is empty. Since the read end of a channel is an 2, this operation inherits fairness guarantees of s (e.g. threads blocked in this operation are woken up in FIFO order).Throws | when the channel is empty and no other thread holds a reference to the channel.7base Duplicate a 7: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, where data written by anyone is seen by everyone else.(Note that a duplicated channel is not equal to its original. So: fmap (c /=) $ dupChan c returns True for all c.)7base>Return a lazy list representing the contents of the supplied 7 , much like .7base#Write an entire list of items to a 7.7base77777777777777j"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstablenon-portable (concurrency) Trustworthy ` 7baseLike *, this sparks off a new thread to run the ; computation passed as the first argument, and returns the  of the newly created thread. However, 7 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 7 instead of  makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use 7 instead of  to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the  -threaded option when linking your program, and to make sure the foreign import is not marked unsafe.7base% if bound threads are supported. If rtsSupportsBoundThreads is , 7 will always return  and both 7 and 7 will fail.7baseFork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked. forkFinally action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_thenThis function is useful for informing the parent when a child terminates, for example.7baseLike /3, but the child thread is a bound thread, as with 7.7baseReturns  if the calling thread is bound, that is, if it is safe to use foreign libraries that rely on thread-local state from the calling thread.7baseRun the  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  computation finishes.You can wrap a series of foreign function calls that rely on thread-local state with runInBoundThread so that you can use them without knowing whether the current thread is bound.7baseRun the  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  computation finishes.Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need its main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap its main action in runInUnboundThread.Note that exceptions which are thrown to the current thread are thrown in turn to the thread that is executing the given computation. This ensures there's always a way of killing the forked thread.7baseBlock the current thread until data is available to read on the given file descriptor (GHC only).This will throw an # if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with 7, use i.7baseBlock the current thread until data can be written to the given file descriptor (GHC only).This will throw an # if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with 7, use i.7baseReturns an STM action that can be used to wait for data to read from a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.7baseReturns an STM action that can be used to wait until data can be written to a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.;777777777777777770000000007777771//////////7777/////////17777777777/"(c) The University of Glasgow 2007/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable non-portableSafe 8base#An exception thrown to a thread by 8' to interrupt a timed-out computation.8baseWrap an $ 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, which on 32-bit machines is only 2147483647 s, less than 36 minutes. Consider using "Control.Concurrent.Timeout.timeout from unbounded-delays package.=timeout 1000000 (threadDelay 1000 *> pure "finished on time")Just "finished on time"=timeout 10000 (threadDelay 100000 *> pure "finished on time")Nothing?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 f7 to receive exceptions thrown to it by another thread.A tricky implementation detail is the question of how to abort an IO computation. This combinator relies on asynchronous exceptions internally (namely throwing the computation the 8 exception). 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. Foreign function calls, for example, cannot be timed out with this combinator simply because an arbitrary C function cannot receive asynchronous exceptions. When timeout is used to wrap an FFI call that blocks, no timeout event can be delivered until the FFI call returns, which 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 , , Network.Socket.accept, or  appear to be blocking, but they really don't because the runtime system uses scheduling mechanisms like  select(2) to perform asynchronous I/O, so it is possible to interrupt standard socket I/O or file I/O using this combinator.8base8base8888'-(c) The University of Glasgow, CWI 2001--2004/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstable-non-portable (local universal quantification) Trustworthy)*0167 H sbaseThe s+ class comprehends a fundamental primitive 8 for folding over constructor applications, say terms. This primitive can be instantiated in several ways to map over the immediate subterms of a term; see the gmap combinators later in this class. Indeed, a generic programmer does not necessarily need to use the ingenious gfoldl primitive but rather the intuitive gmap combinators. The 8 primitive is completed by means to query top-level constructors, to turn constructor representations into proper terms, and to list all possible datatype constructors. This completion allows us to serve generic programming scenarios like read, show, equality, term generation.The combinators 8, 8, 8<, etc are all provided with default definitions in terms of 8, leaving open the opportunity to provide datatype-specific definitions. (The inclusion of the gmap! combinators as members of class s allows the programmer or the compiler to derive specialised, and maybe more efficient code per datatype. Note: 8 is more higher-order than the gmap combinators. This is subject to ongoing benchmarking experiments. It might turn out that the gmap, combinators will be moved out of the class s.)$Conceptually, the definition of the gmap' combinators in terms of the primitive 8$ requires the identification of the 8 function arguments. Technically, we also need to identify the type constructor c for the construction of the result type from the folded term type.In the definition of gmapQx7 combinators, we use phantom type constructors for the c in the type of 8 because the result type of a query does not involve the (polymorphic) type of the term argument. In the definition of 8; we simply use the plain constant type constructor because 8 is left-associative anyway and so it is readily suited to fold a left-associative binary operation over the immediate subterms. In the definition of gmapQr, extra effort is needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., (:)7). When the query is meant to compute a value of type r1, then the result type within generic folding is r -> r. So 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 s9 class automatically. For example, given the declaration 2data T a b = C1 a b | C2 deriving (Typeable, Data)3GHC will generate an instance that is equivalent to 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 ty_T = mkDataType "Module.T" [con_C1, con_C2]?This is suitable for datatypes that are exported transparently.8baseFixity of constructors8baseUnique index for datatype constructors, counting from 1 in the order they are given in the program text.8base%Public representation of constructors8base"Public representation of datatypes8baseRepresentation of constructors. Note that equality on constructors with different types may not work -- i.e. the constructors for  and  may compare equal.8baseRepresentation of datatypes. A package of constructor representations with names of type and module.Cbase1The type constructor used in definition of gmapMpCbase1The type constructor used in definition of gmapQrCbase/Type constructor for adding counters to queries8base=Left-associative fold operation for constructor applications. The type of 8 is a headache, but operationally it is a simple generalisation of a list fold.The default definition for 8 is  , which is suitable for abstract datatypes with no substructures.8base"Unfolding constructor applications8baseObtaining the constructor from a given datum. For proper terms, this is meant to be the top-level constructor. Primitive datatypes are here viewed as potentially infinite sets of values (i.e., constructors).8base&The outer type constructor of the type8base*Mediate types and unary type constructors.In s instances of the form ) instance (Data a, ...) => Data (T a) 8 should be defined as #.The default definition is  5, which is appropriate for instances of other forms.8base+Mediate types and binary type constructors.In s instances of the form 3 instance (Data a, Data b, ...) => Data (T a b) 8 should be defined as #.The default definition is  5, which is appropriate for instances of other forms.8base>A generic transformation that maps over the immediate subterms9The default definition instantiates the type constructor c in the type of 8 to an identity datatype constructor, using the isomorphism pair as injection and projection.8base7A generic query with a left-associative binary operator8base8A generic query with a right-associative binary operator8baseA generic query that processes the immediate subterms and returns a list of results. The list is given in the same order as originally specified in the declaration of the data constructors.8base>A generic query that processes one child by index (zero-based)8baseA generic monadic transformation that maps over the immediate subterms9The default definition instantiates the type constructor c in the type of 8 to the monad datatype constructor, defining injection and projection using A and >.8base>Transformation of at least one immediate subterm does not fail8base4Transformation of one immediate subterm with success8baseBuild a term skeleton8base4Build a term and use a generic function for subterms8baseMonadic variation on 88base.Gets the type constructor including the module8base*Gets the public presentation of a datatype8base"Gets the datatype of a constructor8base,Gets the public presentation of constructors8base+Look up a constructor by its representation8base Constructs an algebraic datatype8baseConstructs a constructor8baseConstructs a constructor8base.Gets the constructors of an algebraic datatype8baseGets the field labels of a constructor. The list of labels is returned in the same order as they were given in the original constructor declaration.8base Gets the fixity of a constructor8base!Gets the string for a constructor8base!Lookup a constructor via a string8baseTest for an algebraic type8base 1 (False, False) -> 2 (True, False) -> 3 -- Warning: redundantThe pattern-match checker will warn here that the third clause is redundant. It will stop doing so if the clause is adorned with +: case (x, x) of (True, True) -> 1 (False, False) -> 2 (True, False) | considerAccessible -> 3 -- No warningPut + as the last statement of the guard to avoid get confusing results from the pattern-match checker, which takes "consider accessible" by word.9baseDeprecated, use  directly instead.Annotating a type with 9 will make  SpecConstr5 not specialise for arguments of that type, e. g., %{-# ANN type SPEC ForceSpecConstr #-}.9base9 ensures that all the elements of the list are identical and then returns that unique element9baseThe 9 function sorts a list of elements using the user supplied function to project something out of each elementIn general if the user supplied function is expensive to compute then you should probably be using 9, as it only needs to compute it once for each element. 9, on the other hand must compute the mapping function for every comparison that it performs.9baseThe 9 function uses the user supplied function which projects an element out of every list element in order to first sort the input list and then to form groups by equality on these projected elements9baseAn implementation of the old atomicModifyMutVar# primop in terms of the new  primop, for backwards compatibility. The type of this function is a bit bogus. It's best to think of it as having type atomicModifyMutVar# :: MutVar# s a -> (a -> (a, b)) -> State# s -> (# State# s, b #) but there may be code that uses this with other two-field record types.9basex <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing#. The latter returns the last non-, thus !x <> Data.Monoid.Last Nothing = x.ExamplesLast 0 <> Last 10Last {getLast = 10}*sconcat $ Last 1 :| [ Last n | n <- [2..]]!Last {getLast = * hangs forever *9base Beware that Data.Semigroup.9 is different from  Data.Monoid.1. The former simply returns the first value, so Data.Semigroup.First Nothing <> x = Data.Semigroup.First Nothing$. The latter returns the first non-, thus "Data.Monoid.First Nothing <> x = x.ExamplesFirst 0 <> First 10First 0.sconcat $ First 1 :| [ First n | n <- [2 ..] ]First 19baseExamples Max (Arg 0 ()) <> Max (Arg 1 ())Max {getMax = Arg 1 ()}maximum [ Arg (length name) name | name <- ["violencia", "lea", "pixie"]]Arg 9 "violencia"9baseExamples Min (Arg 0 ()) <> Min (Arg 1 ())Min {getMin = Arg 0 ()}minimum [ Arg (length name) name | name <- ["violencia", "lea", "pixie"]] Arg 3 "lea"9base9 isn't itself a 0 in its own right, but it can be placed inside 9 and 9" to compute an arg min or arg max.Examples,minimum [ Arg (x * x) x | x <- [-10 .. 10] ]Arg 0 0;maximum [ Arg (-0.2*x^2 + 1.5*x + 1) x | x <- [-10 .. 10] ] Arg 3.8 4.0;minimum [ Arg (-0.2*x^2 + 1.5*x + 1) x | x <- [-10 .. 10] ]Arg (-34.0) (-10.0)9baseThe 9  and - always choose the bigger element as by the v instance and   of the contained type.ExamplesMax 42 <> Max 3Max 42-sconcat $ Max 1 :| [ Max n | n <- [2 .. 100]]Max {getMax = 100}9baseThe 9  and . always choose the smaller element as by the v instance and   of the contained type.ExamplesMin 42 <> Min 3Min 3-sconcat $ Min 1 :| [ Min n | n <- [2 .. 100]]Min {getMin = 1}9baseA generalization of  to an arbitrary <. May fail to terminate for some values in some semigroups.Examplestake 10 $ cycle1 [1, 2, 3][1,2,3,1,2,3,1,2,3,1]cycle1 (Right 1)Right 1cycle1 (Left 1)* hangs forever *9base)This lets you use a difference list of a  as a .Examples let hello = diff "Hello, "appEndo hello "World!""Hello, World!""appEndo (hello <> mempty) "World!""Hello, World!""appEndo (mempty <> hello) "World!""Hello, World!" ,let world = diff "World" let excl = diff "!")appEndo (hello <> (world <> excl)) mempty"Hello, World!")appEndo ((hello <> world) <> excl) mempty"Hello, World!"9baseRepeat a value n times. ?mtimesDefault n a = a <> a <> ... <> a -- using <> (n-1) timesIn many cases,  0 a for a  will produce \. However, there are situations when it cannot do so. In particular, the following situation is fairly common: data T a = ... class Constraint1 a class Constraint1 a => Constraint2 a  instance Constraint1 a => ! (T a) instance Constraint2 a =>  (T a) Since  Constraint1 is insufficient to implement \,  for T a cannot do so.When working with such a type, or when working polymorphically with  instances,  mtimesDefault should be used when the multiplier might be zero. It is implemented using % when the multiplier is nonzero and \ when it is zero.ExamplesmtimesDefault 0 "bark"[]mtimesDefault 3 "meow""meowmeowmeow"9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base9 base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: base: baseC baseC baseC baseC baseC baseC baseC baseC baseC baseC baseC baseC base9base%The argument used for comparisons in n and v.baseThe "value" exposed via the t,  etc. instances./999!!9999999999999999999!!!!!!!!!!!!!!!!!![2[!!9999999999999999!!!!!!!!!!!!!!!!!!999999Edward Kmett, Oleg Grenrus BSD-3-ClauseSafe ::::::::#(c) Ashley Yakeley 2005, 2006, 2009/BSD-style (see the file libraries/base/LICENSE)$Ashley Yakeley stableportable Trustworthy0 A:base$resolution of 10^-12 = .000000000001:base resolution of 10^-9 = .000000001:baseresolution of 10^-6 = .000001:baseresolution of 10^-3 = .001:base>resolution of 10^-2 = .01, useful for many monetary currencies:baseresolution of 10^-1 = .1:base/resolution of 1, this works the same as Integer:base,The type parameter should be an instance of :.:baseGeneralisation of  to any instance of x:baseGeneralisation of  to any instance of x:baseGeneralisation of  to any instance of x:base/First arg is whether to chop off trailing zeros:base Recall that, for numeric types,  and  typically add and subtract 10, respectively. This is not true in the case of :, whose successor and predecessor functions intuitively return the "next" and "previous" values in the enumeration. The results of these functions thus depend on the resolution of the :< value. For example, when enumerating values of resolution 10^-3 of type Milli = Fixed E3, ! succ (0.000 :: Milli) == 0.001  and likewise " pred (0.000 :: Milli) == -0.001 In other words,  and  increment and decrement a fixed-precision value by the least amount such that the value's resolution is unchanged. For example, 10^-12 is the smallest (positive) amount that can be added to a value of type Pico = Fixed E12( without changing its resolution, and so 2 succ (0.000000000000 :: Pico) == 0.000000000001  and similarly 3 pred (0.000000000000 :: Pico) == -0.000000000001 ,This is worth bearing in mind when defining : arithmetic sequences. In particular, you may be forgiven for thinking the sequence  [1..10] :: [Pico]  evaluates to )[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] :: [Pico].However, this is not true. On the contrary, similarly to the above implementations of  and , $enumFromTo :: Pico -> Pico -> [Pico] has a "step size" of 10^-12. Hence, the list [1..10] :: [Pico] has the form  [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]  and contains  9 * 10^12 + 1 values.:base:base:base:base:base:base:base2Multiplication is not associative or distributive:.(0.2 * 0.6 :: Deci) * 0.9 == 0.2 * (0.6 * 0.9)False2(0.1 + 0.1 :: Deci) * 0.5 == 0.1 * 0.5 + 0.1 * 0.5False:base For example,  Fixed 1000 will give you a : with a resolution of 1000.:base:base:base:base:base:base:base:base:base::::::::::::::::::::::::::::::::::::::::::::"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.org provisionalportable Trustworthy79:;< :base&Complex numbers are an algebraic type.For a complex number z,  z# is a number with the magnitude of z8, but oriented in the positive real direction, whereas  z has the phase of z, but unit magnitude.The  and ( instances traverse the real part first. Note that :'s instances inherit the deficiencies from the type parameter's. For example,  Complex Float's v# instance has similar problems to 's.:baseforms a complex number from its real and imaginary rectangular components.:base+Extracts the real part of a complex number.:base0Extracts the imaginary part of a complex number.:base"The conjugate of a complex number.:baseForm a complex number from polar components of magnitude and phase.:base: t# is a complex value with magnitude 1 and phase t (modulo 2*).:base The function : takes a complex number and returns a (magnitude, phase) pair in canonical form: the magnitude is non-negative, and the phase in the range (-, ]2; if the magnitude is zero, then so is the phase.:base/The non-negative magnitude of a complex number.:base,The phase of a complex number, in the range (-, ]2. If the magnitude is zero, then so is the phase.:base:base: base: base:base:base:base:base:base:base:base:base: base: base: baseC baseC base :::::::::: :::::::::::(c) Ross Paterson 2013 BSD-style (see the file LICENSE)libraries@haskell.orgstableportableSafe3= : baseLifting of the {# class to binary type constructors.: base? function for an application of the type constructor based on  and " functions for the argument types.: base? function for an application of the type constructor based on  and  functions for the argument types. The default implementation using standard list syntax is correct for most types.: baseLifting of the w# class to binary type constructors.Both : and :/ exist to match the interface provided in the w1 type class, but it is recommended to implement : instances using : as opposed to :, since the former is more efficient than the latter. For example:  instance : T where : = ... : = ; 9For more information, refer to the documentation for the w class.: base? function for an application of the type constructor based on  and " functions for the argument types.: base? function for an application of the type constructor based on  and  functions for the argument types. The default implementation using standard list syntax is correct for most types.: base? function for an application of the type constructor based on  and " functions for the argument types.: base? function for an application of the type constructor based on  and " functions for the argument types.The default definition uses :. Instances that define : should also define : as ;.; baseLifting of the v# class to binary type constructors.; baseLift  ( functions through the type constructor.The function will usually be applied to comparison functions, but the more general type ensures that the implementation uses them to compare elements of the first container with elements of the second.; baseLifting of the n# class to binary type constructors.; base1Lift equality tests through the type constructor.The function will usually be applied to equality functions, but the more general type ensures that the implementation uses them to compare elements of the first container with elements of the second.; baseLifting of the {" class to unary type constructors.Any instance should be subject to the following laws that canonicity is preserved: liftShowsPrec showsPrec showList = liftShowList showsPrec showList = 6This class therefore represents the generalization of { by decomposing it's methods into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.; base? function for an application of the type constructor based on  and ! functions for the argument type.; base? function for an application of the type constructor based on  and  functions for the argument type. The default implementation using standard list syntax is correct for most types.; baseLifting of the w" class to unary type constructors.Any instance should be subject to the following laws that canonicity is preserved: liftReadsPrec readsPrec readList = liftReadList readsPrec readList = "liftReadPrec readPrec readListPrec = &liftReadListPrec readPrec readListPrec = 6This class therefore represents the generalization of w by decomposing it's methods into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.Both ; and ;/ exist to match the interface provided in the w1 type class, but it is recommended to implement ; instances using ; as opposed to ;, since the former is more efficient than the latter. For example:  instance ; T where ; = ... ; = ; 9For more information, refer to the documentation for the w class.; base? function for an application of the type constructor based on  and ! functions for the argument type.; base? function for an application of the type constructor based on  and  functions for the argument type. The default implementation using standard list syntax is correct for most types.; base? function for an application of the type constructor based on  and ! functions for the argument type.; base? function for an application of the type constructor based on  and ! functions for the argument type.The default definition uses ;. Instances that define ; should also define ; as ;.; baseLifting of the v" class to unary type constructors.Any instance should be subject to the following law that canonicity is preserved:liftCompare compare =  6This class therefore represents the generalization of v by decomposing its main method into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.; baseLift a  ' function through the type constructor.The function will usually be applied to a comparison function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second.; baseLifting of the n" class to unary type constructors.Any instance should be subject to the following law that canonicity is preserved: liftEq (==) = (==)6This class therefore represents the generalization of n by decomposing its main method into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.; base3Lift an equality test through the type constructor.The function will usually be applied to an equality function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second.; baseLift the standard (;)' function through the type constructor.; baseLift the standard  ' function through the type constructor.; baseLift the standard  and ) functions through the type constructor.; baseLift the standard  and ) functions through the type constructor.; base*A possible replacement definition for the ;" method. This is only needed for ; instances where ; isn't defined as ;.; base*A possible replacement definition for the ; method, defined using ;.; baseLift the standard  and ) functions through the type constructor.; baseLift the standard (;)' function through the type constructor.; baseLift the standard  ' function through the type constructor.; baseLift the standard ' function through the type constructor.; baseLift the standard ' function through the type constructor.; base*A possible replacement definition for the :" method. This is only needed for : instances where : isn't defined as ;.; base*A possible replacement definition for the : method, defined using :.; baseLift the standard ' function through the type constructor.; base; p d is a parser for datatypes where each alternative begins with a data constructor. It parses the constructor and passes it to p=. Parsers for various constructors can be constructed with ;, ; and ;, and combined with mappend from the Monoid class.; base; p is a parser for datatypes where each alternative begins with a data constructor. It parses the constructor and passes it to p=. Parsers for various constructors can be constructed with ; and ;, and combined with  from the  class.; base; rp n c n' matches the name of a unary data constructor and then parses its argument using rp.; base; rp n c' matches the name of a unary data constructor and then parses its argument using rp.; base; rp1 rp2 n c n' matches the name of a binary data constructor and then parses its arguments using rp1 and rp2 respectively.; base; rp1 rp2 n c' matches the name of a binary data constructor and then parses its arguments using rp1 and rp2 respectively.; base; sp n d x produces the string representation of a unary data constructor with name n and argument x, in precedence context d.; base; sp1 sp2 n d x y produces the string representation of a binary data constructor with name n and arguments x and y, in precedence context d.; base; n c n' matches the name of a unary data constructor and then parses its argument using .; base; n c n' matches the name of a unary data constructor and then parses its argument using ;.; base; n c n' matches the name of a binary data constructor and then parses its arguments using ;.; base; n d x produces the string representation of a unary data constructor with name n and argument x, in precedence context d.; base; n d x produces the string representation of a unary data constructor with name n and argument x, in precedence context d.; base; n d x y produces the string representation of a binary data constructor with name n and arguments x and y, in precedence context d.;basereadPrec_to_S readPrec1 0 "(2 % 3) :+ (3 % 4)" :: [(Complex Rational, String)][(2 % 3 :+ 3 % 4,"")]; base; base; base;base; base; base; base;baseeq1 (1 :+ 2) (1 :+ 2)Trueeq1 (1 :+ 2) (1 :+ 3)False; base; base; base; base; base; base; base;base;base;base6eq2 ('x', True, "str", 2) ('x', True, "str", 2 :: Int)True;base;base)eq2 ('x', True, "str") ('x', True, "str")True; base;base; base; base; base; base; base; base; base; base; base; base; base;base;base;base;compare2 ('x', True, "str", 2) ('x', True, "str", 3 :: Int)LT;base;base.compare2 ('x', True, "aaa") ('x', True, "zzz")LT; base;base; base; base; base; base; base; base; base; base;base;basereadPrec_to_S readPrec2 0 "('x', True, 2, 4.5)" :: [((Char, Bool, Int, Double), String)][(('x',True,2,4.5),"")];base;basereadPrec_to_S readPrec2 0 "('x', True, 2)" :: [((Char, Bool, Int), String)][(('x',True,2),"")]; base; base;baseshowsPrec1 0 (2 :+ 3) """2 :+ 3"; base; base; base; base; base; base; base;base;base4showsPrec2 0 ('x', True, 2 :: Int, 4.5 :: Double) """('x',True,2,4.5)";base;base%showsPrec2 0 ('x', True, 2 :: Int) """('x',True,2)"; base;base; base; base< base< base ;;;;;;;;;;;;;4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;:::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;;;;;;:::;;;;;;;;;;;;;;;;(c) Ross Paterson 2014 BSD-style (see the file LICENSE)libraries@haskell.orgstableportableSafe067< e<baseLifted sum of functors.< base< base< base< base< base< base< base< base<base<base<base<baseC baseC base<<<<<<(c) Ross Paterson 2010 BSD-style (see the file LICENSE)libraries@haskell.orgstableportableSafe067< e<baseLifted product of functors.<base<base< base< base< base< base< base< base< base< base< base< base< base< base< base< base<base<base<base<baseC baseC base<<<<(c) Ross Paterson 2010 BSD-style (see the file LICENSE)libraries@haskell.orgstableportable Trustworthy )*067< b<baseRight-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.<base)The deduction (via generativity) that if  g x :~: g y then x :~: y.< base< base< base< base< base< base< base< base< base<base<base< base<base<base<base<base<base<base<base<base<baseC baseC base<<<<<<< < (C) 2007-2015 Edward Kmett BSD-style (see the file LICENSE)libraries@haskell.org provisionalportable Trustworthy36 <baseDual function arrows.<base2This data type represents an equivalence relation.9Equivalence relations are expected to satisfy three laws:  Reflexivity< f a a = TrueSymmetry< f a b = < f b a TransitivityIf < f a b and < f b c are both  then so is < f a c.The types alone do not enforce these laws, so you'll have to check them yourself.<base*Defines a total ordering on a type as per  .This condition is not checked by the types. You must ensure that the supplied values are valid total orderings yourself.<base$The class of contravariant functors.'Whereas in Haskell, one can think of a t as containing or producing values, a contravariant functor is a functor that can be thought of as  consuming values.9As an example, consider the type of predicate functions  a -> Bool. One such predicate might be negative x = x < 0, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to( integers. For instance, we can use the negative predicate on a person's bank balance to work out if they are currently overdrawn: newtype Predicate a = Predicate { getPredicate :: a -> Bool } instance Contravariant Predicate where contramap :: (a' -> a) -> (Predicate a -> Predicate a') contramap f (Predicate p) = Predicate (p . f) | `- First, map the input... `----- then apply the predicate. overdrawn :: Predicate Person overdrawn = contramap personBankBalance negative 5Any instance should be subject to the following laws: Identity<  =  Composition< (g . f) = < f . < gNote, that the second law follows from the free theorem of the type of < and the first law, so you need only check that the former condition holds.<baseReplace all locations in the output with the same value. The default definition is < . <, but this may be overridden with a more efficient version.<baseIf f is both t and < then by the time you factor in the laws of each of those classes, it can't actually use its argument in any meaningful capacity.This method is surprisingly useful. Where both instances exist and are lawful we have the following laws: @ f D < < f D < <baseThis is < with its arguments flipped.<baseThis is an infix alias for <.<baseThis is an infix version of < with the arguments flipped.<baseCompare using  .<baseCheck for equivalence with ;.Note: The instances for  and  violate reflexivity for NaN.<baseA < is a < t , because < can apply its function argument to each input of the comparison function.<baseEquivalence relations are <, because you can apply the contramapped function to each input to the equivalence relation.<base([)( on predicates uses logical conjunction ( )/ on the results. Without newtypes this equals  (&&). (<>) :: Predicate a -> Predicate a -> Predicate a Predicate pred <> Predicate pred' = Predicate a -> pred a && pred' a <base\ on predicates always returns True . Without newtypes this equals j True. )mempty :: Predicate a mempty = _ -> True <baseA < is a < t , because < can apply its function argument to the input of the predicate.Without newtypes < f equals precomposing with f (= (. f)). contramap :: (a' -> a) -> (Predicate a -> Predicate a') contramap f (Predicate g) = Predicate (g . f) <base([ ) @(Op a b) without newtypes is ([ ) @(b->a) = liftA2 ([). This lifts the  operation ([) over the output of a. (<>) :: Op a b -> Op a b -> Op a b Op f <> Op g = Op a -> f a <> g a <base\ @(Op a b) without newtypes is mempty @(b->a) =  _ -> mempty. )mempty :: Op a b mempty = Op _ -> mempty <base([)* on equivalences uses logical conjunction ( )/ on the results. Without newtypes this equals  ( (&&)). (<>) :: Equivalence a -> Equivalence a -> Equivalence a Equivalence equiv <> Equivalence equiv' = Equivalence a b -> equiv a b && equiv' a b <base\ on equivalences always returns True . Without newtypes this equals j (j True). 9mempty :: Equivalence a mempty = Equivalence _ _ -> True <base([)& on comparisons combines results with ([ ) @Ordering. Without newtypes this equals  ( ([)). (<>) :: Comparison a -> Comparison a -> Comparison a Comparison cmp <> Comparison cmp' = Comparison a a' -> cmp a a' <> cmp a a' <base\ on comparisons always returns EQ . Without newtypes this equals j (j EQ). 5mempty :: Comparison a mempty = Comparison _ _ -> EQ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Edward Kmett, Oleg Grenrus BSD-3-Clause Trustworthy 06 :7Cbase"Used to implement intercalate1/MapCbase7Strict maybe, used to implement default foldlMap1' etc.Cbase,Used for foldrMap1 and foldlMap1 definitionsCbase+Used for default toNonEmpty implementation.<base-Non-empty data structures that can be folded.<base0Given a structure with elements whose type is a $, combine them via the semigroup's ([) operator. This fold is right-associative and lazy in the accumulator. When you need a strict left-associative fold, use < instead, with  as the map.<baseMap each element of the structure to a semigroup, and combine the results with ([). This fold is right-associative and lazy in the accumulator. For strict left-associative folds consider < instead.foldMap1 (:[]) (1 :| [2, 3, 4]) [1,2,3,4]<baseA left-associative variant of < that is strict in the accumulator. Use this for strict reduction when partial results are merged via ([).foldMap1' Sum (1 :| [2, 3, 4])Sum {getSum = 10}<base5 list of elements of a structure, from left to right.toNonEmpty (Identity 2)2 :| []=base-The largest element of a non-empty structure. maximum (32 :| [64, 8, 128, 16])128=base+The least element of a non-empty structure. minimum (32 :| [64, 8, 128, 16])8=base+The first element of a non-empty structure.head (1 :| [2, 3, 4])1=base*The last element of a non-empty structure.last (1 :| [2, 3, 4])4=base?Right-associative fold of a structure, lazy in the accumulator. In case of  lists, =, when given a function f, a binary operator g%, and a list, reduces the list using g from right to left applying f to the rightmost element: foldrMap1 f g (x1 :| [x2, ..., xn1, xn]) == x1 `g` (x2 `g` ... (xn1 `g` (f xn))...)Note that since the head of the resulting expression is produced by an application of g& to the first element of the list, if g! is lazy in its right argument, => can produce a terminating expression from an unbounded list.For a general <5 structure this should be semantically identical to:  foldrMap1 f g = foldrMap1 f g . <=baseLeft-associative fold of a structure but with strict application of the operator.This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result.For a general <5 structure this should be semantically identical to: "foldlMap1' f z = foldlMap1' f z . <=baseLeft-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument. In case of  lists, =, when given a function f, a binary operator g%, and a list, reduces the list using g from left to right applying f to the leftmost element: foldlMap1 f g (x1 :| [x2, ..., xn]) == (...(((f x1) `g` x2) `g`...) `g` xnNote that to produce the outermost application of the operator the entire input list must be traversed. This means that =) will diverge if given an infinite list.If you want an efficient strict left-fold, you probably want to use = instead of ==. The reason for this is that the latter does not force the inner results (e.g.  (f x1) `g` x2 in the above example) before applying them to the operator (e.g. to (`g` x3)!). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.For a general <5 structure this should be semantically identical to:  foldlMap1 f g = foldlMap1 f g . <=base= is a variant of = that performs strict reduction from right to left, i.e. starting with the right-most element. The input structure must be finite, otherwise = runs out of space (diverges).If you want a strict right fold in constant space, you need a structure that supports faster than O(n)" access to the right-most element.This method does not run in constant space for structures such as  lists that don't support efficient right-to-left iteration and so require O(n) space to perform right-to-left reduction. Use of this method with such a structure is a hint that the chosen structure may be a poor fit for the task at hand. If the order in which the elements are combined is not important, use = instead.=base A variant of =, where the rightmost element maps to itself.=base A variant of =, where the rightmost element maps to itself.=base A variant of =+ where the leftmost element maps to itself.=base A variant of =+ where the leftmost element maps to itself.=base Insert an m between each pair of t m.4intercalate1 ", " $ "hello" :| ["how", "are", "you"]"hello, how, are, you"!intercalate1 ", " $ "hello" :| []"hello"3intercalate1 mempty $ "I" :| ["Am", "Fine", "You?"] "IAmFineYou?"=baseMonadic fold over the elements of a non-empty structure, associating to the right, i.e. from right to left.=baseMap variant of =.=baseMonadic fold over the elements of a non-empty structure, associating to the left, i.e. from left to right.=baseMap variant of =.=baseThe largest element of a non-empty structure with respect to the given comparison function.=baseThe least element of a non-empty structure with respect to the given comparison function.Cbase"Create dlist with a single elementCbase#Convert a dlist to a non-empty list=base=base=base6It would be enough for either half of a product to be <. Other could be .=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base=base =======================<<<<========<$<====<=<<=<========================= (c) Roman Leshchinskiy 2009-2012 BSD-stylelibraries@haskell.org non-portable Trustworthy Q=baseLifted wrapper for .Since . is an unlifted type and not a member of kind 2, things like [MutableByteArray#] or IO MutableByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting 2. Clients are expected to use =, in higher-level APIs, but wrap and unwrap =3 internally as they please and use functions from GHC.Exts.=baseLifted wrapper for .Since . is an unlifted type and not a member of kind 2, things like  [ByteArray#] or  IO ByteArray# are ill-typed. To work around this inconvenience this module provides a standard lifted wrapper, inhabiting 2. Clients are expected to use =, in higher-level APIs, but wrap and unwrap =3 internally as they please and use functions from GHC.Exts.Cbase?Create a new mutable byte array of the specified size in bytes.Note:; this function does not check if the input is non-negative.CbaseConvert a mutable byte array to an immutable one without copying. The array should not be modified after the conversion.Cbase Size of the byte array in bytes.CbaseRead byte at specific index.CbaseWrite byte at specific index.CbaseExplode = into a list of bytes.Cbase Create a = from a list of a known length. If the length of the list does not match the given length, this throws an exception.CbaseCopy a slice of an immutable byte array to a mutable byte array.Note:6 this function does not do bounds or overlap checking.CbaseCopy a slice from one mutable byte array to another or to the same mutable byte array.Note:6 this function does not do bounds or overlap checking.Cbase!Compare prefixes of given length.Cbase*Do two byte arrays share the same pointer?CbaseAppend two byte arrays.CbaseConcatenate a list of =s.CbaseDump immutable =3s into a mutable one, starting from a given offset.CbaseAn array of zero length.CbaseHH$;; AI####.................!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGGHHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBIIIIIIIIIIIIIIIIJJJJKKKKK@@MMNNNNPQQSSSSSSSSSSSS555555555TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT)DUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZZZZZZZZZZZZZZZZZZZZZZ[[\\\\\\\\\\\\\\\VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV!!!                                                                                                                                                                                ##^^^^``````?????ccccccccccccc    RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRdddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffffffffgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg&&&&&&&&&&&&&&&&&&hhhhhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkkkkkkllllll>>>>>AAAAmm;;;;;;;;;;;;;;;;((((XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnoooooooooooooooooooooooooooooooooooo8888888888888888888888888888ppppppppppppppppppqqqqqqqqqrrrrrrrrrrrrrrrrrrrssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!t!t!:!:!:!:!::!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!:!u!u!u!u!u!u!u!u!u!u!u!1!11!1!1!v!v!v!v!v!v!v!vvvvv!v!v!v!v!v!v!/!/!/!/!/!/!/!/!/!/!/!/!//!//!/!/!/!/!/!/!/!/!0!0!0!0!0!0!0!0!0!0!0!0!0!0"0"0"0!0"0"0"0"0"0"0"0"000"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"0"."."."."."."."."."."."."."."."."."."."."."."."."."."."."."."".."."..".."..".."..."..".."..".."..".....".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%,%,,%,,,,,,,,,,,,,,,%,%,,,,,,,%,%,,,,,,,,,,%,,,,,,,,,,,,,,,,,,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%,%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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"%&&&&&&&&&&&&&&&&&&&&&&&zz&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&K&KKK&K&K&K&KK&K&K&KKKKK&K&K&K&K&K&K&M&M&M&MM&M&M&M&M&M&M&M&   & &@&@&@&@&@&@@@&@&@&@&@@&@@&@&@&@&@&@@&@&@@&@&@&@&~&~&~&~&~&~&~&~&~&~&~&~&~&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((L(((((((((((((((((((((((((( ( ( ( ( (  ( ( ( ( ( ( ( ( ( ( ( ( ( (  ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (   ( ( ( ( ( ( ( (   ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))********************************************************************************************************************************++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------------------------------------------------------------------------------------------------.................................................................................................................''.................././././././././///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0/00000000000000000000000000000000000000000000000000000000000000000000000000}0}0}0}}00000kkk0k0k0kk0kk0kk0k0k0k0k0k0k0k0kkk0k0k0k0k0k0k0k0k0k0k0kk0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k0k1k1k1k1k1k1k1k1k1111111111111111111111&&11111111111111111111111|1|1|1|1|1a1111++++++++11111++P1P1P1P1P1P1P1P1P1P1P1P1P1{1{1{1{{{{{{{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1{1b1b0b1b0b1b1b1bb11111111111111112222222222'222222222222222222222222222222222222222222222222222222222222222222...2.2222222222222222222222222222L2L2L2LL2L2L2L2LL2L2L2L2L2L2LL2L2L2L2L2L2L2L2L2L2LLL2L2L2L2L222233333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333%3%3%33%3%3%33%3%3%33%%3%3%3%3%3%3%3%3%3%3%3%3%3%3%3%4%4%4%4%4%4-------%-%-4-4-4-4-----4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-4-44444QQ4Q4Q4Q4Q4Q4Q4Q4Q44444444444444m4m4m4J4J4J4J4J4J4J44444444444444444444444444444444444444444444444444445555555555555555555555555555555  5 5 5 5 5 5 5 5 5 5 5 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 6 6 6 6 6 6 6 6 6 6 2 6 6 6 6 66666666666666666_6_666166&660666666666666666666666666666666666666666/666666666666666666666666666666666666666666666666666666666666666666666666666666666===6=6=======%=6=6=%====%=6=%=6=%=6=====%=============%===6=6=6=6=6=6=%=====%=%===6=6=6=66666677777777777777773777777777777777777777777777777777777777777777777777777777777777777777777 7 7 7 7 7 7777777777777777jj7jj7j7j7j7j2j2j2j277777'"'"'"'7'7'7'7'7'7'7'7'''7'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8''''''''''''8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'#'#'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'8'88889966699999999969"96999999999O9O9O99OOO$OOO$O9O9O9O9O!O!O!9O!O!O!9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O3O%O%O4O%O%O$O9O3O$O$O4O%O$O$O9O9O9O9O9O9O9O9O9O9O9O9O9O$O$O$O$O8O$O$O9O$O$O$O$O8O$O$O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O9O999999999999999999999999999999999999999::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4%;;;;;8;;;;;;;;;73;;;;4%;;;;;8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<================================================================================================================================>>>>>>>>>>><>>>[>>'>>>66>>6666>>V>V>>9999>>>>>>>>!!!9!!!9>>>>>>>>>>>Y>>>>>>>>>>>>>>>>>%>>%>>>>>>>>>>>>>>>>>>>>ee>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.??????????????;??;;;;;?????????????;;;;??;;;;??????????????????????????????????????7??????????7?????????@@7w@w@4@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@%@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@??@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2@@@2@@@@@@@AA@@@2@A22222AAA22AAA@@AAAAAAAAAAAAAAAA%A%A%A%A%A%AQAAAAA5AA5AAJA5A5AA3AAAAAAAAA=A@@'A'A'A'AOAOAO?O?O?O?OAOAOAOAOAOAAA????AAAAAA%AAAAAAAAAAAAAAAAAAAbaseGHC.ListControl.Exception.BasePreludeGHC.BaseGHC.ExtsForeign.StablePtr System.IO Data.BoolGHC.TopHandlerGHC.IO.Exception Debug.Trace Data.Function GHC.Float Data.CoerceData.EqData.Ord Control.Monad Data.FunctorControl.Monad.FixControl.Monad.FailGHC.OverloadedLabels Control.Arrow GHC.Desugar Data.StringControl.Monad.ZipGHC.GHCi GHC.IsListType.Reflection.Unsafe Data.Dynamic Data.Monoid GHC.Stack GHC.StaticPtr Unsafe.Coerce GHC.Records GHC.TypeErrorGHC.RealControl.ApplicativeNumeric Data.Data Text.Read Text.ShowData.IxType.Reflection Data.FoldableData.Traversable GHC.Generics GHC.TypeNats GHC.TypeLits Data.Char Data.KindData.IntNumeric.Natural Data.Maybe Data.RatioControl.Monad.ST.SafeData.Type.Equality Data.Word Foreign.Ptr Data.Either Data.VoidData.List.NonEmptyForeign.C.ConstPtr Data.TupleGHC.IOGHC.Fingerprint.Type GHC.NaturalGHC.WordGHC.CharGHC.Int GHC.IntegerGHC.Integer.Logarithms GHC.MaybeGHC.Stack.Types GHC.ByteOrderGHC.Exception.Type GHC.IO.Handle GHC.ExceptionGHC.ErrData.Semigroup GHC.Stack.CCS Data.Version GHC.UnicodeGHC.NumGHC.ShowGHC.EnumGHC.ArrGHC.Ix Data.BitsGHC.BitsGHC.Float.RealFracMethodsGHC.Float.ConversionUtilsGHC.STControl.Monad.ST.UnsafeData.Type.Bool Data.STRef GHC.STRefSystem.IO.UnsafeControl.Concurrent.MVarGHC.MVarText.ParserCombinators.ReadP Text.Read.LexText.ParserCombinators.ReadPrecGHC.ReadGHC.PtrGHC.ConcControl.Concurrent GHC.Conc.Sync GHC.StableGHC.Fingerprint GHC.StorableForeign.StorableData.Type.CoercionControl.Category Data.ProxyForeign.C.Types GHC.Clock GHC.IO.IOMode Data.Type.OrdData.Functor.Const GHC.OldList GHC.Event Data.TypeableSystem.IO.ErrorControl.Exception Data.IORef GHC.IORefForeign.ForeignPtr.SafeGHC.ForeignPtrForeign.ForeignPtr.UnsafeForeign.ForeignPtr GHC.IO.BufferGHC.IO.Encoding.TypesGHC.IO.Encoding GHC.IO.DeviceGHC.IO.BufferedIOGHC.IO.Handle.TypesGHC.IO.StdHandlesGHC.IO.Handle.FDGHC.Encoding.UTF8 GHC.IOArrayGHC.Event.TimeOut System.ExitForeign.Marshal.AllocForeign.Marshal.UtilsForeign.Marshal.ArrayForeign.Marshal.Error GHC.ForeignForeign.C.StringForeign.C.ErrorGHC.IO.Encoding.FailureGHC.IO.Encoding.UTF8GHC.IO.Encoding.UTF32GHC.IO.Encoding.UTF16GHC.IO.Encoding.Latin1Foreign.Marshal.PoolSystem.Posix.TypesSystem.Posix.Internals GHC.RTS.FlagsGHC.IO.SubSystemGHC.Weak.FinalizeSystem.Mem.WeakGHC.WeakGHC.IO.Handle.Lock System.MemGHC.IO.Encoding.IconvGHC.IO.Handle.InternalsGHC.IO.Handle.TextGHC.Conc.Signal GHC.Conc.IO GHC.IO.FDData.Functor.Identity Data.ListGHC.ArrayArrayText.Show.FunctionsGHC.StableName GHC.ProfilingGHC.PackForeign.Marshal.UnsafeForeign.ConcurrentSystem.CPUTime GHC.InfoProvGHC.Environment Text.PrintfSystem.EnvironmentSystem.Environment.BlankGHC.ResponseFileGHC.GHCi.HelpersSystem.Console.GetOpt System.Info Data.UniqueControl.Monad.ST.Lazy.SafeControl.Monad.ST.Lazy.UnsafeData.STRef.LazyControl.Monad.IO.Class GHC.StatsGHC.ExecutionStack.InternalGHC.ExecutionStackData.BifunctorData.BifoldableData.BitraversableControl.Concurrent.QSemNControl.Concurrent.QSemControl.Concurrent.ChanSystem.TimeoutGHC.Stack.CloneStackData.Bifoldable1 Data.Fixed Data.ComplexData.Functor.ClassesData.Functor.SumData.Functor.ProductData.Functor.ComposeData.Functor.ContravariantData.Foldable1Data.Array.ByteerrorEitherthrow Underflow callStackconcatfoldrfoldlAssertionFailedmapMaybe readMaybeData BifunctorMaybeshowevenSTM atomicallyIO<$>SumProductIsStringstimesIdempotentstimesIdempotentMonoidfromEnumChar$dm*>$dm<$$dm<*$dm<*>$dm<>$dm>> $dmliftA2$dmmany $dmmappend $dmmconcat $dmmempty$dmmplus$dmmzero $dmreturn $dmsconcat$dmsome $dmstimes5016439Integral toIntegerRational$dm- $dmnegate7 GHC.IO.Unsafebracket hGetContentsGHC.IO.Handle.Lock.WindowsGHC.IO.Encoding.CodePage GHC.Event.Arr GHC.ConstantsGHC.ConsoleHandler$IntStringJustRightunzip2repeatcyclebool>>= MonadPlus genericLength maximumBy minimumBygenericReplicate genericTake genericDropgenericSplitAt genericIndex!?Read readsPrec$dmshow $dmshowList $dmshowsPrecControl.Monad.STstToIOGHC.Event.UniquetoEnum $dmenumFrom$dmenumFromThen$dmenumFromThenTo $dmenumFromTo$dmpred$dmsuccCFloatCDoubleNatural$dm/ $dmceiling$dmdiv $dmdivMod$dmfloor$dmmod$dmquot$dmrecip$dmrem$dmround $dmtruncate8$dmindex $dmrangeSize$dmunsafeIndex$dmunsafeRangeSizeData.Functor.UtilsOverflow $dmbitSize $dmclearBit$dmcomplementBit$dmcountLeadingZeros$dmcountTrailingZeros $dmrotate $dmrotateL $dmrotateR $dmsetBit$dmshift $dmshiftL $dmshiftR$dmunsafeShiftL$dmunsafeShiftR $dmzeroBitsGHC.Event.IntVarGHC.TypeLits.InternalGHC.TypeNats.InternalGHC.Unicode.Internal.Bits/GHC.Unicode.Internal.Char.DerivedCoreProperties5GHC.Unicode.Internal.Char.UnicodeData.GeneralCategory$$dmfold1 $dmfoldMap1 $dmfoldMap1' $dmfoldlMap1 $dmfoldlMap1' $dmfoldrMap1 $dmfoldrMap1'$dmhead$dmlast $dmtoNonEmptyTypeaugment++build recSelErrorghc-primGHC.PrimseqeqStringnoMethodBindingErrornonExhaustiveGuardsErrorimpossibleErrorimpossibleConstraintErrorpatError realWorld# recConError GHC.CStringunpackCStringUtf8#unpackCString#unpackAppendCString#unpackFoldrCString#void# typeErrorcstringLength#zipbindIOreturnIO newStablePtrprint nullAddr# otherwiseassert leftSection rightSection runMainIOthenIO GHC.Magiclazy assertErroroneShotrunRW#traceinlinemapconsiderAccessiblenoinlineintegerToFloat#integerToDouble#naturalToFloat#naturalToDouble#rationalToFloatrationalToDoublecoerce fromInteger- fromRationalenumFrom enumFromThen enumFromToenumFromThenTo GHC.Classes==>=negate>>fmapfail fromLabelarr>>>firstapp|||loop fromStringtoAnnotationWrapper fromIntegral realToFrac toRationalguardmzip ghciStepIOIsListfromList fromListNtoListproxy#mkTrContoDyn<>memptymappendmconcatemptyCallStack pushCallStack fromStaticPtrunsafeEqualityProof unsafeCoerce#getField unsatisfiablemkRationalBase2mkRationalBase10join<*>pure*>BoundedEnumEqFloating FractionalMonadFunctorNumOrdReal RealFloatRealFracIxTypeableGHC.Magic.DictWithDictMonadFix MonadFail ApplicativeFoldable TraversableGenericGeneric1Datatype ConstructorSelectorKnownNat KnownSymbol KnownChar GHCiSandboxIO SemigroupMonoidHasFieldAddr#Array# GHC.TypesBool ByteArray#Char#Double#DoubleFloat#FloatFUNInt#Int8#Int16#Int32#Int64# ghc-bignumGHC.Num.IntegerIntegerGHC.Num.NaturalWeak# MutableArray#MutableByteArray#OrderingMVar#IOPort#Ratio RealWorld StablePtr#~~~State# StableName#MutVar#Word#WordWord8#Word16#Word32#Word64# ThreadId#BCOFunPtrTVar#Compact#StackSnapshot# PromptTag#VoidNonEmpty UnliftedTypeTYPE CONSTRAINT ConstraintLevity RuntimeRepVecCountVecElem LiftedRep UnliftedRep ZeroBitRep ZeroBitTypeTyConModuleKindRep TypeLitSortV1U1Par1Rec1K1M1:+::*::.:RDCSRec0D1C1S1RepRep1URecUAddrUCharUDoubleUFloatUIntUWord Unsatisfiable TypeError CoercibleProxy#SPECAny SmallArray#SmallMutableArray# StaticPtr CallStackTypeRep SomeTypeRep AppendSymbolUnsafeEquality MultiplicityInt8X16#Int16X8#Int32X4#Int64X2#Int8X32# Int16X16#Int32X8#Int64X4#Int8X64# Int16X32# Int32X16#Int64X8# Word8X16# Word16X8# Word32X4# Word64X2# Word8X32# Word16X16# Word32X8# Word64X4# Word8X64# Word16X32# Word32X16# Word64X8#FloatX4# DoubleX2#FloatX8# DoubleX4# FloatX16# DoubleX8#Symbol+*^ CmpSymbolCmpNatCmpCharDivModLog2 ConsSymbol UnconsSymbol CharToNat NatToCharConstPtrGHC.Tuple.PrimSoloC#D#FalseF#I#Nothing:%TrueW#LeftLTEQGT StaticPtrInfo FingerprintSrcLocTrNameSTrNameDText:<>::$$:ShowTypePrefixIInfixILeftAssociativeRightAssociativeNotAssociative SourceUnpackSourceNoUnpackNoSourceUnpackedness SourceLazy SourceStrictNoSourceStrictness DecidedLazy DecidedStrict DecidedUnpackMetaDataMetaConsMetaSelVecRepTupleRepSumRepBoxedRepIntRepInt8RepInt16RepInt32RepInt64RepWordRepWord8Rep Word16Rep Word32Rep Word64RepAddrRepFloatRep DoubleRepLiftedUnliftedVec2Vec4Vec8Vec16Vec32Vec64 Int8ElemRep Int16ElemRep Int32ElemRep Int64ElemRep Word8ElemRep Word16ElemRep Word32ElemRep Word64ElemRep FloatElemRep DoubleElemRepKindRepTyConApp KindRepVar KindRepApp KindRepFun KindRepTYPEKindRepTypeLitSKindRepTypeLitD TypeLitSymbol TypeLitNat TypeLitChar UnsafeReflOneManyMkSologtChar#geChar#eqChar#neChar#ltChar#leChar#ord# int8ToInt# intToInt8# negateInt8# plusInt8#subInt8# timesInt8# quotInt8#remInt8# quotRemInt8#uncheckedShiftLInt8#uncheckedShiftRAInt8#uncheckedShiftRLInt8# int8ToWord8#eqInt8#geInt8#gtInt8#leInt8#ltInt8#neInt8# word8ToWord# wordToWord8# plusWord8# subWord8# timesWord8# quotWord8# remWord8# quotRemWord8# andWord8#orWord8# xorWord8# notWord8#uncheckedShiftLWord8#uncheckedShiftRLWord8# word8ToInt8#eqWord8#geWord8#gtWord8#leWord8#ltWord8#neWord8# int16ToInt# intToInt16# negateInt16# plusInt16# subInt16# timesInt16# quotInt16# remInt16# quotRemInt16#uncheckedShiftLInt16#uncheckedShiftRAInt16#uncheckedShiftRLInt16#int16ToWord16#eqInt16#geInt16#gtInt16#leInt16#ltInt16#neInt16# word16ToWord# wordToWord16# plusWord16# subWord16# timesWord16# quotWord16# remWord16#quotRemWord16# andWord16# orWord16# xorWord16# notWord16#uncheckedShiftLWord16#uncheckedShiftRLWord16#word16ToInt16# eqWord16# geWord16# gtWord16# leWord16# ltWord16# neWord16# int32ToInt# intToInt32# negateInt32# plusInt32# subInt32# timesInt32# quotInt32# remInt32# quotRemInt32#uncheckedShiftLInt32#uncheckedShiftRAInt32#uncheckedShiftRLInt32#int32ToWord32#eqInt32#geInt32#gtInt32#leInt32#ltInt32#neInt32# word32ToWord# wordToWord32# plusWord32# subWord32# timesWord32# quotWord32# remWord32#quotRemWord32# andWord32# orWord32# xorWord32# notWord32#uncheckedShiftLWord32#uncheckedShiftRLWord32#word32ToInt32# eqWord32# geWord32# gtWord32# leWord32# ltWord32# neWord32# int64ToInt# intToInt64# negateInt64# plusInt64# subInt64# timesInt64# quotInt64# remInt64#uncheckedIShiftL64#uncheckedIShiftRA64#uncheckedIShiftRL64#int64ToWord64#eqInt64#geInt64#gtInt64#leInt64#ltInt64#neInt64# word64ToWord# wordToWord64# plusWord64# subWord64# timesWord64# quotWord64# remWord64#and64#or64#xor64#not64#uncheckedShiftL64#uncheckedShiftRL64#word64ToInt64# eqWord64# geWord64# gtWord64# leWord64# ltWord64# neWord64#+#-#*# timesInt2#mulIntMayOflo#quotInt#remInt# quotRemInt#andI#orI#xorI#notI# negateInt#addIntC#subIntC#>#>=#==#/=#<#<=#chr# int2Word# int2Float# int2Double# word2Float# word2Double#uncheckedIShiftL#uncheckedIShiftRA#uncheckedIShiftRL# plusWord# addWordC# subWordC# plusWord2# minusWord# timesWord# timesWord2# quotWord#remWord# quotRemWord# quotRemWord2#and#or#xor#not#uncheckedShiftL#uncheckedShiftRL# word2Int#gtWord#geWord#eqWord#neWord#ltWord#leWord#popCnt8# popCnt16# popCnt32# popCnt64#popCnt#pdep8#pdep16#pdep32#pdep64#pdep#pext8#pext16#pext32#pext64#pext#clz8#clz16#clz32#clz64#clz#ctz8#ctz16#ctz32#ctz64#ctz# byteSwap16# byteSwap32# byteSwap64# byteSwap# bitReverse8# bitReverse16# bitReverse32# bitReverse64# bitReverse# narrow8Int# narrow16Int# narrow32Int# narrow8Word# narrow16Word# narrow32Word#>##>=##==##/=##<##<=##+##-##*##/## negateDouble# fabsDouble# double2Int# double2Float# expDouble# expm1Double# logDouble# log1pDouble# sqrtDouble# sinDouble# cosDouble# tanDouble# asinDouble# acosDouble# atanDouble# sinhDouble# coshDouble# tanhDouble# asinhDouble# acoshDouble# atanhDouble#**##decodeDouble_2Int#decodeDouble_Int64#gtFloat#geFloat#eqFloat#neFloat#ltFloat#leFloat# plusFloat# minusFloat# timesFloat# divideFloat# negateFloat# fabsFloat# float2Int# expFloat# expm1Float# logFloat# log1pFloat# sqrtFloat# sinFloat# cosFloat# tanFloat# asinFloat# acosFloat# atanFloat# sinhFloat# coshFloat# tanhFloat# asinhFloat# acoshFloat# atanhFloat# powerFloat# float2Double#decodeFloat_Int# fmaddFloat# fmsubFloat# fnmaddFloat# fnmsubFloat# fmaddDouble# fmsubDouble# fnmaddDouble# fnmsubDouble# newArray# readArray# writeArray# sizeofArray#sizeofMutableArray# indexArray#unsafeFreezeArray#unsafeThawArray# copyArray#copyMutableArray# cloneArray#cloneMutableArray# freezeArray# thawArray# casArray#newSmallArray#shrinkSmallMutableArray#readSmallArray#writeSmallArray#sizeofSmallArray#sizeofSmallMutableArray#getSizeofSmallMutableArray#indexSmallArray#unsafeFreezeSmallArray#unsafeThawSmallArray#copySmallArray#copySmallMutableArray#cloneSmallArray#cloneSmallMutableArray#freezeSmallArray#thawSmallArray#casSmallArray# newByteArray#newPinnedByteArray#newAlignedPinnedByteArray#isMutableByteArrayPinned#isByteArrayPinned#byteArrayContents#mutableByteArrayContents#shrinkMutableByteArray#resizeMutableByteArray#unsafeFreezeByteArray#sizeofByteArray#sizeofMutableByteArray#getSizeofMutableByteArray#indexCharArray#indexWideCharArray#indexIntArray#indexWordArray#indexAddrArray#indexFloatArray#indexDoubleArray#indexStablePtrArray#indexInt8Array#indexWord8Array#indexInt16Array#indexWord16Array#indexInt32Array#indexWord32Array#indexInt64Array#indexWord64Array#indexWord8ArrayAsChar#indexWord8ArrayAsWideChar#indexWord8ArrayAsInt#indexWord8ArrayAsWord#indexWord8ArrayAsAddr#indexWord8ArrayAsFloat#indexWord8ArrayAsDouble#indexWord8ArrayAsStablePtr#indexWord8ArrayAsInt16#indexWord8ArrayAsWord16#indexWord8ArrayAsInt32#indexWord8ArrayAsWord32#indexWord8ArrayAsInt64#indexWord8ArrayAsWord64#readCharArray#readWideCharArray# readIntArray#readWordArray#readAddrArray#readFloatArray#readDoubleArray#readStablePtrArray#readInt8Array#readWord8Array#readInt16Array#readWord16Array#readInt32Array#readWord32Array#readInt64Array#readWord64Array#readWord8ArrayAsChar#readWord8ArrayAsWideChar#readWord8ArrayAsInt#readWord8ArrayAsWord#readWord8ArrayAsAddr#readWord8ArrayAsFloat#readWord8ArrayAsDouble#readWord8ArrayAsStablePtr#readWord8ArrayAsInt16#readWord8ArrayAsWord16#readWord8ArrayAsInt32#readWord8ArrayAsWord32#readWord8ArrayAsInt64#readWord8ArrayAsWord64#writeCharArray#writeWideCharArray#writeIntArray#writeWordArray#writeAddrArray#writeFloatArray#writeDoubleArray#writeStablePtrArray#writeInt8Array#writeWord8Array#writeInt16Array#writeWord16Array#writeInt32Array#writeWord32Array#writeInt64Array#writeWord64Array#writeWord8ArrayAsChar#writeWord8ArrayAsWideChar#writeWord8ArrayAsInt#writeWord8ArrayAsWord#writeWord8ArrayAsAddr#writeWord8ArrayAsFloat#writeWord8ArrayAsDouble#writeWord8ArrayAsStablePtr#writeWord8ArrayAsInt16#writeWord8ArrayAsWord16#writeWord8ArrayAsInt32#writeWord8ArrayAsWord32#writeWord8ArrayAsInt64#writeWord8ArrayAsWord64#compareByteArrays#copyByteArray#copyMutableByteArray##copyMutableByteArrayNonOverlapping#copyByteArrayToAddr#copyMutableByteArrayToAddr#copyAddrToByteArray#copyAddrToAddr#copyAddrToAddrNonOverlapping# setByteArray# setAddrRange#atomicReadIntArray#atomicWriteIntArray# casIntArray# casInt8Array#casInt16Array#casInt32Array#casInt64Array#fetchAddIntArray#fetchSubIntArray#fetchAndIntArray#fetchNandIntArray#fetchOrIntArray#fetchXorIntArray# plusAddr# minusAddr#remAddr# addr2Int# int2Addr#gtAddr#geAddr#eqAddr#neAddr#ltAddr#leAddr#indexCharOffAddr#indexWideCharOffAddr#indexIntOffAddr#indexWordOffAddr#indexAddrOffAddr#indexFloatOffAddr#indexDoubleOffAddr#indexStablePtrOffAddr#indexInt8OffAddr#indexWord8OffAddr#indexInt16OffAddr#indexWord16OffAddr#indexInt32OffAddr#indexWord32OffAddr#indexInt64OffAddr#indexWord64OffAddr#readCharOffAddr#readWideCharOffAddr#readIntOffAddr#readWordOffAddr#readAddrOffAddr#readFloatOffAddr#readDoubleOffAddr#readStablePtrOffAddr#readInt8OffAddr#readWord8OffAddr#readInt16OffAddr#readWord16OffAddr#readInt32OffAddr#readWord32OffAddr#readInt64OffAddr#readWord64OffAddr#writeCharOffAddr#writeWideCharOffAddr#writeIntOffAddr#writeWordOffAddr#writeAddrOffAddr#writeFloatOffAddr#writeDoubleOffAddr#writeStablePtrOffAddr#writeInt8OffAddr#writeWord8OffAddr#writeInt16OffAddr#writeWord16OffAddr#writeInt32OffAddr#writeWord32OffAddr#writeInt64OffAddr#writeWord64OffAddr#atomicExchangeAddrAddr#atomicExchangeWordAddr#atomicCasAddrAddr#atomicCasWordAddr#atomicCasWord8Addr#atomicCasWord16Addr#atomicCasWord32Addr#atomicCasWord64Addr#fetchAddWordAddr#fetchSubWordAddr#fetchAndWordAddr#fetchNandWordAddr#fetchOrWordAddr#fetchXorWordAddr#atomicReadWordAddr#atomicWriteWordAddr# newMutVar# readMutVar# writeMutVar#atomicSwapMutVar#atomicModifyMutVar2#atomicModifyMutVar_# casMutVar#catch#raise#raiseUnderflow#raiseOverflow# raiseDivZero#raiseIO#maskAsyncExceptions#maskUninterruptible#unmaskAsyncExceptions#getMaskingState# newPromptTag#prompt# control0# atomically#retry# catchRetry# catchSTM#newTVar# readTVar# readTVarIO# writeTVar#newMVar# takeMVar# tryTakeMVar#putMVar# tryPutMVar# readMVar# tryReadMVar# isEmptyMVar# newIOPort# readIOPort# writeIOPort#delay# waitRead# waitWrite#fork#forkOn# killThread#yield# myThreadId# labelThread#isCurrentThreadBound# noDuplicate# threadLabel# threadStatus# listThreads#mkWeak#mkWeakNoFinalizer#addCFinalizerToWeak# deRefWeak# finalizeWeak#touch#makeStablePtr#deRefStablePtr# eqStablePtr#makeStableName#stableNameToInt# compactNew#compactResize#compactContains#compactContainsAny#compactGetFirstBlock#compactGetNextBlock#compactAllocateBlock#compactFixupPointers# compactAdd#compactAddWithSharing# compactSize#reallyUnsafePtrEquality#par#spark#seq# getSpark# numSparks# keepAlive# dataToTag# tagToEnum# addrToAny# anyToAddr# mkApUpd0#newBCO#unpackClosure# closureSize#getApStackVal# getCCSOf#getCurrentCCS# clearCCS# whereFrom# traceEvent#traceBinaryEvent# traceMarker#setThreadAllocationCounter#broadcastInt8X16#broadcastInt16X8#broadcastInt32X4#broadcastInt64X2#broadcastInt8X32#broadcastInt16X16#broadcastInt32X8#broadcastInt64X4#broadcastInt8X64#broadcastInt16X32#broadcastInt32X16#broadcastInt64X8#broadcastWord8X16#broadcastWord16X8#broadcastWord32X4#broadcastWord64X2#broadcastWord8X32#broadcastWord16X16#broadcastWord32X8#broadcastWord64X4#broadcastWord8X64#broadcastWord16X32#broadcastWord32X16#broadcastWord64X8#broadcastFloatX4#broadcastDoubleX2#broadcastFloatX8#broadcastDoubleX4#broadcastFloatX16#broadcastDoubleX8# packInt8X16# packInt16X8# packInt32X4# packInt64X2# packInt8X32# packInt16X16# packInt32X8# packInt64X4# packInt8X64# packInt16X32# packInt32X16# packInt64X8# packWord8X16# packWord16X8# packWord32X4# packWord64X2# packWord8X32#packWord16X16# packWord32X8# packWord64X4# packWord8X64#packWord16X32#packWord32X16# packWord64X8# packFloatX4# packDoubleX2# packFloatX8# packDoubleX4# packFloatX16# packDoubleX8#unpackInt8X16#unpackInt16X8#unpackInt32X4#unpackInt64X2#unpackInt8X32#unpackInt16X16#unpackInt32X8#unpackInt64X4#unpackInt8X64#unpackInt16X32#unpackInt32X16#unpackInt64X8#unpackWord8X16#unpackWord16X8#unpackWord32X4#unpackWord64X2#unpackWord8X32#unpackWord16X16#unpackWord32X8#unpackWord64X4#unpackWord8X64#unpackWord16X32#unpackWord32X16#unpackWord64X8#unpackFloatX4#unpackDoubleX2#unpackFloatX8#unpackDoubleX4#unpackFloatX16#unpackDoubleX8#insertInt8X16#insertInt16X8#insertInt32X4#insertInt64X2#insertInt8X32#insertInt16X16#insertInt32X8#insertInt64X4#insertInt8X64#insertInt16X32#insertInt32X16#insertInt64X8#insertWord8X16#insertWord16X8#insertWord32X4#insertWord64X2#insertWord8X32#insertWord16X16#insertWord32X8#insertWord64X4#insertWord8X64#insertWord16X32#insertWord32X16#insertWord64X8#insertFloatX4#insertDoubleX2#insertFloatX8#insertDoubleX4#insertFloatX16#insertDoubleX8# plusInt8X16# plusInt16X8# plusInt32X4# plusInt64X2# plusInt8X32# plusInt16X16# plusInt32X8# plusInt64X4# plusInt8X64# plusInt16X32# plusInt32X16# plusInt64X8# plusWord8X16# plusWord16X8# plusWord32X4# plusWord64X2# plusWord8X32#plusWord16X16# plusWord32X8# plusWord64X4# plusWord8X64#plusWord16X32#plusWord32X16# plusWord64X8# plusFloatX4# plusDoubleX2# plusFloatX8# plusDoubleX4# plusFloatX16# plusDoubleX8# minusInt8X16# minusInt16X8# minusInt32X4# minusInt64X2# minusInt8X32#minusInt16X16# minusInt32X8# minusInt64X4# minusInt8X64#minusInt16X32#minusInt32X16# minusInt64X8#minusWord8X16#minusWord16X8#minusWord32X4#minusWord64X2#minusWord8X32#minusWord16X16#minusWord32X8#minusWord64X4#minusWord8X64#minusWord16X32#minusWord32X16#minusWord64X8# minusFloatX4#minusDoubleX2# minusFloatX8#minusDoubleX4#minusFloatX16#minusDoubleX8# timesInt8X16# timesInt16X8# timesInt32X4# timesInt64X2# timesInt8X32#timesInt16X16# timesInt32X8# timesInt64X4# timesInt8X64#timesInt16X32#timesInt32X16# timesInt64X8#timesWord8X16#timesWord16X8#timesWord32X4#timesWord64X2#timesWord8X32#timesWord16X16#timesWord32X8#timesWord64X4#timesWord8X64#timesWord16X32#timesWord32X16#timesWord64X8# timesFloatX4#timesDoubleX2# timesFloatX8#timesDoubleX4#timesFloatX16#timesDoubleX8#divideFloatX4#divideDoubleX2#divideFloatX8#divideDoubleX4#divideFloatX16#divideDoubleX8# quotInt8X16# quotInt16X8# quotInt32X4# quotInt64X2# quotInt8X32# quotInt16X16# quotInt32X8# quotInt64X4# quotInt8X64# quotInt16X32# quotInt32X16# quotInt64X8# quotWord8X16# quotWord16X8# quotWord32X4# quotWord64X2# quotWord8X32#quotWord16X16# quotWord32X8# quotWord64X4# quotWord8X64#quotWord16X32#quotWord32X16# quotWord64X8# remInt8X16# remInt16X8# remInt32X4# remInt64X2# remInt8X32# remInt16X16# remInt32X8# remInt64X4# remInt8X64# remInt16X32# remInt32X16# remInt64X8# remWord8X16# remWord16X8# remWord32X4# remWord64X2# remWord8X32# remWord16X16# remWord32X8# remWord64X4# remWord8X64# remWord16X32# remWord32X16# remWord64X8#negateInt8X16#negateInt16X8#negateInt32X4#negateInt64X2#negateInt8X32#negateInt16X16#negateInt32X8#negateInt64X4#negateInt8X64#negateInt16X32#negateInt32X16#negateInt64X8#negateFloatX4#negateDoubleX2#negateFloatX8#negateDoubleX4#negateFloatX16#negateDoubleX8#indexInt8X16Array#indexInt16X8Array#indexInt32X4Array#indexInt64X2Array#indexInt8X32Array#indexInt16X16Array#indexInt32X8Array#indexInt64X4Array#indexInt8X64Array#indexInt16X32Array#indexInt32X16Array#indexInt64X8Array#indexWord8X16Array#indexWord16X8Array#indexWord32X4Array#indexWord64X2Array#indexWord8X32Array#indexWord16X16Array#indexWord32X8Array#indexWord64X4Array#indexWord8X64Array#indexWord16X32Array#indexWord32X16Array#indexWord64X8Array#indexFloatX4Array#indexDoubleX2Array#indexFloatX8Array#indexDoubleX4Array#indexFloatX16Array#indexDoubleX8Array#readInt8X16Array#readInt16X8Array#readInt32X4Array#readInt64X2Array#readInt8X32Array#readInt16X16Array#readInt32X8Array#readInt64X4Array#readInt8X64Array#readInt16X32Array#readInt32X16Array#readInt64X8Array#readWord8X16Array#readWord16X8Array#readWord32X4Array#readWord64X2Array#readWord8X32Array#readWord16X16Array#readWord32X8Array#readWord64X4Array#readWord8X64Array#readWord16X32Array#readWord32X16Array#readWord64X8Array#readFloatX4Array#readDoubleX2Array#readFloatX8Array#readDoubleX4Array#readFloatX16Array#readDoubleX8Array#writeInt8X16Array#writeInt16X8Array#writeInt32X4Array#writeInt64X2Array#writeInt8X32Array#writeInt16X16Array#writeInt32X8Array#writeInt64X4Array#writeInt8X64Array#writeInt16X32Array#writeInt32X16Array#writeInt64X8Array#writeWord8X16Array#writeWord16X8Array#writeWord32X4Array#writeWord64X2Array#writeWord8X32Array#writeWord16X16Array#writeWord32X8Array#writeWord64X4Array#writeWord8X64Array#writeWord16X32Array#writeWord32X16Array#writeWord64X8Array#writeFloatX4Array#writeDoubleX2Array#writeFloatX8Array#writeDoubleX4Array#writeFloatX16Array#writeDoubleX8Array#indexInt8X16OffAddr#indexInt16X8OffAddr#indexInt32X4OffAddr#indexInt64X2OffAddr#indexInt8X32OffAddr#indexInt16X16OffAddr#indexInt32X8OffAddr#indexInt64X4OffAddr#indexInt8X64OffAddr#indexInt16X32OffAddr#indexInt32X16OffAddr#indexInt64X8OffAddr#indexWord8X16OffAddr#indexWord16X8OffAddr#indexWord32X4OffAddr#indexWord64X2OffAddr#indexWord8X32OffAddr#indexWord16X16OffAddr#indexWord32X8OffAddr#indexWord64X4OffAddr#indexWord8X64OffAddr#indexWord16X32OffAddr#indexWord32X16OffAddr#indexWord64X8OffAddr#indexFloatX4OffAddr#indexDoubleX2OffAddr#indexFloatX8OffAddr#indexDoubleX4OffAddr#indexFloatX16OffAddr#indexDoubleX8OffAddr#readInt8X16OffAddr#readInt16X8OffAddr#readInt32X4OffAddr#readInt64X2OffAddr#readInt8X32OffAddr#readInt16X16OffAddr#readInt32X8OffAddr#readInt64X4OffAddr#readInt8X64OffAddr#readInt16X32OffAddr#readInt32X16OffAddr#readInt64X8OffAddr#readWord8X16OffAddr#readWord16X8OffAddr#readWord32X4OffAddr#readWord64X2OffAddr#readWord8X32OffAddr#readWord16X16OffAddr#readWord32X8OffAddr#readWord64X4OffAddr#readWord8X64OffAddr#readWord16X32OffAddr#readWord32X16OffAddr#readWord64X8OffAddr#readFloatX4OffAddr#readDoubleX2OffAddr#readFloatX8OffAddr#readDoubleX4OffAddr#readFloatX16OffAddr#readDoubleX8OffAddr#writeInt8X16OffAddr#writeInt16X8OffAddr#writeInt32X4OffAddr#writeInt64X2OffAddr#writeInt8X32OffAddr#writeInt16X16OffAddr#writeInt32X8OffAddr#writeInt64X4OffAddr#writeInt8X64OffAddr#writeInt16X32OffAddr#writeInt32X16OffAddr#writeInt64X8OffAddr#writeWord8X16OffAddr#writeWord16X8OffAddr#writeWord32X4OffAddr#writeWord64X2OffAddr#writeWord8X32OffAddr#writeWord16X16OffAddr#writeWord32X8OffAddr#writeWord64X4OffAddr#writeWord8X64OffAddr#writeWord16X32OffAddr#writeWord32X16OffAddr#writeWord64X8OffAddr#writeFloatX4OffAddr#writeDoubleX2OffAddr#writeFloatX8OffAddr#writeDoubleX4OffAddr#writeFloatX16OffAddr#writeDoubleX8OffAddr#indexInt8ArrayAsInt8X16#indexInt16ArrayAsInt16X8#indexInt32ArrayAsInt32X4#indexInt64ArrayAsInt64X2#indexInt8ArrayAsInt8X32#indexInt16ArrayAsInt16X16#indexInt32ArrayAsInt32X8#indexInt64ArrayAsInt64X4#indexInt8ArrayAsInt8X64#indexInt16ArrayAsInt16X32#indexInt32ArrayAsInt32X16#indexInt64ArrayAsInt64X8#indexWord8ArrayAsWord8X16#indexWord16ArrayAsWord16X8#indexWord32ArrayAsWord32X4#indexWord64ArrayAsWord64X2#indexWord8ArrayAsWord8X32#indexWord16ArrayAsWord16X16#indexWord32ArrayAsWord32X8#indexWord64ArrayAsWord64X4#indexWord8ArrayAsWord8X64#indexWord16ArrayAsWord16X32#indexWord32ArrayAsWord32X16#indexWord64ArrayAsWord64X8#indexFloatArrayAsFloatX4#indexDoubleArrayAsDoubleX2#indexFloatArrayAsFloatX8#indexDoubleArrayAsDoubleX4#indexFloatArrayAsFloatX16#indexDoubleArrayAsDoubleX8#readInt8ArrayAsInt8X16#readInt16ArrayAsInt16X8#readInt32ArrayAsInt32X4#readInt64ArrayAsInt64X2#readInt8ArrayAsInt8X32#readInt16ArrayAsInt16X16#readInt32ArrayAsInt32X8#readInt64ArrayAsInt64X4#readInt8ArrayAsInt8X64#readInt16ArrayAsInt16X32#readInt32ArrayAsInt32X16#readInt64ArrayAsInt64X8#readWord8ArrayAsWord8X16#readWord16ArrayAsWord16X8#readWord32ArrayAsWord32X4#readWord64ArrayAsWord64X2#readWord8ArrayAsWord8X32#readWord16ArrayAsWord16X16#readWord32ArrayAsWord32X8#readWord64ArrayAsWord64X4#readWord8ArrayAsWord8X64#readWord16ArrayAsWord16X32#readWord32ArrayAsWord32X16#readWord64ArrayAsWord64X8#readFloatArrayAsFloatX4#readDoubleArrayAsDoubleX2#readFloatArrayAsFloatX8#readDoubleArrayAsDoubleX4#readFloatArrayAsFloatX16#readDoubleArrayAsDoubleX8#writeInt8ArrayAsInt8X16#writeInt16ArrayAsInt16X8#writeInt32ArrayAsInt32X4#writeInt64ArrayAsInt64X2#writeInt8ArrayAsInt8X32#writeInt16ArrayAsInt16X16#writeInt32ArrayAsInt32X8#writeInt64ArrayAsInt64X4#writeInt8ArrayAsInt8X64#writeInt16ArrayAsInt16X32#writeInt32ArrayAsInt32X16#writeInt64ArrayAsInt64X8#writeWord8ArrayAsWord8X16#writeWord16ArrayAsWord16X8#writeWord32ArrayAsWord32X4#writeWord64ArrayAsWord64X2#writeWord8ArrayAsWord8X32#writeWord16ArrayAsWord16X16#writeWord32ArrayAsWord32X8#writeWord64ArrayAsWord64X4#writeWord8ArrayAsWord8X64#writeWord16ArrayAsWord16X32#writeWord32ArrayAsWord32X16#writeWord64ArrayAsWord64X8#writeFloatArrayAsFloatX4#writeDoubleArrayAsDoubleX2#writeFloatArrayAsFloatX8#writeDoubleArrayAsDoubleX4#writeFloatArrayAsFloatX16#writeDoubleArrayAsDoubleX8#indexInt8OffAddrAsInt8X16#indexInt16OffAddrAsInt16X8#indexInt32OffAddrAsInt32X4#indexInt64OffAddrAsInt64X2#indexInt8OffAddrAsInt8X32#indexInt16OffAddrAsInt16X16#indexInt32OffAddrAsInt32X8#indexInt64OffAddrAsInt64X4#indexInt8OffAddrAsInt8X64#indexInt16OffAddrAsInt16X32#indexInt32OffAddrAsInt32X16#indexInt64OffAddrAsInt64X8#indexWord8OffAddrAsWord8X16#indexWord16OffAddrAsWord16X8#indexWord32OffAddrAsWord32X4#indexWord64OffAddrAsWord64X2#indexWord8OffAddrAsWord8X32#indexWord16OffAddrAsWord16X16#indexWord32OffAddrAsWord32X8#indexWord64OffAddrAsWord64X4#indexWord8OffAddrAsWord8X64#indexWord16OffAddrAsWord16X32#indexWord32OffAddrAsWord32X16#indexWord64OffAddrAsWord64X8#indexFloatOffAddrAsFloatX4#indexDoubleOffAddrAsDoubleX2#indexFloatOffAddrAsFloatX8#indexDoubleOffAddrAsDoubleX4#indexFloatOffAddrAsFloatX16#indexDoubleOffAddrAsDoubleX8#readInt8OffAddrAsInt8X16#readInt16OffAddrAsInt16X8#readInt32OffAddrAsInt32X4#readInt64OffAddrAsInt64X2#readInt8OffAddrAsInt8X32#readInt16OffAddrAsInt16X16#readInt32OffAddrAsInt32X8#readInt64OffAddrAsInt64X4#readInt8OffAddrAsInt8X64#readInt16OffAddrAsInt16X32#readInt32OffAddrAsInt32X16#readInt64OffAddrAsInt64X8#readWord8OffAddrAsWord8X16#readWord16OffAddrAsWord16X8#readWord32OffAddrAsWord32X4#readWord64OffAddrAsWord64X2#readWord8OffAddrAsWord8X32#readWord16OffAddrAsWord16X16#readWord32OffAddrAsWord32X8#readWord64OffAddrAsWord64X4#readWord8OffAddrAsWord8X64#readWord16OffAddrAsWord16X32#readWord32OffAddrAsWord32X16#readWord64OffAddrAsWord64X8#readFloatOffAddrAsFloatX4#readDoubleOffAddrAsDoubleX2#readFloatOffAddrAsFloatX8#readDoubleOffAddrAsDoubleX4#readFloatOffAddrAsFloatX16#readDoubleOffAddrAsDoubleX8#writeInt8OffAddrAsInt8X16#writeInt16OffAddrAsInt16X8#writeInt32OffAddrAsInt32X4#writeInt64OffAddrAsInt64X2#writeInt8OffAddrAsInt8X32#writeInt16OffAddrAsInt16X16#writeInt32OffAddrAsInt32X8#writeInt64OffAddrAsInt64X4#writeInt8OffAddrAsInt8X64#writeInt16OffAddrAsInt16X32#writeInt32OffAddrAsInt32X16#writeInt64OffAddrAsInt64X8#writeWord8OffAddrAsWord8X16#writeWord16OffAddrAsWord16X8#writeWord32OffAddrAsWord32X4#writeWord64OffAddrAsWord64X2#writeWord8OffAddrAsWord8X32#writeWord16OffAddrAsWord16X16#writeWord32OffAddrAsWord32X8#writeWord64OffAddrAsWord64X4#writeWord8OffAddrAsWord8X64#writeWord16OffAddrAsWord16X32#writeWord32OffAddrAsWord32X16#writeWord64OffAddrAsWord64X8#writeFloatOffAddrAsFloatX4#writeDoubleOffAddrAsDoubleX2#writeFloatOffAddrAsFloatX8#writeDoubleOffAddrAsDoubleX4#writeFloatOffAddrAsFloatX16#writeDoubleOffAddrAsDoubleX8#prefetchByteArray3#prefetchMutableByteArray3#prefetchAddr3#prefetchValue3#prefetchByteArray2#prefetchMutableByteArray2#prefetchAddr2#prefetchValue2#prefetchByteArray1#prefetchMutableByteArray1#prefetchAddr1#prefetchValue1#prefetchByteArray0#prefetchMutableByteArray0#prefetchAddr0#prefetchValue0#WordBox MkWordBoxIntBoxMkIntBoxFloatBox MkFloatBox DoubleBox MkDoubleBoxDictBox MkDictBoxGHC.Num.BigNatBigNatBN#unBigNatVoid#SPEC2MultMulisTrue#GHC.Prim.PtrEqreallyUnsafePtrEqualityunsafePtrEquality# sameArray#sameMutableArray#sameSmallArray#sameSmallMutableArray#sameByteArray#sameMutableByteArray# sameMutVar# sameTVar# sameMVar# sameIOPort#samePromptTag# eqStableName#withDict unpackNBytes#getSolo GHC.Tuplecompare<<=>maxmin/=eqWordneWordeqCharneChareqFloateqDoubleeqIntneIntgtIntgeIntltIntleIntgtWordgeWordltWordleWord&&||not$dm==$dm/= $dmcompare$dm<$dm<=$dm>$dm>=$dmmax$dmmin smallInteger integerToInt wordToInteger integerToWordencodeFloatIntegerencodeDoubleIntegerdecodeDoubleInteger plusInteger minusInteger timesInteger negateInteger absInteger signumInteger divModInteger divInteger modIntegerquotRemInteger quotInteger remInteger eqInteger neqInteger leInteger gtInteger ltInteger geIntegercompareInteger eqInteger# neqInteger# leInteger# gtInteger# ltInteger# geInteger# andInteger orInteger xorIntegercomplementInteger shiftLInteger shiftRIntegertestBitInteger hashInteger bitIntegerpopCountInteger wordLog2# integerLog2#integerLogBase# $fEqMaybe $fOrdMaybeNatJ#NatS# mkNaturalisValidNatural plusNatural minusNaturalminusNaturalMaybe timesNatural negateNatural signumNaturalquotRemNatural remNatural quotNatural gcdNatural lcmNatural andNatural orNatural xorNatural bitNaturaltestBitNaturalpopCountNatural shiftLNatural shiftRNaturalnaturalToInteger naturalToWordnaturalFromInteger wordToNaturalnaturalToWordMaybewordToNatural# powModNatural srcLocEndCol srcLocEndLinesrcLocStartColsrcLocStartLine srcLocFile srcLocModule srcLocPackageEmptyCallStack PushCallStackFreezeCallStack HasCallStack getCallStackfromCallSiteListfreezeCallStack $fEqSrcLoc ByteOrder BigEndian LittleEndiantargetByteOrder SomeExceptiondivZeroExceptionoverflowExceptionratioZeroDenomExceptionunderflowException mkUserErrormplusIOerrorCallWithCallStackExceptionerrorCallExceptionerrorWithoutStackTrace undefined absentErrOpaqueO:|mzeromplus Alternativeempty<|>somemanyliftA2<*<$sconcatstimesabsurdvacuous<**>liftAliftA3=<<whenliftM2liftM3liftM4liftM5apmapFB unsafeChrminIntmaxInt breakpointbreakpointCond.flip$!untilasTypeOffailIOunIOgetTagquotIntremIntdivIntmodInt quotRemInt divModInt shift_maskshiftL#shiftRL#iShiftL# iShiftRA# iShiftRL# $fFunctorList$fFunctorMaybe$fFunctorTuple2 $fFunctorSolo $fFunctorFUN$fFunctorTuple7$fFunctorTuple6$fFunctorTuple5$fFunctorTuple4$fFunctorTuple3$fApplicativeIO$fApplicativeList$fApplicativeMaybe$fApplicativeFUN$fApplicativeSolo $fMonadIO $fFunctorIO $fMonadList $fMonadMaybe $fMonadFUN $fMonadSolo$fAlternativeIO$fAlternativeList$fAlternativeMaybe $fMonadPlusIO$fMonadPlusList$fMonadPlusMaybe$fMonadNonEmpty$fApplicativeNonEmpty$fFunctorNonEmpty $fSemigroupIO$fSemigroupMaybe$fSemigroupOrdering$fSemigroupTuple5$fSemigroupTuple4$fSemigroupTuple3$fSemigroupTuple2$fSemigroupSolo$fSemigroupUnit$fSemigroupFUN$fSemigroupNonEmpty$fSemigroupVoid$fSemigroupList $fMonoidIO $fMonadTuple4$fApplicativeTuple4 $fMonadTuple3$fApplicativeTuple3 $fMonadTuple2$fApplicativeTuple2 $fMonoidMaybe$fMonoidOrdering$fMonoidTuple5$fMonoidTuple4$fMonoidTuple3$fMonoidTuple2 $fMonoidSolo $fMonoidUnit $fMonoidFUN $fMonoidList $fEqNonEmpty $fOrdNonEmpty$fEqVoid $fOrdVoidcurrentCallStackVersion makeVersionunicodeVersion hPutStrLnabssignumsubtract $fNumNatural $fNumInteger $fNumWord$fNumIntmaybeisJust isNothingfromJust fromMaybe maybeToList listToMaybe catMaybesunconsunsnoctaillastinitnullfoldl1'sumproductscanlscanl1scanl'foldr'foldr1scanrscanr1maximumminimumiterateiterate' replicate takeWhile dropWhiletakedropsplitAtspanbreakreverseandoranyallelemnotElemlookup concatMap!!zip3zipWithzipWith3unzip3errorEmptyListshowListShowS showList__appPrecappPrec1showsshowChar showString showParen showSpaceshowCommaSpace showLitChar showLitStringshowMultiLineString protectEscasciiTab intToDigit showSignedInt $fShowKindRep $fShowNatural $fShowInteger $fShowTuple15 $fShowTuple14 $fShowTuple13 $fShowTuple12 $fShowTuple11 $fShowTuple10 $fShowTuple9 $fShowTuple8 $fShowTuple7 $fShowTuple6 $fShowTuple5 $fShowTuple4 $fShowTuple3 $fShowTuple2$fShowCallStack $fShowModule $fShowTrName $fShowTyCon $fShowWord $fShowInt $fShowChar $fShowList$fShowTypeLitSort $fShowVecElem$fShowVecCount$fShowRuntimeRep $fShowLevity $fShowSrcLoc$fShowNonEmpty $fShowMaybe$fShowOrdering $fShowBool $fShowSolo $fShowUnit $fShowVoid showListWith $fMonadFailIO$fMonadFailList$fMonadFailMaybesuccpredminBoundmaxBoundboundedEnumFromboundedEnumFromThen toEnumError fromEnumError succError predError $fBoundedWord $fBoundedInt $fBoundedChar $fEnumNatural $fEnumInteger $fEnumWord $fEnumInt $fEnumChar$fEnumOrdering $fEnumBool $fEnumSolo $fEnumUnit $fEnumVecElem$fBoundedVecElem$fEnumVecCount$fBoundedVecCount $fEnumLevity$fBoundedLevity$fBoundedOrdering $fBoundedBool$fBoundedTuple15$fBoundedTuple14$fBoundedTuple13$fBoundedTuple12$fBoundedTuple11$fBoundedTuple10$fBoundedTuple9$fBoundedTuple8$fBoundedTuple7$fBoundedTuple6$fBoundedTuple5$fBoundedTuple4$fBoundedTuple3$fBoundedTuple2 $fBoundedSolo $fBoundedUnitFractionalExponentBaseBase2Base10properFractiontruncateroundceilingfloor/recipquotremdivmodquotRemdivMod divZeroErrorratioZeroDenominatorError overflowErrorunderflowError ratioPrec ratioPrec1infinity notANumberreduce% numerator denominatornumericEnumFromnumericEnumFromThennumericEnumFromTonumericEnumFromThenTo showSignedoddpowImpl powImplAcc^^^%^^^%^^gcdlcmintegralEnumFromintegralEnumFromThenintegralEnumFromTointegralEnumFromThenTomkRationalWithExponentBase $fShowRatio $fRealNatural $fRealInteger $fRealRatio $fNumRatio $fOrdRatio$fIntegralNatural$fIntegralInteger$fIntegralWord $fRealWord $fIntegralInt $fRealInt$fFractionalRatio $fEnumRatio$fRealFracRatio$fShowFractionalExponentBase $fEqRatiorangeindex unsafeIndexinRange rangeSizeunsafeRangeSize indexError $fIxTuple15 $fIxTuple14 $fIxTuple13 $fIxTuple12 $fIxTuple11 $fIxTuple10 $fIxTuple9 $fIxTuple8 $fIxTuple7 $fIxTuple6 $fIxTuple5 $fIxTuple4 $fIxTuple3 $fIxTuple2$fIxSolo$fIxUnit$fIxVoid $fIxOrdering$fIxBool $fIxNatural $fIxInteger$fIxWord$fIxInt$fIxChar FiniteBits finiteBitSizecountLeadingZeroscountTrailingZerosBits.&..|.xor complementshiftrotatezeroBitsbitsetBitclearBit complementBittestBit bitSizeMaybebitSizeisSignedshiftL unsafeShiftLshiftR unsafeShiftRrotateLrotateRpopCount bitDefaulttestBitDefaultpopCountDefaulttoIntegralSized $fBitsNatural $fBitsInteger $fBitsBool$fFiniteBitsWord $fBitsWord$fFiniteBitsInt $fBitsInt$fFiniteBitsBoolW64#W32#W16#W8#eqWord8neWord8gtWord8geWord8ltWord8leWord8eqWord16neWord16gtWord16geWord16ltWord16leWord16 byteSwap16eqWord32neWord32gtWord32geWord32ltWord32leWord32 byteSwap32eqWord64neWord64gtWord64geWord64ltWord64leWord64 byteSwap64 bitReverse8 bitReverse16 bitReverse32 bitReverse64$fFiniteBitsWord8 $fBitsWord8 $fIxWord8$fBoundedWord8$fIntegralWord8 $fEnumWord8 $fRealWord8 $fNumWord8 $fShowWord8 $fOrdWord8 $fEqWord8$fFiniteBitsWord16 $fBitsWord16 $fIxWord16$fBoundedWord16$fIntegralWord16 $fEnumWord16 $fRealWord16 $fNumWord16 $fShowWord16 $fOrdWord16 $fEqWord16 $fIxWord32$fBoundedWord32 $fRealWord32 $fShowWord32$fFiniteBitsWord32 $fBitsWord32$fIntegralWord32 $fEnumWord32 $fNumWord32 $fOrdWord32 $fEqWord32 $fIxWord64$fBoundedWord64 $fRealWord64 $fShowWord64$fFiniteBitsWord64 $fBitsWord64$fIntegralWord64 $fEnumWord64 $fNumWord64 $fOrdWord64 $fEqWord64properFractionFloatInt floorFloatIntceilingFloatInt roundFloatIntproperFractionFloatIntegertruncateFloatIntegerfloorFloatIntegerceilingFloatIntegerroundFloatIntegerproperFractionDoubleIntfloorDoubleIntceilingDoubleIntroundDoubleIntproperFractionDoubleIntegertruncateDoubleIntegerfloorDoubleIntegerceilingDoubleIntegerroundDoubleInteger double2Int int2Double float2Int int2FloatelimZerosInteger elimZerosInt#STretSTRepSTliftSTunsafeInterleaveSTunsafeDupableInterleaveSTrunST$fShowST $fMonoidST $fSemigroupST $fMonadST$fApplicativeST $fFunctorSTSTArrayArray arrEleBottomarray unsafeArray unsafeArray'filldone listArray! safeRangeSizenegRange safeIndex lessSafeIndex badSafeIndexunsafeAtbounds numElementsindiceselems foldrElems foldlElems foldrElems' foldlElems' foldl1Elems foldr1Elemsassocs accumArrayunsafeAccumArrayunsafeAccumArray'adjust// unsafeReplaceaccum unsafeAccumamapixmapeqArraycmpArray cmpIntArray newSTArray boundsSTArraynumElementsSTArray readSTArrayunsafeReadSTArray writeSTArrayunsafeWriteSTArray freezeSTArrayunsafeFreezeSTArray thawSTArrayunsafeThawSTArray $fShowArray $fOrdArray $fEqArray$fFunctorArray $fEqSTArray unsafeCoerceunsafeCoerceUnliftedunsafeCoerceAddrFFFormat FFExponentFFFixed FFGeneric floatRadix floatDigits floatRange decodeFloat encodeFloatexponent significand scaleFloatisNaN isInfiniteisDenormalizedisNegativeZeroisIEEEatan2piexplogsqrt**logBasesincostanasinacosatansinhcoshtanhasinhacoshatanhlog1pexpm1log1pexplog1mexpstgDoubleToWord64stgWord64ToDoublestgFloatToWord32stgWord32ToFloatisDoubleFiniteisDoubleNegativeZeroisDoubleDenormalizedisDoubleInfinite isDoubleNaN isFloatFiniteisFloatNegativeZeroisFloatDenormalizedisFloatInfinite isFloatNaN log1mexpOrd floorFloat ceilingFloat truncateFloat roundFloatproperFractionFloat floorDouble ceilingDoubletruncateDouble roundDoubleproperFractionDouble showFloatformatRealFloatformatRealFloatAltroundTo floatToDigitsintegerToBinaryFloat'fromRatfromRat'minExptmaxExptexptexpts maxExpt10expts10 fromRat'' roundingMode# plusFloat minusFloat timesFloat divideFloat negateFloatgtFloatgeFloatltFloatleFloatexpFloat expm1FloatlogFloat log1pFloat sqrtFloat fabsFloatsinFloatcosFloattanFloat asinFloat acosFloat atanFloat sinhFloat coshFloat tanhFloat asinhFloat acoshFloat atanhFloat powerFloat plusDouble minusDouble timesDouble divideDouble negateDoublegtDoublegeDoubleltDoubleleDouble double2Float float2Double expDouble expm1Double logDouble log1pDouble sqrtDouble fabsDouble sinDouble cosDouble tanDouble asinDouble acosDouble atanDouble sinhDouble coshDouble tanhDouble asinhDouble acoshDouble atanhDouble powerDouble word2Double word2FloatshowSignedFloatclampcastWord32ToFloatcastFloatToWord32castWord64ToDoublecastDoubleToWord64 $fEnumDouble $fEnumFloat $fShowDouble$fRealFracDouble$fFractionalDouble $fRealDouble $fNumDouble $fShowFloat$fRealFracFloat$fFractionalFloat $fRealFloat $fNumFloat$fFloatingDouble$fFloatingFloat$fRealFloatDouble$fRealFloatFloatAssert ErrorMessageNotIfnewSTRef readSTRef writeSTRef $fEqSTRefunsafeDupablePerformIOunsafeInterleaveIOunsafeDupableInterleaveIO noDuplicatefstsndcurryswap newEmptyMVarnewMVartakeMVarreadMVarputMVar tryTakeMVar tryPutMVar tryReadMVar isEmptyMVaraddMVarFinalizer$fEqMVar<&>$>voidfixon& applyWhenGeneralCategoryUppercaseLetterLowercaseLetterTitlecaseLetterModifierLetter OtherLetterNonSpacingMarkSpacingCombiningMark EnclosingMark DecimalNumber LetterNumber OtherNumberConnectorPunctuationDashPunctuationOpenPunctuationClosePunctuation InitialQuote FinalQuoteOtherPunctuation MathSymbolCurrencySymbolModifierSymbol OtherSymbolSpace LineSeparatorParagraphSeparatorFormat Surrogate PrivateUse NotAssignedgeneralCategoryisAsciiisLatin1 isAsciiLower isAsciiUpper isControlisPrintisSpaceisUpper isUpperCaseisLower isLowerCase isAlphaNumisDigit isOctDigit isHexDigit isPunctuationisSymboltoUppertoLowertoTitle$fShowGeneralCategory$fEqGeneralCategory$fOrdGeneralCategory$fEnumGeneralCategory$fBoundedGeneralCategory$fIxGeneralCategoryReadPReadSgetlookpfail+++<++gathersatisfychareofstringmunchmunch1choice skipSpacescountbetweenoptionoptionalmany1skipMany skipMany1sepBysepBy1endByendBy1chainrchainlchainr1chainl1manyTill readP_to_S readS_to_P$fAlternativeP $fMonadFailP$fMonadP $fMonadPlusP$fApplicativeP$fMonadPlusReadP$fAlternativeReadP$fMonadFailReadP $fMonadReadP$fApplicativeReadP$fFunctorReadP $fFunctorPNumberLexemePuncIdentEOFnumberToInteger numberToFixednumberToRangedRationalnumberToRationallexexpecthsLex isSymbolCharlexCharreadIntPreadBinPreadOctPreadDecPreadHexP $fEqLexeme $fShowLexeme $fEqNumber $fShowNumberPrecReadPrecminPrecliftstepresetprec readPrec_to_P readP_to_Prec readPrec_to_S readS_to_Prec$fAlternativeReadPrec$fMonadPlusReadPrec$fMonadFailReadPrec$fMonadReadPrec$fApplicativeReadPrec$fFunctorReadPrecreadListreadPrec readListPrec readParenreadListDefaultreadListPrecDefault lexLitChar readLitChar lexDigitslexPexpectPparenparenslistchoose readField readFieldHash readSymField readNumber $fReadTuple15 $fReadTuple14 $fReadTuple13 $fReadTuple12 $fReadTuple11 $fReadTuple10 $fReadTuple9 $fReadTuple8 $fReadTuple7 $fReadTuple6 $fReadTuple5 $fReadTuple4 $fReadTuple3 $fReadTuple2 $fReadUnit $fReadRatio $fReadDouble $fReadFloat $fReadNatural $fReadInteger $fReadWord64 $fReadWord32 $fReadWord16 $fReadWord8 $fReadWord $fReadInt $fReadLexeme $fReadArray $fReadList $fReadMaybe$fReadOrdering $fReadBool $fReadChar $fReadSolo $fReadVoid$fReadNonEmpty$fReadGeneralCategoryreadIntreadBinreadOctreadDecreadHex readFloat readSignedshowInt showHFloat showIntAtBaseshowHexshowOctshowBincastPtrplusPtralignPtrminusPtr nullFunPtr castFunPtrcastFunPtrToPtrcastPtrToFunPtr $fShowPtr $fShowFunPtr $fEqFunPtr $fOrdFunPtr$fEqPtr$fOrdPtr ThreadStatus ThreadRunningThreadFinished ThreadBlocked ThreadDied BlockReason BlockedOnMVarBlockedOnBlackHoleBlockedOnException BlockedOnSTMBlockedOnForeignCallBlockedOnOtherTVarThreadIdlabelThreadByteArray# sharedCAF threadStatus showThreadId myThreadId freeStablePtrdeRefStablePtrcastStablePtrToPtrcastPtrToStablePtr $fEqStablePtr unConstPtr$fShowConstPtr $fEqConstPtr $fOrdConstPtr$fShowFingerprint$fEqFingerprint$fOrdFingerprintfingerprintStringfingerprintFingerprintseitherleftsrightspartitionEithersisLeftisRightfromLeft fromRight $fMonadEither$fApplicativeEither$fSemigroupEither$fFunctorEither $fEqEither $fOrdEither $fReadEither $fShowEitherreads readEitherreadIffgetIffXorgetXorIorgetIorAndgetAndoneBits.^..>>..<<.!>>.!<<. $fMonoidAnd$fSemigroupAnd $fMonoidIor$fSemigroupIor $fMonoidXor$fSemigroupXor $fMonoidIff$fSemigroupIff $fBoundedIff $fEnumIff $fBitsIff$fFiniteBitsIff$fEqIff $fShowIff $fReadIff $fBoundedXor $fEnumXor $fBitsXor$fFiniteBitsXor$fEqXor $fShowXor $fReadXor $fBoundedIor $fEnumIor $fBitsIor$fFiniteBitsIor$fEqIor $fShowIor $fReadIor $fBoundedAnd $fEnumAnd $fBitsAnd$fFiniteBitsAnd$fEqAnd $fShowAnd $fReadAndI64#I32#I16#I8#eqInt8neInt8gtInt8geInt8ltInt8leInt8eqInt16neInt16gtInt16geInt16ltInt16leInt16eqInt32neInt32gtInt32geInt32ltInt32leInt32eqInt64neInt64gtInt64geInt64ltInt64leInt64 shiftRLInt8# shiftRLInt16# shiftRLInt32#$fFiniteBitsInt8 $fBitsInt8 $fReadInt8$fIxInt8 $fBoundedInt8$fIntegralInt8 $fEnumInt8 $fRealInt8 $fNumInt8 $fShowInt8 $fOrdInt8$fEqInt8$fFiniteBitsInt16 $fBitsInt16 $fReadInt16 $fIxInt16$fBoundedInt16$fIntegralInt16 $fEnumInt16 $fRealInt16 $fNumInt16 $fShowInt16 $fOrdInt16 $fEqInt16 $fIxInt32$fBoundedInt32 $fRealInt32$fFiniteBitsInt32 $fBitsInt32 $fReadInt32$fIntegralInt32 $fEnumInt32 $fNumInt32 $fShowInt32 $fOrdInt32 $fEqInt32 $fIxInt64$fBoundedInt64 $fRealInt64$fFiniteBitsInt64 $fBitsInt64 $fReadInt64$fIntegralInt64 $fEnumInt64 $fNumInt64 $fShowInt64 $fOrdInt64 $fEqInt64readWideCharOffPtr readIntOffPtrreadWordOffPtr readPtrOffPtrreadFunPtrOffPtrreadFloatOffPtrreadDoubleOffPtrreadStablePtrOffPtrreadInt8OffPtrreadWord8OffPtrreadInt16OffPtrreadWord16OffPtrreadInt32OffPtrreadWord32OffPtrreadInt64OffPtrreadWord64OffPtrwriteWideCharOffPtrwriteIntOffPtrwriteWordOffPtrwritePtrOffPtrwriteFunPtrOffPtrwriteFloatOffPtrwriteDoubleOffPtrwriteStablePtrOffPtrwriteInt8OffPtrwriteWord8OffPtrwriteInt16OffPtrwriteWord16OffPtrwriteInt32OffPtrwriteWord32OffPtrwriteInt64OffPtrwriteWord64OffPtr alignment peekElemOff pokeElemOff peekByteOff pokeByteOffpeekpoke$fStorableFingerprint$fStorableRatio$fStorableInt64$fStorableInt32$fStorableInt16$fStorableInt8$fStorableWord64$fStorableWord32$fStorableWord16$fStorableWord8$fStorableDouble$fStorableFloat$fStorableStablePtr$fStorableFunPtr $fStorablePtr$fStorableWord $fStorableInt$fStorableChar$fStorableBool$fStorableUnit$fStorableConstPtrDowngetDown comparing $fMonadDown$fApplicativeDown $fFunctorDown $fEnumDown $fBoundedDown $fOrdDown $fShowDown $fReadDown$fEqDown $fNumDown$fSemigroupDown $fMonoidDown $fBitsDown$fFiniteBitsDown$fFloatingDown$fFractionalDown$fIxDown $fRealDown$fRealFracDown$fRealFloatDown$fStorableDown TestEquality testEquality:~~:HRefl:~:ReflsymtranscastWith gcastWithapplyinnerouter $fEnum:~: $fEnum:~~:$fTestEqualityk:~~:$fTestEqualityk:~: $fBounded:~~: $fRead:~~: $fOrd:~~: $fShow:~~:$fEq:~~: $fBounded:~: $fRead:~:$fOrd:~: $fShow:~:$fEq:~: TestCoercion testCoercionCoercion coerceWith gcoerceWithrepr$fEnumCoercion$fTestCoercionkCoercion$fTestCoercionk:~~:$fTestCoercionk:~:$fBoundedCoercion$fReadCoercion $fOrdCoercion$fShowCoercion $fEqCoercionCategory<<<$fCategorykCoercion$fCategoryk:~~:$fCategoryk:~:$fCategoryTYPEFUNKProxyProxy asProxyTypeOf$fMonadPlusProxy $fMonadProxy$fAlternativeProxy$fApplicativeProxy$fFunctorProxy $fMonoidProxy$fSemigroupProxy $fIxProxy $fEnumProxy $fShowProxy $fOrdProxy $fEqProxy$fBoundedProxy $fReadProxyCUIntMaxCIntMaxCUIntPtrCIntPtrCJmpBufCFposCFile CSUSeconds CUSecondsCTimeCClock CSigAtomicCWcharCSizeCPtrdiffCBoolCULLongCLLongCULongCLongCUIntCIntCUShortCShortCUCharCSCharCChar$fReadCUIntMax$fShowCUIntMax $fEqCUIntMax $fOrdCUIntMax $fNumCUIntMax$fEnumCUIntMax$fStorableCUIntMax$fRealCUIntMax$fBoundedCUIntMax$fIntegralCUIntMax$fBitsCUIntMax$fFiniteBitsCUIntMax $fIxCUIntMax $fReadCIntMax $fShowCIntMax $fEqCIntMax $fOrdCIntMax $fNumCIntMax $fEnumCIntMax$fStorableCIntMax $fRealCIntMax$fBoundedCIntMax$fIntegralCIntMax $fBitsCIntMax$fFiniteBitsCIntMax $fIxCIntMax$fReadCUIntPtr$fShowCUIntPtr $fEqCUIntPtr $fOrdCUIntPtr $fNumCUIntPtr$fEnumCUIntPtr$fStorableCUIntPtr$fRealCUIntPtr$fBoundedCUIntPtr$fIntegralCUIntPtr$fBitsCUIntPtr$fFiniteBitsCUIntPtr $fIxCUIntPtr $fReadCIntPtr $fShowCIntPtr $fEqCIntPtr $fOrdCIntPtr $fNumCIntPtr $fEnumCIntPtr$fStorableCIntPtr $fRealCIntPtr$fBoundedCIntPtr$fIntegralCIntPtr $fBitsCIntPtr$fFiniteBitsCIntPtr $fIxCIntPtr$fReadCSUSeconds$fShowCSUSeconds$fEqCSUSeconds$fOrdCSUSeconds$fNumCSUSeconds$fEnumCSUSeconds$fStorableCSUSeconds$fRealCSUSeconds$fReadCUSeconds$fShowCUSeconds $fEqCUSeconds$fOrdCUSeconds$fNumCUSeconds$fEnumCUSeconds$fStorableCUSeconds$fRealCUSeconds $fReadCTime $fShowCTime $fEqCTime $fOrdCTime $fNumCTime $fEnumCTime$fStorableCTime $fRealCTime $fReadCClock $fShowCClock $fEqCClock $fOrdCClock $fNumCClock $fEnumCClock$fStorableCClock $fRealCClock$fReadCSigAtomic$fShowCSigAtomic$fEqCSigAtomic$fOrdCSigAtomic$fNumCSigAtomic$fEnumCSigAtomic$fStorableCSigAtomic$fRealCSigAtomic$fBoundedCSigAtomic$fIntegralCSigAtomic$fBitsCSigAtomic$fFiniteBitsCSigAtomic$fIxCSigAtomic $fReadCWchar $fShowCWchar $fEqCWchar $fOrdCWchar $fNumCWchar $fEnumCWchar$fStorableCWchar $fRealCWchar$fBoundedCWchar$fIntegralCWchar $fBitsCWchar$fFiniteBitsCWchar $fIxCWchar $fReadCSize $fShowCSize $fEqCSize $fOrdCSize $fNumCSize $fEnumCSize$fStorableCSize $fRealCSize$fBoundedCSize$fIntegralCSize $fBitsCSize$fFiniteBitsCSize $fIxCSize$fReadCPtrdiff$fShowCPtrdiff $fEqCPtrdiff $fOrdCPtrdiff $fNumCPtrdiff$fEnumCPtrdiff$fStorableCPtrdiff$fRealCPtrdiff$fBoundedCPtrdiff$fIntegralCPtrdiff$fBitsCPtrdiff$fFiniteBitsCPtrdiff $fIxCPtrdiff $fReadCDouble $fShowCDouble $fEqCDouble $fOrdCDouble $fNumCDouble $fEnumCDouble$fStorableCDouble $fRealCDouble$fFractionalCDouble$fFloatingCDouble$fRealFracCDouble$fRealFloatCDouble $fReadCFloat $fShowCFloat $fEqCFloat $fOrdCFloat $fNumCFloat $fEnumCFloat$fStorableCFloat $fRealCFloat$fFractionalCFloat$fFloatingCFloat$fRealFracCFloat$fRealFloatCFloat $fReadCBool $fShowCBool $fEqCBool $fOrdCBool $fNumCBool $fEnumCBool$fStorableCBool $fRealCBool$fBoundedCBool$fIntegralCBool $fBitsCBool$fFiniteBitsCBool $fIxCBool $fReadCULLong $fShowCULLong $fEqCULLong $fOrdCULLong $fNumCULLong $fEnumCULLong$fStorableCULLong $fRealCULLong$fBoundedCULLong$fIntegralCULLong $fBitsCULLong$fFiniteBitsCULLong $fIxCULLong $fReadCLLong $fShowCLLong $fEqCLLong $fOrdCLLong $fNumCLLong $fEnumCLLong$fStorableCLLong $fRealCLLong$fBoundedCLLong$fIntegralCLLong $fBitsCLLong$fFiniteBitsCLLong $fIxCLLong $fReadCULong $fShowCULong $fEqCULong $fOrdCULong $fNumCULong $fEnumCULong$fStorableCULong $fRealCULong$fBoundedCULong$fIntegralCULong $fBitsCULong$fFiniteBitsCULong $fIxCULong $fReadCLong $fShowCLong $fEqCLong $fOrdCLong $fNumCLong $fEnumCLong$fStorableCLong $fRealCLong$fBoundedCLong$fIntegralCLong $fBitsCLong$fFiniteBitsCLong $fIxCLong $fReadCUInt $fShowCUInt $fEqCUInt $fOrdCUInt $fNumCUInt $fEnumCUInt$fStorableCUInt $fRealCUInt$fBoundedCUInt$fIntegralCUInt $fBitsCUInt$fFiniteBitsCUInt $fIxCUInt $fReadCInt $fShowCInt$fEqCInt $fOrdCInt $fNumCInt $fEnumCInt$fStorableCInt $fRealCInt $fBoundedCInt$fIntegralCInt $fBitsCInt$fFiniteBitsCInt$fIxCInt $fReadCUShort $fShowCUShort $fEqCUShort $fOrdCUShort $fNumCUShort $fEnumCUShort$fStorableCUShort $fRealCUShort$fBoundedCUShort$fIntegralCUShort $fBitsCUShort$fFiniteBitsCUShort $fIxCUShort $fReadCShort $fShowCShort $fEqCShort $fOrdCShort $fNumCShort $fEnumCShort$fStorableCShort $fRealCShort$fBoundedCShort$fIntegralCShort $fBitsCShort$fFiniteBitsCShort $fIxCShort $fReadCUChar $fShowCUChar $fEqCUChar $fOrdCUChar $fNumCUChar $fEnumCUChar$fStorableCUChar $fRealCUChar$fBoundedCUChar$fIntegralCUChar $fBitsCUChar$fFiniteBitsCUChar $fIxCUChar $fReadCSChar $fShowCSChar $fEqCSChar $fOrdCSChar $fNumCSChar $fEnumCSChar$fStorableCSChar $fRealCSChar$fBoundedCSChar$fIntegralCSChar $fBitsCSChar$fFiniteBitsCSChar $fIxCSChar $fReadCChar $fShowCChar $fEqCChar $fOrdCChar $fNumCChar $fEnumCChar$fStorableCChar $fRealCChar$fBoundedCChar$fIntegralCChar $fBitsCChar$fFiniteBitsCChar $fIxCChargetMonotonicTimeNSecgetMonotonicTimeIntPtrWordPtr ptrToWordPtr wordPtrToPtr ptrToIntPtr intPtrToPtr $fReadIntPtr $fShowIntPtr $fEqIntPtr $fOrdIntPtr $fNumIntPtr $fEnumIntPtr$fStorableIntPtr $fRealIntPtr$fBoundedIntPtr$fIntegralIntPtr $fBitsIntPtr$fFiniteBitsIntPtr $fIxIntPtr $fReadWordPtr $fShowWordPtr $fEqWordPtr $fOrdWordPtr $fNumWordPtr $fEnumWordPtr$fStorableWordPtr $fRealWordPtr$fBoundedWordPtr$fIntegralWordPtr $fBitsWordPtr$fFiniteBitsWordPtr $fIxWordPtrIOModeReadMode WriteMode AppendMode ReadWriteMode $fEqIOMode $fOrdIOMode $fIxIOMode $fEnumIOMode $fReadIOMode $fShowIOMode digitToIntisMarkisNumber isSeparatorOrdCondMinMax>?=?<=? OrderingILTIEQIGTICompare $fEqOrderingI$fShowOrderingISNatSomeNatnatSingNatnatValnatVal' someNatValsameNat decideNatcmpNat withKnownNat$fTestCoercionNaturalSNat$fTestEqualityNaturalSNat $fShowSNat $fOrdSNat$fEqSNat $fReadSomeNat $fShowSomeNat $fOrdSomeNat $fEqSomeNatSCharSSymbolSomeCharcharSing SomeSymbol symbolSing symbolVal symbolVal'charValcharVal' someSymbolVal someCharVal sameSymbol decideSymbolsameChar decideChar cmpSymbolcmpChar fromSSymbolwithKnownSymbolwithSomeSSymbol fromSChar withKnownChar withSomeSChar$fTestCoercionSymbolSSymbol$fTestEqualitySymbolSSymbol $fShowSSymbol $fOrdSSymbol $fEqSSymbol$fReadSomeSymbol$fShowSomeSymbol$fOrdSomeSymbol$fEqSomeSymbol$fTestCoercionCharSChar$fTestEqualityCharSChar $fShowSChar $fOrdSChar $fEqSChar$fReadSomeChar$fShowSomeChar $fOrdSomeChar $fEqSomeCharMeta Generically1 Genericallyfrom1to1fromtoselNameselSourceUnpackednessselSourceStrictnessselDecidedStrictnessDecidedStrictnessSourceStrictnessSourceUnpackedness AssociativityFixityIFixityPrefixInfixconName conFixity conIsRecord datatypeName moduleName packageName isNewtypeComp1unComp1L1R1unM1unK1unRec1unPar1uWord#uInt#uFloat#uDouble#uChar#uAddr#$fAlternative:.:$fApplicative:.: $fMonoid:*:$fSemigroup:*:$fMonadPlus:*: $fMonad:*:$fAlternative:*:$fApplicative:*:$fApplicativeK1 $fMonadRec1 $fMonadPar1$fApplicativePar1 $fMonoidU1 $fSemigroupU1 $fMonadPlusU1 $fMonadU1$fAlternativeU1$fApplicativeU1 $fFunctorU1$fShowU1$fOrdU1$fEqU1 $fSemigroupV1$fMonoidGenerically$fSemigroupGenerically$fAlternativeGenerically1$fApplicativeGenerically1$fFunctorGenerically1$fOrdGenerically1$fEqGenerically1%$fSingIDecidedStrictnessDecidedUnpack%$fSingIDecidedStrictnessDecidedStrict#$fSingIDecidedStrictnessDecidedLazy#$fSingISourceStrictnessSourceStrict!$fSingISourceStrictnessSourceLazy)$fSingISourceStrictnessNoSourceStrictness%$fSingISourceUnpackednessSourceUnpack'$fSingISourceUnpackednessSourceNoUnpack-$fSingISourceUnpackednessNoSourceUnpackedness"$fSingIAssociativityNotAssociative$$fSingIAssociativityRightAssociative#$fSingIAssociativityLeftAssociative$fSingIFixityIInfixI$fSingIFixityIPrefixI$fSingIMaybeJust$fSingIMaybeNothing$fSingIBoolFalse$fSingIBoolTrue$fSingISymbola$fSingKindDecidedStrictness$fSingKindSourceStrictness$fSingKindSourceUnpackedness$fSingKindAssociativity$fSingKindFixityI$fSingKindMaybe$fSingKindBool$fSingKindSymbol$fSelectorMetaMetaSel$fConstructorMetaMetaCons$fDatatypeMetaMetaData$fEqM1$fOrdM1$fReadM1$fShowM1 $fFunctorM1 $fGenericM1 $fGeneric1kM1$fEqV1$fOrdV1$fReadV1$fShowV1 $fFunctorV1 $fGenericV1 $fGeneric1kV1 $fGenericU1 $fGeneric1kU1$fEqPar1 $fOrdPar1 $fReadPar1 $fShowPar1 $fFunctorPar1 $fGenericPar1$fGeneric1TYPEPar1$fEqRec1 $fOrdRec1 $fReadRec1 $fShowRec1 $fFunctorRec1 $fGenericRec1$fGeneric1kRec1$fEqK1$fOrdK1$fReadK1$fShowK1 $fFunctorK1 $fGenericK1 $fGeneric1kK1$fEq:+:$fOrd:+: $fRead:+: $fShow:+: $fFunctor:+: $fGeneric:+:$fGeneric1k:+:$fEq:*:$fOrd:*: $fRead:*: $fShow:*: $fFunctor:*: $fGeneric:*:$fGeneric1k:*:$fEq:.:$fOrd:.: $fRead:.: $fShow:.: $fFunctor:.: $fGeneric:.:$fGeneric1k:.:$fEqURec $fOrdURec $fShowURec $fFunctorURec $fGenericURec$fGeneric1kURec $fEqURec0 $fOrdURec0 $fShowURec0$fFunctorURec0$fGenericURec0$fGeneric1kURec0 $fEqURec1 $fOrdURec1 $fShowURec1$fFunctorURec1$fGenericURec1$fGeneric1kURec1 $fEqURec2 $fOrdURec2 $fShowURec2$fFunctorURec2$fGenericURec2$fGeneric1kURec2 $fEqURec3 $fOrdURec3 $fShowURec3$fFunctorURec3$fGenericURec3$fGeneric1kURec3 $fEqURec4 $fOrdURec4$fFunctorURec4$fGenericURec4$fGeneric1kURec4 $fEqFixity $fShowFixity $fOrdFixity $fReadFixity$fGenericFixity$fEqAssociativity$fShowAssociativity$fOrdAssociativity$fReadAssociativity$fEnumAssociativity$fBoundedAssociativity$fIxAssociativity$fGenericAssociativity$fEqSourceUnpackedness$fShowSourceUnpackedness$fOrdSourceUnpackedness$fReadSourceUnpackedness$fEnumSourceUnpackedness$fBoundedSourceUnpackedness$fIxSourceUnpackedness$fGenericSourceUnpackedness$fEqSourceStrictness$fShowSourceStrictness$fOrdSourceStrictness$fReadSourceStrictness$fEnumSourceStrictness$fBoundedSourceStrictness$fIxSourceStrictness$fGenericSourceStrictness$fEqDecidedStrictness$fShowDecidedStrictness$fOrdDecidedStrictness$fReadDecidedStrictness$fEnumDecidedStrictness$fBoundedDecidedStrictness$fIxDecidedStrictness$fGenericDecidedStrictness$fGeneric1TYPEDown$fGeneric1TYPETuple15$fGeneric1TYPETuple14$fGeneric1TYPETuple13$fGeneric1TYPETuple12$fGeneric1TYPETuple11$fGeneric1TYPETuple10$fGeneric1TYPETuple9$fGeneric1TYPETuple8$fGeneric1TYPETuple7$fGeneric1TYPETuple6$fGeneric1TYPETuple5$fGeneric1TYPETuple4$fGeneric1TYPETuple3$fGeneric1TYPETuple2$fGeneric1TYPESolo$fGeneric1kProxy$fGeneric1TYPEEither$fGeneric1TYPEMaybe$fGeneric1TYPENonEmpty$fGeneric1TYPEList$fGenericFingerprint$fGenericGeneralCategory$fGenericSrcLoc $fGenericDown$fGenericTuple15$fGenericTuple14$fGenericTuple13$fGenericTuple12$fGenericTuple11$fGenericTuple10$fGenericTuple9$fGenericTuple8$fGenericTuple7$fGenericTuple6$fGenericTuple5$fGenericTuple4$fGenericTuple3$fGenericTuple2 $fGenericSolo $fGenericUnit$fGenericProxy$fGenericOrdering $fGenericBool$fGenericEither$fGenericMaybe$fGenericNonEmpty $fGenericList $fGenericVoid $fMonoid:.:$fSemigroup:.: $fMonoidM1 $fSemigroupM1 $fMonadPlusM1 $fMonadM1$fAlternativeM1$fApplicativeM1 $fMonoidK1 $fSemigroupK1 $fMonoidRec1$fSemigroupRec1$fMonadPlusRec1$fAlternativeRec1$fApplicativeRec1 $fMonoidPar1$fSemigroupPar1$fReadU1AltgetAlt getProductgetSumgetAnyAllgetAllEndoappEndoDualgetDual stimesMonoidApgetApgetLastgetFirst $fMonoidFirst$fSemigroupFirst $fMonoidLast$fSemigroupLast$fNumAp $fBoundedAp $fMonoidAp $fSemigroupAp$fAlternativeAp$fApplicativeAp$fEnumAp$fEqAp $fFunctorAp $fGenericAp $fGeneric1kAp $fMonadAp $fMonadFailAp $fMonadPlusAp$fOrdAp$fReadAp$fShowAp$fEqLast $fOrdLast $fReadLast $fShowLast $fGenericLast$fGeneric1TYPELast $fFunctorLast$fApplicativeLast $fMonadLast $fEqFirst $fOrdFirst $fReadFirst $fShowFirst$fGenericFirst$fGeneric1TYPEFirst$fFunctorFirst$fApplicativeFirst $fMonadFirstfoldfoldMap'foldrMfoldlMasummsumfind $fFoldableU1 $fFoldableAp $fFoldableAlt$fFoldableLast$fFoldableFirst$fFoldableProduct $fFoldableSum$fFoldableDual$fFoldableProxy$fFoldableArray$fFoldableTuple2$fFoldableEither$fFoldableNonEmpty$fFoldableList$fFoldableMaybe$fFoldableDown$fFoldableURec$fFoldableURec0$fFoldableURec1$fFoldableURec2$fFoldableURec3$fFoldableURec4 $fFoldable:.: $fFoldable:*: $fFoldable:+: $fFoldableM1 $fFoldableK1$fFoldableRec1$fFoldablePar1 $fFoldableV1$fFoldableSoloConstgetConst$fApplicativeConst$fFunctorConst$fFoldableConst $fShowConst $fReadConst $fBitsConst$fBoundedConst $fEnumConst $fEqConst$fFiniteBitsConst$fFloatingConst$fFractionalConst$fGenericConst$fGeneric1kConst$fIntegralConst $fIxConst$fSemigroupConst $fMonoidConst $fNumConst $fOrdConst $fRealConst$fRealFracConst$fRealFloatConst$fStorableConst dropWhileEnd stripPrefix elemIndex elemIndices findIndex findIndices isPrefixOf isSuffixOf isInfixOfnubnubBydeletedeleteBy\\unionunionBy intersect intersectBy intersperse intercalate partition mapAccumL mapAccumRinsertinsertByzip4zip5zip6zip7zipWith4zipWith5zipWith6zipWith7unzip4unzip5unzip6unzip7deleteFirstsByinitstails subsequences permutationssort singletonlinesunlineswordsunwordsLifetimeOneShot MultiShotEventevtReadevtWriteKindRepTypeLitCon'ConAppFun modulePackage tyConPackage tyConModule tyConNametyConFingerprint tyConKindArgs tyConKindRep rnfModulernfTyContypeRepFingerprint trLiftedRep withTypeablesomeTypeRepTyCon typeRepTyCon eqTypeRep decTypeRep typeRepKindtypeReptypeOf someTypeRepsomeTypeRepFingerprint splitApps rnfTypeReprnfSomeTypeRepmkTyCon showsTypeRepcasteqTdecTheqThdecTgcastgcast1gcast2 funResultTymkFunTy splitTyConApp typeRepArgstypeOf1typeOf2typeOf3typeOf4typeOf5typeOf6typeOf7ArithExceptionLossOfPrecision DivideByZeroDenormalRatioZeroDenominator toException fromExceptiondisplayException$fExceptionSomeException$fExceptionVoid$fShowSomeException$fShowArithException$fExceptionArithException$fEqArithException$fOrdArithException ErrorCallErrorCallWithLocation showCCSStack prettySrcLocprettyCallStackprettyCallStackLines$fShowErrorCall$fExceptionErrorCall $fEqErrorCall$fOrdErrorCallunsupportedOperation userError MaskingStateUnmaskedMaskedInterruptibleMaskedUninterruptibleFilePathioToST unsafeIOToST unsafeSTToIOcatchExceptioncatchAny unsafeUnmask interruptiblegetMaskingState onExceptionmask_uninterruptibleMask_uninterruptibleMaskfinallyevaluate$fEqMaskingState$fShowMaskingStateIORefnewIORef readIORef writeIORefatomicModifyIORef2LazyatomicModifyIORef2atomicModifyIORefPatomicModifyIORefLazy_atomicModifyIORef'_atomicSwapIORefatomicModifyIORef' $fEqIORefFinalizerEnvPtr FinalizerPtrForeignPtrContentsPlainForeignPtrFinalPtr MallocPtrPlainPtr Finalizers NoFinalizers CFinalizersHaskellFinalizersnewConcForeignPtrmallocForeignPtrmallocForeignPtrBytesmallocForeignPtrAlignedBytesmallocPlainForeignPtrmallocPlainForeignPtrBytes!mallocPlainForeignPtrAlignedBytesaddForeignPtrFinalizerEnvaddForeignPtrConcFinalizernewForeignPtr_unsafeWithForeignPtrunsafeForeignPtrToPtrcastForeignPtrplusForeignPtrfinalizeForeignPtr$fShowForeignPtr$fOrdForeignPtr$fEqForeignPtrnewForeignPtrEnvmallocForeignPtrArraymallocForeignPtrArray0 BufferState ReadBuffer WriteBuffer CharBufferBufferbufRbufL bufOffsetbufSizebufStatebufRaw RawCharBuffer CharBufElem RawBuffer readWord8Buf writeWord8Buf peekCharBuf readCharBuf writeCharBufreadCharBufPtrwriteCharBufPtrcharSize withBuffer withRawBuffer isEmptyBuffer isFullBufferisFullCharBuffer isWriteBuffer bufferElemsbufferAvailable bufferRemove bufferAdjustL bufferAdd bufferOffsetbufferAdjustOffsetbufferAddOffset emptyBuffer newByteBuffer newCharBuffer newBuffer slideContents summaryBuffer checkBuffer$fEqBufferStateCodingProgressInputUnderflowOutputUnderflowInvalidSequence mkTextEncoder mkTextDecodertextEncodingName TextEncoder TextDecoderEncodingBuffer#DecodingBuffer# EncodeBuffer# DecodeBuffer# EncodeBuffer DecodeBuffer CodeBuffer BufferCodec BufferCodec# setState# getState#close#recover#encode#encoderecoverclosegetStatesetState$fShowTextEncoding$fEqCodingProgress$fShowCodingProgressgetLocaleEncodinggetFileSystemEncodinggetForeignEncodingSeekMode AbsoluteSeek RelativeSeek SeekFromEnd IODeviceType DirectoryStream RegularFile RawDeviceready isTerminal isSeekableseektellgetSizesetSizesetEchogetEchosetRawdevTypedupdup2RawIOreadNonBlockingwritewriteNonBlocking $fEqSeekMode $fOrdSeekMode $fIxSeekMode$fEnumSeekMode$fReadSeekMode$fShowSeekMode$fEqIODeviceType BufferedIOfillReadBufferfillReadBuffer0emptyWriteBufferflushWriteBufferflushWriteBuffer0readBufreadBufNonBlockingwriteBufwriteBufNonBlocking NewlineModeoutputNLinputNLNewlineLFCRLF BufferMode NoBuffering LineBufferingBlockBuffering HandleType ClosedHandleSemiClosedHandle ReadHandle WriteHandle AppendHandleReadWriteHandle BufferList BufferListNilBufferListConsHandle__ haOtherSide haOutputNL haInputNLhaCodec haDecoder haEncoder haBuffers haCharBuffer haLastDecode haBufferMode haByteBufferhaTypehaDevice FileHandle DuplexHandleisReadableHandleTypeisWritableHandleTypeisReadWriteHandleTypeisAppendHandleTypecheckHandleInvariants nativeNewlineuniversalNewlineModenativeNewlineModenoNewlineTranslation showHandle$fShowHandleType $fShowHandle $fEqHandle$fEqNewlineMode$fOrdNewlineMode$fReadNewlineMode$fShowNewlineMode $fEqNewline $fOrdNewline $fReadNewline $fShowNewline$fEqBufferMode$fOrdBufferMode$fReadBufferMode$fShowBufferModeutf8DecodeCharAddr#utf8DecodeCharPtrutf8DecodeCharByteArray#utf8DecodeForeignPtrutf8DecodeByteArray#utf8CompareByteArray#utf8CountCharsByteArray# utf8EncodePtrutf8EncodeByteArray#utf8EncodedLengthIOArray newIOArrayunsafeReadIOArrayunsafeWriteIOArray readIOArray writeIOArray boundsIOArray $fEqIOArray TimeoutKeyTK TimeoutEditTimeoutCallback TimeoutQueue$fEqTimeoutKey$fOrdTimeoutKey IOErrorType AlreadyExists NoSuchThing ResourceBusyResourceExhaustedIllegalOperationPermissionDenied UserErrorUnsatisfiedConstraints SystemError ProtocolError OtherErrorInvalidArgumentInappropriateType HardwareFaultUnsupportedOperation TimeExpiredResourceVanished Interrupted ioe_filename ioe_errnoioe_description ioe_locationioe_type ioe_handleExitCode ExitSuccess ExitFailureFixIOExceptionArrayExceptionIndexOutOfBoundsUndefinedElementAsyncException StackOverflow HeapOverflow ThreadKilled UserInterruptSomeAsyncExceptionCompactionFailedAllocationLimitExceededDeadlockBlockedIndefinitelyOnSTMblockedIndefinitelyOnMVarblockedIndefinitelyOnSTMallocationLimitExceededcannotCompactFunctioncannotCompactPinnedcannotCompactMutableasyncExceptionToExceptionasyncExceptionFromException stackOverflow heapOverflow ioExceptionioErroruntangle$fShowBlockedIndefinitelyOnMVar$$fExceptionBlockedIndefinitelyOnMVar$fShowBlockedIndefinitelyOnSTM#$fExceptionBlockedIndefinitelyOnSTM$fShowDeadlock$fExceptionDeadlock$fShowAllocationLimitExceeded"$fExceptionAllocationLimitExceeded$fShowCompactionFailed$fExceptionCompactionFailed$fShowAssertionFailed$fExceptionAssertionFailed$fExceptionSomeAsyncException$fShowSomeAsyncException$fShowAsyncException$fExceptionAsyncException$fShowArrayException$fExceptionArrayException$fShowFixIOException$fExceptionFixIOException$fExceptionExitCode$fShowIOErrorType$fEqIOErrorType$fShowIOException$fEqIOException$fExceptionIOException $fEqExitCode $fOrdExitCode$fReadExitCode$fShowExitCode$fGenericExitCode$fEqArrayException$fOrdArrayException$fEqAsyncException$fOrdAsyncExceptioncalloc mallocBytes callocBytes allocaBytesallocaBytesAlignedrealloc reallocBytesfromBooltoBoolmaybeNew maybeWith maybePeekwithMany copyBytes moveBytes fillBytes callocArray callocArray0 allocaArray allocaArray0 reallocArray reallocArray0 peekArray peekArray0 pokeArray pokeArray0newArray newArray0 withArray withArrayLen withArray0 withArrayLen0 copyArray moveArray lengthArray0 advancePtrthrowIfthrowIf_ throwIfNeg throwIfNeg_ throwIfNull CStringLen peekCStringpeekCStringLen newCString newCStringLen withCStringwithCStringLennewCStringLen0withCStringLen0withCStringsLencharIsRepresentable CWStringLenCWStringcastCCharToCharcastCharToCCharcastCUCharToCharcastCharToCUCharcastCSCharToCharcastCharToCSChar peekCAStringpeekCAStringLen newCAStringnewCAStringLen withCAStringwithCAStringLen peekCWStringpeekCWStringLen newCWStringnewCWStringLen withCWStringwithCWStringLenErrnoeOKe2BIGeACCES eADDRINUSE eADDRNOTAVAILeADV eAFNOSUPPORTeAGAINeALREADYeBADFeBADMSGeBADRPCeBUSYeCHILDeCOMM eCONNABORTED eCONNREFUSED eCONNRESETeDEADLK eDESTADDRREQeDIRTYeDOMeDQUOTeEXISTeFAULTeFBIGeFTYPE eHOSTDOWN eHOSTUNREACHeIDRMeILSEQ eINPROGRESSeINTReINVALeIOeISCONNeISDIReLOOPeMFILEeMLINKeMSGSIZE eMULTIHOP eNAMETOOLONGeNETDOWN eNETRESET eNETUNREACHeNFILEeNOBUFSeNODATAeNODEVeNOENTeNOEXECeNOLCKeNOLINKeNOMEMeNOMSGeNONET eNOPROTOOPTeNOSPCeNOSReNOSTReNOSYSeNOTBLKeNOTCONNeNOTDIR eNOTEMPTYeNOTSOCKeNOTSUPeNOTTYeNXIO eOPNOTSUPPePERM ePFNOSUPPORTePIPEePROCLIM ePROCUNAVAIL ePROGMISMATCH ePROGUNAVAILePROTOePROTONOSUPPORT ePROTOTYPEeRANGEeREMCHGeREMOTEeROFS eRPCMISMATCHeRREMOTE eSHUTDOWNeSOCKTNOSUPPORTeSPIPEeSRCHeSRMNTeSTALEeTIME eTIMEDOUT eTOOMANYREFSeTXTBSYeUSERS eWOULDBLOCKeXDEV isValidErrnogetErrno resetErrno throwErrno throwErrnoIf throwErrnoIf_throwErrnoIfRetrythrowErrnoIfRetryMayBlockthrowErrnoIfRetry_throwErrnoIfRetryMayBlock_throwErrnoIfMinus1throwErrnoIfMinus1_throwErrnoIfMinus1RetrythrowErrnoIfMinus1Retry_throwErrnoIfMinus1RetryMayBlock throwErrnoIfMinus1RetryMayBlock_throwErrnoIfNullthrowErrnoIfNullRetrythrowErrnoIfNullRetryMayBlockthrowErrnoPaththrowErrnoPathIfthrowErrnoPathIf_throwErrnoPathIfNullthrowErrnoPathIfMinus1throwErrnoPathIfMinus1_errnoToIOError $fEqErrnoCodingFailureModeErrorOnCodingFailureIgnoreCodingFailureTransliterateCodingFailureRoundtripFailurecodingFailureModeSuffix isSurrogaterecoverDecode# recoverDecoderecoverEncode# recoverEncode$fShowCodingFailureModemkUTF8utf8_bom mkUTF8_bomutf32mkUTF32 utf32_encode utf32_decodeutf32be mkUTF32beutf32le mkUTF32leutf32be_decodeutf32le_decodeutf32be_encodeutf32le_encodeutf16mkUTF16 utf16_encode utf16_decodeutf16be mkUTF16beutf16le mkUTF16leutf16be_decodeutf16le_decodeutf16be_encodeutf16le_encodelatin1mkLatin1latin1_checkedmkLatin1_checkedasciimkAscii latin1_decode ascii_decode latin1_encodelatin1_checked_encode ascii_encodePoolnewPoolfreePoolwithPool pooledMallocpooledMallocBytes pooledReallocpooledReallocBytespooledMallocArraypooledMallocArray0pooledReallocArraypooledReallocArray0 pooledNewpooledNewArraypooledNewArray0LimitProcessGroupID FileOffset ProcessIDFileModeFileIDDeviceID EpochTime ClockTick ByteCountGroupIDUserID LinkCountFdCNfdsCSocklenCTimerCKeyCId CFsFilCnt CFsBlkCntCClockIdCBlkCntCBlkSizeCRLimCTcflagCSpeedCCcCUidCNlinkCGidCSsizeCPidCOffCModeCInoCDev$fReadFd$fShowFd$fEqFd$fOrdFd$fNumFd$fEnumFd $fStorableFd$fRealFd $fBoundedFd $fIntegralFd$fBitsFd$fFiniteBitsFd$fIxFd $fReadCNfds $fShowCNfds $fEqCNfds $fOrdCNfds $fNumCNfds $fEnumCNfds$fStorableCNfds $fRealCNfds$fBoundedCNfds$fIntegralCNfds $fBitsCNfds$fFiniteBitsCNfds $fIxCNfds$fReadCSocklen$fShowCSocklen $fEqCSocklen $fOrdCSocklen $fNumCSocklen$fEnumCSocklen$fStorableCSocklen$fRealCSocklen$fBoundedCSocklen$fIntegralCSocklen$fBitsCSocklen$fFiniteBitsCSocklen $fIxCSocklen $fShowCTimer $fEqCTimer $fOrdCTimer$fStorableCTimer $fReadCKey $fShowCKey$fEqCKey $fOrdCKey $fNumCKey $fEnumCKey$fStorableCKey $fRealCKey $fBoundedCKey$fIntegralCKey $fBitsCKey$fFiniteBitsCKey$fIxCKey $fReadCId $fShowCId$fEqCId$fOrdCId$fNumCId $fEnumCId $fStorableCId $fRealCId $fBoundedCId $fIntegralCId $fBitsCId$fFiniteBitsCId$fIxCId$fReadCFsFilCnt$fShowCFsFilCnt $fEqCFsFilCnt$fOrdCFsFilCnt$fNumCFsFilCnt$fEnumCFsFilCnt$fStorableCFsFilCnt$fRealCFsFilCnt$fBoundedCFsFilCnt$fIntegralCFsFilCnt$fBitsCFsFilCnt$fFiniteBitsCFsFilCnt $fIxCFsFilCnt$fReadCFsBlkCnt$fShowCFsBlkCnt $fEqCFsBlkCnt$fOrdCFsBlkCnt$fNumCFsBlkCnt$fEnumCFsBlkCnt$fStorableCFsBlkCnt$fRealCFsBlkCnt$fBoundedCFsBlkCnt$fIntegralCFsBlkCnt$fBitsCFsBlkCnt$fFiniteBitsCFsBlkCnt $fIxCFsBlkCnt$fReadCClockId$fShowCClockId $fEqCClockId $fOrdCClockId $fNumCClockId$fEnumCClockId$fStorableCClockId$fRealCClockId$fBoundedCClockId$fIntegralCClockId$fBitsCClockId$fFiniteBitsCClockId $fIxCClockId $fReadCBlkCnt $fShowCBlkCnt $fEqCBlkCnt $fOrdCBlkCnt $fNumCBlkCnt $fEnumCBlkCnt$fStorableCBlkCnt $fRealCBlkCnt$fBoundedCBlkCnt$fIntegralCBlkCnt $fBitsCBlkCnt$fFiniteBitsCBlkCnt $fIxCBlkCnt$fReadCBlkSize$fShowCBlkSize $fEqCBlkSize $fOrdCBlkSize $fNumCBlkSize$fEnumCBlkSize$fStorableCBlkSize$fRealCBlkSize$fBoundedCBlkSize$fIntegralCBlkSize$fBitsCBlkSize$fFiniteBitsCBlkSize $fIxCBlkSize $fReadCRLim $fShowCRLim $fEqCRLim $fOrdCRLim $fNumCRLim $fEnumCRLim$fStorableCRLim $fRealCRLim$fBoundedCRLim$fIntegralCRLim $fBitsCRLim$fFiniteBitsCRLim $fIxCRLim $fReadCTcflag $fShowCTcflag $fEqCTcflag $fOrdCTcflag $fNumCTcflag $fEnumCTcflag$fStorableCTcflag $fRealCTcflag$fBoundedCTcflag$fIntegralCTcflag $fBitsCTcflag$fFiniteBitsCTcflag $fIxCTcflag $fReadCSpeed $fShowCSpeed $fEqCSpeed $fOrdCSpeed $fNumCSpeed $fEnumCSpeed$fStorableCSpeed $fRealCSpeed $fReadCCc $fShowCCc$fEqCCc$fOrdCCc$fNumCCc $fEnumCCc $fStorableCCc $fRealCCc $fReadCUid $fShowCUid$fEqCUid $fOrdCUid $fNumCUid $fEnumCUid$fStorableCUid $fRealCUid $fBoundedCUid$fIntegralCUid $fBitsCUid$fFiniteBitsCUid$fIxCUid $fReadCNlink $fShowCNlink $fEqCNlink $fOrdCNlink $fNumCNlink $fEnumCNlink$fStorableCNlink $fRealCNlink$fBoundedCNlink$fIntegralCNlink $fBitsCNlink$fFiniteBitsCNlink $fIxCNlink $fReadCGid $fShowCGid$fEqCGid $fOrdCGid $fNumCGid $fEnumCGid$fStorableCGid $fRealCGid $fBoundedCGid$fIntegralCGid $fBitsCGid$fFiniteBitsCGid$fIxCGid $fReadCSsize $fShowCSsize $fEqCSsize $fOrdCSsize $fNumCSsize $fEnumCSsize$fStorableCSsize $fRealCSsize$fBoundedCSsize$fIntegralCSsize $fBitsCSsize$fFiniteBitsCSsize $fIxCSsize $fReadCPid $fShowCPid$fEqCPid $fOrdCPid $fNumCPid $fEnumCPid$fStorableCPid $fRealCPid $fBoundedCPid$fIntegralCPid $fBitsCPid$fFiniteBitsCPid$fIxCPid $fReadCOff $fShowCOff$fEqCOff $fOrdCOff $fNumCOff $fEnumCOff$fStorableCOff $fRealCOff $fBoundedCOff$fIntegralCOff $fBitsCOff$fFiniteBitsCOff$fIxCOff $fReadCMode $fShowCMode $fEqCMode $fOrdCMode $fNumCMode $fEnumCMode$fStorableCMode $fRealCMode$fBoundedCMode$fIntegralCMode $fBitsCMode$fFiniteBitsCMode $fIxCMode $fReadCIno $fShowCIno$fEqCIno $fOrdCIno $fNumCIno $fEnumCIno$fStorableCIno $fRealCIno $fBoundedCIno$fIntegralCIno $fBitsCIno$fFiniteBitsCIno$fIxCIno $fReadCDev $fShowCDev$fEqCDev $fOrdCDev $fNumCDev $fEnumCDev$fStorableCDev $fRealCDev $fBoundedCDev$fIntegralCDev $fBitsCDev$fFiniteBitsCDev$fIxCDev CFilePathFDCUtsnameCUtimbufCTmsCTmCTermiosCStatCSigset CSigactionCPasswdCLconvCGroupCFLocksEEK_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_waitpid c_tcsetattr c_tcgetattr c_sigprocmask c_sigaddset c_sigemptysetc_mkfifoc_linkc_fork c_fcntl_lock c_fcntl_write c_fcntl_read c_ftruncatec_statc_getpidc_utimec_unlinkc_isattyc_dup2c_dupc_creatc_closec_chmodc_accessc_lseekc_pipe c_safe_writec_writec_umask c_safe_readc_readlstatc_fstat c_safe_open_rtsIsThreaded_c_interruptible_open_c_openset_saved_termiosget_saved_termiosputs fdFileSizefileTypefdStatfdType statGetTypeioe_unknownfiletype fdGetMode withFilePath newFilePath peekFilePathpeekFilePathLencheckForInteriorNulsthrowInternalNulError setCooked tcSetAttrsetNonBlockingFDsetCloseOnExecc_interruptible_open c_safe_openhostIsThreadeds_isregs_ischrs_isblks_isdirs_isfifos_issockRTSFlagsparFlags tickyFlags traceFlagsprofilingFlagscostCentreFlags debugFlags miscFlagsconcurrentFlagsgcFlagsParFlags setAffinity parGcThreadsparGcNoSyncWithIdleparGcLoadBalancingGenparGcLoadBalancingEnabledparGcGen parGcEnabledmaxLocalSparksmigrate nCapabilities TickyFlags tickyFileshowTickyStats TraceFlagsuser sparksFull sparksSampledtraceNonmovingGctraceGctraceScheduler timestamptracingDoTrace TraceNone TraceEventLog TraceStderr ProfFlags bioSelectorretainerSelector ccsSelector ccSelector typeSelector descrSelector modSelector ccsLengthmaxRetainerSetSizeshowCCSOnExceptionstartHeapProfileAtStartupheapProfileIntervalTicksheapProfileInterval doHeapProfile DoHeapProfileNoHeapProfiling HeapByCCS HeapByMod HeapByDescr HeapByTypeHeapByRetainer HeapByLDVHeapByClosureTypeHeapByInfoTableCCFlags msecsPerTick profilerTicks doCostCentres DoCostCentresCostCentresNoneCostCentresSummaryCostCentresVerboseCostCentresAllCostCentresJSON DebugFlagssparkshpcsqueezestmlinkerprofstablesanity block_alloc nonmoving_gcgcgccafsweak interpreter scheduler MiscFlagsnumIoWorkerThreads ioManager linkerMemBaselinkerAlwaysPicinternalCountersdisableDelayedOsMemoryReturnmachineReadablegenerateStackTracegenerateCrashDumpFileinstallSEHHandlersinstallSignalHandlers tickInterval ConcFlagsctxtSwitchTicksctxtSwitchTimeGCFlagsnumaMasknumaallocLimitGraceheapBasedoIdleGCidleGCDelayTimeringBellsweepcompactThresholdsqueezeUpdFrames generations pcFreeHeapreturnDecayFactor oldGenFactorheapSizeSuggestionAutoheapSizeSuggestion minOldGenSizenurseryChunkSize largeAllocLimminAllocAreaSize maxHeapSizestkChunkBufferSize stkChunkSizeinitialStkSize maxStkSize giveStats statsFile IoSubSystemIoPOSIXIoNative GiveGCStats NoGCStatsCollectGCStatsOneLineGCStatsSummaryGCStatsVerboseGCStatsRtsTime getRTSFlags getGCFlags getParFlags getConcFlags getMiscFlagsgetIoManagerFlag getDebugFlags getCCFlags getProfFlags getTraceFlags getTickyFlags$fEnumGiveGCStats$fStorableIoSubSystem$fEnumIoSubSystem$fEnumDoCostCentres$fEnumDoHeapProfile $fEnumDoTrace$fShowRTSFlags$fGenericRTSFlags$fShowParFlags$fGenericParFlags$fShowTickyFlags$fGenericTickyFlags$fShowTraceFlags$fGenericTraceFlags $fShowDoTrace$fGenericDoTrace$fShowProfFlags$fGenericProfFlags$fShowDoHeapProfile$fGenericDoHeapProfile $fShowCCFlags$fGenericCCFlags$fShowDoCostCentres$fGenericDoCostCentres$fShowDebugFlags$fGenericDebugFlags$fShowMiscFlags$fGenericMiscFlags$fShowConcFlags$fGenericConcFlags $fShowGCFlags$fGenericGCFlags$fEqIoSubSystem$fShowIoSubSystem$fShowGiveGCStats$fGenericGiveGCStats conditionalisWindowsNativeIO ioSubSystemwithIoSubSystemwithIoSubSystem'whenIoSubSystemrunFinalizerBatchgetFinalizerExceptionHandlersetFinalizerExceptionHandler&printToHandleFinalizerExceptionHandlerWeakmkWeak deRefWeakfinalize mkWeakIORef modifyIORef modifyIORef'LockMode SharedLock ExclusiveLockFileLockingNotSupportedPrimMVarreportHeapOverflow fromThreadIdgetAllocationCounterdisableAllocationLimitforkOnforkOnWithUnmasknumCapabilitiesgetNumCapabilitiessetNumCapabilitiesgetNumProcessors numSparks childHandleryield labelThreadpseqpar runSparks listThreadsthreadCapability threadLabelmkWeakThreadIdnewStablePtrPrimMVar unsafeIOToSTMretryorElsethrowSTMcatchSTMnewTVar newTVarIO readTVarIOreadTVar writeTVarwithMVar modifyMVar_reportStackOverflow reportErrorsetUncaughtExceptionHandlergetUncaughtExceptionHandler $fOrdThreadId $fEqThreadId$fShowThreadId$fMonadPlusSTM$fAlternativeSTM $fMonoidSTM$fSemigroupSTM $fMonadSTM$fApplicativeSTM $fFunctorSTM$fEqTVar$fEqThreadStatus$fOrdThreadStatus$fShowThreadStatus$fEqBlockReason$fOrdBlockReason$fShowBlockReasonNoMatchingContinuationPromptNestedAtomicallyNonTermination NoMethodError RecUpdError RecConError RecSelErrorPatternMatchFail catchJusthandle handleJust mapExceptiontryJustbracket_bracketOnErrornonTerminationnestedAtomicallynoMatchingContinuationPrompt$fExceptionPatternMatchFail$fShowPatternMatchFail$fExceptionRecSelError$fShowRecSelError$fExceptionRecConError$fShowRecConError$fExceptionRecUpdError$fShowRecUpdError$fExceptionNoMethodError$fShowNoMethodError$fExceptionTypeError$fShowTypeError$fExceptionNonTermination$fShowNonTermination$fExceptionNestedAtomically$fShowNestedAtomically'$fExceptionNoMatchingContinuationPrompt"$fShowNoMatchingContinuationPromptHandlercatchesallowInterrupt$fFunctorHandler unsafeFixIOlocaleEncodingName iconvEncodingmkIconvEncodingsetFileSystemEncodingsetForeignEncodinginitLocaleEncoding argvEncodingchar8 CostCentreCostCentreStack getCurrentCCSgetCCSOfclearCCSccsCC ccsParentccLabelccModule ccSrcSpan ccsToStrings whoCreated renderStack tryIOError mkIOErrorisAlreadyExistsError isUserErrorisResourceVanishedErroralreadyExistsErrorTypedoesNotExistErrorTypealreadyInUseErrorType fullErrorType eofErrorTypeillegalOperationErrorTypepermissionErrorType userErrorTyperesourceVanishedErrorTypeisAlreadyExistsErrorTypeisDoesNotExistErrorTypeisAlreadyInUseErrorTypeisFullErrorTypeisEOFErrorTypeisIllegalOperationErrorTypeisPermissionErrorTypeisUserErrorTypeisResourceVanishedErrorTypeioeGetErrorTypeioeGetErrorStringioeGetLocation ioeGetHandleioeGetFileNameioeSetErrorTypeioeSetErrorStringioeSetLocation ioeSetHandleioeSetFileName modifyIOErrorannotateIOError catchIOErrorswapMVarwithMVarMasked modifyMVarmodifyMVarMasked_modifyMVarMasked mkWeakMVarfixSTHandleFinalizeraddHandleFinalizer withHandle withHandle' withHandle_ withHandle_'withAllHandles__ withHandle__'augmentIOErrorwantWritableHandlewantReadableHandlewantReadableHandle_wantSeekableHandleioe_closedHandleioe_semiclosedHandleioe_EOFioe_notReadableioe_notWritableioe_finalizedHandle ioe_bufsizhandleFinalizerdEFAULT_CHAR_BUFFER_SIZE flushBufferflushCharBufferflushByteWriteBufferwriteCharBufferflushCharReadBufferflushByteReadBuffermkHandlemkFileHandleNoFinalizermkDuplexHandleNoFinalizermkDuplexHandleinitBufferStateopenTextEncodingcloseTextCodecs hClose_impl hClose_help hLookAhead_debugIOtraceIOreadTextDevicereadTextDeviceNonBlocking decodeByteBufmemcpyhGetCharhGetLine hGetContents'hPutCharhPutStr commitBuffer'hPutBufNonBlocking hGetBufSomehGetBufNonBlockingDynamicfromDyn fromDynamicdynApplydynApp dynTypeRep$fExceptionDynamic $fShowDynamic HandlerFunSignal setHandler runHandlersrunHandlersPtr TimerManagerregisterTimeoutunregisterTimeout updateTimeout EventManager IOCallbackFdKeykeyFd registerFd unregisterFd_ unregisterFdcloseFdgetSystemEventManagergetSystemTimerManagerensureIOManagerIsRunninginterruptIOManagerioManagerCapabilitiesChangedthreadWaitReadthreadWaitWritethreadWaitReadSTMthreadWaitWriteSTM registerDelayfdIsNonBlockingfdFD openFileWithmkFDreleasesetNonBlockingModereadRawBufferPtrreadRawBufferPtrNoBlockwriteRawBufferPtr$fBufferedIOFD $fIODeviceFD $fRawIOFD$fShowFDwithFileopenFileBlockingwithFileBlockingopenBinaryFilewithBinaryFile fdToHandle' fdToHandle handleToFdhLockhTryLockhUnlockHandlePosition HandlePosn hFileSize hSetFileSizehIsEOFisEOF hSetBuffering hSetEncoding hGetEncoding hFlushAllhGetPosnhSetPosnhTellhIsOpen hIsClosed hIsReadable hIsWritable hGetBuffering hIsSeekablehSetEchohGetEchohIsTerminalDevice hDuplicate hDuplicateTohShow$fShowHandlePosn$fEqHandlePosnputCharputStrgetChar getContents getContents'interactreadFile appendFilereadLnreadIOhReadyhPrint openTempFileopenBinaryTempFile"openTempFileWithDefaultPermissions(openBinaryTempFileWithDefaultPermissions$fMonadFixDown $fMonadFix:*: $fMonadFixM1$fMonadFixRec1$fMonadFixPar1 $fMonadFixAp $fMonadFixAlt$fMonadFixLast$fMonadFixFirst$fMonadFixProduct $fMonadFixSum$fMonadFixDual $fMonadFixST$fMonadFixEither $fMonadFixFUN $fMonadFixIO$fMonadFixNonEmpty$fMonadFixList$fMonadFixMaybe$fMonadFixSoloIdentity runIdentity$fMonadFixIdentity$fMonadIdentity$fApplicativeIdentity$fFunctorIdentity$fFoldableIdentity$fShowIdentity$fReadIdentity$fBitsIdentity$fBoundedIdentity$fEnumIdentity $fEqIdentity$fFiniteBitsIdentity$fFloatingIdentity$fFractionalIdentity$fGenericIdentity$fGeneric1TYPEIdentity$fIntegralIdentity $fIxIdentity$fSemigroupIdentity$fMonoidIdentity $fNumIdentity $fOrdIdentity$fRealIdentity$fRealFracIdentity$fRealFloatIdentity$fStorableIdentity ArrowLoop ArrowMonad ArrowApply ArrowChoiceleftright ArrowPlus<+> ArrowZero zeroArrowKleisli runKleisliArrowsecond&&&returnA^>>>>^<<^^<<leftApp $fArrowFUN$fArrowKleisli$fCategoryTYPEKleisli$fMonadPlusKleisli$fMonadKleisli$fAlternativeKleisli$fApplicativeKleisli$fArrowZeroKleisli$fArrowPlusKleisli$fArrowChoiceKleisli$fArrowChoiceFUN$fArrowApplyKleisli$fArrowApplyFUN$fMonadPlusArrowMonad$fAlternativeArrowMonad$fMonadArrowMonad$fApplicativeArrowMonad$fFunctorArrowMonad$fArrowLoopKleisli$fArrowLoopFUN$fFunctorKleisli$fGeneric1TYPEKleisli$fGenericKleisliZipList getZipList WrappedArrow WrapArrow unwrapArrow WrappedMonad WrapMonad unwrapMonad$fAlternativeWrappedMonad$fApplicativeWrappedMonad$fFunctorWrappedMonad$fAlternativeWrappedArrow$fApplicativeWrappedArrow$fFunctorWrappedArrow$fAlternativeZipList$fApplicativeZipList $fShowZipList $fEqZipList $fOrdZipList $fReadZipList$fFunctorZipList$fFoldableZipList$fGenericZipList$fGeneric1TYPEZipList$fGenericWrappedArrow$fGeneric1TYPEWrappedArrow$fGenericWrappedMonad$fGeneric1TYPEWrappedMonad$fMonadWrappedMonad mapAccumM forAccumM fmapDefaultfoldMapDefault$fTraversableU1$fTraversableZipList$fTraversableAp$fTraversableAlt$fTraversableLast$fTraversableFirst$fTraversableProduct$fTraversableSum$fTraversableDual$fTraversableConst$fTraversableProxy$fTraversableArray$fTraversableTuple2$fTraversableEither$fTraversableNonEmpty$fTraversableList$fTraversableMaybe$fTraversableDown$fTraversableURec$fTraversableURec0$fTraversableURec1$fTraversableURec2$fTraversableURec3$fTraversableURec4$fTraversable:.:$fTraversable:*:$fTraversable:+:$fTraversableM1$fTraversableK1$fTraversableRec1$fTraversablePar1$fTraversableV1$fTraversableIdentity$fTraversableSoloisSubsequenceOf$fIsStringList$fIsStringIdentity$fIsStringConst versionTags versionBranch showVersion parseVersion $fOrdVersion $fEqVersion $fReadVersion $fShowVersion$fGenericVersionfilterM>=><=< mapAndUnzipMzipWithM zipWithM_foldMfoldM_ replicateM replicateM_unless<$!>mfilter fingerprint0fingerprintData getFileHash $fEqByteOrder$fOrdByteOrder$fBoundedByteOrder$fEnumByteOrder$fReadByteOrder$fShowByteOrder$fGenericByteOrderMutableArrayArray# ArrayArray#newArrayArray#unsafeFreezeArrayArray#sizeofArrayArray#sizeofMutableArrayArray#indexByteArrayArray#indexArrayArrayArray#readByteArrayArray#readMutableByteArrayArray#readArrayArrayArray#readMutableArrayArrayArray#writeByteArrayArray#writeMutableByteArrayArray#writeArrayArrayArray#writeMutableArrayArrayArray#copyArrayArray#copyMutableArrayArray#sameArrayArray#sameMutableArrayArray#mkTrApp $fShowFUNperformMinorGCperformMajorGC performGC exitFailure exitSuccessdie StableNamemakeStableNamehashStableName eqStableName$fEqStableNamestopHeapProfTimerstartHeapProfTimerrequestHeapCensusstartProfTimer stopProfTimerIsLabelNoIO$fGHCiSandboxIOIO$fGHCiSandboxIONoIO $fMonadNoIO$fApplicativeNoIO $fFunctorNoIOerrorWithStackTrace popCallStackwithFrozenCallStack unpackCString packCString#unsafeLocalStatecpuTimePrecision getCPUTime InfoProvEntInfoProv ipSrcSpan ipSrcFileipModipLabelipTyDescipDescipNameipLocipeProv peekInfoProv whereFrom $fEqInfoProv$fShowInfoProv mkWeakPtr addFinalizer mkWeakPair spInfoSrcLocspInfoModuleName spInfoUnitIdIsStatic StaticKeydeRefStaticPtr staticKeyunsafeLookupStaticPtr staticPtrInfo staticPtrKeys$fIsStaticStaticPtr$fShowStaticPtrInfo getFullArgsModifierParserFieldFormatter FormatParsefpRestfpChar fpModifiers FieldFormatfmtChar fmtModifiers fmtAlternatefmtSign fmtAdjust fmtPrecisionfmtWidth FormatSignSignPlus SignSpaceFormatAdjustment LeftAdjustZeroPadIsChartoCharfromChar PrintfArg formatArg parseFormat HPrintfType PrintfTypeprintfhPrintfvFmt formatChar formatString formatInt formatIntegerperrorerrorBadFormaterrorShortFormaterrorMissingArgumenterrorBadArgument $fIsCharChar$fPrintfArgDouble$fPrintfArgFloat$fPrintfArgNatural$fPrintfArgInteger$fPrintfArgWord64$fPrintfArgWord32$fPrintfArgWord16$fPrintfArgWord8$fPrintfArgWord$fPrintfArgInt64$fPrintfArgInt32$fPrintfArgInt16$fPrintfArgInt8$fPrintfArgInt$fPrintfArgList$fPrintfArgChar$fHPrintfTypeFUN$fHPrintfTypeIO$fPrintfTypeFUN$fPrintfTypeIO$fPrintfTypeListgetExecutablePathexecutablePath getProgNamewithArgs withProgNamegetEnvironment getEnvDefaultgetArgsWithResponseFiles unescapeArgs escapeArgsexpandResponsedisableBufferingflushAll evalWrapperArgDescrNoArgReqArgOptArgOptDescrOptionArgOrder RequireOrderPermute ReturnInOrder usageInfogetOptgetOpt'$fFunctorArgOrder$fFunctorArgDescr$fFunctorOptDescr traceMarkerIO traceMarker traceEventIO traceEvent traceStack traceShowMtraceM traceShowId traceShowtraceId putTraceMsg traceWith traceShowWithtraceEventWith flushEventLogcompilerVersionfullCompilerVersionosarch compilerNameItem$fIsListCallStack$fIsListVersion$fIsListNonEmpty$fIsListZipList $fIsListListUnique newUnique hashUnique $fEqUnique $fOrdUnique modifySTRef modifySTRef'approxRationalstrictToLazySTlazyToStrictST $fMonadIOIO GCDetails&gcdetails_nonmoving_gc_sync_elapsed_ns"gcdetails_nonmoving_gc_sync_cpu_nsgcdetails_elapsed_nsgcdetails_cpu_nsgcdetails_sync_elapsed_ns#gcdetails_block_fragmentation_bytes#gcdetails_par_balanced_copied_bytesgcdetails_par_max_copied_bytesgcdetails_copied_bytesgcdetails_mem_in_use_bytesgcdetails_slop_bytesgcdetails_compact_bytesgcdetails_large_objects_bytesgcdetails_live_bytesgcdetails_allocated_bytesgcdetails_threads gcdetails_genRTSStatsnonmoving_gc_max_elapsed_nsnonmoving_gc_elapsed_nsnonmoving_gc_cpu_ns nonmoving_gc_sync_max_elapsed_nsnonmoving_gc_sync_elapsed_nsnonmoving_gc_sync_cpu_ns elapsed_nscpu_ns gc_elapsed_ns gc_cpu_nsmutator_elapsed_nsmutator_cpu_nsinit_elapsed_ns init_cpu_ns$cumulative_par_balanced_copied_bytescumulative_par_max_copied_bytespar_copied_bytes copied_bytescumulative_live_bytesmax_mem_in_use_bytesmax_slop_bytesmax_compact_bytesmax_large_objects_bytesmax_live_bytesallocated_bytes major_gcsgcsgetRTSStatsEnabled getRTSStats$fReadRTSStats$fShowRTSStats$fGenericRTSStats$fReadGCDetails$fShowGCDetails$fGenericGCDetails StackTraceLocationsrcLoc functionName objectName sourceColumn sourceLine sourceFile stackDepth stackFramescollectStackTraceinvalidateDebugCacheshowStackFrames getStackTraceshowStackTraceunfoldnonEmpty<|consinits1tails1some1 groupWith groupAllWithgroup1groupBy1 groupWith1 groupAllWith1sortWithappend appendList prependListMonadZipmzipWithmunzip$fMonadZipDown $fMonadZip:*: $fMonadZipM1$fMonadZipRec1$fMonadZipPar1 $fMonadZipU1$fMonadZipProxy $fMonadZipAlt$fMonadZipLast$fMonadZipFirst$fMonadZipMaybe$fMonadZipProduct $fMonadZipSum$fMonadZipDual$fMonadZipSolo$fMonadZipIdentity$fMonadZipNonEmpty$fMonadZipList $fBifunctorK1$fBifunctorConst$fBifunctorEither$fBifunctorTuple7$fBifunctorTuple6$fBifunctorTuple5$fBifunctorTuple4$fBifunctorTuple3$fBifunctorTuple2 Bifoldablebifold bifoldMapbifoldrbifoldlbifoldr'bifoldr1bifoldrMbifoldl'bifoldl1bifoldlM bitraverse_bifor_bimapM_biforM_ bisequenceA_ bisequence_biasumbimsumbiListbinullbilengthbielembiconcat bimaximum biminimumbisum biproduct biconcatMapbiandbiorbianybiall bimaximumBy biminimumBy binotElembifind$fBifoldableEither$fBifoldableTuple7$fBifoldableTuple6$fBifoldableTuple5$fBifoldableTuple4$fBifoldableTuple3$fBifoldableK1$fBifoldableConst$fBifoldableTuple2 Bitraversable bisequenceAbimapMbiforM bimapAccumL bimapAccumR bimapDefaultbifoldMapDefault$fBitraversableK1$fBitraversableConst$fBitraversableEither$fBitraversableTuple7$fBitraversableTuple6$fBitraversableTuple5$fBitraversableTuple4$fBitraversableTuple3$fBitraversableTuple2runIO runIOFastExitrunNonIO topHandlertopHandlerFastExitflushStdHandlesQSemNnewQSemN waitQSemN signalQSemNQSemnewQSemwaitQSem signalQSemnewChan writeChanreadChandupChangetChanContentswriteList2Chan$fEqChanrtsSupportsBoundThreadsforkOSWithUnmaskisCurrentThreadBoundrunInBoundThreadrunInUnboundThreadTimeouttimeout$fExceptionTimeout $fShowTimeout $fEqTimeoutConIndex ConstrRep AlgConstr IntConstr FloatConstr CharConstrDataRepAlgRepCharRepNoRepConstrDataTypegfoldlgunfoldtoConstr dataTypeOf dataCast1 dataCast2gmapTgmapQlgmapQrgmapQgmapQigmapMgmapMpgmapMo fromConstr fromConstrB fromConstrM dataTypeName dataTypeRep constrType constrRep repConstr mkDataType mkConstrTagmkConstrdataTypeConstrs constrFields constrFixity showConstr readConstr isAlgType indexConstr constrIndexmaxConstrIndex mkIntType mkFloatType mkCharTypemkIntegralConstr mkRealConstr mkCharConstr mkNoRepType isNorepType tyconUQname tyconModule $fEqConstr $fShowConstr $fDataArray$fDataForeignPtr $fDataPtr $fDataList $fDataRatio $fDataWord64 $fDataWord32 $fDataWord16 $fDataWord8 $fDataWord $fDataInt64 $fDataInt32 $fDataInt16 $fDataInt8 $fDataNatural $fDataInteger $fDataInt $fDataDouble $fDataFloat $fDataChar$fShowDataType $fEqDataRep $fShowDataRep $fEqConstrRep$fShowConstrRep $fDataDown$fDataDecidedStrictness$fDataSourceStrictness$fDataSourceUnpackedness$fDataAssociativity $fDataFixity $fData:*:$fDataV1 $fData:.: $fData:+:$fDataM1$fDataK1 $fDataRec1 $fDataPar1$fDataU1$fDataAp $fDataAlt $fDataLast $fDataFirst $fDataProduct $fDataSum $fDataAny $fDataAll $fDataDual $fDataVersion $fDataConst$fDataIdentity$fDataCoercion $fData:~~: $fData:~: $fDataProxy $fDataWordPtr $fDataIntPtr$fDataConstPtr $fDataTuple7 $fDataTuple6 $fDataTuple5 $fDataTuple4 $fDataTuple3 $fDataTuple2 $fDataSolo $fDataUnit $fDataVoid $fDataEither$fDataOrdering $fDataMaybe$fDataNonEmpty $fDataZipList$fDataWrappedMonad$fDataWrappedArrow $fDataBoolSpecConstrAnnotation NoSpecConstrForceSpecConstr maxTupleSizetheatomicModifyMutVar#resizeSmallMutableArray#$fDataSpecConstrAnnotation$fEqSpecConstrAnnotation StackEntry closureType StackSnapshot cloneMyStackcloneThreadStackdecode$fShowStackEntry$fEqStackEntryAnnotationWrapper WrappedMonoid WrapMonoid unwrapMonoidArgMaxArgMinArggetMaxgetMincycle1diff mtimesDefault$fNumMin $fMonadFixMin $fMonadMin$fApplicativeMin$fTraversableMin $fFoldableMin $fFunctorMin $fMonoidMin$fSemigroupMin $fEnumMin$fNumMax $fMonadFixMax $fMonadMax$fApplicativeMax$fTraversableMax $fFoldableMax $fFunctorMax $fMonoidMax$fSemigroupMax $fEnumMax$fBitraversableArg$fBifoldableArg$fBifunctorArg$fOrdArg$fEqArg$fTraversableArg $fFoldableArg $fFunctorArg $fEnumFirst $fEnumLast$fEnumWrappedMonoid$fMonoidWrappedMonoid$fSemigroupWrappedMonoid$fBoundedWrappedMonoid$fEqWrappedMonoid$fOrdWrappedMonoid$fShowWrappedMonoid$fReadWrappedMonoid$fDataWrappedMonoid$fGenericWrappedMonoid$fGeneric1TYPEWrappedMonoid $fBoundedLast$fBoundedFirst $fShowArg $fReadArg $fDataArg $fGenericArg$fGeneric1TYPEArg $fBoundedMax$fEqMax$fOrdMax $fShowMax $fReadMax $fDataMax $fGenericMax$fGeneric1TYPEMax $fBoundedMin$fEqMin$fOrdMin $fShowMin $fReadMin $fDataMin $fGenericMin$fGeneric1TYPEMin Bifoldable1bifold1 bifoldMap1$fBifoldable1Const$fBifoldable1Tuple5$fBifoldable1Tuple4$fBifoldable1Tuple3$fBifoldable1Tuple2$fBifoldable1Either$fBifoldable1ArgPicoE12NanoE9MicroE6MilliE3CentiE2DeciE1UniE0 HasResolution resolutionFixedMkFixeddiv'divMod'mod' showFixed $fEnumFixed $fDataFixed $fReadFixed $fShowFixed$fRealFracFixed$fFractionalFixed $fRealFixed $fNumFixed$fHasResolutionNaturaln$fHasResolutionTYPEE0$fHasResolutionTYPEE1$fHasResolutionTYPEE2$fHasResolutionTYPEE3$fHasResolutionTYPEE6$fHasResolutionTYPEE9$fHasResolutionTYPEE12 $fEqFixed $fOrdFixedComplex:+realPartimagPart conjugatemkPolarcispolar magnitudephase$fMonadFixComplex$fMonadZipComplex$fMonadComplex$fApplicativeComplex$fStorableComplex$fFloatingComplex$fFractionalComplex $fNumComplex $fEqComplex $fShowComplex $fReadComplex $fDataComplex$fGenericComplex$fGeneric1TYPEComplex$fFunctorComplex$fFoldableComplex$fTraversableComplexShow2liftShowsPrec2 liftShowList2Read2liftReadsPrec2 liftReadList2 liftReadPrec2liftReadListPrec2Ord2 liftCompare2Eq2liftEq2Show1 liftShowsPrec liftShowListRead1 liftReadsPrec liftReadList liftReadPrecliftReadListPrecOrd1 liftCompareEq1liftEqeq1compare1 readsPrec1 readPrec1liftReadListDefaultliftReadListPrecDefault showsPrec1eq2compare2 readsPrec2 readPrec2liftReadList2DefaultliftReadListPrec2Default showsPrec2 readsDatareadDatareadsUnaryWith readUnaryWithreadsBinaryWithreadBinaryWithshowsUnaryWithshowsBinaryWith readsUnary readsUnary1 readsBinary1 showsUnary showsUnary1 showsBinary1$fRead1Complex $fRead1Down $fRead1Proxy$fRead1Identity $fRead1Solo$fRead1NonEmpty $fRead1List $fRead1Maybe $fEq1Complex $fEq1Down $fEq1Proxy $fEq1Const $fEq2Const $fEq1Identity $fEq1Either $fEq2Either$fEq1Generically1 $fEq1Tuple4 $fEq2Tuple4 $fEq1Tuple3 $fEq2Tuple3 $fEq1Tuple2 $fEq1Solo $fEq2Tuple2 $fEq1NonEmpty $fEq1List $fEq1Maybe $fOrd1Down $fOrd1Proxy $fOrd1Const $fOrd2Const$fOrd1Identity $fOrd1Either $fOrd2Either$fOrd1Generically1 $fOrd1Tuple4 $fOrd2Tuple4 $fOrd1Tuple3 $fOrd2Tuple3 $fOrd1Tuple2 $fOrd1Solo $fOrd2Tuple2$fOrd1NonEmpty $fOrd1List $fOrd1Maybe $fRead1Const $fRead2Const $fRead1Either $fRead2Either $fRead1Tuple4 $fRead2Tuple4 $fRead1Tuple3 $fRead2Tuple3 $fRead1Tuple2 $fRead2Tuple2$fShow1Complex $fShow1Down $fShow1Proxy $fShow1Const $fShow2Const$fShow1Identity $fShow1Either $fShow2Either $fShow1Tuple4 $fShow2Tuple4 $fShow1Tuple3 $fShow2Tuple3 $fShow1Tuple2 $fShow1Solo $fShow2Tuple2$fShow1NonEmpty $fShow1List $fShow1MaybeInLInR $fFunctorSum $fShow1Sum $fRead1Sum $fOrd1Sum$fEq1Sum $fGenericSum$fGeneric1kSum $fShowSum $fReadSum$fOrdSum$fEqSumPair$fMonoidProduct$fSemigroupProduct$fMonadPlusProduct$fMonadProduct$fAlternativeProduct$fApplicativeProduct$fFunctorProduct$fShow1Product$fRead1Product $fOrd1Product $fEq1Product$fGenericProduct$fGeneric1kProduct $fShowProduct $fReadProduct $fOrdProduct $fEqProduct getCompose$fTestEqualitykCompose$fAlternativeCompose$fApplicativeCompose$fTraversableCompose$fFoldableCompose$fFunctorCompose$fShow1Compose$fRead1Compose $fOrd1Compose $fEq1Compose $fShowCompose $fReadCompose $fDataCompose$fGenericCompose$fGeneric1kCompose$fSemigroupCompose$fMonoidCompose$fIntegralCompose $fRealCompose $fNumCompose$fBoundedCompose $fEnumCompose $fOrdCompose $fEqComposeOpgetOp EquivalencegetEquivalence Comparison getComparison Predicate getPredicate Contravariant contramap>$phantom$<>$<>$$<defaultComparisondefaultEquivalencecomparisonEquivalence$fContravariantProxy$fContravariantCompose$fContravariantConst$fContravariantProduct$fContravariantSum$fContravariant:+:$fContravariant:.:$fContravariant:*:$fContravariantK1$fContravariantU1$fContravariantV1$fContravariantComparison$fContravariantEquivalence $fFloatingOp$fFractionalOp$fNumOp$fContravariantOp$fCategoryTYPEOp$fSemigroupPredicate$fMonoidPredicate$fContravariantPredicate $fSemigroupOp $fMonoidOp$fSemigroupEquivalence$fMonoidEquivalence$fSemigroupComparison$fMonoidComparison$fContravariantM1$fContravariantRec1$fContravariantAlt Foldable1fold1foldMap1 foldMap1' toNonEmpty foldrMap1 foldlMap1' foldlMap1 foldrMap1'foldr1' intercalate1foldrM1 foldrMapM1foldlM1 foldlMapM1$fSemigroupNonEmptyDList$fSemigroupFromMaybe$fFoldable1Compose$fFoldable1Sum$fFoldable1Product$fFoldable1Identity$fFoldable1:.:$fFoldable1:*:$fFoldable1:+:$fFoldable1Par1 $fFoldable1V1$fFoldable1Last$fFoldable1First$fFoldable1Max$fFoldable1Min$fFoldable1Product0$fFoldable1Sum0$fFoldable1Dual$fFoldable1Tuple2$fFoldable1Solo$fFoldable1Complex$fFoldable1Down$fFoldable1NonEmpty$fSemigroupJoinWith $fFoldable1M1$fFoldable1Rec1 $fFoldable1Ap$fFoldable1AltMutableByteArray ByteArray$fIsListByteArray$fMonoidByteArray$fSemigroupByteArray$fOrdByteArray $fEqByteArray$fShowByteArray$fDataByteArray$fEqMutableByteArray$fDataMutableByteArrayunpackAppendCStringUtf8#unpackFoldrCStringUtf8# compareInt compareInt# compareWord compareWord#divInt# divInt16# divInt32#divInt8# divModInt# divModInt16# divModInt32# divModInt8#modInt# modInt16# modInt32#modInt8# GHC.Prim.ExtgetThreadAllocationCounter#IPipKindBndrTrName integerAbs integerAdd integerAnd integerBit integerBit# integerCheck integerCheck#integerCompareintegerComplementintegerDecodeDouble# integerDiv integerDivModintegerDivMod#integerEncodeDoubleintegerEncodeDouble#integerEncodeFloat# integerEq integerEq#integerFromAddrintegerFromAddr#integerFromBigNat#integerFromBigNatNeg#integerFromBigNatSign#integerFromByteArrayintegerFromByteArray#integerFromIntintegerFromInt#integerFromInt64#integerFromNaturalintegerFromWordintegerFromWord#integerFromWord64#integerFromWordListintegerFromWordNeg#integerFromWordSign# integerGcd integerGcde integerGcde# integerGe integerGe# integerGt integerGt#integerIsNegativeintegerIsNegative# integerIsOneintegerIsPowerOf2# integerIsZero integerLcm integerLe integerLe# integerLog2integerLogBaseintegerLogBaseWordintegerLogBaseWord# integerLt integerLt# integerMod integerMul integerNe integerNe# integerNegate integerOne integerOrintegerPopCount#integerPowMod# integerQuotintegerQuotRemintegerQuotRem#integerRecipMod# integerRem integerShiftLintegerShiftL# integerShiftRintegerShiftR# integerSignumintegerSignum#integerSizeInBase# integerSqr integerSubintegerTestBitintegerTestBit# integerToAddrintegerToAddr#integerToBigNatClamp#integerToBigNatSign# integerToInt#integerToInt64#integerToMutableByteArrayintegerToMutableByteArray#integerToNaturalintegerToNaturalClampintegerToNaturalThrowintegerToWord#integerToWord64# integerXor integerZero naturalAdd naturalAnd naturalAndNot naturalBit naturalBit# naturalCheck naturalCheck#naturalClearBitnaturalClearBit#naturalComparenaturalComplementBitnaturalComplementBit#naturalEncodeDouble#naturalEncodeFloat# naturalEq naturalEq#naturalFromAddrnaturalFromAddr#naturalFromBigNat#naturalFromByteArray#naturalFromWordnaturalFromWord#naturalFromWord2#naturalFromWordList naturalGcd naturalGe naturalGe# naturalGt naturalGt# naturalIsOnenaturalIsPowerOf2# naturalIsZero naturalLcm naturalLe naturalLe# naturalLog2 naturalLog2#naturalLogBasenaturalLogBase#naturalLogBaseWordnaturalLogBaseWord# naturalLt naturalLt# naturalMul naturalNe naturalNe# naturalNegate naturalOne naturalOrnaturalPopCountnaturalPopCount# naturalPowMod naturalQuotnaturalQuotRemnaturalQuotRem# naturalRem naturalSetBitnaturalSetBit# naturalShiftLnaturalShiftL# naturalShiftRnaturalShiftR# naturalSignumnaturalSizeInBase# naturalSqr naturalSubnaturalSubThrownaturalSubUnsafenaturalTestBitnaturalTestBit# naturalToAddrnaturalToAddr#naturalToBigNat#naturalToMutableByteArray#naturalToWord#naturalToWordClampnaturalToWordClamp#naturalToWordMaybe# naturalXor naturalZeroINISNBNS zeroCountsizeArr $fShowUnique $fNumUnique newSourceasInt UniqueSource unsafeAt# unsafeAtAStateT$fApplicativeStateL$fFunctorStateL$fApplicativeStateR$fFunctorStateR $fMonadStateT$fApplicativeStateT$fFunctorStateT#.StateL runStateLStateR runStateR runStateT isBitSubType newIntVar readIntVar writeIntVarIntVar lookupBit64 lookupIntN isLowercase isUppercasetoSimpleLowerCasetoSimpleTitleCasetoSimpleUpperCaseIntPSQElemMaskfindMinunsafeInsertNewlink deleteMinalter binShrinkLBinNil binShrinkR deleteViewminViewatMostmergeEkeypriovalueKeyPSQPrio isPuncCharSingKind DemoteRepfromSingSingIsingSingD:R:UReckWordp0D:R:UReckIntp0D:R:UReckFloatp0D:R:UReckDoublep0D:R:UReckCharp0D:R:UReckPtrp0 Rep1_Down Rep1_Tuple15 Rep1_Tuple14 Rep1_Tuple13 Rep1_Tuple12 Rep1_Tuple11 Rep1_Tuple10 Rep1_Tuple9 Rep1_Tuple8 Rep1_Tuple7 Rep1_Tuple6 Rep1_Tuple5 Rep1_Tuple4 Rep1_Tuple3 Rep1_Tuple2 Rep1_Solo Rep1_Proxy Rep1_Either Rep1_Maybe Rep1_NonEmpty Rep1_ListRep_FingerprintRep_GeneralCategory Rep_SrcLocRep_Down Rep_Tuple15 Rep_Tuple14 Rep_Tuple13 Rep_Tuple12 Rep_Tuple11 Rep_Tuple10 Rep_Tuple9 Rep_Tuple8 Rep_Tuple7 Rep_Tuple6 Rep_Tuple5 Rep_Tuple4 Rep_Tuple3 Rep_Tuple2Rep_SoloRep_Unit Rep_Proxy Rep_OrderingRep_Bool Rep_Either Rep_Maybe Rep_NonEmptyRep_ListRep_VoidRep_M1Rep1_M1Rep_V1Rep1_V1Rep_U1Rep1_U1Rep_Par1 Rep1_Par1Rep_Rec1 Rep1_Rec1Rep_K1Rep1_K1Rep_:+:Rep1_:+:Rep_:*:Rep1_:*:Rep_:.:Rep1_:.:Rep_R:UReckWordpRep1_R:UReckWordpRep_R:UReckIntpRep1_R:UReckIntpRep1_R:UReckFloatpRep_R:UReckDoublepRep1_R:UReckDoublepRep_R:UReckCharpRep1_R:UReckCharpRep_R:UReckPtrpRep1_R:UReckPtrp Rep_FixityRep_AssociativityRep_SourceUnpackednessRep_SourceStrictnessRep_DecidedStrictness $fMonadDual$fApplicativeDual $fFunctorDual $fMonoidDual$fSemigroupDual $fMonoidEndo$fSemigroupEndo $fMonoidAll$fSemigroupAll $fMonoidAny$fSemigroupAny $fMonadSum$fApplicativeSum $fMonoidSum$fSemigroupSum $fMonoidAlt$fSemigroupAlt $fReadAlt $fShowAlt$fEqAlt$fOrdAlt$fNumAlt $fEnumAlt $fMonadAlt$fMonadPlusAlt$fApplicativeAlt$fAlternativeAlt $fFunctorAlt$fBoundedProduct $fNumProduct $fBoundedSum$fNumSum$fEqAny$fOrdAny $fReadAny $fShowAny $fBoundedAny$fEqAll$fOrdAll $fReadAll $fShowAll $fBoundedAll$fEqDual $fOrdDual $fReadDual $fShowDual $fBoundedDualRep_AltRep1_Alt Rep_Product Rep1_ProductRep_SumRep1_SumRep_AnyRep_AllRep_EndoRep_Dual Rep1_Dual stimesDefault stimesList stimesMaybeRep_ApRep1_ApRep_Last Rep1_Last Rep_First Rep1_FirstnonEmptySubsequences EventLifetimeevtClose elSupremum $fMonoidEvent$fSemigroupEvent $fShowEvent$fMonoidLifetime$fSemigroupLifetime$fMonoidEventLifetime$fSemigroupEventLifetime$fShowEventLifetime$fEqEventLifetime$fShowLifetime $fEqLifetime $fEqEventelEvent elLifetimeeventIs eventLifetime evtNothingForever Rep_Const Rep1_ConsttypeNatTypeReptypeSymbolTypeReptypeCharTypeRepmkTrFunTypeableInstanceTrAppTrFuntypeableInstancemkTrAppCheckedisTYPE readTwoDigitsmkTyCon#typeLitTypeRep$fShowSomeTypeRep $fOrdTypeRep $fEqTypeRepmkTyConFingerprintmkTrTypetypeRep#IOPort writeIOPortnewEmptyIOPort newIOPort readIOPort $fEqIOPortdoubleReadException$fShowFileLockingNotSupportedMyWeaklockImpl unlockImplunrepresentableCharpeekEncodedCStringwithEncodedCStringnewEncodedCStringutf8DecodeChar#label insertWith updateWithIntTable unsafeLoadunsafeCopyFromBuffercopycopy' firstPowerOf2capacityclear duplicateensureCapacityremoveAtsnoc unsafeRead unsafeWriteuseAsPtrBackend_beModifyFdOnce _beModifyFd_bePollmodifyFd modifyFdOncethrowErrnoIfMinus1NoRetry exchangePtrbackendpoll available epollOneShot$fStorableEvent$fShowEventType $fEqEventType$fNumEventType$fBitsEventType$fFiniteBitsEventTypepeekCStringOpt Rep_RTSFlags Rep_ParFlagsRep_TickyFlagsRep_TraceFlags Rep_DoTrace Rep_ProfFlagsRep_DoHeapProfile Rep_CCFlagsRep_DoCostCentresRep_DebugFlags Rep_MiscFlags Rep_ConcFlags Rep_GCFlagsRep_GiveGCStatsinitFileSystemEncodinginitForeignEncodingrecoveringEncode mkHandleMVar$fStorablePollFd $fShowPollFd $fNumEvent $fBitsEvent$fFiniteBitsEventW controlIsDead newControl closeControl$fEqControlMessage$fShowControlMessagereadControlMessagesendDie sendWakeup wakeupReadFd controlReadFdcontrolWriteFdControlMessageCMsgDie CMsgSignal CMsgWakeupshutdown wakeManager $fEqState $fShowStatecleanupfinishednewDefaultBackendnewWith emControl registerFd_closeFd_ onFdEvent $fEqFdKey $fShowFdKeycallbackTableVarFdData ioManagerLock eventManagerblockedOnBadFD withOpenFile' withFile'c_fcntlFLockl_lenl_pidl_startl_typel_whence Rep_Identity Rep1_Identity Rep1_Kleisli Rep_Kleisli Rep_ZipList Rep1_ZipListRep_WrappedArrowRep1_WrappedArrowRep_WrappedMonadRep1_WrappedMonad Rep_VersionreadSymbolicLinkcClockToIntegercTimeToIntegercsuSecondsToIntegergetCpuTimePrecision withTimespec makeStatic Rep_ByteOrdernoDup Rep_RTSStats Rep_GCDetailsSessionAddrChunk chunksList peekLocation locationSize showLocationc_flockMpQrQi mkPrimTypeRep_WrappedMonoidRep1_WrappedMonoidRep_ArgRep1_ArgRep_MaxRep1_MaxRep_MinRep1_Min Rep_Complex Rep1_Complex Rep_Compose Rep1_ComposeJoinWithSMaybe FromMaybe NonEmptyDListrunNonEmptyDList newByteArrayunsafeFreezeByteArraysizeofByteArrayindexByteArraywriteByteArraybyteArrayToListbyteArrayFromListNunsafeCopyByteArrayunsafeCopyMutableByteArraycompareByteArraysFromBeginning sameByteArrayappendByteArrayconcatByteArraypasteByteArraysemptyByteArraystimesPolymorphic checkedIntAddcheckedIntMultiply