`l      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               !"#$%&'( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                  Safe-InferedAUse this value for zlib format. Add 16 for gzip format. Negate ? for raw zlib format. When uncompressing, add 32 to determine  zlib/gzip format automatically. <  <  7   Safe-Infered TrustworthyHException thrown by CtlI& when the type of the control request / is not supported by the enclosing enumerator. An IterR0 is the result of feeding a chunk of data to an ..  An IterR9 is in one of several states: it may require more input  ( 1), it may wish to execute monadic actions in the  transformed monad ((), it may have a control request for an  enclosing enumerator (!), it may have produced a result  (), or it may have failed (). The .' failed. If it was an enumerator, the  target .! that the enumerator was feeding 2 likely has not failed, in which case its current  state is returned in the Maybe a. If it makes 1 sense to preserve the state of the input stream - (which it does for most errors except parse 0 errors), then the third parameter includes the  residual 1 at the time of the failure. #Sufficient input was received; the . is  returning a result of type a. In adition, the   has a 1 containing any residual . input that was not consumed in producing the  result. A control request (see '). 0The iteratee must execute monadic bind in monad m "The iteratee requires more input. !$Contains information about a failed .. Failures of type  & must be caught by E (or G , etc.). E However, any other type of failure is considered a parse error, and  will be caught by O, P, and . "What you get from . Useful if you don't 4 want to specify any information about the failure. #%A miscellaneous parse error occured. $0An EOF error occurred, either in some IO action  wrapped by  , or in some . that called  C. %List of (input_seen, input_expected) pairs. &3An actual error occured that is not a parse error,  EOF, etc. ' Used when an .. is issuing a control request to an enclosing  enumerator. Note that unlike   or , control requests E expose the residual data, which is ordinarily fed right back to the B continuation upon execution of the request. This allows certain @ control operations (such as seek and tell) to flush, check the ) length of, or adjust the residual data. )The outcome of an  request. *%The result of the control operation. +3The request was supported, and executing it caused  an exception to be thrown. ,6The request type was not supported by the enumerator. -@Class of control commands for enclosing enumerators. The class ; binds each control argument type to a unique result type. .The basic Iteratee type is  Iter t m a, where t is the type of  input (in class 3), m" is a monad in which the iteratee  may execute actions (using the   method), and a % is the result type of the iteratee. Internally, an Iter is a function from an input 1 to a  result of type . 1Chunk is a wrapper around a 3 type that also includes  an EOF flag that is  if the data is followed by an  end-of-file condition. An . that receives a Chunk with EOF  = must return a result (or failure); it is an error to demand  more data (return  ) after an EOF. 3 ChunkData5 is the class of data types that can be output by an 1 enumerator and iterated on with an iteratee. A  ChunkData type  must be a -, but must additionally provide a predicate,  null,, for testing whether an object is equal to .  Feeding a null2 chunk to an iteratee followed by any other chunk C should have the same effect as just feeding the second chunk. To = simplify debugging, there is an additional requirement that   ChunkData% be convertable to a String with the  chunkShow method. Note that because the Prelude contains a function  0 for lists, you may wish to include the import:  import Prelude hiding (null) 6?Constructor function that builds a chunk containing data and a   EOF flag. 7An chunk with  data and the EOF flag . 8 Builds an .1 that keeps requesting input until it receives a  non-4 1. In other words, the 1 fed to the C argument function is guaranteed either to contain data or to have  the EOF flag true (or both). 9 True if an ! is requesting something from an  enumerator--i.e., the  is not  or . :Show the current state of an , prepending it to some  remaining input (the standard  optimization), when a is in  class . Note that if a is not in , you can simply  use the  function. ;Show the current state of an . if type a is in the  5 class. (Otherwise, you can simply use the ordinary   function.) <fmapI is like (, but differs in one important respect: > it preserves the failed result of an enumerator (and in fact / applies the function to the non-failed target . state). By  contrast, , which is equivalent to  f i = i    . f, transforms the  a component of all   states to  because of its use of . =Maps the result of an  like , but only if the  < is no longer active. It is an error to call this function  on an  in the  , , or  state. Because  of this restriction, fmapR' does not require the input and output   types (m1 and m2) to be the same. >Feed an EOF to an .# and return the result. Throws an ( exception if there has been a failure. ?The equivalent for @ for s. @Runs an . from within a different . monad. If  successful,  runI iter! will produce the same result as   (> iter). However, if iter fails, > throws a ? language-level exception, which cannot be caught within other  . monads. By contrast, runI! throws a monadic exception that  can be caught. In short, use runI in preference to run in < situations where both are applicable. See a more detailed E discussion of the same issue with examples in the documentation for  .|$ in Data.IterIO.Inum. AMake an $ from a String. B<Throw an exception from an Iteratee. The exception will be C propagated properly through nested Iteratees, which will allow it D to be categorized properly and avoid situations in which resources B such as file handles are not released. (Most iteratee code does  not assume the Monad parameter m is in the  class, and  hence cannot use  or  onException to clean up after  exceptions.) Use B in preference to  whenever  possible.  Do not use throwI+ to throw parse errors or EOF errors. Use  C and D$ instead. For performance reasons,  the !1 type segregates EOF and parse errors from other  types of failures. CThrow an exception of type IterEOF. This will be interpreted  by mkInum7 as an end of file chunk when thrown by the codec. It  will also be interpreted by P and O as parsing $ failure. If not caught within the . monad, the exception will  be rethrown by > (and hence |$) as an  of type EOF. D@Throw a miscellaneous parse error (after which input is assumed C to be unsynchronized and thus is discarded). Parse errors may be  caught as exception type !, but they can also be caught # more efficiently by the functions O, P, and  . E Catch an exception thrown by an ., including exceptions  thrown by any Inums fused to the . (or applied to it with  .|$3). If you wish to catch just errors thrown within Inums,  see the function  inumCatch in Data.IterIO.Inum. On exceptions, catchI' invokes a handler passing it both the / exception thrown and the state of the failing  , which may C contain more information than just the exception. In particular,  if the exception occured in an Inum, the returned  will  also contain the  being fed by that Inum, which likely D will not have failed. To avoid discarding this extra information, ) you should not re-throw exceptions with B. Rather, you 9 should re-throw an exception by re-executing the failed   with e). For example, a possible definition of  L is:    onExceptionI iter cleanup =  iter `catchI` \( _) r -> cleanup >> e r  Note that catchI only works for  synchronous exceptions, such as  IO errors (thrown within  blocks), the monadic  % operation, and exceptions raised by B. It is not possible  to catch  asynchronous& exceptions, such as lazily evaluated  divide-by-zero errors, the  function, or exceptions raised  by other threads using throwTo" if those exceptions might arrive  anywhere outside of a  call. `catchI`# has the default infix precedence ( infixl 9  `catchI`6), which binds more tightly than any concatenation or  fusing operators. F>Like catchI, but catches only what are considered to be parse ' errors--that is, every constructor of ! except  &. GIf an . succeeds and returns a , returns  a. If  the . fails and throws an exception e (of type e ), returns   (e, r) where r is the state of the failing .. H A version of G* that catches all exceptions. Instead of 8 returning the exception caught, it returns the failing  C (from which you can extract the exception if you really want it). A The main use of this is for doing some kind of clean-up action, % then re-throwing the exception with e. ;For example, the following is a possible implementation of K:  finallyI iter cleanup = do  er <- tryRI iter  cleanup  either reRunIter return er I A variant of G( that just catches EOF errors. Returns   after an EOF error, and  the result otherwise. A Should be much faster than trying to catch an EOF error of type  . J A varient of G that returns the ! state rather than ) trying to match a particular exception. K Execute an .., then perform a cleanup action regardless of  whether the .. threw an exception or not. Analogous to the  standard library function finally. L Execute an .% and perform a cleanup action if the . A threw an exception. Analogous to the standard library function   onException. M Simlar to G., but saves all data that has been fed to the  ., and rewinds the input if the . fails. (The B in  tryBI stands for " backtracking" .) Thus, if tryBI returns   exception , the next .! to be invoked will see the same  input that caused the previous . to fail. (For this reason,  it makes no sense ever to call resumeI on the . you get  back from tryBI, which is why tryBI does not return the failing  Iteratee the way G does.) Because tryBI4 saves a copy of all input, it can consume a lot of ) memory and should only be used when the . argument is known to # consume a bounded amount of data. N A variant of M* that, also rewinds input on failure, but  returns the raw !( structure, rather than mapping it to a C particular exception. This is much faster because it requires no 8 dynamic casts. However, the same warning applies that tryFBI  should not be applied to .#s that could take unbounded input. O@Try two Iteratees and return the result of executing the second * if the first one throws a parse, EOF, or  error. Note that  Data.IterIO.Parse defines <|> as an infix synonym for this  function. The statement multiParse a b is similar to P a return  b?, but the two functions operate differently. Depending on the = situation, only one of the two formulations may be correct.  Specifically:  P a f b works by first executing a, saving a copy of  all input consumed by a. If a throws a parse error, the 1 saved input is used to backtrack and execute b on the same  input that a just rejected. If a succeeds, b is never  run; a's result is fed to f, and the resulting action is > executed without backtracking (so any error thrown within f  will not be caught by this P expression).  Instead of saving input, multiParse a b executes both a and  b* concurrently as input chunks arrive. If a throws a parse ( error, then the result of executing b is returned. If a ? either succeeds or throws an exception that is not a parse  error/EOF/, then the result of running a is returned.  With multiParse a b, if b returns a value, executes a  monadic action via ", or issues a control request via  ], then further processing of b will be suspended until  a: experiences a parse error, and thus the behavior will be  equivalent to P a return b. The main restriction on P is that a must not consume ? unbounded amounts of input, or the program may exhaust memory C saving the input for backtracking. Note that the second argument  to P (i.e.,  in ifParse a return b) is a  continuation for a when a succeeds. The advantage of  multiParse is that it can avoid storing > unbounded amounts of input for backtracking purposes if both  .>s consume data. Another advantage is that with an expression  such as P a f b*, sometimes it is not convenient to break ? the parse target into an action to execute with backtracking (a) 5 and a continuation to execute without backtracking (f). The  equivalent multiParse (a >>= f) b avoids the need to do this, $ since it does not do backtracking. BHowever, it is important to note that it is still possible to end , up storing unbounded amounts of input with  multiParse. For ' example, consider the following code:  ) total :: (Monad m) => Iter String m Int > total = multiParse parseAndSumIntegerList (return -1) -- Bad Here the intent is for parseAndSumIntegerList to parse a E (possibly huge) list of integers and return their sum. If there is = a parse error at any point in the input, then the result is  identical to having defined total = return -1. But  return -1 < succeeds immediately, consuming no input, which means that total < must return all left-over input for the next action (i.e., next  in total >>= next ). Since total has to look arbitrarily far " into the input to determine that parseAndSumIntegerList fails, in  practice total1 will have to save all input until it knows that  parseAndSumIntegerList succeeds. A better approach might be:   . total = multiParse parseAndSumIntegerList (R >> return -1) Here R4 discards all input until an EOF is encountered, so B there is no need to keep a copy of the input around. This makes  sense so long as total) is the last or only Iteratee run on the  input stream. (Otherwise, R would have to be replaced with A an Iteratee that discards input up to some end-of-list marker.) DAnother approach might be to avoid parsing combinators entirely and  use:   " total = parseAndSumIntegerList `F` handler # where handler _ = return -1 This last definition of total may leave the input in some 4 partially consumed state. This is fine so long as total is the  last .2 executed on the input stream. Otherwise, before  throwing the parse error, parseAndSumIntegerList would need to D ensure the input is at some reasonable boundary point for whatever  comes next. (The [( function is sometimes helpful for this  purpose.) PifParse iter success failure runs iter, but saves a copy of  all input consumed using N. (This means iter must not * consume unbounded amounts of input! See O for such  cases.) If iter0 succeeds, its result is passed to the function  success. If iter throws a parse error (with D),  throws an EOF error (with C), or executes , then  failure. is executed with the input re-wound (so that failure is  fed the same input that iter was). If iter throws any other  type of exception, ifParse( passes the exception back and does not  execute failure. See Data.IterIO.Parse+ for a discussion of this function and the  related infix operator \/ (which is a synonym for Q). Q ifNoParse is just P% with the second and third arguments  reversed. RSinks data like /dev/null , returning () on EOF. S?Returns a non-empty amount of input data if there is any input  left. Returns  on an EOF condition. TLike S0, but always returns non-empty data. Throws an  exception on an EOF condition. U A variant of S- that reads the whole input up to an EOF and  returns it. VReturns the next 1 that either contains non-4 data or  has the EOF bit set. WRun an . returning data of class 3 and throw an  EOF exception if the data is 4 . (Note that this is different  from the some method of the  Alternative class in  Control.Applicative#, which executes a computation one or more ) times. The iterIO library does not use  Alternative , in part  because  Alternative's <|> operator has left rather than = right fixity, which would make parsing less efficient. See  Data.IterIO.Parse for information about iterIO's <|>  operator.) XKeep running an . until either its output is not 4 or & we have reached EOF. Return the the .'s value on the last  (i.e., usually non-4 ) iteration. YRuns an .2 then rewinds the input state, so that the effect # is to parse lookahead data. (See M if you want to rewind the  input only when the . fails.) Z1Does not actually consume any input, but returns  if there " is no more input data to be had. [APlace data back onto the input stream, where it will be the next  data consumed by subsequent .s. \"Issue a control request. Returns , if the request type % is unsupported. Otherwise, returns * with the result if ! the request succeeds, or return + if the request type is ; supported but attempting to execute the request caused an  exception. ]:Issue a control request and return the result. Throws an  exception of type  if the operation type was not ' supported by an enclosing enumerator. ^ A variant of _ that only works for the   and   states, not the % state. (Because of this additional # restriction, the input and output  types m1 and m2 do  not need to be the same.) _Step an active  (i.e., one in the  , , or  9 state) to its next state, and pass the result through a  function. `The equivalent of a for s. aRun an . until it enters the  or  state, then ! use a function to transform the . bGet the residual data for an  that is in no longer active  or that is in the & state. (It is an error to call this  function on an  in the   or  state.) cSet residual data for an  that is not active. (It is an  error to call this on an  in the , , or   states.) dFeed more input to an .& that has already been run (and hence  is already an ). In the event that the  is ( requesting more input (i.e., is in the   state), this is $ straight forward. However, if the . is in some other state  such as 3, this function needs to save the input until such  time as the ' is stepped to a new state (e.g., with _  or e). eTurn an  back into an .. The . instance of  handles errors specially. If + the lifted operation throws an exception,  catches the  exception and returns it as an ! failure. If the  exception is an  satisfying  , then the  exception is wrapped in the $ constructor; otherwise, it  is wrapped in &" otherwise. This approach allows A efficient testing for EOF errors without the need to invoke the  expensive  or  operations. (Yes liftIO uses ! these expensive operations, but .s that invoke C do  not.) 8One consequence of this exception handling is that with ., & unlike with most monad transformers,  is not equivalent # to some number of nested calls to . See the documentation of  .|$ for an example. A 1 is 4 when its data is 4 and its EOF flag is  . d !"#$%&'()*+,-./0123456789:;<=>?@ABCDE. that might throw an exception 4Exception handler, which gets as arguments both the  exception and the failing . state. FGHIJKLMNOP Iteratee iter to run with backtracking success function failure action result QRSTUVWXYZ[\]^The  that needs to be stepped. Transformation function if the  is in the    or  state. Fallback if the  is no longer active. _The . that needs to be stepped Function to pass the . to after stepping it. Fallback if the . can no longer be stepped `abcde     M !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeM3451267./0-),+*'(!&%$#" 89:;>@ABCDEFGJHIKLMNPQORSTUVWXYZ[\]a<`_^?=edbcP !&%$#"'(),+*-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde      Trustworthyf IterStateT is a variant of the  monad transformer & specifically designed for use inside .s. The f  Monad itself is the same as . However, the h ! function works differently from --it returns an  E and the result state separately. The advantage of this approach is D that you can still recover the state at the point of the excaption  even after an ! or InumFail condition. hRuns an f s m computation on some state s.  Returns the result ( ) of the . and the state of s as 3 a pair. Pulls residual input up to the enclosing . monad (as  with  pullupResid in Data.IterIO.Inum). iReturns the state in an . t (f s m) monad.  Analogous to  for a  s m monad. j"Returns a particular field of the f state, analogous  to   for . k Sets the f state. Analogous to ! for  . l Modifies the f state. Analogous to " for  . m Adapt an .2 from one monad to another. This function is the B lowest-level monad adapter function, upon which all of the other  adapters are built.  adaptIter requires two functions as E arguments. One adapts the result to a new type (if required). The A second adapts monadic computations from one monad to the other.  For example, o could be implemented as:    liftI :: ( t, Monad m, Monad (t m), 3 s) =>  . s m a -> . s (t m) a  liftI = adaptIter # (\m ->  ( m) >>= liftI) Here  ( m) executes a computation m of type m  (. s m a) from within the . s (t m) monad. The  result, of type . s m a, can then be fed back into  liftI recursively. BNote that in general a computation adapters must invoke the outer  adapter function recursively.  adaptIter is designed this way E because the result adapter function may need to change. An example  is w), which could be implemented as follows:  ) runStateTI :: (ChunkData t, Monad m) => = Iter t (StateT s m) a -> s -> Iter t m (a, s) A runStateTI iter s = adaptIter adaptResult adaptComputation iter " where adaptResult a = (a, s) D adaptComputation m = do (r', s') <- lift (runStateT m s) 4 runStateTI r' s' Here, after executing , the state may be modified.  Thus, adaptComputation invokes  runStateTI recursively with the  modified state, s', to ensure that subsequent  C computations will be run on the latest state, and that eventually   adaptResult will pair the result a with the newest state. n)Simplified adapter function to translate . computations from 2 one monad to another. This only works on monads m for which  running m a returns a result of type a. For more complex  scenarios (such as $ or ), you need to use the more  general m. As an example, the p% function is implemented as follows:   liftIterIO :: (ChunkData t, ! m) => Iter t IO a -> Iter t m a  liftIterIO = adaptIterM  oRun an . s m computation from witin the . s (t m)  monad, where t is a . pRun an . t IO computation from within an . t m  monad where m is in class . qTurn a computation of type . t (% (. t m a) m)  a into one of type . t m a . Note the continuation has to  return type . t m a and not a so that runContTI can call  itself recursively. rRun a computation of type . t (& e m) from within  the . t m1 monad. This function is here for completeness,  but please consider using B instead, since the . monad / already has built-in exception handling and it's best to have a . single, uniform approach to error reporting. sRun an . t ($ m) computation from within the .  t m monad. tRun an . t (' r m) computation from within the  . t m monad. uRun an . t (( r w s m) computation from within the  . t m monad. vRun an . t () r w s m) computation from within  the . t m monad. Just like u, execpt this function  is for Lazy ) rather than strict (. wRun an . t ( m) computation from within the  . t m monad. xRun an . t (* m) computation from within the  . t m monad. Just like w, except this function  works on Lazy * rather than strict . yRun an . t (+ w m) computation from within the  . t m monad. zRun an . t (, w m) computation from within  the . t m monad. This is the same as - but for  the Lazy ,, rather than the strict one. !fghijklmHow to adapt result values How to adapt computations Input computation Output computation nConversion function . of input monad Returns . of output monad opqrstuComputation to transform  Reader State Mutable State &Returns result, mutable state, writer vComputation to transform  Reader State Mutable State &Returns result, mutable state, writer wxyz./0123456789fghijklmnopqrstuvwxyzopqrstuvwxyzmnfghijkl fghijklmnopqrstuvwxyz./0123456789 Trustworthy4{-A monad in which to define the actions of an  tIn tOut m  a. Note InumM tIn tOut m a is a  of kind * -> *, where  a6 is the (almost always parametric) return type of the . A B fifth type argument is required for monadic computations of kind  *, e.g.:  ! seven :: InumM tIn tOut m a Int  seven = return 7 *Another important thing to note about the { monad, as $ described in the documentation for , is that you must call  # twice to execute actions in monad m, and you must use  the o& function to execute actions in monad . t m a. |A Codec# produces some input to feed to an ., and  optionally returns an # that will produce the rest of the  input. The funciton  can be used to build an  out  of a | . Using  is much simpler than , but  more expressive than . For example, a possible  implementation of  would be:   mkInum :: (3 tIn, 3 tOut,  m) =>  . tIn m tOut ->  tIn tOut m a  mkInum trans = inum  where inum =  # $  I trans >>= :$ (return (mempty, Nothing)) doinput  doinput input = do  eof <'- if null input then return False else Z A return (input, if eof then Nothing else Just inum) }+A control handler maps control requests to  results.  Generally the type parameter m1 is . t' m. ~A  ResidHandler- specifies how to handle residual data in an  . Typically, when an  finishes executing, there are ) two kinds of residual data. First, the  itself (in its role B as an iteratee) may have left some unconsumed data. Second, the  target . being fed by the  may have some resitual data, . and this data may be of a different type. A  ResidHandler allows A this residual data to be adjusted by untranslating the residual  data of the target .' and sticking the result back into the  's residual data. The two most common  ResidHandlers are  (to pull the  target .'s residual data back up to the  as is), and  #) (to do no adjustment of residual data).  ResidHandlers are used by the  function, and by the   }. An  Onum t m a is just an  in which the input is  ()--i.e.,  () t m a'--so that there is no meaningful input 5 data to transcode. Such an enumerator is called an  outer enumerator/, because it must produce the data it feeds to  .'s by either executing actions in monad m, or from its own  internal pure state (as for ). As with s, an Onum) should under no circumstances ever feed % a chunk with the EOF bit set to its . argument. When the  Onum> runs out of data, it must simply return the current state of  the .7. This way more data from another source can still be C fed to the iteratee, as happens when enumerators are concatenated  with the  function. Onum,s should generally be constructed using the  or   function, just like s, the only difference being  that for an Onum the input type is (), so executing .s to & consume input will be of little use. The type of an iterator-enumerator, which transcodes data from  some input type tIn to some output type tOut. An Inum acts  as an .6 when consuming data, then acts as an enumerator when $ feeding transcoded data to another .. %At a high level, one can think of an Inum as a function from  .s to  s, where an Inum's input and output types are . different. A simpler-seeming alternative to Inum might have  been:  9 type Inum' tIn tOut m a = Iter tOut m a -> Iter tIn m a In fact, given an Inum object inum, it is possible to construct  a function of type Inum' with (inum ). But sometimes one  might like to concatenate Inums. For instance, consider a ? network protocol that changes encryption or compression modes $ midstream. Transcoding is done by Inums. To change transcoding  methods after applying an Inum to an iteratee requires the  ability to "pop" the iteratee back out of the Inum so as to be  able to hand it to another Inum. Inum's return type ( Iter tIn  m (IterR tOut m a) as opposed to  Iter tIn m a ) allows the  monadic bind operator  to accomplish this popping in  conjunction with the H and e functions. All Inum%s must obey the following two rules.   An Inum /may never feed a chunk with the EOF flag set to   it's target .#. Instead, upon receiving EOF, the Inum 0 should simply return the state of the inner . (this is how  "popping"% the iteratee back out works--If the Inum passed  the EOF through to the ., the . would stop requesting 4 more input and could not be handed off to a new Inum).  An Inum *must always return the state of its target ..  This is true even when the Inum fails, and is why the   state contains a  a field. >In addition to returning when it receives an EOF or fails, an  Inum should return when the target . returns a result or  fails. An Inum/ may also unilaterally return the state of the D iteratee at any earlier point, for instance if it has reached some B logical message boundary (e.g., many protocols finish processing % headers upon reading a blank line). Inum,s are generally constructed with one of the  or  : functions, which hide most of the error handling details . and ensure the above rules are obeyed. Most Inums are  polymorphic in the last type, a", in order to work with iteratees  returning any type. There isn't much reason for an Inum to care  about the type a/. Had this module used the Rank2Types Haskell  extension, it would define Inum as: 0 type Inum tIn tOut m = forall a. Iter tOut m a > -> Iter tIn m (IterR tOut m a) Run an  on an .$. This is the main way of actually  executing IO with .s. |$! is a type-restricted version of  the following code, in which inum must be an :   inum |$ iter = > (inum .| iter)  infixr 2 |$ .|$ is a variant of  that allows you to apply an   from within an ., monad. This is often useful in conjuction  with 2, if you want to parse at some coarse-granularity 9 (such as lines), and then re-parse the contents of some + coarser-grained parse unit. For example:   rawcommand <- lineI 6 command <- enumPure rawcommand .|$ parseCommandI ; return Request { cmd = command, rawcmd = rawcommand } .|$ has the same fixity as |$ , namely:   infixr 2 .|$ 'Note the important distinction between (.|$) and ().  (.|$) runs an - and does not touch the current input, while  (%) pipes the current input through an . For instance, to C send the contents of a file to standard output (regardless of the  current input), you must say enumFile " .signature" .|$  stdoutI8. But to take the current input, compress it, and send - the result to standard output, you must use , as in inumGzip   stdoutI. As suggested by the types,  enum .|$ iter is sort of equivalent to   (enum |$ iter)#, except that the latter will call throw ? on failures, causing language-level exceptions that cannot be  caught within the outer .. Thus, it is better to use .|$  than  (...  ...)%, though in the less general case of  the IO monad,  enum .|$ iter is equivalent to  (enum   iter)+ as illustrated by the following examples: H -- Catches exception, because .|$ propagates failure through the outer . -- Iter Monad, where it can still be caught.  apply1 :: IO String 4 apply1 = enumPure "test1" |$ iter `catchI` handler  where 0 iter = enumPure "test2" .|$ fail "error" ; handler (SomeException _) _ = return "caught error"  F -- Does not catch error. |$ turns the Iter failure into a language- ? -- level exception, which can only be caught in the IO Monad.  apply2 :: IO String 4 apply2 = enumPure "test1" |$ iter `catchI` handler  where 6 iter = lift (enumPure "test2" |$ fail "error") ; handler (SomeException _) _ = return "caught error"  H -- Catches the exception, because liftIO uses the IO catch function to D -- turn language-level exceptions into monadic Iter failures. (By E -- contrast, lift works in any Monad, so cannot do this in apply2.) C -- This example illustrates how liftIO is not equivalent to lift.  apply3 :: IO String 4 apply3 = enumPure "test1" |$ iter `catchI` handler  where 8 iter = liftIO (enumPure "test2" |$ fail "error") ; handler (SomeException _) _ = return "caught error" :Concatenate the outputs of two enumerators. For example,  enumFile "file1" `cat` enumFile "file2" produces an  ) that outputs the concatenation of files "file1" and  "file2". Unless the first  fails, cat always invokes the  second , as the second  may have monadic side-effects % that must be executed even when the . has already finished.  See  if you want to stop when the . no longer requires C input. If you want to continue executing even in the event of an  InumFail# condition, you can wrap the first  with   and invoke $ from within the exception handler. cat (and ., described below) are useful in right folds.  Say, for instance, that files is a list of files you wish to 0 concatenate. You can use a construct such as:    catFiles :: ( m) => [;] ->   m a  catFiles files = < ( . enumFile)  files Note the use of  as the starting value for <. This  is not to be confused with .  acts as a no-op 8 for concatentation, producing no output analogously to  /dev/null. By contrast  is the no-op for fusing (see   and 6 below) because it passes all data through untouched. cat has fixity:  infixr 3 `cat` Lazy cat. Like ), except that it does not run the second   if the .- is no longer active after completion of the  first . Also has fixity  infixr 3 `lcat`. +Left-associative pipe operator. Fuses two  s when the  output type of the first " is the same as the input type of $ the second. More specifically, if inum1 transcodes type tIn to  tOut and inum2 transcodes tOut to tOut2, then inum1  |. inum2 produces a new  that transcodes from tIn to  tOut2. Typically types i and iR are . tOut2 m a and   tOut2 m a6, respectively, in which case the second argument and  result of |. are also s.  This function is equivalent to:    outer |. inner = \iter -> outer  inner iter  infixl 4 |. 4But if you like point-free notation, think of it as outer |. inner  = (outer  ) . inner, or better yet (|.) = (.) . (). +Right-associative pipe operator. Fuses an  that transcodes  tIn to tOut with an . taking input type tOut to produce  an . taking input type tIn . If the . is still active  when the + terminates (either normally or through an  exception), then .| sends it an EOF.  Has fixity:  infixr 4 .| Catches errors thrown by an , or a set of fused s.  Note that only errors in  s that are lexically within the  scope of the argument to  will be caught. For example:  3 inumBad :: (ChunkData t, Monad m) => Inum t t m a # inumBad = mkInum $ fail "inumBad"  , skipError :: (ChunkData tIn, MonadIO m) =>  SomeException + -> IterR tIn m (IterR tOut m a) * -> Iter tIn m (IterR tOut m a)  skipError e iter = do < liftIO $ hPutStrLn stderr $ "skipping error: " ++ show e  resumeI iter  H -- Throws an exception, because inumBad was fused outside the argument  -- to inumCatch.  test1 :: IO () C test1 = inumCatch (enumPure "test") skipError |. inumBad |$ nullI  B -- Does not throw an exception, because inumBad fused within the  -- argument to inumCatch.  test2 :: IO () C test2 = inumCatch (enumPure "test" |. inumBad) skipError |$ nullI  E -- Again no exception, because inumCatch is wrapped around inumBad.  test3 :: IO () A test3 = enumPure "test" |. inumCatch inumBad skipError |$ nullI  Note that ` inumCatch`# has the default infix precedence (infixl  9 ` inumcatch`3), which binds more tightly than any concatenation  or fusing operators.  As noted for E&, exception handlers receive both the ! exception thrown and the failed . Particularly in the case  of  inumCatch,, it is important to re-throw exceptions by  re-executing the failed . with e, not passing the  exception itself to B!. That way, if the exception is  re-caught, / will continue to work properly. For example, @ to copy two files to standard output and ignore file not found @ errors but re-throw any other kind of error, you could use the  following:   resumeTest :: IO ()  resumeTest = doFile "file1" `` doFile "file2" |$ stdoutI  where ! doFile path = inumCatch ( enumFile' path) $ \ err r ->  if isDoesNotExistError err  then  r  else e r $Execute some cleanup action when an  finishes. "Execute some cleanup action if an  fails. Does not execute  the action if the . (or some inner ) fails. Has the  same scoping rules as . 'Used in an exception handler, after an  failure, to resume  processing of the . by the next enumerator in a ed  series. See  for an example. Like  , but if the . is resumable, also prints an 2 error message to standard error before resuming. Reject all control requests. 3Pass all control requests through to the enclosing . monad.  The ~/ argument says how to adjust residual data, in  case some enclosing } decides to flush pending input C data, it is advisable to un-translate any data in the output type  tOut back to the input type tIn.  Create a }* given a function of a particular control  argument type and a fallback } to run if the argument  type does not match. consCtl% is used to chain handlers, with the  rightmost handler being either  or . AFor example, to create a control handler that implements seek on  SeekC+ requests, returns the size of the file on SizeC ; requests, and passes everything else out to the enclosing 3 enumerator (if any), you could use the following:   O fileCtl :: (ChunkData t, MonadIO m) => Handle -> CtlHandler (Iter () m) t m a  fileCtl h = ( $ (.SeekC mode pos) -> liftIO (hSeek h mode pos))  `consCtl` ( $ SizeC -> liftIO (hFileSize h))  `consCtl`  #  Has fixity:  infixr 9 `consCtl` BMake a control function suitable for use as the first argument to  . Like 6, except that it flushes all input and clears the EOF  flag in both .. monads after executing the control function. Like , but only for  --may return . Run an . just like 0, but then keep stepping the $ result for as long as it is in the  or  state (using  the supplied } for  states).  s should  generally use this function or  in preference to  0, as it is convenient if s avoid ever returning   s in the  state.  Takes an  that might return  s in the  state $ (which is considered impolite--see ) and transforms it  into an  that never returns  s in the  state. Create a stateless  from a "codec" . that transcodes D the input type to the output type. The codec is invoked repeately $ until one of the following occurs:  5 The input is at an EOF marker AND the codec returns 4  data. ( s are always fed EOF, but other s might  have reason to return  data.) < The codec throws an exception. If the exception is an EOF " exception--thrown either by C, or by some IO action  inside 0--this is considered normal termination, and is . the normal way for a codec to cause the  to return. If 3 the exception is of any other type, then the  will , further propagate the exception as an  failure.  The underlying target .# either returns a result or throws  an exception. mkInumC: requires two other arguments before the codec. First, a  ~1 allows residual data to be adjusted between the  input and output . monads. Second, a } specifies a @ handler for control requests. For example, to pass up control 7 requests and ensure no residual data is lost when the  is  fused to an ., the  inumConcat function given previously for   at  #mkInumExample could be re-written: A inumConcat :: (Monad m) => Inum [L.ByteString] L.ByteString m a 9 inumConcat = mkInumC reList (passCtl reList) iterConcat ) where reList (a, b) = (b:a, mempty)  Create an  based on an . that transcodes the input to 3 the output type. This is a simplified version of  that A rejects all control requests and does not adjust residual data.  mkInum = mkInumC id noCtl A simplified version of " that passes all control requests * to enclosing enumerators. It requires a ~ to describe * how to adjust residual data. (E.g., use  when tIn  and tOut are the same type.) ) mkInumP adj = mkInumC adj (passCtl adj) *pullupResid (a, b) = (mappend a b, mempty). See ~.  Bracket an - with a start and end function, which can be ? used to acquire and release a resource, must like the IO monad's  bracket function. For example: < enumFile :: (MonadIO m, ChunkData t, LL.ListLikeIO t e) => $ FilePath -> Onum t m a E enumFile path = inumBracket (liftIO $ openBinaryFile path ReadMode) / (liftIO . hClose) ( enumHandle inumNop+ passes all data through to the underlying .. It % acts as a no-op when fused to other s with  or when fused  to .s with . inumNop1 is particularly useful for conditionally fusing s  together. Even though most  s are polymorphic in the return A type, this library does not use the Rank2Types extension, which  means any given , must have a specific return type. Here is  an example of incorrect code:   $ let enum = if debug then base_enum   inumStderr else base_enum -- Error  This doesn't work because  base_enum cannot have the same type as  (base_enum |. inumStderr)'. Instead, you can use the following:   let enum = base_enum  if debug then  inumStderr else inumNop inumNull$ feeds empty data to the underlying . . It pretty 1 much acts as a no-op when concatenated to other s with   or . There may be cases where inumNull is required to avoid deadlock.  In an expression such as enum  iter, if enum immediately $ blocks waiting for some event, and iter immediately starts out C triggering that event before reading any input, then to break the ' deadlock you can re-write the code as cat inumNull enum   iter. Feed pure data to an .. Type-restricted version of .  Repeat an 0 until the input receives an EOF condition, the  ." no longer requires input, or the . is in an unhandled  : state (which presumably will continue to be unhandled by  the same &, so no point in executing it again). A generalized version of  that allows a } to  be specified.  . runCodec adj = runCodecC adj (passCtl adj)  Build an  from a |. Set the control handler an  should use from within an  { computation. (The default is .) Set the AutoEOF flag within an { computation. If this  flag is  , handle IterEOF exceptions like a normal but  immediate termination of the . If this flag is   (the default), then IterEOF' exceptions must be manually caught or ! they will terminate the thread. Set the AutoDone flag within an { computation. When  , the + will immediately terminate as soon as the  .0 it is feeding enters a non-active state (i.e.,  or a " failure state). If this flag is  (the default), the  {5 computation will need to monitor the results of the  , , and  functions to ensure the  0 terminates when one of these functions returns . -Add a cleanup action to be executed when the  finishes, or, ! if used in conjunction with the  function, when the  innermost enclosing  action finishes. Run an {2 with some cleanup action in effect. The cleanup A action specified will be executed when the main action returns, 8 whether normally, through an exception, because of the AutoDone  or AutoEOF flags, or because  is invoked. Note  withCleanup0 also defines the scope of actions added by the  1 function. In other words, given a call such as  withCleanup cleaner1 main, if main invokes   cleaner2 , then both cleaner1 and cleaner2 will be executed  upon main's return, even if the overall  has not finished  yet.  A variant of  that sets AutoEOF and AutoDone to  % by default. (Equivalent to calling   >>    as the first thing inside .)  Build an  out of an { computation. If you run   inside the . tIn m monad (i.e., to create an  enumerator of type  tIn tOut m a ), then the { ( computation will be in a Monad of type . t tm where tm is  a transformed version of m. This has the following two  consequences: ) If you wish to execute actions in monad m from within your  {% computation, you will have to apply  twice (as  in  $  action_in_m) rather than just once. ' If you need to execute actions in the . t m monad, you $ will have to lift them with the o function. The {3 computation you construct can feed output of type  tOut to the target .' (which is implicitly contained in the  monad state), using the , , and  functions. Used from within the {" monad to feed data to the target  . . Returns  if the target . is still active and  " if the iter has finished and the  should also  return. (If the autoDone flag is , then ifeed,  ipipe, and irun will never actually return , but = instead just immediately run cleanup functions and exit the   when the target . stops being active.)  A variant of " that throws an exception of type IterEOF  if the data being fed is 4!. Convenient when reading input  with a function (such as  Data.ListLike's hget) that returns 0 E bytes instead of throwing an EOF exception to indicate end of file.  For instance, the main loop of enumFile could be implemented  as:    $  ( h defaultChunkSize) >>=  Apply another  to the target . from within the {  monad. As with  , returns  when the . is  finished. Note that the applied ( must handle all control requests. (In C other words, ones it passes on are not caught by whatever handler  is installed by  , but if the  returns the   in the  state, as  does, then requests  will be handled.)  Apply an  (or ( of an arbitrary, unused input type) to  the . from within the { monad. As with  , returns   when the . is finished. Repeats an action until the . is done or an EOF error is E thrown. (Also stops if a different kind of exception is thrown, in ? which case the exception propagates further and may cause the   to fail.) irepeat sets both the AutoEOF and  AutoDone flags to . If the target . being fed by the  is no longer active  (i.e., if it is in the # state or in an error state), this , funciton pops the residual data out of the . and returns it. . If the target is in any other state, returns . .Immediately perform a successful exit from an { monad,  terminating the ( and returning the current state of the  target .. Can be used to end an  loop. (Use  B ... for an unsuccessful exit.) An  that acts like , except that before passing  data on, it feeds a copy to a "tee" . (by analogy with the  Unix tee: utility), which may, for instance, transform and log the  data. The tee .''s return value is ignored. If the tee . 9 returns before an EOF is received and before the target . has ! finished processing input, then inumTee will continue to pass  data to the target .. However, if the tee . fails, then  this will cause inumTee to fail immediately. 6As an example, one could implement something close to   inumStderr (from Data.IterIO.ListLike) as follows:  ' inumStderr = inumTee $ handleI stderr (Except note that the real  inumStderr does not close its file @ descriptor, while the above implementation will send an EOF to  handleI , causing stderr to be closed.) 4{|}~ that might throw an exception Exception handler Adjust residual data (use # for no adjustment) Handle control requests (use  or  if   shouldn'-t implement any specific control functions).  Generate transcoded data chunks Computation to run first Computation to run last Inum to bracket Cleanup action Main action to execute 4{|}~4~}|{4{|}~ Safe-InferedSendRecvString1 is the class of string-like objects that can be  used with datagram sockets. Create a loopback (., ) pair. The iteratee and E enumerator can be used in different threads. Any data fed into the  . will in turn be fed by the  into whatever . it A is given. This is useful for testing a protocol implementation  against itself.  Returns an .. that always returns itself until a result is  produced. You can fuse  inumSplit to an . to produce an  .$ that can safely be fed (e.g., with ) from multiple  threads. $Flushes a file handle and calls the shutdown system call so as E to write an EOF to a socket while still being able to read from it. C This is very important when the same file handle is being used to  to read data in an  and to write data in an . . Proper & protocol functioning may require the . to send an EOF (e.g., a  TCP FIN segment), but the  may still be reading from the  socket in a different thread. BFor debugging, print a tag along with the current residual input.  Not referentially transparent. @For debugging. Print the current thread ID and a message. Not  referentially transparent. =>? =>? Trustworthy(#A control request that returns the @ from an enclosing  socket enumerator. >A control command for determining the current offset within a E file. Note that this subtracts the size of the residual input data C from the offset in the file. Thus, it will only be accurate when 4 all left-over input data is from the current file. BA control command for seeking within a file, when a file is being / enumerated. Flushes the residual input data. A control command (issued with ] SizeC) requesting the , size of the current file being enumerated. AAn Iteratee that puts data to a consumer function, then calls an  eof function. For instance,  could be defined as:   handleI :: (MonadIO m) => A -> . B m ()  handleI h = putI ( . C h) ( $  h 1) ASend datagrams using a supplied function. The datagrams are fed B as a list of packets, where each element of the list should be a / separate datagram. For example, to create an . from a  connected UDP socket:   udpI :: ( s,  m) => @ -> . s m ()  udpI sock = sendI $  .  sock @Return the first element when the Iteratee data type is a list. Return / the first element when the Iteratee data type  is a list, or  on EOF. Like , but works for any D data type. Like , but works for any D data type. Like , but returns  on EOF. Return a line delimited by \r, \n, or \r\n. Return D- data that is at most the number of elements B specified by the first argument, and at least one element unless ? EOF is encountered or 0 elements are requested, in which case   is returned. Return D- data that is at most the number of elements D specified by the first argument, and at least one element (as long ? as a positive number is requested). Throws an exception if a B positive number of items is requested and an EOF is encountered. Return the next len elements of a D data stream, D unless an EOF is encountered, in which case fewer may be returned.  Note the difference from :  n will keep ( reading input until it has accumulated n elements or seen an EOF,  then return the data;  n will keep reading only until B it has received any non-empty amount of data, even if the amount  received is less than n elements and there is no EOF. Puts strings (or E data) to a file A, then  writes an EOF to the handle. @Note that this does not put the handle into binary mode. To do  this, you may need to call F h  on the  handle before using it with handleI. Otherwise, Haskell by C default will treat the data as UTF-8. (On the other hand, if the  A9 corresponds to a socket and the socket is being read in  another thread, calling F can cause deadlock, so in ? this case it is better to have the thread handling reads call  F.) :Also note that Haskell by default buffers data written to  A6s. For many network protocols this is a problem. Don't  forget to call G h H before passing a  handle to . .Sends a list of packets to a datagram socket. BSends output to a stream socket. Calls shutdown (e.g., to send a % TCP FIN packet) upon receiving EOF. An . that uses I to write all output to J. A handler function for the , , and  control  requests. fileCtl is used internally by  and  1, and is exposed for similar enumerators to use. A handler for the  control request. ARead datagrams (of up to 64KiB in size) from a socket and feed a ; list of strings (one for each datagram) into an Iteratee. =Read datagrams from a socket and feed a list of (Bytestring, ; SockAddr) pairs (one for each datagram) into an Iteratee. ,Read data from a stream (e.g., TCP) socket.  A variant of & type restricted to input in the Lazy  B format. $Puts a handle into binary mode with F, then 1 enumerates data read from the handle to feed an . with any  E input type.  Feeds an ./ with data from a file handle, using any input  type in the E class. Note that enumNonBinHandle  uses the handle as is, unlike , and so can be used if / you want to read the data in non-binary form. 5Enumerate the contents of a file as a series of lazy  B*s. (This is a type-restricted version of  .) (Enumerate the contents of a file for an . taking input in  any E* type. Note that the file is opened with  K to ensure binary mode. Enumerate standard input. (Feed exactly some number of bytes to an .. Throws an error ' if that many bytes are not available. >Feed up to some number of list elements (bytes in the case of  B s) to an ., or feed fewer if the . returns , or an EOF is encountered. The formulation  inumMax n  iter  can be used to prevent iter% from consuming unbounded amounts of  input. This inner enumerator is like  in that it passes  unmodified 10s straight through to an iteratee. However, it  also logs the 1/s to a file (which can optionally be truncated 0 or appended to, based on the second argument). Like 2, but takes a writeable file handle rather than a 2 file name. Does not close the handle when done. .Log a copy of everything to standard error. ( inumStderr =   L) An ! that converts input in the lazy B format  to strict Ms.  The dual of --converts input from strict  M s to lazy Bs. Add a finalizer to run when an . has received an EOF and an  < has finished. This works regardless of the order in which  the two events happen. "Iterizes" a file A by turning into an  (for  reading) and an . (for writing). Uses  to  N the A when both the . and  are finished. ; Puts the handle into binary mode, but does not change the  buffering. As mentioned for  , Haskell's default buffering E can cause problems for many network protocols. Hence, you may wish  to call G h H before  iterHandle h. "Iterizes" a stream @ by turning into an  (for  reading) and an . (for writing). Uses  to  O the @ when both the . and  are finished. 0Path to log to True to truncate file Cleanup action 5Cleanup action will run when these two are both done PQRS0 0  ,PQRSSafe/An infix synonym for O that allows LL(*) parsing of B alternatives by executing both Iteratees on input chunks as they ! arrive. This is similar to the <|> method of the   Alternative class in Control.Applicative , but the   Alternative5 operator has left fixity, while for efficiency this  one has:  infixr 3 <|> An infix synonym for Q that allows LL(*) parsing of D alternatives by keeping a copy of input data consumed by the first D Iteratee so as to backtrack and execute the second Iteratee if the D first one fails. Returns a function that takes a continuation for  the first . , should it succeed. The code:  B iter1 \/ iter2 $ \iter1Result -> doSomethingWith iter1Result  Executes iter14 (saving a copy of the input for backtracking). If  iter1" fails with an exception of class  IterNoParse , then the  input is re-wound and fed to iter2. On the other hand, if  iter1 succeeds and returns  iter1Result, then the saved input is  discarded (as iter2, will not need to be run) and the result of  iter1 is fed to function doSomethingWith. 8For example, to build up a list of results of executing iter, one . could implement a type-restricted version of  as follows:   @ myMany :: (ChunkData t, Monad m) => Iter t m a -> Iter t m [a]  myMany iter = iter \/ return [] T \r ->  ((:) r) (myMany iter) In other words, myMany tries running iter. If iter fails,  then myMany returns the empty list. If iter succeeds, its  result r6 is added to the head of the list returned by calling  myMany9 recursively. This idiom of partially applying a binary E funciton to a result and then applying the resulting function to an  . via 2 is so common that there is an infix operator for  it, (. Thus, the above code can be written:    myMany iter = iter \/ return [] T (:)  myMany iter Of course, using , is not the most efficient way to implement  myMany6. If you are going to use this pattern for something A performance critical, you should use an accumulator rather than  build up long chains of &s. A faster implementation would be:    myMany iter = loop id  where loop ac = iter \/ return (acc []) T a -> loop (acc . (a :)) \/ has fixity:  infix 2 \/  (f >$> a) t is equivalent to f t  a (where  is and  infix alias for #). Particularly useful with infix  combinators such as  and `` when chaining parse  actions. See examples at  and . Note  is not ; always the most efficient solution (see an example in the  description of ).  Has fixity:  infixl 3 >$>  fa $> b = b <$ fa+ -- replaces the output value of a functor / with some pure value. Has the same fixity as  and  ,  namely:  infixl 4 $>  Defined as  orEmpty = ( return ), and useful when , parse failures should just return an empty . For example,  a type-restricted  can be implemented as:   @ myMany :: (ChunkData t, Monad m) => Iter t m a -> Iter t m [a]  myMany iter = iter `` (:)  myMany iter  Has fixity:  infixr 3 `orEmpty` iter <?> token' replaces any kind of parse failure in iter ) with an exception equivalent to calling  prefix token  where prefix* is a prefix of the input that was fed to iter and  caused it to fail.  Has fixity:  infix 0 <?>  Throw an .- exception that describes expected input not  found. Repeatedly invoke an .$ and right-fold a function over the  results.  A variant of  that requires the . to succeed at  least once.  A variant of  that requires the . to succeed at C least a minimum number of items and stops parsing after executing  the . some maximum number of times. Strict left fold over an . (until it throws an  IterNoParse  exception). foldlI f z iter is sort of equivalent to: : ... (f <$> (f <$> (f z <$> iter) <*> iter) <*> iter) ...  A version of  that fails if the . argument does not  succeed at least once. foldMI: is a left fold in which the folding function can execute  monadic actions. Essentially foldMI is to  as U is  to foldl' in the standard libraries.  A variant of  that requires the . to succeed at  least once. =Discard the result of executing an Iteratee once. Throws an % error if the Iteratee fails. (Like skip x = x >> return ().) AExecute an iteratee. Discard the result if it succeeds. Rewind / the input and suppress the error if it fails. AEnsures the next input element satisfies a predicate or throws a + parse error. Does not consume any input. "A variant of the standard library V function, but that  translates a W into any X type, not just Y.  Particularly useful for .s that must work with both Zs  (which consist of W s) and ASCII  ByteStrings (which consist  of Word83s). For example, to skip one or more space or TAB  characters, you can use:   skipSpace :: (D t e, ChunkData t, [ e, X e, Monad m) =>  . t m ()  skipSpace =  (\c -> c == eord ' ' || c == eord '\t') >Skip all input elements encountered until an element is found . that does not match the specified predicate. Like -, but fails if at least one element does not  satisfy the predicate. BReturn all input elements up to the first one that does not match  the specified predicate. Like 5, but fails if at least one element does not satisfy  the predicate.  A variant of  with a maximum number matches.  A variant of , with a minimum and maximum number matches. Repeatedly execute an . returning a  and \ " all the results in a right fold. Like , but fails if the . doesn't return at least  once.  A version of , that takes a minimum and maximum number of  items to parse. This . parses a ] argument. It does not C consume any Iteratee input. The only reason it is an Iteratee is @ so that it can throw an Iteratee parse error should it fail to < parse the argument string (or should the argument yield an  ambiguous parse). BEnsures the input is at the end-of-file marker, or else throws an  exception. \ the result of two  types returning   types (<++> = ^ \). Has the same fixity  as _ , namely:  infixr 5 <++> ` an  type onto an an   D type (<:> = ^ `). Has the same  fixity as : , namely:  infixr 5 <:> nil =   --An empty  injected into an   type. Run an .2 zero or more times (until it fails) and return a % list-like container of the results. Repeatedly run an .$ until it fails and discard all the  results. Parses a sequence of the form  3Item1 Separator Item2 Separator ... Separator ItemN  and returns the list [Item1, Item2, ..., ItemN]  or a D equivalent. Like 4, but expects a separator after the final item. In , other words, parses a sequence of the form  =Item1 Separator Item2 Separator ... Separator ItemN Separator  and returns the list [Item1, Item2, ..., ItemN] or  a D equivalent.  -Accepts items that would be parsed by either  or .  Essentially a version of ! in which the final separator is  optional.  Run an .1 one or more times (until it fails) and return a % list-like container of the results.   A variant of " that throws a parse error if the . ! does not succeed at least once.   A variant of ( that throws a parse error if it cannot  return at least one item.   A variant of ( that throws a parse error if it cannot  return at least one item.  A variant of  ( that throws a parse error if it cannot  return at least one item. <Read the next input element if it satisfies some predicate.  Otherwise throw an error. -Read input that exactly matches a character. -Read input that exactly matches some target. *Read input that exactly matches a string. -Read input that matches a string up to case. /Input actually received %Description of input that was wanted Minimum number to parse Maximum number to parse Folding function Rightmost value "Iteratee generating items to fold Maximum number to match Predicate test Minumum number Maximum number Predicate test Minimum number to parse Maximum number to parse . whose results to concatenate Item to parse Separator between items Returns D list of items Item to parse %Separator that must follow each item Returns D list of items      7      7      /      Safe-Infered@Feeds input to an Iteratee until some boundary string is found. C The boundary string is neither consumed nor passed through to the  target ./. (Thus, if the input is at end-of-file after @ inumStopString returns, it means the boundary string was never  encountered.) AReads input until it can uniquely determine the longest key in a  a9 that is a prefix of the input. Consumes the input that = matches the key, and returns the corresponding value in the  a6, along with the residual input that follows the key. mapLI is a variant of  that takes a list of   (key, value) pairs instead of a a.  mapLI =  . b.   Safe-InferedControl request to fetch the SSL object associated with an  enumerator. A wrapper around the type c to make it an instance of the  d class. Simple OpenSSL . Simple OpenSSL .,. Does a uni-directional SSL shutdown when  it receives a 1 with the EOF bit . Turn a socket into an . and  that use OpenSSL to write 9 to and read from the socket, respectively. Does an SSL E bi-directional shutdown and closes the socket when both a) the enum 6 completes and b) the iter has received an EOF chunk. !If the SSL handshake fails, then iterSSL closes the socket before  throwing an exception. 9This funciton must only be invoked from within a call to   withOpenSSL. BSimplest possible SSL context, loads cert and unencrypted private  key from a single file.  ?Quick and dirty funciton to generate a self signed certificate , for testing and stick it in a file. E.g.: ) genSelfSigned "testkey.pem" "localhost" OpenSSL context  The socket  for server handshake,  for client   Filename in which to output key "Common Name (usually domain name) e    e Safe-Infered!State used by $, the most generic zlib .  Create the state using " or #. " Create a !* for compression. See the description of   deflateInit21 in the zlib.h C header file for a more detailed E description of the arguments. Note in particular that the value of   windowBits7 determines the encapsulation format of the compressed  data:  8..15 = zlib format  24..31 = gzip format 0 -8..-15 = means raw zlib format with no header # Create a Zstate, for uncompression. See the description of   inflateInit21 in the zlib.h C header file for a more detailed E description of the arguments. Note in particular that the value of   windowBits7 determines the encapsulation format of the compressed  data:  8..15 = zlib format  24..31 = gzip format ' 40..47 = automatically determine zlib/ gzip format 0 -8..-15 = means raw zlib format with no header $The most general zlib , which can take any ! created  by " or #. %An 5 that compresses in zlib format. To uncompress, use  '. &An ! that compresses in gzip format. 'An 5 that uncompresses a data in either the zlib or gzip C format. Note that this only uncompresses one gzip stream. Thus, = if you feed in the concatenation of multiple gzipped files,   inumGunzip5 will stop after the first one. If this is not what  you want, then use  inumGunzip to decode repeated  gzip streams. !"Compression level (use  for default)  Method (use )  windowBits (e.g., ) memLevel (e.g., ) strategy (e.g., ) # windowBits $%&' !"#$%&'!"#$%&'  !"#$%&'Safe  !"#$%&'()*+,-./012356789:;<=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Infered(Class of types whose .s can be converted to strict  Ms. Basically just strict M s and lazy  B)s. This class mostly exists so that the * 3 function can work with either type of ByteString. *Run an attoparsec parser in an . monad. Throws an  ! exception with constructor # if the parse - fails. (This exception can be handled with O and  P.) ++Try running an attoparsec parser. Returns  a if the  parser succeeds with result a . Returns  err where err D is an error message otherwise. Note that the input stream will be D in an indeterminate state should the parser fail. (If you need to C keep parsing input from some known state, it may be better to use  * in conjunction with O.) ()*+fg()*+()*+()*+fg  Trustworthy;,BData structure describing the configuration of an HTTP server for  {. 1@Given the headers of an HTTP request, provides an iteratee that ? will process the request body (if any) and return a response. 2AA data structure describing an HTTP response message to be sent, E parameterized by the Monad in which the response will be written to  the network. 4The response status. 5Headers to send back 62True if the message body should be passed through  Z and a "Transfer-Encoding: chunked" header , should be added. Generally this should be  unless you  have added a Content-Length header, manually set up chunk  encoding by fusing it in 7, or are not returning a  message body with the reply. 7" producing the message body. Use  (which is  an empty 1) to produce an empty body for responses that do  not contain a body. 8AHTTP status code and text description of response, for the first D line of an HTTP response message. A bunch of pre-defined statuses , from RFC 2616 are supplied under the names _, h,  j, etc. :BData structure representing the name and metadata of a control in  a submitted form. <)Name of the form control being processed =Parameters from the Content-Disposition: header. This only  applies to Content-Type: multipart/ form-data, and will be $ empty for forms of type application/x-www-form-urlencoded or 9 forms submitted in the URL parameters of a GET request. >Extra headers following the Content-Disposition: header of  a  multipart/ form-data& post. Empty for other kinds of form  submission. ?5Data structure representing an HTTP request message. AScheme (e.g., 'http', 'https', ...) BMethod (e.g., GET, POST, ...). C-Raw path from the URL (not needed if you use  reqPathList  and  reqPathParams). D>URL request path, broken into a list of directory components,  and normalized to remove "." and process "..". EUsed by routeVar& to save pathname components that are ? variables (used as a stack, so the last variable saved is the  first one in the list). F:Stores pathname components that have been stripped off of   reqPathLst during routing. G!The portion of the URL after the ? character (if any). H>Lower-case host header (or the host from the request line, if & the request is for an absolute URI). I(Port number if supplied in Host header. J;HTTP version major and minor number from the request line. K6List of all header field names and values in the HTTP ; request. Field names are converted to lowercase to allow  easier searching. L)List of Cookies supplied in the request. M>Parsed version of the Content-Type header, if any. The first  M2 is the actual content type. Following this is a @ list of parameter names and values. The most useful parameter  is "boundary", used with the  multipart/ form-data content  type. N,Value of the content-Length header, if any. OThe Transfer-Encoding header. P4Time from the If-Modified-Since header (if present) Q)Application-specific session information R4Formats a time in the format specified by RFC 2616. S Parses a Date/,Time string in any one of the three formats  specified by RFC 2616. T=Parses an absoluteURI, returning (scheme, host, path, query) U.Parses a Request-URI, defined by RFC2616, and & returns (scheme, host, path, query). V7Turn a path into a list of components. Used to set the  D field in a request. X8Returns a normalized version of the full requested path  (including all context in reqCtx) in the URL (e.g., where "."  has been eliminated, ".."& has been processed, there is exactly  one '/'5 between each directory component, and the query has  been stripped off). Y#Parse an HTTP header, returning an ? data structure. Z2An HTTP Chunk encoder (as specified by RFC 2616). [2An HTTP Chunk decoder (as specified by RFC 2616). \This 3 reads to the end of an HTTP message body (and not A beyond) and decodes the Transfer-Encoding. It handles straight > content of a size specified by the Content-Length header and  chunk-encoded content. ]BParses a form, and folds a function over each control. The value E of each control is available through Iteratee input. Thus, you can " extract the submitted value with U, or redirect it elsewhere  by executing another .$. For example, to parse a form and D print it to standard output (without buffering possibly large file  uploads in memory):   do let docontrol _ field = do  liftIO $ putStrLn $ G "The value of " ++ (S8.unpack $ ffName field) ++ " is:" K stdoutI -- Send form value to standard output " liftIO $ putStrLn "\n"  foldForm req docontrol () DOr to produce a list of (field, value) pairs, you can say something  like:  " do let docontrol acc field = do  val <- pureI . return $ (ffName field, val) : acc  foldForm req docontrol [] &Note that for POSTed forms of enctype   application/x-www-form-urlencoded, foldForm will read to the 4 end of its input. Thus, it is important to ensure foldForm is  called from within an \ enumerator (which is  guaranteed by {). l!Add header to the HTTP response. m:An empty HTTP response, to which you must add headers and  possibly a message body. n Generate an 2 without a body. o Generate an 2 with a body of type text/html. pMake an 2. of an arbitrary content-type based on a pure  lazy B1. Since the result is pure, this function first E measures its length so as to set a Content-Length header instead of  using HTTP chunk encoding. qMake an 2* of an arbitrary content-type based on an  = that will dynamically generate the message body. Since the C message body is generated dynamically, the reply will use an HTTP  chunk encoding. r$Generate a 301 (redirect) response. s%Generate a 303 (see other) response. t%Generate a 403 (forbidden) response. u%Generate a 404 (not found) response. v.Generate a 405 (method not allowed) response. w1Generate a 500 (internal server error) response. x1Format and enumerate a response header and body. yGenerate a null ," structure with no logging and no  Date header. z Generate an ,( structure that uses IO calls to log to > standard error and get the current time for the Date header. {An - that behaves like an HTTP server. The file  Examples/ httptest.hs) that comes with the iterIO distribution / gives an example of how to use this function. |Enumerate a request, and body. }Return a response. If the 'Trasnfer-Encoding' header is set to  'chunked'), it is removed from the headers and the 6  field is set.  x$ to enumerate the headers and body. T,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoBody as a pure lazy B pValue for Content-Type: header Contents of response body qValue for Content-Type header: , that will generate reply body dynamically. rstuvwxyz{Server configuration |}hiR,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}R?@ABCDEFGHIJKLMNOPQWXY\Z[RS:;<=>]|89^kjihgfedcba`_234567mlnopqrstuvwx}1,-./0yz{TUV4,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}hi  Safe-Infered~/An HTTP response handler used by HTTP clients. An HTTP client. Socket Socket address  SSL context Use SSL *User agent corresponding to this library. 6Maximum number of redirects. Defult: no redirect (0). BGiven an HTTP client configuration, make the actual connection to  server. #Given the host, port, context, and "is-https" flag, create 5 a client value. The returned value can be used with   to get raw pipes to/from the server. Note: Some of this code is from the HTTP package. 3Perform a simple HTTP GET request. No SSL support. $Perform a simple HTTPS GET request. 4Perform a simple HTTP HEAD request. No SSL support. %Perform a simple HTTPS HEAD request. BPerform a simple HTTP request, given the the request header, body  and SSL context, if any. >Make a general HTTP request to host specified in the request. A If the request is over HTTPS, the SSL context must be provided. = The redirect count is used to limit the number of redirects @ followed (when receiving a 3xx response); use 0 to return the  direct response. The  passCookies flag is used to guard cookies  on redirects: because  genSimpleHttp performs a "single request"  it does not parse " Set-Cookie"" headers and so is unaware of the D cookie domain. Hence, the flag is used for the decision in passing + the cookie to the location of a redirect. Create a simple HEAD request.  The url must be an  absoluteURI. Create a simple GET request.  The url must be an  absoluteURI. >Given a URL, Content-Type, and message body, perform a simple B POST request. Note: message body must be properly encoded (e.g., $ URL-encoded if the Content-Type is  " application/x-www-form-urlencoded"). 4Createa generic HTTP request, given an absoluteURI: 3 If the URI is not absolute, the parser will fail. 2Given an initial request, and a response handler, B create an inum that provides underlying functionality of an http  client. ~Host Port  SSL context  Is HTTPS URL URL  SSL Context URL URL  SSL Context Request header  Request body  SSL Context Request header  Message body  SSL Context Redirect count  Pass cookies URL Content-Type header  Message body ~~~  Trustworthy=An abstract representation of file system calls returning an  opaque handle type h in an . parameterized by an arbitrary   m). This representation allows one to use  ' in a monad that is not an instance of . Return file attributes. .Open file and return an opaque handle of type h. =Close an open file. You must call this unless you apply the  enumerator returned by fs_enum. 'Return the attributes of an open file. =Enumerate the contents of an open file, then close the file.  If you apply the  returned by fs_enum, you do not need  to call fs_close. Type alias for the argument of . *Simple HTTP request routing structure for {. This # is a wrapper around a function on ? structures. If the  function accepts the ? , it returns  a response  action. Otherwise it returns .  HttpRoute is a %, and hence can be concatenated with  \ or j,. For example, you can say something like:  C simpleServer :: Iter L.ByteString IO () -- Output to web browser D -> Onum L.ByteString IO () -- Input from web browser  -> IO () @ simpleServer iter enum = enum |$ inumHttpServer server .| iter & where htdocs = "/var/www/htdocs" 8 server = ioHttpServer $ runHttpRoute routing M routing = mconcat [ routeTop $ routeConst $ resp301 "/start.html" @ , routeName "apps" $ routeMap apps H , routeFileSys mimeMap "index.html" htdocs  ] + apps = [ ("app1", routeFn app1) - , ("app2", routeFn app2) ]  B app1 :: (Monad m) => HttpReq -> Iter L.ByteString m (HttpResp m)  app1 = ... .The above function will redirect requests for / to the URL  / start.html6 using an HTTP 301 (Moved Permanently) response. Any  request for a path under apps will be redirected to the  functions app1, app2*, etc. Finally, any other file name will , be served out of the file system under the "/var/www/htdocs" # directory. (This example assumes mimeMap has been constructed as  discussed for .) 6Prepend a header field to the response produced by an   if that - is successful. For example, to let clients / cache static data for an hour, you might use:   addHeader (k " Cache-control", k " max-age=3600") $   mime ( " index.html") "/var/www/htdocs" ?Route all requests to a constant response action that does not A depend on the request. This route always succeeds, so anything  \ed will never be used. @Route all requests to a particular function. This route always  succeeds, so anything \ed will never be used. @Select a route based on some arbitrary function of the request. - For most purposes, the existing predicates (,  8, etc.) should be fine, but occationally you might want E to define a custom predicate. For example, to reject methods other  then "GET" or "POST"* at the top of your route, you could say:   myRoute = j [ rejectBadMethod & , otherRoute1  , ...  ]  ...  rejectBadMethod ::  m rejectBadMethod =  routeReq $ req ->  case B req of  s | s == k "GET" || s == k "PUT" ->  4 {- reject route, falling through L to rest of myRoute -}  _ ->  $ v req {- reject request -} Route the root directory (/). Route requests whose "Host:" header matches a particular  string. @Route based on the method (GET, POST, HEAD, etc.) in a request. routeMap* builds an efficient map out of a list of  (directory_name, )! pairs. If a name is not in the E map, the request is not matched. Note that only the next directory " component in the URL is matched. routeAlwaysMap is like routeMap, but matches all requests and > returns a 404 error for names that do not appear in the map. 'Routes a specific directory name, like  for a singleton  map. Routes a specific path, like , except that the path " can include several directories. @Matches any directory name, but additionally pushes it onto the  front of the E list in the ? structure. This A allows the name to serve as a variable argument to the eventual  handling function. Parses  mime.types- file data. Returns a function mapping file B suffixes to mime types. The argument is a default mime type for E suffixes that do not match any in the mime.types data. (Reasonable  defaults might be "text/html", "text/plain" , or, more ! pedantically but less usefully, " application/ octet-stream".) Since this likely doesn'*t change, it is convenient just to define < it once in your program, for instance with something like: $ mimeMap :: String -> S8.ByteString  mimeMap = unsafePerformIO $ do 1 path <- findMimeTypes ["mime.types" 7 , "/etc/mime.types" A , "/var/www/conf/mime.types"] D enumFile path |$ mimeTypesI "application/octet-stream"  where 5 findMimeTypes (h:t) = do exist <- fileExist h L if exist then return h else findMimeTypes t @ findMimeTypes [] = return "mime.types" -- cause error dirRedir indexFileName) redirects requests to the URL formed by  appending "/" ++ indexFileName to the requested URL. ARoute a request to a directory tree in the file system. It gets ( the Content-Length from the target file's attributes (after opening E the file). Thus, overwriting files on an active server could cause ? problems, while renaming new files into place should be safe. A generalized version of  that takes a  . object and can therefore work outside of the   monad. Other than the  object, the . arguments and their meaning are identical to . 4String to compare against host (must be lower-case) 'Target route to follow if host matches String method should match 'Target route to take if method matches (Map of file suffixes to mime types (see ) 3Handler to invoke when the URL maps to a directory 2 in the file system. Reasonable options include:  (l )# to do nothing, which results in a  403 forbidden,  ( " index.html") to redirect directory " accesses to an index file, and  a recursive invocation such as (routeFileSys  typemap . (++ "/ index.html")) to re-route the $ request directly to an index file. 0Pathname of directory to serve from file system mmn !"#$%&'()*+,-./01233456789:;<=>?@@ABCDEFFGHHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{||}~      !"#$%&' ( ( ) ) * + , - . /0123456 7 8 9 : ; ; < = > ? @ @ A B C D E E F F G H I J J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                          &'J$$$$   $    !"#$%&'()*+,-.-/012013014015$6789:;<=>?@A@B.CDEDCFGHIJKLMNOPQRSTU$VWXYZ[\]^_`_abcdecfghihj]kcflmnmomp_qhrZ[stuvw$xy$z{|}~$c$cd     _$  iterIO-0.2.2Data.IterIO.ParseData.IterIO.ListLikeData.IterIO.ZlibData.IterIO.IterData.IterIO.TransData.IterIO.InumData.IterIO.ExtraData.IterIO.SearchData.IterIO.SSLData.IterIO.AttoData.IterIO.HttpData.IterIO.HttpClientData.IterIO.HttpRouteData.IterIO.ZlibInt Paths_iterIOL ByteStringLLhGet Data.IterIObaseControl.Applicative Applicative<**><**><*>pure Data.Functor<$> GHC.IO.Device AbsoluteSeek RelativeSeek SeekFromEndSeekModeGHC.Base<$ZMethod ZStrategy max_wbits max_mem_level def_mem_level zlib_versionz_DEFAULT_COMPRESSION z_FILTEREDz_HUFFMAN_ONLYz_RLEz_FIXEDz_DEFAULT_STRATEGY z_DEFLATED IterCUnsuppIterRFailDoneIterCIterMIterFIterFail IterMzero IterParseErr IterEOFErr IterExpected IterExceptionCtlArgCtlResCtlDoneCtlFail CtlUnsuppCtlCmdIterrunIterChunk ChunkDatanull chunkShowchunkchunkEOFiterF isIterActive iterShowsiterShowfmapIfmapRrunrunRrunI mkIterEOFthrowI throwEOFI throwParseIcatchIcatchPItryItryRItryEOFItryFIfinallyI onExceptionItryBItryFBI multiParseifParse ifNoParsenullIdata0IdataIpureIchunkIsomeI whileNullIpeekIatEOFIungetIsafeCtlIctlIstepR'stepRonDoneRonDonegetResidsetResidrunIterR reRunIter IterStateT runIterStateTigetigetsiputimodify adaptIter adaptIterMliftI liftIterIO runContTI runErrorTI runListTI runReaderTIrunRWSIrunRWSLI runStateTI runStateTLI runWriterTI runWriterTLIInumMCodec CtlHandler ResidHandlerOnumInum|$.|$catlcat|..| inumCatch inumFinallyinumOnExceptionresumeIverboseResumeInoCtlpassCtlconsCtlmkCtl mkFlushCtlrunIterM runIterMCrunInummkInumCmkInummkInumP pullupResid inumBracketinumNopinumNullinumPureenumPure inumRepeat runCodecCrunCodec setCtlHandler setAutoEOF setAutoDone addCleanup withCleanup mkInumAutoMmkInumMifeedifeed1ipipeirunirepeat ipopresididoneinumTeeSendRecvStringgenRecvgenSend genRecvFrom genSendToiterLoop inumSplit hShutdown traceInputtraceI GetSocketCTellCSeekCSizeCputIsendIheadLI safeHeadLIheadI safeHeadI safeLineIlineI data0MaxIdataMaxItakeIhandleI sockDgramI sockStreamIstdoutIfileCtl socketCtl enumDgram enumDgramFrom enumStream enumHandle' enumHandleenumNonBinHandle enumFile'enumFile enumStdin inumTakeExactinumMaxinumLoginumhLog inumStderrinumLtoSinumStoL pairFinalizer iterHandle iterStream<|>\/>$>$>orEmpty expectedIfoldrIfoldr1I foldrMinMaxIfoldlIfoldl1IfoldMIfoldM1IskipI optionalIensureIeord skipWhileI skipWhile1IwhileIwhile1I whileMaxI whileMinMaxIconcatIconcat1I concatMinMaxIreadIeofI<++><:>nilmanyskipManysepByendBysepEndBymany1 skipMany1sepBy1endBy1 sepEndBy1satisfycharmatchstring stringCaseinumStopStringmapImapLISslC SslConnectionunSslConnectionenumSslsslIiterSSL simpleContext genSelfSignedZState deflateInit2 inflateInit2 inumZStateinumZlibinumGzip inumGunzipIterStrictByteStringfromIterStrictByteStringattotryAttoHttpServerConf srvLoggersrvDate srvHandlerHttpRequestHandlerHttpResp respStatus respHeaders respChunkrespBody HttpStatus FormFieldffNameffParams ffHeadersHttpReq reqScheme reqMethodreqPath reqPathLst reqPathParams reqPathCtxreqQueryreqHostreqPortreqVers reqHeaders reqCookiesreqContentTypereqContentLengthreqTransferEncodingreqIfModifiedSince reqSession http_fmt_timedateIabsUriuri path2listdefaultHttpReq reqNormalPathhttpReqI inumToChunksinumFromChunks inumHttpBodyfoldFormstat100stat200stat301stat302stat303stat304stat307stat400stat401stat403stat404stat405stat500stat501 respAddHeaderdefaultHttpResp mkHttpHead mkHtmlRespmkContentLenResp mkOnumRespresp301resp303resp403resp404resp405resp500 enumHttpRespnullHttpServer ioHttpServerinumHttpServer enumHttpReq httpRespIHttpResponseHandler HttpClienthcSock hcSockAddrhcSslCtx hcIsHttps userAgentmaxNrRedirects httpConnect mkHttpClient simpleGetHttpsimpleGetHttpssimpleHeadHttpsimpleHeadHttps simpleHttp genSimpleHttp headRequest getRequest postRequestmkRequestToAbsUriinumHttpClientFileSystemCallsfs_statfs_openfs_closefs_fstatfs_enumHttpMap HttpRoute runHttpRoute addHeader routeConstrouteFnrouteReqrouteTop routeHost routeMethodrouteMaprouteAlwaysMap routeName routePathrouteVar mimeTypesIdirRedir routeFileSysrouteGenFileSys ZDataTypeZFlushZStream c_inflateEnd c_inflatec_inflateInit2 c_inflateInit c_deflateEnd c_deflatec_deflateInit2 c_deflateInit z_stream_sizez_stream_alignmentnext_inavail_intotal_innext_out avail_out total_outmsgzalloczfreeopaque data_typeadler z_NO_FLUSH z_SYNC_FLUSH z_FULL_FLUSHz_FINISHz_BLOCKz_OK z_STREAM_END z_NEED_DICTz_ERRNOz_STREAM_ERROR z_DATA_ERROR z_MEM_ERROR z_BUF_ERRORz_VERSION_ERRORz_BINARYz_TEXT z_UNKNOWNversion getBinDir getLibDir getDataDir getLibexecDirgetDataFileName Control.Monadmplusmzerotransformers-0.2.2.0Control.Monad.IO.ClassliftIOControl.Monad.Trans.Class MonadTransliftghc-prim GHC.TypesTrue Data.MonoidMonoidmemptyGHC.ListFalseGHC.ShowShowSShowshowsshowliftM>>=return Data.MaybeMaybeNothingfmapMonadMonadIOSystem.IO.Errorcatch GHC.ExceptionthrowGHC.IO.ExceptionIOError SomeExceptionfail Data.EitherRightLeftJust Exception $fMonadIOIter isEOFError Data.Typeablecast fromException$fChunkDataChunk$fExceptionIterCUnsupp$fShowIterCUnsupp$fMonadFixIter$fMonadTransIter$fMonadPlusIter $fMonadIter$fApplicativeIter$fFunctorIterR $fFunctorIter$fTypeableIter$fTypeable1Iter $fShowIterR$fExceptionIterFail$fShowIterFail $fMonoidChunk$fFunctorChunk $fShowChunk $fChunkData()$fChunkDataByteString$fChunkDataByteString0 $fChunkData[] Control.Monad.Trans.State.StrictStateT runStateT mtl-2.0.1.0Control.Monad.State.ClassgetgetsputmodifyidControl.Monad.Trans.ListListTControl.Monad.Trans.ContContTControl.Monad.Trans.ErrorErrorTControl.Monad.Trans.ReaderReaderTControl.Monad.Trans.RWS.StrictRWSTControl.Monad.Trans.RWS.LazyControl.Monad.Trans.State.Lazy!Control.Monad.Trans.Writer.StrictWriterTControl.Monad.Trans.Writer.Lazy runWriterT$fMonadWriterwIterStateT$fMonadReaderrIterStateT$fMonadErroreIterStateT$fMonadContIterStateT$fMonadWriterwIter$fMonadStatesIter$fMonadReaderrIter$fMonadErroreIter$fMonadContIter$fMonadIOIterStateT$fMonadTransIterStateT$fMonadIterStateTmaybeGHC.IOFilePathfoldr$fSendRecvStringByteString$fSendRecvStringByteString0$fSendRecvString[]network-2.3.0.11Network.SocketSocketGHC.IO.Handle.TypesHandlebytestring-0.9.2.1Data.ByteString.Lazy.InternalData.ByteString.LazyhPutListLike-3.1.4Data.ListLike.BaseListLikeData.ListLike.IO ListLikeIO GHC.IO.HandlehSetBinaryMode hSetBuffering NoBufferinghPutStrGHC.IO.Handle.FDstdoutopenBinaryFilestderrData.ByteString.InternalhClosesClose$fCtlCmdGetSocketCSocket$fCtlCmdTellCInteger$fCtlCmdSeekC()$fCtlCmdSizeCInteger$foldMordCharGHC.EnumEnumIntString GHC.ClassesEqmappendData.ListLike.String StringLikeliftA2++conscontainers-0.4.2.1Data.MapMapfromListHsOpenSSL-0.10.3OpenSSL.SessionSSLData.Typeable.InternalTypeable$fCtlCmdSslCSslConnection $fIterStrictByteStringByteString!$fIterStrictByteStringByteString0$fShowHttpResp$fEqHttpStatusmconcatData.ByteString.Char8packconst$fMonoidHttpRoute