$\      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-InferredThe 7 type class is used to implement functions that have a < variable number of arguments. It provides a family of type  isomorphisms  fun ==|*++~|== args -> res,where % fun = a1 -> a2 -> ... -> an -> res, % args = (a1, (a2, (..., (an, ())))).  Multiple curry: map a function  (a[sub 1], (a[sub 2], (==|*?~.|==, ())) ==|*%-$|== b  to its curried form  a[sub 1] ==|*%-$|== a[sub 2]" ==|*%-$|== ==|*?~.|== ==|*%-$|== b. !Multiple uncurry: map a function  a[sub 1] ==|*%-$|== a[sub 2]" ==|*%-$|== ==|*?~.|== ==|*%-$|== b  to its uncurried form  (a[sub 1], (a[sub 2], (==|*?~.|==, ())) ==|*%-$|== b. A version of the  function that returns an . None*Available graphics formats for rendering. !An ASCII-based debugging format. %Encapsulated PostScript. The integer ) argument specifies which single page to  extract from the document. Portable Document Format.  PostScript. Boxed version of the   monad. The   monad is just a   wrapped around  the  monad. Its $ and % methods 0 automatically keep track of the file position. 9A state to keep track of PDF document structure: current 2 character count, current TOC, current page, etc. Current position in file. Object count. Cross-reference table. Next available page number.  Page table. Next available font number. Font table mapping each font'#s PostScript name to a local name. A PDF object reference. +A position in a file. The first byte is 0. The  monad. This is just a  wrapped around  the  monad. AA state to keep track of a current bounding box and page number. The type of page numbers. A class to curry/+uncurry functions in any boxed monad. This  establishes an isomorphism  ) @fun ==|*++~|== args -> Boxed m res,@ where - fun = a1 -> a2 -> ... -> an -> Boxed m res, % args = (a1, (a2, (..., (an, ())))). Create an identical "boxed"% copy of a type constructor. This is * used for technical reasons, to allow the  operation to be  typed.  A generic #. Write a string. !Write a character. "Terminate with a result. #A #. is any monad that one can output strings to. Minimal complete definition: $ or %. $Write a character. %Write a string. &?A data structure that holds application-specific meta-data and  customization information. (,Name of the software that created the file.  Example: " MyApp 1.0". Note: this is intended + to hold the name of the software, not the ( human user, that created the document. )$Definitions to go in the PostScript  preamble. *4The type of custom definitions, to be used with the  d command. ,AAn enumeration of backend languages, for the purpose of defining C custom drawing commands. Note that several backends (e.g. EPS and A PostScript) may share the same language, and therefore they are , only represented once in this enumeration. -ASCII (for debugging) .PDF /PostScript (including EPS) 0The Draw monad. 1Block structure. Perform the  commands of the outer 0 in  a temporary copy of the  graphics state, then continue  with the inner 0 in the  original graphics state. 2Write a command and continue. 3Terminate with a result. 4>An abstract data type describing individual drawing commands. 50A subroutine is a composite drawing command. In 1 addition to a default definition that works for 4 any backend, it can also have optional specialized & definitions for particular backends. 6'A human-readable comment, not rendered 7&Rotate the current coordinate system. 8%Scale the current coordinate system. 9%Translate current coordinate system. :Set current color. ;Set current line width. <Text. =,Fill and stroke and clear the current path. >!Fill and clear the current path. ?#Stroke and clear the current path. @Close the current subpath. AAppend a Bezier curve segment. B/Append a straight line to the current subpath. C.Start a new subpath at the given coordinates. DSet the current path to empty. EThe Document monad. FPage with bounding box  known at the end. GPage with bounding box  known at the beginning. HTerminate with a result. IBA real number representing text alignment. 0 = left aligned, 0.5 = = centered, 1 = right aligned. Intermediate values are also E possible. For example, an alignment value of 0.25 means one quarter 4 of the way between left aligned and right aligned. J>A data type describing a scaled font. This consists of a base  font and a point size. LBA type representing font metrics for a given base font. The first D component is the default width of characters; the second component % is a map from characters to widths. M?A enumeration type for base fonts. For the time being, we only ! offer TimesRoman and Helvetica. PThe type of colors. QGray value, in the range from  0.0 (black) to 1.0 (white). R Red, green and blue components, ! in the range from 0.0 (dark) to  1.0 (bright). S The type of y-coordinates. T The type of x-coordinates. U)Define a font metric for each base font. VFont metrics for TimesRoman. WFont metrics for Helvetica. X6Look up the width of a character in the given metric. Y4Look up with width of a string in the given metric. Z)Return the nominal point size of a font. [8Return the width of the given string in the given font. \Left alignment. ]Centered alignment. ^Right alignment. _)Skip document without rendering. `>Create a page of the given bounding box, containing the given  drawing. aBCreate a page containing the given drawing, with the bounding box . computed at the end of the drawing routines. b*End the page with the given bounding box. cWrite the given command to the 0 monad. dCreate a new subroutine. eWrite a block to the 0 monad. f%Skip draw actions without rendering. gSet the current path to empty. hStart a new subpath at (x,y). The point (x,y) becomes the  current point. i?Extend the current subpath by a straight line segment from the  current point to (x,y). The point (x,y) becomes the current  point. jj x1 y1 x2 y2 x y: Extend the current = subpath by a Bezier curve segment from the current point to  (x,y), with control points (x1,y1) and (x2,y2). The  point (x,y) becomes the current point. k<Close the current subpath. If necessary, connect the subpath's B final and initial points by a straight line segment. Note that a B closed path is rendered differently than a non-closed path whose D initial and final points coincide, because in the latter case, the + endpoints are capped rather than mitered. l<Stroke the current path, using the current line color, line A width, and other graphics parameters. This operation implicitly # resets the current path to empty. m=Fill the current path, using the given color. This operation / implicitly resets the current path to empty. n>Fill the current path, using the given color; also stroke the E path using the current line color. This operation implicitly resets  the current path to empty. oo a f c x0 y0 x1 y1 b s : Write the / given string on an imaginary line from point (x0,y0) to  (x1,y1), using font f and color c. If the text is too wide A to fit on the line, it is scaled down. Otherwise, it is aligned & according to the alignment parameter a. The parameter b A specifies an additional offset by which to lower the text, with  respect to the text' s nominal size. For example, if b =0, then the & above-mentioned imaginary line from (x0,y0) to (x1,y1)  coincides with the text's usual baseline. If b=0.5, then this ? line approximately goes through the center of each character. [image textbox.png] p1Set the line width. The initial line width is 1. q@Set the current color for stroking. The initial stroke color is  black. r,Translate the current coordinate system by (x,y). s(Scale the current coordinate system by (s,t ). Here, s is  the scaling factor in the x-direction, and t is the scaling  factor in the y -direction. t(Rotate the current coordinate system by angle , measured  counterclockwise in degrees. u?Insert a human-readable comment in the content stream. This is D for information only, and is not rendered in the graphical output. v<Perform a block of commands in a local copy of the graphics / state. This is intended to be used like this:  block $ do  <<drawing commands>> w>Start a new subpath consisting of a circular arc segment. The  arc segment is centered at (x,y), has radius r, and extends  from angle a1 to angle a2, measured in degrees,  counterclockwise from the x%-axis. The arc is drawn clockwise if  a2 ==|**.%|== a12, and counterclockwise otherwise. The final point  becomes the new current point. xLike w6, except append to the current subpath. If necessary, D add a straight line segment from the current point to the starting  point of the arc. y>Append a new closed subpath consisting of an oval centered at  (x,y&), with horizontal and vertical radii rx and ry,  respectively. zThe common implementation of w, x, and y. The C first parameter is a boolean flag indicating whether to append to B an existing subpath or start a new subpath. The fourth and fifth 3 parameter are the horizontal and vertical radius. {{ x y w h: Draw a rectangle of width w and  height h, starting from (x,y). If w and h are positive,  then (x,y) is the lower left corner. |'Define a custom PostScript definition. } Define a custom PDF definition. ~"Define a custom ASCII definition.  Look up an element in a list of *s. ;An empty customization structure. Customizations should be  specified by modifying , for example: " custom { creator = "MyApp 1.0" } Like % , but adds a newline character. 8Write a value of any printable type, and add a newline. Isomorphically map a # computation to a pair of a string  and a value. Important usage note: the  in the output is produced  lazily, and before a+ is produced. To preserve laziness, do not  evaluate a before the end of  has been reached. The inverse of . Run a  computation in any #. Run a writer in the  monad by printing to a file. &Run a writer by printing to a string. Unbox a boxed item. FPrint a formatted value in the context of a boxed WriterMonad. Usage: wprintf %f %f x y :: Boxed Writer In any #, introduce a block in which  can be D used. This has no computational overhead, i.e., is compiled to the ? identity operation; it exists only to please the type system,  due to the fancy typing of . Wrap a filter around a  computation. This introduces a  local block within the $ monad; all text written within the D block is encoded through the given filter. Filters can be composed  and nested. A filter for performing "flate" (also known as "zlib")  compression. BNote: both the input and output strings are regarded as sequences E of bytes, not characters. Any characters outside the byte range are  truncated to 8 bits. :Ensure that the last line of the string ends in a newline  character, adding one if necessary. An empty string is considered to contain zero lines, so no newline character needs to be added. Render draw actions as ASCII. "Render drawing commands as ASCII. Render a document as ASCII. ARender a document as ASCII. This is for debugging purposes only. = The output is a sequence of drawing commands, rather than a  graphical representation. /Escape special characters in a string literal. 'Remove newline characters in a string.  The initial . Run function for the  monad. Get the bounding box. Add to the bounding box. Get the page count. Return the next page number. #Render draw actions as PostScript. Set the color. Set the font. -Draw a single drawing command to PostScript. !Render a document as PostScript. <Global PostScript definitions used by the rendering engine. Render pages as PostScript. 7Render document as PostScript. The first argument is a  customization data structure. BRender a document as EPS. Since EPS only permits a single page of  output, the / parameter is used to specify which page (of a D potential multi-page document) should be printed. An error will be - thrown if the page number was out of range. ?Note: if the return value is not used, the remaining pages are  lazily skipped. >Render document as EPS. The first argument is a customization C data structure, and the second argument is the number of the page  to extract from the document. /Escape special characters in a string literal.  The initial  . Run function for the   monad. Get the file position. Add to the file position. ;Get the number of allocated objects. Note that objects are  allocated as 1, 2, ..., n; this function returns n. &Allocate an unused object identifier. 4Add a cross reference to the cross reference table. $Retrieve the cross reference table. Get the page count. Return the next page number. Add a page to the page table. Retrieve the page table. .Look up the local font identifier for a font. Retrieve the font table. Clear the font table.  A version of  tailored to the   monad. AThis allows certain global state updates within the local block. B Specifically, updates to everything except the file position are > propagated from the inner to the outer block. The outer block's 8 file position is updated to reflect the encoded content's  length. From the inner block'#s point of view, the file position  starts from 0. >Define an indirect PDF object with the given object id, which 2 must have previously been uniquely obtained with . BThis can be used to define objects with forward references: first @ obtain an object id, then create references to the object, and  finally define the object. It should be used like this:  obj <- pdf_next_object  ...  pdf_deferred_object obj $ do  <<object definition>> @Define an indirect PDF object with a newly generated object id. 1 Return the object id. This essentially combines   and ' into a single function, and should be  used like this:  obj <- pdf_define_object $ do  <<object definition>> @Define a PDF stream object with the given object id, which must - have previously been uniquely obtained with . It  should be used like this:  obj <- pdf_next_object  ...  pdf_deferred_stream obj $ do  <<stream contents>> 9Define a PDF stream object with a newly generated object : id. Return the object id. This should be used like this:  obj <- pdf_define_stream $ do  <<stream contents>> @Define a compressed PDF stream object with the given object id, 8 which must have previously been uniquely obtained with  . It should be used like this:  obj <- pdf_next_object  ... $ pdf_deferred_flate_stream obj $ do  <<stream contents>> ?Create a direct object from a reference to an indirect object. BWrite one line in the cross reference table. This must be exactly 8 20 characters long, including the terminating newline. BFormat the cross reference table. Return the file position of the  cross reference table. Set the fill color. Set the stroke color. Set the font. !Render a drawing command to PDF. Render a draw action to PDF. >Render pages as PDF. The first argument is a reference to the  document's page tree node. BNote: Acrobat reader cannot handle pages whose bounding box width ; or height exceed 200 inches (14400 points). Therefore, we = automatically scale pages to be no greater than 199 inches. Render a document as PDF. 0Render document as PDF. The first argument is a  customization data structure. +Does the format require raw binary output? Render a document to the  monad, using the given output * format and customization data structure. ?Render a document to a file, using the given output format and  customization data structure. =Render a document to standard output, using the given output * format and customization data structure. ARender a document to a string, using the given output format and  customization data structure. Render a document to the ' monad, using the given output format. <Render a document to a file, using the given output format. ERender a document to standard output, using the given output format. >Render a document to a string, using the given output format.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~TSPRQMONLUVWXYJKZ[I\]^EHGF_`ab4DCBA@?>=<;:987650321cdefghijklmnopqrstuvwxyz{,/.-*+|}~&'()#$%"!     "! #$%&'()*+,/.-03214DCBA@?>=<;:98765EHGFIJKLMONPRQSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None<&'()0EIJKMNOPQRSTZ[\]^`abdghijklmnopqrsuvwxy{|}~<TSPRQMONJKZ[I\]^E`ab0ghijkwxy{lmnopqrsuvd|}~&'()      !"#$%&''()**+,-./0123456789:;<=>?@ABCDEFGHIIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~easyrender-0.1.0.0Graphics.EasyRender.AuxiliaryGraphics.EasyRender.InternalGraphics.EasyRenderCurrymcurrymuncurry int_ceiling RenderFormat Format_Debug Format_EPS Format_PDF Format_PS PDFWriter RawPDFWriter PDF_State pdf_filepospdf_objpdf_xrefpdf_page pdf_pagetablepdf_font pdf_fonttableObjectFileposPSWriterPS_StatePage Boxed_Curry boxed_curry boxed_uncurryBoxedWriter Writer_PutStrWriter_PutChar Writer_Return WriterMonadwPutCharwPutStrCustomcreatorps_defs CustomDefLanguageLanguage_ASCII Language_PDF Language_PSDraw Draw_Block Draw_Write Draw_Return DrawCommand SubroutineCommentRotateScale TranslateSetColor SetLineWidthTextBox FillStrokeFillStroke ClosepathCurvetoLinetoMovetoNewpathDocumentDocument_Page_defer Document_PageDocument_Return AlignmentFont FontmetricBasefont Helvetica TimesRomanColor Color_Gray Color_RGBYXmetricmetric_timesromanmetric_helvetica char_metric string_metric nominalsize text_width align_left align_center align_right document_skipnewpage newpage_deferendpage draw_writedraw_subroutine draw_block draw_skipnewpathmovetolinetocurveto closepathstrokefill fillstroketextbox setlinewidthsetcolor translatescalerotatecommentblockarc arc_appendoval arc_internal rectangle custom_ps custom_pdf custom_ascii custom_lookupcustom wPutStrLnwprintwriter_to_pairpair_to_writer run_writerwriter_to_filewriter_to_stringunboxwprintf with_printf with_filter flate_filter ensure_nl draw_to_asciicommand_to_asciidocument_to_ascii render_ascii ps_escape remove_nlps_state_empty pswriter_run ps_get_bbox ps_add_bboxps_get_pagecount ps_next_page draw_to_ps color_to_ps font_to_ps command_to_psdocument_to_psglobal_ps_defs pages_to_psrender_ps_customdocument_to_epsrender_eps_custom pdf_escapepdf_state_empty pdfwriter_runpdf_get_filepospdf_inc_filepospdf_get_objcountpdf_next_object pdf_add_xref pdf_get_xrefpdf_get_pagecount pdf_next_pagepdf_add_pagetablepdf_get_pagetable pdf_find_fontpdf_get_fonttablepdf_clear_fonttablewith_filter_pdfpdf_deferred_objectpdf_define_objectpdf_deferred_streampdf_define_streampdf_deferred_flate_streamobjrefwprintf_xref_entry wprintf_xreffillcolor_to_pdfstrokecolor_to_pdf font_to_pdfcommand_to_pdf draw_to_pdf pages_to_pdfdocument_to_pdfrender_pdf_customis_binary_format render_customrender_custom_filerender_custom_stdoutrender_custom_stringrender render_file render_stdout render_stringbaseGHC.Realceiling integer-gmpGHC.Integer.TypeInteger$fCurry(->)(,)res $fCurryb()bGHC.BaseStringghc-prim GHC.TypesIO$fWriterMonadStateT$fWriterMonadStateT0$fBoxed_Curry(->)(,)mres$fBoxed_CurryBoxed()ma$fMonadStatesBoxed$fWriterMonadBoxed $fMonadBoxed$fWriterMonadWriter $fMonadWriter$fWriterMonadIO $fMonadDraw$fMonadDocument