123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <!--
- Copyright Louis Dionne 2013-2017
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- -->
- <!-- boost-no-inspect -->
- <!-- HTML header for doxygen 1.8.9.1-->
- <!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/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.15"/>
- <title>Boost.Hana: Comonad</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(initResizable);
- /* @license-end */</script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function() { init_search(); });
- /* @license-end */
- </script>
- <script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
- });
- // Copyright Louis Dionne 2013-2017
- // Distributed under the Boost Software License, Version 1.0.
- // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- MathJax.Hub.Config({
- "HTML-CSS": {
- linebreaks: {
- automatic: true,
- width: "75% container"
- }
- }
- });
- </script><script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <!-- Additional javascript for drawing charts. -->
- <script type="text/javascript" src="highcharts.js"></script>
- <script type="text/javascript" src="highcharts-data.js"></script>
- <script type="text/javascript" src="highcharts-exporting.js"></script>
- <script type="text/javascript" src="chart.js"></script>
- <script type="text/javascript" src="hana.js"></script>
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
- <td style="padding-left: 0.5em;">
- <div id="projectname">Boost.Hana
-  <span id="projectnumber">1.6.0</span>
- </div>
- <div id="projectbrief">Your standard library for metaprogramming</div>
- </td>
- <td> <div id="MSearchBox" class="MSearchBoxInactive">
- <span class="left">
- <img id="MSearchSelect" src="search/mag_sel.png"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- alt=""/>
- <input type="text" id="MSearchField" value="Search" accesskey="S"
- onfocus="searchBox.OnSearchFieldFocus(true)"
- onblur="searchBox.OnSearchFieldFocus(false)"
- onkeyup="searchBox.OnSearchFieldChange(event)"/>
- </span><span class="right">
- <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
- </span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.15 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @license-end */
- </script>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('group__group-Comonad.html','');});
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="summary">
- <a href="#var-members">Variables</a> </div>
- <div class="headertitle">
- <div class="title">Comonad<div class="ingroups"><a class="el" href="group__group-concepts.html">Concepts</a></div></div> </div>
- </div><!--header-->
- <div class="contents">
- <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
- <p>The <code>Comonad</code> concept represents context-sensitive computations and data. </p>
- <p>Formally, the Comonad concept is dual to the Monad concept. But unless you're a mathematician, you don't care about that and it's fine. So intuitively, a Comonad represents context sensitive values and computations. First, Comonads make it possible to extract context-sensitive values from their context with <code>extract</code>. In contrast, Monads make it possible to wrap raw values into a given context with <code>lift</code> (from Applicative).</p>
- <p>Secondly, Comonads make it possible to apply context-sensitive values to functions accepting those, and to return the result as a context-sensitive value using <code>extend</code>. In contrast, Monads make it possible to apply a monadic value to a function accepting a normal value and returning a monadic value, and to return the result as a monadic value (with <code>chain</code>).</p>
- <p>Finally, Comonads make it possible to wrap a context-sensitive value into an extra layer of context using <code>duplicate</code>, while Monads make it possible to take a value with an extra layer of context and to strip it with <code>flatten</code>.</p>
- <p>Whereas <code>lift</code>, <code>chain</code> and <code>flatten</code> from Applicative and Monad have signatures </p><p class="formulaDsp">
- \begin{align*} \mathtt{lift}_M &: T \to M(T) \\ \mathtt{chain} &: M(T) \times (T \to M(U)) \to M(U) \\ \mathtt{flatten} &: M(M(T)) \to M(T) \end{align*}
- </p>
- <p><code>extract</code>, <code>extend</code> and <code>duplicate</code> from Comonad have signatures </p><p class="formulaDsp">
- \begin{align*} \mathtt{extract} &: W(T) \to T \\ \mathtt{extend} &: W(T) \times (W(T) \to U) \to W(U) \\ \mathtt{duplicate} &: W(T) \to W(W(T)) \end{align*}
- </p>
- <p>Notice how the "arrows" are reversed. This symmetry is essentially what we mean by Comonad being the <em>dual</em> of Monad.</p>
- <dl class="section note"><dt>Note</dt><dd>The <a href="https://wiki.haskell.org/Typeclassopedia#Comonad">Typeclassopedia</a> is a nice Haskell-oriented resource for further reading about Comonads.</dd></dl>
- <h2>Minimal complete definition </h2>
- <p><code>extract</code> and (<code>extend</code> or <code>duplicate</code>) satisfying the laws below. A <code>Comonad</code> must also be a <code>Functor</code>.</p>
- <h2>Laws </h2>
- <p>For all Comonads <code>w</code>, the following laws must be satisfied: </p><div class="fragment"><div class="line"><a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">extract</a>(<a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>(w)) == w</div><div class="line"><a class="code" href="group__group-Functor.html#ga5a8975f6e55375d5b6038a9c36ee63e7">transform</a>(<a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>(w), <a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">extract</a>) == w</div><div class="line"><a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>(<a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>(w)) == <a class="code" href="group__group-Functor.html#ga5a8975f6e55375d5b6038a9c36ee63e7">transform</a>(<a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>(w), <a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">duplicate</a>)</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>There are several equivalent ways of defining Comonads, and this one is just one that was picked arbitrarily for simplicity.</dd></dl>
- <h2>Refined concept </h2>
- <ol type="1">
- <li>Functor<br />
- Every Comonad is also required to be a Functor. At first, one might think that it should instead be some imaginary concept CoFunctor. However, it turns out that a CoFunctor is the same as a <code>Functor</code>, hence the requirement that a <code>Comonad</code> also is a <code>Functor</code>.</li>
- </ol>
- <h2>Concrete models </h2>
- <p><code><a class="el" href="structboost_1_1hana_1_1lazy.html" title="hana::lazy implements superficial laziness via a monadic interface.">hana::lazy</a></code> </p>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
- Variables</h2></td></tr>
- <tr class="memitem:ga181751278bd19a4bfc3c08bd7ddef399"><td class="memItemLeft" align="right" valign="top">constexpr auto </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">boost::hana::duplicate</a></td></tr>
- <tr class="memdesc:ga181751278bd19a4bfc3c08bd7ddef399"><td class="mdescLeft"> </td><td class="mdescRight">Add an extra layer of comonadic context to a comonadic value.Given a value already in a comonadic context, <code>duplicate</code> wraps this value with an additional layer of comonadic context. This can be seen as the dual operation to <code>flatten</code> from the Monad concept. <a href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">More...</a><br /></td></tr>
- <tr class="separator:ga181751278bd19a4bfc3c08bd7ddef399"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:gaf44692351fd9fe4e76815dfef6ff4478"><td class="memItemLeft" align="right" valign="top">constexpr auto </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Comonad.html#gaf44692351fd9fe4e76815dfef6ff4478">boost::hana::extend</a></td></tr>
- <tr class="memdesc:gaf44692351fd9fe4e76815dfef6ff4478"><td class="mdescLeft"> </td><td class="mdescRight">Comonadic application of a function to a comonadic value.Given a comonadic value and a function accepting a comonadic input, <code>extend</code> returns the result of applying the function to that input inside the comonadic context. <a href="group__group-Comonad.html#gaf44692351fd9fe4e76815dfef6ff4478">More...</a><br /></td></tr>
- <tr class="separator:gaf44692351fd9fe4e76815dfef6ff4478"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ga307479a91a21b7ab06a2bc746b003dcc"><td class="memItemLeft" align="right" valign="top">constexpr auto </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">boost::hana::extract</a></td></tr>
- <tr class="memdesc:ga307479a91a21b7ab06a2bc746b003dcc"><td class="mdescLeft"> </td><td class="mdescRight">Extract a value in a given comonadic context.Given a value inside a comonadic context, extract it from that context, performing whatever effects are mandated by that context. This can be seen as the dual operation to the <code>lift</code> method of the Applicative concept. <a href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">More...</a><br /></td></tr>
- <tr class="separator:ga307479a91a21b7ab06a2bc746b003dcc"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <h2 class="groupheader">Variable Documentation</h2>
- <a id="ga181751278bd19a4bfc3c08bd7ddef399"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ga181751278bd19a4bfc3c08bd7ddef399">◆ </a></span>duplicate</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto boost::hana::duplicate</td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><code>#include <<a class="el" href="fwd_2duplicate_8hpp.html">boost/hana/fwd/duplicate.hpp</a>></code></p>
- <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& w) -> decltype(<span class="keyword">auto</span>) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
- <p>Add an extra layer of comonadic context to a comonadic value.Given a value already in a comonadic context, <code>duplicate</code> wraps this value with an additional layer of comonadic context. This can be seen as the dual operation to <code>flatten</code> from the Monad concept. </p>
- <h2>Signature </h2>
- <p>Given a Comonad <code>W</code>, the signature is \( \mathtt{duplicate} : W(T) \to W(W(T)) \)</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">w</td><td>The value to wrap in an additional level of comonadic context.</td></tr>
- </table>
- </dd>
- </dl>
- <h2>Example </h2>
- <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <<a class="code" href="duplicate_8hpp.html">boost/hana/duplicate.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="extract_8hpp.html">boost/hana/extract.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="lazy_8hpp.html">boost/hana/lazy.hpp</a>></span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> constexpr <span class="keyword">auto</span> very_lazy = <a class="code" href="group__group-Comonad.html#ga181751278bd19a4bfc3c08bd7ddef399">hana::duplicate</a>(hana::make_lazy(3));</div><div class="line"> static_assert(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(very_lazy)) == 3, <span class="stringliteral">""</span>);</div><div class="line">}</div></div><!-- fragment -->
- </div>
- </div>
- <a id="gaf44692351fd9fe4e76815dfef6ff4478"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#gaf44692351fd9fe4e76815dfef6ff4478">◆ </a></span>extend</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto boost::hana::extend</td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><code>#include <<a class="el" href="fwd_2extend_8hpp.html">boost/hana/fwd/extend.hpp</a>></code></p>
- <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& w, <span class="keyword">auto</span>&& f) -> decltype(<span class="keyword">auto</span>) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
- <p>Comonadic application of a function to a comonadic value.Given a comonadic value and a function accepting a comonadic input, <code>extend</code> returns the result of applying the function to that input inside the comonadic context. </p>
- <h2>Signature </h2>
- <p>Given a Comonad <code>W</code> and a function of type \( W(T) \to U \), the signature is \( \mathtt{extend} : W(T) \times (W(T) \to U) \to W(U) \)</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">w</td><td>A comonadic value to call the function with.</td></tr>
- <tr><td class="paramname">f</td><td>A function of signature \( W(T) \to U \) to be applied to its comonadic argument inside the comonadic context.</td></tr>
- </table>
- </dd>
- </dl>
- <h2>Example </h2>
- <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="eval_8hpp.html">boost/hana/eval.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="extend_8hpp.html">boost/hana/extend.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="extract_8hpp.html">boost/hana/extract.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="lazy_8hpp.html">boost/hana/lazy.hpp</a>></span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <functional></span></div><div class="line"><span class="preprocessor">#include <istream></span></div><div class="line"><span class="preprocessor">#include <sstream></span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line">T read_one(std::istream& s) {</div><div class="line"> T <a class="code" href="group__group-Constant.html#ga1687520692a6b0c49e3a69de2980f388">value</a>;</div><div class="line"> s >> <a class="code" href="group__group-Constant.html#ga1687520692a6b0c49e3a69de2980f388">value</a>;</div><div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__group-Constant.html#ga1687520692a6b0c49e3a69de2980f388">value</a>;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> std::stringstream s;</div><div class="line"> s << <span class="stringliteral">"1 2 3"</span>;</div><div class="line"></div><div class="line"> <span class="keyword">auto</span> from_stream = <a class="code" href="group__group-Comonad.html#gaf44692351fd9fe4e76815dfef6ff4478">hana::extend</a>(hana::make_lazy(read_one<int>)(std::ref(s)), [](<span class="keyword">auto</span> i) {</div><div class="line"> <span class="keywordflow">return</span> hana::eval(i) + 1;</div><div class="line"> });</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(from_stream) == 2);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(from_stream) == 3);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(from_stream) == 4);</div><div class="line">}</div></div><!-- fragment -->
- </div>
- </div>
- <a id="ga307479a91a21b7ab06a2bc746b003dcc"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ga307479a91a21b7ab06a2bc746b003dcc">◆ </a></span>extract</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto boost::hana::extract</td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><code>#include <<a class="el" href="fwd_2extract_8hpp.html">boost/hana/fwd/extract.hpp</a>></code></p>
- <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& w) -> decltype(<span class="keyword">auto</span>) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
- <p>Extract a value in a given comonadic context.Given a value inside a comonadic context, extract it from that context, performing whatever effects are mandated by that context. This can be seen as the dual operation to the <code>lift</code> method of the Applicative concept. </p>
- <h2>Signature </h2>
- <p>Given a Comonad <code>W</code>, the signature is \( \mathtt{extract} : W(T) \to T \)</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">w</td><td>The value to be extracted inside a comonadic context.</td></tr>
- </table>
- </dd>
- </dl>
- <h2>Example </h2>
- <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <<a class="code" href="extract_8hpp.html">boost/hana/extract.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="placeholder_8hpp.html">boost/hana/functional/placeholder.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="lazy_8hpp.html">boost/hana/lazy.hpp</a>></span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">static_assert(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(hana::make_lazy(1)) == 1, <span class="stringliteral">""</span>);</div><div class="line">static_assert(<a class="code" href="group__group-Comonad.html#ga307479a91a21b7ab06a2bc746b003dcc">hana::extract</a>(hana::make_lazy(<a class="code" href="group__group-functional.html#gaefe9fd152cba94be71c2b5b9de689d23">hana::_</a> + 1)(3)) == 4, <span class="stringliteral">""</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
- </div>
- </div>
- </div><!-- contents -->
- </div><!-- doc-content -->
- <!--
- Copyright Louis Dionne 2013-2017
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- -->
- <!-- boost-no-inspect -->
- <!-- HTML footer for doxygen 1.8.9.1-->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- </ul>
- </div>
- </body>
- </html>
|