This file is indexed.

/usr/share/doc/libghc-netwire-doc/html/Control-Wire-Switch.html is in libghc-netwire-doc 5.0.0-5build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<!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>Control.Wire.Switch</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_Control-Wire-Switch.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Wire-Switch.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">netwire-5.0.0: Functional reactive programming library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>(c) 2013 Ertugrul Soeylemez</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>Ertugrul Soeylemez &lt;es@ertes.de&gt;</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Control.Wire.Switch</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Simple switching</a></li><li><a href="#g:2">Context switching</a></li><li><a href="#g:3">Event-based switching</a><ul><li><a href="#g:4">Intrinsic</a></li><li><a href="#g:5">Intrinsic continuable</a></li><li><a href="#g:6">Extrinsic</a></li><li><a href="#g:7">Extrinsic continuable</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc empty">&nbsp;</div></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="#v:-45--45--62-">(--&gt;)</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b</li><li class="src short"><a href="#v:modes">modes</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> k) =&gt; k -&gt; (k -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> k) b</li><li class="src short"><a href="#v:switch">switch</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> s) =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a (b, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b</li><li class="src short"><a href="#v:dSwitch">dSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a (b, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b</li><li class="src short"><a href="#v:kSwitch">kSwitch</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> s) =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, b) (<a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b</li><li class="src short"><a href="#v:dkSwitch">dkSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, b) (<a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b</li><li class="src short"><a href="#v:rSwitch">rSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b</li><li class="src short"><a href="#v:drSwitch">drSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b</li><li class="src short"><a href="#v:krSwitch">krSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b</li><li class="src short"><a href="#v:dkrSwitch">dkrSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b</li></ul></div><div id="interface"><h1 id="g:1">Simple switching</h1><div class="top"><p class="src"><a name="v:-45--45--62-" class="def">(--&gt;)</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b <span class="fixity">infixr 1</span><span class="rightedge"></span> <a href="src/Control-Wire-Switch.html#--%3E" class="link">Source</a></p><div class="doc"><p>Acts like the first wire until it inhibits, then switches to the
 second wire.  Infixr 1.</p><ul><li>Depends: like current wire.</li><li>Inhibits: after switching like the second wire.</li><li>Switch: now.</li></ul></div></div><h1 id="g:2">Context switching</h1><div class="top"><p class="src"><a name="v:modes" class="def">modes</a> <a href="src/Control-Wire-Switch.html#modes" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> k)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; k</td><td class="doc"><p>Initial mode.</p></td></tr><tr><td class="src">-&gt; (k -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)</td><td class="doc"><p>Select wire for given mode.</p></td></tr><tr><td class="src">-&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> k) b</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Route the left input signal based on the current mode.  The right
 input signal can be used to change the current mode.  When switching
 away from a mode and then switching back to it, it will be resumed.
 Freezes time during inactivity.</p><ul><li>Complexity: O(n * log n) space, O(log n) lookup time on switch wrt
   number of started, inactive modes.</li><li>Depends: like currently active wire (left), now (right).</li><li>Inhibits: when active wire inhibits.</li><li>Switch: now on mode change.</li></ul></div></div><h1 id="g:3">Event-based switching</h1><h2 id="g:4">Intrinsic</h2><div class="top"><p class="src"><a name="v:switch" class="def">switch</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> s) =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a (b, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b <a href="src/Control-Wire-Switch.html#switch" class="link">Source</a></p><div class="doc"><p>Intrinsic switch:  Start with the given wire.  As soon as its event
 occurs, switch to the wire in the event's value.</p><ul><li>Inhibits: like argument wire until switch, then like the new wire.</li><li>Switch: once, now, restart state.</li></ul></div></div><div class="top"><p class="src"><a name="v:dSwitch" class="def">dSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a (b, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b <a href="src/Control-Wire-Switch.html#dSwitch" class="link">Source</a></p><div class="doc"><p>Intrinsic switch:  Delayed version of <code><a href="Control-Wire-Switch.html#v:switch">switch</a></code>.</p><ul><li>Inhibits: like argument wire until switch, then like the new wire.</li><li>Switch: once, after now, restart state.</li></ul></div></div><h2 id="g:5">Intrinsic continuable</h2><div class="top"><p class="src"><a name="v:kSwitch" class="def">kSwitch</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> s) =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, b) (<a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b <a href="src/Control-Wire-Switch.html#kSwitch" class="link">Source</a></p><div class="doc"><p>Intrinsic continuable switch:  <code>kSwitch w1 w2</code> starts with <code>w1</code>.
 Its signal is received by <code>w2</code>, which may choose to switch to a new
 wire.  Passes the wire we are switching away from to the new wire,
 such that it may be reused in it.</p><ul><li>Inhibits: like the first argument wire, like the new wire after
   switch.  Inhibition of the second argument wire is ignored.</li><li>Switch: once, now, restart state.</li></ul></div></div><div class="top"><p class="src"><a name="v:dkSwitch" class="def">dkSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, b) (<a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b <a href="src/Control-Wire-Switch.html#dkSwitch" class="link">Source</a></p><div class="doc"><p>Intrinsic continuable switch:  Delayed version of <code><a href="Control-Wire-Switch.html#v:kSwitch">kSwitch</a></code>.</p><ul><li>Inhibits: like the first argument wire, like the new wire after
   switch.  Inhibition of the second argument wire is ignored.</li><li>Switch: once, after now, restart state.</li></ul></div></div><h2 id="g:6">Extrinsic</h2><div class="top"><p class="src"><a name="v:rSwitch" class="def">rSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b <a href="src/Control-Wire-Switch.html#rSwitch" class="link">Source</a></p><div class="doc"><p>Extrinsic switch:  Start with the given wire.  Each time the input
 event occurs, switch to the wire it carries.</p><ul><li>Inhibits: like the current wire.</li><li>Switch: recurrent, now, restart state.</li></ul></div></div><div class="top"><p class="src"><a name="v:drSwitch" class="def">drSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b <a href="src/Control-Wire-Switch.html#drSwitch" class="link">Source</a></p><div class="doc"><p>Extrinsic switch:  Delayed version of <code><a href="Control-Wire-Switch.html#v:rSwitch">rSwitch</a></code>.</p><ul><li>Inhibits: like the current wire.</li><li>Switch: recurrent, after now, restart state.</li></ul></div></div><h2 id="g:7">Extrinsic continuable</h2><div class="top"><p class="src"><a name="v:krSwitch" class="def">krSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b <a href="src/Control-Wire-Switch.html#krSwitch" class="link">Source</a></p><div class="doc"><p>Extrinsic continuable switch.  This switch works like <code><a href="Control-Wire-Switch.html#v:rSwitch">rSwitch</a></code>,
 except that it passes the wire we are switching away from to the new
 wire.</p><ul><li>Inhibits: like the current wire.</li><li>Switch: recurrent, now, restart state.</li></ul></div></div><div class="top"><p class="src"><a name="v:dkrSwitch" class="def">dkrSwitch</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m (a, <a href="Control-Wire-Unsafe-Event.html#t:Event">Event</a> (<a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b -&gt; <a href="Control-Wire-Core.html#t:Wire">Wire</a> s e m a b)) b <a href="src/Control-Wire-Switch.html#dkrSwitch" class="link">Source</a></p><div class="doc"><p>Extrinsic continuable switch.  Delayed version of <code><a href="Control-Wire-Switch.html#v:krSwitch">krSwitch</a></code>.</p><ul><li>Inhibits: like the current wire.</li><li>Switch: recurrent, after now, restart state.</li></ul></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>