Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > 51057bcd013d992f61ce4c2b0a4565e3 > files > 140

haskell-hxt-8.3.2-1mdv2010.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Control.Arrow.ArrowList</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_Control-Arrow-ArrowList.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>hxt-8.3.2: A collection of tools for processing XML with Haskell.</TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Control.Arrow.ArrowList</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Portability</TD
><TD CLASS="infoval"
>portable</TD
></TR
><TR
><TD CLASS="infohead"
>Stability</TD
><TD CLASS="infoval"
>experimental</TD
></TR
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>Uwe Schmidt (uwe\@fh-wedel.de)</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
><P
>Version    : $Id: ArrowList.hs,v 1.11 2006<EM
>06</EM
>01 12:59:04 hxml Exp $
</P
><P
>The List Arrow Class
</P
><P
>This module defines the interface for list arrows.
</P
><P
>A list arrow is a function, that gives a list of results
for a given argument. A single element result represents a normal function.
An empty list oven indicates, the function is undefined for the given argument.
The empty list may also represent False, none empty lists True.
A list with more than one element gives all results for a nondeterministic function.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> (<A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrow"
>Arrow</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowPlus"
>ArrowPlus</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowZero"
>ArrowZero</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowApply"
>ArrowApply</A
> a) =&gt; <A HREF="#t%3AArrowList"
>ArrowList</A
> a  <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3Aarr2"
>arr2</A
> ::  (b1 -&gt; b2 -&gt; c) -&gt; a (b1, b2) c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aarr3"
>arr3</A
> ::  (b1 -&gt; b2 -&gt; b3 -&gt; c) -&gt; a (b1, (b2, b3)) c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aarr4"
>arr4</A
> ::  (b1 -&gt; b2 -&gt; b3 -&gt; b4 -&gt; c) -&gt; a (b1, (b2, (b3, b4))) c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aarr2A"
>arr2A</A
> ::  (b -&gt; a c d) -&gt; a (b, c) d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AarrL"
>arrL</A
> ::  (b -&gt; [c]) -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aarr2L"
>arr2L</A
> ::  (b -&gt; c -&gt; [d]) -&gt; a (b, c) d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AconstA"
>constA</A
> ::  c -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AconstL"
>constL</A
> ::  [c] -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisA"
>isA</A
> ::  (b -&gt; <A HREF="/usr/share/doc/ghc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
>) -&gt; a b b</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%3E%3E."
>(&gt;&gt;.)</A
> ::  a b c -&gt; ([c] -&gt; [d]) -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%3E."
>(&gt;.)</A
> ::  a b c -&gt; ([c] -&gt; d) -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlistA"
>listA</A
> ::  a b c -&gt; a b [c]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunlistA"
>unlistA</A
> ::  a [b] b</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Athis"
>this</A
> ::  a b b</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Anone"
>none</A
> ::  a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwithDefault"
>withDefault</A
> ::  a b c -&gt; c -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Asingle"
>single</A
> ::  a b c -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AapplyA"
>applyA</A
> ::  a b (a b c) -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%24%3C"
>($&lt;)</A
> ::  (c -&gt; a b d) -&gt; a b c -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%24%3C%3C"
>($&lt;&lt;)</A
> ::  (c1 -&gt; c2 -&gt; a b d) -&gt; a b (c1, c2) -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%24%3C%3C%3C"
>($&lt;&lt;&lt;)</A
> ::  (c1 -&gt; c2 -&gt; c3 -&gt; a b d) -&gt; a b (c1, (c2, c3)) -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%24%3C%3C%3C%3C"
>($&lt;&lt;&lt;&lt;)</A
> ::  (c1 -&gt; c2 -&gt; c3 -&gt; c4 -&gt; a b d) -&gt; a b (c1, (c2, (c3, c4))) -&gt; a b d</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%24%3C%24"
>($&lt;$)</A
> ::  (c -&gt; a b b) -&gt; a b c -&gt; a b b</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmergeA"
>mergeA</A
> ::  (a (a1, b1) a1 -&gt; a (a1, b1) b1 -&gt; a (a1, b1) c) -&gt; a (a1, b1) c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aperform"
>perform</A
> ::  a b c -&gt; a b b</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcatA"
>catA</A
> ::  [a b c] -&gt; a b c</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AseqA"
>seqA</A
> ::  [a b b] -&gt; a b b</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Documentation</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> (<A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrow"
>Arrow</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowPlus"
>ArrowPlus</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowZero"
>ArrowZero</A
> a, <A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#t%3AArrowApply"
>ArrowApply</A
> a) =&gt; <A NAME="t:ArrowList"
><A NAME="t%3AArrowList"
></A
></A
><B
>ArrowList</B
> a  <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>The interface for list arrows
</P
><P
>Only mkA, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3Aarr2A"
>arr2A</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3AisA"
>isA</A
></TT
> '(&gt;&gt;.)' don't have default implementations
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
>Methods</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A NAME="v:arr2"
><A NAME="v%3Aarr2"
></A
></A
><B
>arr2</B
> ::  (b1 -&gt; b2 -&gt; c) -&gt; a (b1, b2) c</TD
></TR
><TR
><TD CLASS="doc"
>construction of a 2 argument arrow from a binary function
 |
 | example: <TT
> a1 &amp;&amp;&amp; a2 &gt;&gt;&gt; arr2 f </TT
>
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:arr3"
><A NAME="v%3Aarr3"
></A
></A
><B
>arr3</B
> ::  (b1 -&gt; b2 -&gt; b3 -&gt; c) -&gt; a (b1, (b2, b3)) c</TD
></TR
><TR
><TD CLASS="doc"
>construction of a 3 argument arrow from a 3-ary function
 |
 | example: <TT
> a1 &amp;&amp;&amp; a2 &amp;&amp;&amp; a3 &gt;&gt;&gt; arr3 f </TT
>
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:arr4"
><A NAME="v%3Aarr4"
></A
></A
><B
>arr4</B
> ::  (b1 -&gt; b2 -&gt; b3 -&gt; b4 -&gt; c) -&gt; a (b1, (b2, (b3, b4))) c</TD
></TR
><TR
><TD CLASS="doc"
>construction of a 4 argument arrow from a 4-ary function
 |
 | example: <TT
> a1 &amp;&amp;&amp; a2 &amp;&amp;&amp; a3 &amp;&amp;&amp; a4 &gt;&gt;&gt; arr4 f </TT
>
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:arr2A"
><A NAME="v%3Aarr2A"
></A
></A
><B
>arr2A</B
> ::  (b -&gt; a c d) -&gt; a (b, c) d</TD
></TR
><TR
><TD CLASS="doc"
>construction of a 2 argument arrow from a singe argument arrow
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:arrL"
><A NAME="v%3AarrL"
></A
></A
><B
>arrL</B
> ::  (b -&gt; [c]) -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
>constructor for a list arrow from a function with a list as result
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:arr2L"
><A NAME="v%3Aarr2L"
></A
></A
><B
>arr2L</B
> ::  (b -&gt; c -&gt; [d]) -&gt; a (b, c) d</TD
></TR
><TR
><TD CLASS="doc"
>constructor for a list arrow with 2 arguments
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:constA"
><A NAME="v%3AconstA"
></A
></A
><B
>constA</B
> ::  c -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
>constructor for a const arrow: <TT
> constA = arr . const </TT
>
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:constL"
><A NAME="v%3AconstL"
></A
></A
><B
>constL</B
> ::  [c] -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
>constructor for a const arrow: <TT
> constL = arrL . const </TT
>
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isA"
><A NAME="v%3AisA"
></A
></A
><B
>isA</B
> ::  (b -&gt; <A HREF="/usr/share/doc/ghc/libraries/ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
>) -&gt; a b b</TD
></TR
><TR
><TD CLASS="doc"
>builds an arrow from a predicate.
 If the predicate holds, the single list containing the input is returned, else the empty list
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:>>."
><A NAME="v%3A%3E%3E."
></A
></A
><B
>(&gt;&gt;.)</B
> ::  a b c -&gt; ([c] -&gt; [d]) -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
><P
>combinator for converting the result of a list arrow into another list
</P
><P
>example: <TT
> foo &gt;&gt;. reverse </TT
> reverses the the result of foo
</P
><P
>example: <TT
> foo &gt;&gt;. take 1 </TT
> constructs a deterministic version of foo by deleting all further results
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:>."
><A NAME="v%3A%3E."
></A
></A
><B
>(&gt;.)</B
> ::  a b c -&gt; ([c] -&gt; d) -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
>combinator for converting the result of an arrow into a single element result
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:listA"
><A NAME="v%3AlistA"
></A
></A
><B
>listA</B
> ::  a b c -&gt; a b [c]</TD
></TR
><TR
><TD CLASS="doc"
><P
>combinator for converting an arrow into a determinstic version with all results collected in a single element list
</P
><PRE
> listA af = af &gt;&gt;. (:[])</PRE
><P
>this is useful when the list of results computed by an arrow must be manipulated (e.g. sorted)
</P
><P
>example for sorting the results of a filter
</P
><PRE
> collectAndSort         :: a b c -&gt; a b c

 collectAndSort collect = listA collect &gt;&gt;&gt; arrL sort
</PRE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unlistA"
><A NAME="v%3AunlistA"
></A
></A
><B
>unlistA</B
> ::  a [b] b</TD
></TR
><TR
><TD CLASS="doc"
><P
>the inverse of <TT
><A HREF="Control-Arrow-ArrowList.html#v%3AlistA"
>listA</A
></TT
>
</P
><PRE
> listA af &gt;&gt;&gt; unlistA = af</PRE
><P
>unlistA is defined as <TT
> arrL id </TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:this"
><A NAME="v%3Athis"
></A
></A
><B
>this</B
> ::  a b b</TD
></TR
><TR
><TD CLASS="doc"
>the identity arrow, alias for returnA
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:none"
><A NAME="v%3Anone"
></A
></A
><B
>none</B
> ::  a b c</TD
></TR
><TR
><TD CLASS="doc"
>the zero arrow, alias for zeroArrow
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:withDefault"
><A NAME="v%3AwithDefault"
></A
></A
><B
>withDefault</B
> ::  a b c -&gt; c -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
><P
>converts an arrow, that may fail, into an arrow that always succeeds
</P
><P
>example: <TT
> withDefault none &quot;abc&quot; </TT
> is equivalent to <TT
> constA &quot;abc&quot; </TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:single"
><A NAME="v%3Asingle"
></A
></A
><B
>single</B
> ::  a b c -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
><P
>makes a list arrow deterministic, the number of results is at most 1
</P
><P
>definition
</P
><PRE
> single f = f &gt;&gt;. take 1
</PRE
><P
>examples with strings:
</P
><PRE
> runLA ( single none ) &quot;x&quot; == []
 runLA ( single this ) &quot;x&quot; == [&quot;x&quot;]
 runLA ( single
         (constA &quot;y&quot;
          &lt;+&gt; this ) ) &quot;x&quot; == [&quot;y&quot;]
</PRE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:applyA"
><A NAME="v%3AapplyA"
></A
></A
><B
>applyA</B
> ::  a b (a b c) -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
><P
>compute an arrow from the input and apply the arrow to this input
</P
><P
>definition: <TT
> (f &amp;&amp;&amp; this) &gt;&gt;&gt; app </TT
>
</P
><P
>in a point free style, there is no way to use an argument in 2 places,
 this is a combinator for simulating this. first the argument is used to compute an arrow,
 then this new arrow is applied to the input
</P
><P
>applyA coresponds to: <TT
> apply f x = let g = f x in g x </TT
>
</P
><P
>see also: <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C"
>$&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C%3C"
>$&lt;&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C%3C%3C"
>$&lt;&lt;&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%24"
>$&lt;$</A
></TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:$<"
><A NAME="v%3A%24%3C"
></A
></A
><B
>($&lt;)</B
> ::  (c -&gt; a b d) -&gt; a b c -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
><P
>compute the parameter for an arrow with extra parameters from the input
 and apply the arrow for all parameter values to the input
</P
><P
>a kind of &quot;function call&quot; for arrows, useful for joining arrows
</P
><PRE
> infixl 2 ($&lt;)
</PRE
><P
>definition:
</P
><PRE
> g $&lt; f = applyA (f &gt;&gt;&gt; arr g)
</PRE
><P
>if <TT
>f</TT
> fails, the whole arrow fails, e.g. <TT
> g $&lt; none == none </TT
>
</P
><P
>if <TT
>f</TT
> computes n values and <TT
>g</TT
> is deterministic, the whole arrow computes n values
</P
><P
>examples with simple list arrows with strings
</P
><PRE
> prefixString   :: String -&gt; a String String
 prefixString s =  arr (s++)

 runLA ( prefixString $&lt; none           ) &quot;x&quot; == []
 runLA ( prefixString $&lt; constA &quot;y&quot;     ) &quot;x&quot; == [&quot;yx&quot;]
 runLA ( prefixString $&lt; this           ) &quot;x&quot; == [&quot;xx&quot;]
 runLA ( prefixString $&lt; constA &quot;y&quot;
                         &lt;+&gt; constA &quot;z&quot; ) &quot;x&quot; == [&quot;yx&quot;,&quot;zx&quot;]
 runLA ( prefixString $&lt; constA &quot;y&quot;
                         &lt;+&gt; this
                         &lt;+&gt; constA &quot;z&quot; ) &quot;x&quot; == [&quot;yx&quot;,&quot;xx&quot;,&quot;zx&quot;]
</PRE
><P
>see also: <TT
><A HREF="Control-Arrow-ArrowList.html#v%3AapplyA"
>applyA</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C"
>$&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C%3C"
>$&lt;&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%3C%3C%3C"
>$&lt;&lt;&lt;&lt;</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C%24"
>$&lt;$</A
></TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:$<<"
><A NAME="v%3A%24%3C%3C"
></A
></A
><B
>($&lt;&lt;)</B
> ::  (c1 -&gt; c2 -&gt; a b d) -&gt; a b (c1, c2) -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
><P
>binary version of <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
>
</P
><P
>example with simple list arrows with strings
</P
><PRE
> infixString    :: String -&gt; String -&gt; a String String
 infixString s1 s2
                = arr (\ s -&gt; s1 ++ s ++ s2)

 runLA ( infixString $&lt;&lt; constA &quot;y&quot; &amp;&amp;&amp; constA &quot;z&quot; ) &quot;x&quot; = [&quot;yxz&quot;]
 runLA ( infixString $&lt;&lt; this &amp;&amp;&amp; this             ) &quot;x&quot; = [&quot;xxx&quot;]
 runLA ( infixString $&lt;&lt; constA &quot;y&quot;
                         &amp;&amp;&amp; (constA &quot;z&quot; &lt;+&gt; this) ) &quot;x&quot; = [&quot;yxz&quot;, &quot;yxx&quot;]
</PRE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:$<<<"
><A NAME="v%3A%24%3C%3C%3C"
></A
></A
><B
>($&lt;&lt;&lt;)</B
> ::  (c1 -&gt; c2 -&gt; c3 -&gt; a b d) -&gt; a b (c1, (c2, c3)) -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
><P
>version of <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
> for arrows with 3 extra parameters
</P
><P
>typical usage
</P
><PRE
> f $&lt;&lt;&lt; g1 &amp;&amp;&amp; g2 &amp;&amp;&amp; g3
</PRE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:$<<<<"
><A NAME="v%3A%24%3C%3C%3C%3C"
></A
></A
><B
>($&lt;&lt;&lt;&lt;)</B
> ::  (c1 -&gt; c2 -&gt; c3 -&gt; c4 -&gt; a b d) -&gt; a b (c1, (c2, (c3, c4))) -&gt; a b d</TD
></TR
><TR
><TD CLASS="doc"
><P
>version of <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
> for arrows with 4 extra parameters
</P
><P
>typical usage
</P
><PRE
> f $&lt;&lt;&lt;&lt; g1 &amp;&amp;&amp; g2 &amp;&amp;&amp; g3 &amp;&amp;&amp; g4
</PRE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:$<$"
><A NAME="v%3A%24%3C%24"
></A
></A
><B
>($&lt;$)</B
> ::  (c -&gt; a b b) -&gt; a b c -&gt; a b b</TD
></TR
><TR
><TD CLASS="doc"
><P
>compute the parameter for an arrow <TT
>f</TT
> with an extra parameter by an arrow <TT
>g</TT
>
 and apply all the results from <TT
>g</TT
> sequentially to the input
</P
><PRE
> infixl 2 ($&lt;$)
</PRE
><P
>typical usage:
</P
><PRE
> g :: a b c
 g = ...

 f :: c -&gt; a b b
 f x = ... x ...

 f $&lt;$ g
</PRE
><P
><TT
>f</TT
> computes the extra parameters for <TT
>g</TT
> from the input of type <TT
>b</TT
> and <TT
>g</TT
> is applied with this
 parameter to the input. This allows programming in a point wise style in <TT
>g</TT
>, which becomes
 neccessary, when a value is needed more than once.
</P
><P
>this combinator is useful, when transforming a single value (document) step by step,
 with <TT
>g</TT
> for collecting the data for all steps, and <TT
>f</TT
> for transforming the input step by step
</P
><P
>if <TT
>g</TT
> is deterministic (computes exactly one result),
 <TT
> g $&lt;$ f == g $&lt; f </TT
> holds
</P
><P
>if <TT
>g</TT
> fails, <TT
> f $&lt;$ g == this </TT
>
</P
><P
>if <TT
>g</TT
> computes more than one result, <TT
>f</TT
> is applied sequentially to the input for every result from <TT
>g</TT
>
</P
><P
>examples with simple list arrows with strings
</P
><PRE
> prefixString   :: String -&gt; a String String
 prefixString s =  arr (s++)

 runLA ( prefixString $&lt;$ none                      ) &quot;x&quot; == [&quot;x&quot;]
 runLA ( prefixString $&lt;$ constA &quot;y&quot;                ) &quot;x&quot; == [&quot;yx&quot;]
 runLA ( prefixString $&lt;$ constA &quot;y&quot; &lt;+&gt; constA &quot;z&quot; ) &quot;x&quot; == [&quot;zyx&quot;]
 runLA ( prefixString $&lt;$ constA &quot;y&quot; &lt;+&gt; this
                          &lt;+&gt; constA &quot;z&quot;            ) &quot;x&quot; == [&quot;zxyx&quot;]
</PRE
><P
>example with two extra parameter
</P
><PRE
> g1 :: a b c1
 g2 :: a b c2

 f          :: (c1, c2) -&gt; a b b
 f (x1, x2) =  ... x1 ... x2 ... 

 f $&lt;$ g1 &amp;&amp;&amp; g2
</PRE
><P
>see also: <TT
><A HREF="Control-Arrow-ArrowList.html#v%3AapplyA"
>applyA</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mergeA"
><A NAME="v%3AmergeA"
></A
></A
><B
>mergeA</B
> ::  (a (a1, b1) a1 -&gt; a (a1, b1) b1 -&gt; a (a1, b1) c) -&gt; a (a1, b1) c</TD
></TR
><TR
><TD CLASS="doc"
><P
>merge the result pairs of an arrow with type <TT
>a a1 (b1, b2)</TT
>
 by combining the tuple components with the <TT
>op</TT
> arrow
</P
><P
>examples with simple list arrows working on strings and XmlTrees
</P
><PRE
>     a1 :: a String (XmlTree, XmlTree)
     a1 = selem &quot;foo&quot; [this &gt;&gt;&gt; mkText]
 	  &amp;&amp;&amp;
 	  selem &quot;bar&quot; [arr (++&quot;0&quot;) &gt;&gt;&gt; mkText]
 
     runLA (a1 &gt;&gt;&gt; mergeA (&lt;+&gt;) &gt;&gt;&gt; xshow this) &quot;42&quot; == [&quot;&lt;foo&gt;42&lt;/foo&gt;&quot;,&quot;&lt;bar&gt;420&lt;/bar&gt;&quot;]
     runLA (a1 &gt;&gt;&gt; mergeA (+=)  &gt;&gt;&gt; xshow this) &quot;42&quot; == [&quot;&lt;foo&gt;42&lt;bar&gt;420&lt;/bar&gt;&lt;/foo&gt;&quot;]
</PRE
><P
>see also: <TT
><A HREF="Control-Arrow-ArrowList.html#v%3AapplyA"
>applyA</A
></TT
>, <TT
><A HREF="Control-Arrow-ArrowList.html#v%3A%24%3C"
>$&lt;</A
></TT
> and += in class Text.XML.HXT.Arrow.ArrowXml
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:perform"
><A NAME="v%3Aperform"
></A
></A
><B
>perform</B
> ::  a b c -&gt; a b b</TD
></TR
><TR
><TD CLASS="doc"
><P
>useful only for arrows with side effects: perform applies an arrow to the input
 ignores the result and returns the input
</P
><P
>example: <TT
> ... &gt;&gt;&gt; perform someTraceArrow &gt;&gt;&gt; ... </TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:catA"
><A NAME="v%3AcatA"
></A
></A
><B
>catA</B
> ::  [a b c] -&gt; a b c</TD
></TR
><TR
><TD CLASS="doc"
><P
>generalization of arrow combinator <TT
><A HREF="/usr/share/doc/ghc/libraries/base/Control-Arrow.html#v%3A%3C%2B%3E"
>&lt;+&gt;</A
></TT
>
</P
><P
>definition: <TT
> catA = foldl (&lt;+&gt;) none </TT
>
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:seqA"
><A NAME="v%3AseqA"
></A
></A
><B
>seqA</B
> ::  [a b b] -&gt; a b b</TD
></TR
><TR
><TD CLASS="doc"
><P
>generalization of arrow combinator <TT
><A HREF="/usr/share/doc/ghc/libraries/base/Control-Category.html#v%3A%3E%3E%3E"
>&gt;&gt;&gt;</A
></TT
>
</P
><P
>definition: <TT
> seqA = foldl (&gt;&gt;&gt;) this </TT
>
</P
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ArrowList')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:ArrowList" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="Control-Arrow-ArrowList.html#t%3AArrowList"
>ArrowList</A
> <A HREF="Control-Arrow-ListArrow.html#t%3ALA"
>LA</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Control-Arrow-ArrowList.html#t%3AArrowList"
>ArrowList</A
> <A HREF="Control-Arrow-IOListArrow.html#t%3AIOLA"
>IOLA</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Control-Arrow-ArrowList.html#t%3AArrowList"
>ArrowList</A
> (<A HREF="Control-Arrow-StateListArrow.html#t%3ASLA"
>SLA</A
> s)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Control-Arrow-ArrowList.html#t%3AArrowList"
>ArrowList</A
> (<A HREF="Control-Arrow-IOStateListArrow.html#t%3AIOSLA"
>IOSLA</A
> s)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.5.0</TD
></TR
></TABLE
></BODY
></HTML
>