/usr/share/doc/libghc-mtl-doc/html/Control-Monad-Cont-Class.html is in libghc-mtl-doc 2.1.2-4.
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 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 44 45 46 47 48 49 50 51 | <!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.Monad.Cont.Class</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-Monad-Cont-Class.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Monad-Cont-Class.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">mtl-2.1.2: Monad classes, using functional dependencies</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Control.Monad.Cont.Class</p></div><div id="description"><p class="caption">Description</p><div class="doc"><dl><dt>Computation type:</dt><dd> Computations which can be interrupted and resumed.
</dd><dt>Binding strategy:</dt><dd> Binding a function to a monadic value creates
a new continuation which uses the function as the continuation of the monadic
computation.
</dd><dt>Useful for:</dt><dd> Complex control structures, error handling,
and creating co-routines.
</dd><dt>Zero and plus:</dt><dd> None.
</dd><dt>Example type:</dt><dd> <code><code>Cont</code> r a</code>
</dd></dl><p>The Continuation monad represents computations in continuation-passing style
(CPS).
In continuation-passing style function result is not returned,
but instead is passed to another function,
received as a parameter (continuation).
Computations are built up from sequences
of nested continuations, terminated by a final continuation (often <code>id</code>)
which produces the final result.
Since continuations are functions which represent the future of a computation,
manipulation of the continuation functions can achieve complex manipulations
of the future of the computation,
such as interrupting a computation in the middle, aborting a portion
of a computation, restarting a computation, and interleaving execution of
computations.
The Continuation monad adapts CPS to the structure of a monad.
</p><p>Before using the Continuation monad, be sure that you have
a firm understanding of continuation-passing style
and that continuations represent the best solution to your particular
design problem.
Many algorithms which require continuations in other languages do not require
them in Haskell, due to Haskell's lazy semantics.
Abuse of the Continuation monad can produce code that is impossible
to understand and maintain.
</p></div></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m => <a name="t:MonadCont" class="def">MonadCont</a> m <span class="keyword">where</span><a href="src/Control-Monad-Cont-Class.html#MonadCont" class="link">Source</a></p><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:callCC" class="def">callCC</a> :: ((a -> m b) -> m a) -> m a<a href="src/Control-Monad-Cont-Class.html#callCC" class="link">Source</a></p><div class="doc"><p><code>callCC</code> (call-with-current-continuation)
calls a function with the current continuation as its argument.
Provides an escape continuation mechanism for use with Continuation monads.
Escape continuations allow to abort the current computation and return
a value immediately.
They achieve a similar effect to <code><a href="Control-Monad-Error.html#t:throwError">throwError</a></code>
and <code><a href="Control-Monad-Error.html#t:catchError">catchError</a></code>
within an <code><a href="Control-Monad-Error.html#t:Error">Error</a></code> monad.
Advantage of this function over calling <code>return</code> is that it makes
the continuation explicit,
allowing more flexibility and better control
(see examples in <a href="Control-Monad-Cont.html">Control.Monad.Cont</a>).
</p><p>The standard idiom used with <code>callCC</code> is to provide a lambda-expression
to name the continuation. Then calling the named continuation anywhere
within its scope will escape from the computation,
even if it is many layers deep within nested computations.
</p></div></div><div class="subs instances"><p id="control.i:MonadCont" class="caption collapser" onclick="toggleSection('i:MonadCont')">Instances</p><div id="section.i:MonadCont" class="show"><table><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-List.html#t:ListT">ListT</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m) => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Writer-Strict.html#t:WriterT">WriterT</a> w m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m) => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Writer-Lazy.html#t:WriterT">WriterT</a> w m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-State-Strict.html#t:StateT">StateT</a> s m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-State-Lazy.html#t:StateT">StateT</a> s m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Reader.html#t:ReaderT">ReaderT</a> r m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Control-Monad-Error-Class.html#t:Error">Error</a> e, <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m) => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Error.html#t:ErrorT">ErrorT</a> e m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Cont.html#t:ContT">ContT</a> r m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m) => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-RWS-Strict.html#t:RWST">RWST</a> r w s m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m) => <a href="Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-RWS-Lazy.html#t:RWST">RWST</a> r w s m)</td><td class="doc empty"> </td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|