1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CrossPackageDocs</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><A HREF="">Contents</a></li><li><A HREF="">Index</a></li></ul><p class="caption" class="empty"> </p></div><div id="content"><div id="module-header"><p class="caption">CrossPackageDocs</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><A HREF="">map</a> :: (a -> b) -> [a] -> [b]</li><li class="src short"><span class="keyword">class</span> <A HREF="">Monad</a> m <span class="keyword">where</span><ul class="subs"><li><A HREF="">(>>=)</a> :: m a -> (a -> m b) -> m b</li><li><A HREF="">(>>)</a> :: m a -> m b -> m b</li><li><A HREF="">return</a> :: a -> m a</li><li><A HREF="">fail</a> :: <A HREF="">String</a> -> m a</li></ul></li><li class="src short"><A HREF="">runInteractiveProcess</a> :: <A HREF="">FilePath</a> -> [<A HREF="">String</a>] -> <A HREF="">Maybe</a> <A HREF="">FilePath</a> -> <A HREF="">Maybe</a> [(<A HREF="">String</a>, <A HREF="">String</a>)] -> <A HREF="">IO</a> (<A HREF="">Handle</a>, <A HREF="">Handle</a>, <A HREF="">Handle</a>, <A HREF="">ProcessHandle</a>)</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:map" class="def">map</a> :: (a -> b) -> [a] -> [b]</p><div class="doc"><p><code><A HREF="">map</a></code> <code>f xs</code> is the list obtained by applying <code>f</code> to each element
of <code>xs</code>, i.e.,
</p><pre> map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]
</pre></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Monad" class="def">Monad</a> m <span class="keyword">where</span></p><div class="doc"><p>The <code><A HREF="">Monad</a></code> class defines the basic operations over a <em>monad</em>,
a concept from a branch of mathematics known as <em>category theory</em>.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an <em>abstract datatype</em> of actions.
Haskell's <code>do</code> expressions provide a convenient syntax for writing
monadic expressions.
</p><p>Minimal complete definition: <code><A HREF="">>>=</a></code> and <code><A HREF="">return</a></code>.
</p><p>Instances of <code><A HREF="">Monad</a></code> should satisfy the following laws:
</p><pre> return a >>= k == k a
m >>= return == m
m >>= (\x -> k x >>= h) == (m >>= k) >>= h
</pre><p>Instances of both <code><A HREF="">Monad</a></code> and <code><A HREF="">Functor</a></code> should additionally satisfy the law:
</p><pre> fmap f xs == xs >>= return . f
</pre><p>The instances of <code><A HREF="">Monad</a></code> for lists, <code>Data.Maybe.Maybe</code> and <code>System.IO.IO</code>
defined in the <A HREF="">Prelude</a> satisfy these laws.
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:-62--62--61-" class="def">(>>=)</a> :: m a -> (a -> m b) -> m b</p><div class="doc"><p>Sequentially compose two actions, passing any value produced
by the first as an argument to the second.
</p></div><p class="src"><a name="v:-62--62-" class="def">(>>)</a> :: m a -> m b -> m b</p><div class="doc"><p>Sequentially compose two actions, discarding any value produced
by the first, like sequencing operators (such as the semicolon)
in imperative languages.
</p></div><p class="src"><a name="v:return" class="def">return</a> :: a -> m a</p><div class="doc"><p>Inject a value into the monadic type.
</p></div><p class="src"><a name="v:fail" class="def">fail</a> :: <A HREF="">String</a> -> m a</p><div class="doc"><p>Fail with a message. This operation is not part of the
mathematical definition of a monad, but is invoked on pattern-match
failure in a <code>do</code> expression.
</p></div></div><div class="subs instances"><p id="control.i:Monad" class="caption collapser" onclick="toggleSection('i:Monad')">Instances</p><div id="section.i:Monad" class="show"><table><tr><td class="src"><A HREF="">Monad</a> []</td><td class="doc empty"> </td></tr><tr><td class="src"><A HREF="">Monad</a> <A HREF="">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><A HREF="">Monad</a> Q</td><td class="doc empty"> </td></tr><tr><td class="src"><A HREF="">Monad</a> <A HREF="">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><A HREF="">Monad</a> ((->) r)</td><td class="doc empty"> </td></tr><tr><td class="src"><A HREF="">Monad</a> (<A HREF="">Either</a> e)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:runInteractiveProcess" class="def">runInteractiveProcess</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <A HREF="">FilePath</a></td><td class="doc"><p>Filename of the executable
</p></td></tr><tr><td class="src">-> [<A HREF="">String</a>]</td><td class="doc"><p>Arguments to pass to the executable
</p></td></tr><tr><td class="src">-> <A HREF="">Maybe</a> <A HREF="">FilePath</a></td><td class="doc"><p>Optional path to the working directory
</p></td></tr><tr><td class="src">-> <A HREF="">Maybe</a> [(<A HREF="">String</a>, <A HREF="">String</a>)]</td><td class="doc"><p>Optional environment (otherwise inherit)
</p></td></tr><tr><td class="src">-> <A HREF="">IO</a> (<A HREF="">Handle</a>, <A HREF="">Handle</a>, <A HREF="">Handle</a>, <A HREF="">ProcessHandle</a>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Runs a raw command, and returns <code><A HREF="">Handle</a></code>s that may be used to communicate
with the process via its <code>stdin</code>, <code>stdout</code> and <code>stderr</code> respectively.
</p><p>For example, to start a process and feed a string to its stdin:
</p><pre> (inp,out,err,pid) <- runInteractiveProcess "..."
forkIO (hPutStr inp str)
</pre><p>The <code><A HREF="">Handle</a></code>s are initially in binary mode; if you need them to be
in text mode then use <code><A HREF="">hSetBinaryMode</a></code>.
</p></div></div></div></div><div id="footer"><p>Produced by <A HREF="">Haddock</a> version 2.8.2</p></div></body></html>
|