244 lines
23 KiB
HTML
244 lines
23 KiB
HTML
<!--
|
|
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.11"/>
|
|
<title>Boost.Hana: Applicative</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">
|
|
$(document).ready(initResizable);
|
|
$(window).load(resizeHeight);
|
|
</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">
|
|
$(document).ready(function() { init_search(); });
|
|
</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" 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.3.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.11 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</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">
|
|
$(document).ready(function(){initNavTree('group__group-Applicative.html','');});
|
|
</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">Applicative<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>Applicative</code> concept represents <code>Functor</code>s with the ability to lift values and combine computations. </p>
|
|
<p>A <code>Functor</code> can only take a normal function and map it over a structure containing values to obtain a new structure containing values. Intuitively, an <code>Applicative</code> can also take a value and lift it into the structure. In addition, an <code>Applicative</code> can take a structure containing functions and apply it to a structure containing values to obtain a new structure containing values. By currying the function(s) inside the structure, it is then also possible to apply n-ary functions to n structures containing values.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>This documentation does not go into much details about the nature of applicatives. However, the <a href="https://wiki.haskell.org/Typeclassopedia#Applicative">Typeclassopedia</a> is a nice Haskell-oriented resource where such information can be found.</dd></dl>
|
|
<h2>Minimal complete definition </h2>
|
|
<p><code>lift</code> and <code>ap</code> satisfying the laws below. An <code>Applicative</code> must also be a <code>Functor</code>.</p>
|
|
<h2>Laws </h2>
|
|
<p>Given an <code>Applicative</code> <code>F</code>, the following laws must be satisfied:</p><ol type="1">
|
|
<li>Identity<br />
|
|
For all objects <code>xs</code> of tag <code>F(A)</code>, <div class="fragment"><div class="line"><a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(<span class="keywordtype">id</span>), xs) == xs</div></div><!-- fragment --></li>
|
|
<li>Composition<br />
|
|
For all objects <code>xs</code> of tag <code>F(A)</code> and functions-in-an-applicative \( fs : F(B \to C) \), \( gs : F(A \to B) \), <div class="fragment"><div class="line"><a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(<a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(<a class="code" href="group__group-functional.html#ga3b16146e53efcdf9ecbb9a7b21f8cd0b">compose</a>), fs, gs), xs) == <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(fs, <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(gs, xs))</div></div><!-- fragment --></li>
|
|
<li>Homomorphism<br />
|
|
For all objects <code>x</code> of tag <code>A</code> and functions \( f : A \to B \), <div class="fragment"><div class="line"><a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(f), lift<F>(x)) == lift<F>(f(x))</div></div><!-- fragment --></li>
|
|
<li>Interchange<br />
|
|
For all objects <code>x</code> of tag <code>A</code> and functions-in-an-applicative \( fs : F(A \to B) \), <div class="fragment"><div class="line"><a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(fs, lift<F>(x)) == <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(<a class="code" href="group__group-functional.html#ga30027c383676084be151ef3c6cf2829f">apply</a>(-, x)), fs)</div></div><!-- fragment --> where <code>apply(-, x)</code> denotes the partial application of the <code>apply</code> function from the <a class="el" href="group__group-functional.html">Functional</a> module to the <code>x</code> argument.</li>
|
|
</ol>
|
|
<p>As a consequence of these laws, the model of <code>Functor</code> for <code>F</code> will satisfy the following for all objects <code>xs</code> of tag <code>F(A)</code> and functions \( f : A \to B \): </p><div class="fragment"><div class="line"><a class="code" href="group__group-Functor.html#ga5a8975f6e55375d5b6038a9c36ee63e7">transform</a>(xs, f) == <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(f), xs)</div></div><!-- fragment --><h2>Refined concept </h2>
|
|
<ol type="1">
|
|
<li><code>Functor</code> (free model)<br />
|
|
As a consequence of the laws, any <code>Applicative F</code> can be made a <code>Functor</code> by setting <div class="fragment"><div class="line"><a class="code" href="group__group-Functor.html#ga5a8975f6e55375d5b6038a9c36ee63e7">transform</a>(xs, f) = <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(lift<F>(f), xs)</div></div><!-- fragment --></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>, <code><a class="el" href="structboost_1_1hana_1_1optional.html" title="Optional value whose optional-ness is known at compile-time. ">hana::optional</a></code>, <code><a class="el" href="structboost_1_1hana_1_1tuple.html" title="General purpose index-based heterogeneous sequence with a fixed length. ">hana::tuple</a></code></p>
|
|
<p><a class="anchor" id="applicative-transformation"></a></p><h2>Structure-preserving functions </h2>
|
|
<p>An <em>applicative transformation</em> is a function \( t : F(X) \to G(X) \) between two Applicatives <code>F</code> and <code>G</code>, where <code>X</code> can be any tag, and which preserves the operations of an Applicative. In other words, for all objects <code>x</code> of tag <code>X</code>, functions-in-an-applicative \( fs : F(X \to Y) \) and objects <code>xs</code> of tag <code>F(X)</code>, </p><div class="fragment"><div class="line">t(lift<F>(x)) == lift<G>(x)</div><div class="line">t(<a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(fs, xs)) == <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">ap</a>(t(fs), t(xs))</div></div><!-- fragment --><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
|
|
Variables</h2></td></tr>
|
|
<tr class="memitem:ga6176a32953dbbdee96e3ab3c73e4c890"><td class="memItemLeft" align="right" valign="top">constexpr auto </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">boost::hana::ap</a></td></tr>
|
|
<tr class="memdesc:ga6176a32953dbbdee96e3ab3c73e4c890"><td class="mdescLeft"> </td><td class="mdescRight">Lifted application.Specifically, <code>ap</code> applies a structure containing functions to a structure containing values, and returns a new structure containing values. The exact way in which the functions are applied to the values depends on the <code>Applicative</code>. <a href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">More...</a><br /></td></tr>
|
|
<tr class="separator:ga6176a32953dbbdee96e3ab3c73e4c890"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga712038d7abbc7159f8792788f7cd0c73"><td class="memTemplParams" colspan="2">template<typename A > </td></tr>
|
|
<tr class="memitem:ga712038d7abbc7159f8792788f7cd0c73"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__group-Applicative.html#ga712038d7abbc7159f8792788f7cd0c73">boost::hana::lift</a></td></tr>
|
|
<tr class="memdesc:ga712038d7abbc7159f8792788f7cd0c73"><td class="mdescLeft"> </td><td class="mdescRight">Lift a value into an <code>Applicative</code> structure.<code>lift<A></code> takes a normal value and embeds it into a structure whose shape is represented by the <code>A</code> <code>Applicative</code>. Note that the value may be a function, in which case the created structure may be <code>ap</code>plied to another <code>Applicative</code> structure containing values. <a href="group__group-Applicative.html#ga712038d7abbc7159f8792788f7cd0c73">More...</a><br /></td></tr>
|
|
<tr class="separator:ga712038d7abbc7159f8792788f7cd0c73"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Variable Documentation</h2>
|
|
<a class="anchor" id="ga6176a32953dbbdee96e3ab3c73e4c890"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">constexpr auto boost::hana::ap</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p><code>#include <<a class="el" href="fwd_2ap_8hpp.html">boost/hana/fwd/ap.hpp</a>></code></p>
|
|
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& f, <span class="keyword">auto</span>&& ...x) -> 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>Lifted application.Specifically, <code>ap</code> applies a structure containing functions to a structure containing values, and returns a new structure containing values. The exact way in which the functions are applied to the values depends on the <code>Applicative</code>. </p>
|
|
<p><code>ap</code> can be called with two arguments or more; the functions in the <code>f</code> structure are curried and then applied to the values in each <code>x...</code> structure using the binary form of <code>ap</code>. Note that this requires the number of <code>x...</code> must match the arity of the functions in the <code>f</code> structure. In other words, <code>ap(f, x1, ..., xN)</code> is equivalent to </p><div class="fragment"><div class="line">((f<span class="stringliteral">' <ap> x1) <ap> x2) ... <ap> xN</span></div></div><!-- fragment --><p> where <code>f'</code> is <code>f</code> but containing curried functions instead and <code>x <ap> y</code> is just <code>ap(x, y)</code> written in infix notation to emphasize the left associativity.</p>
|
|
<h2>Signature </h2>
|
|
<p>Given an Applicative <code>A</code>, the signature is \( \mathtt{ap} : A(T_1 \times \cdots \times T_n \to U) \times A(T_1) \times \cdots \times A(T_n) \to A(U) \).</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">f</td><td>A structure containing function(s).</td></tr>
|
|
<tr><td class="paramname">x...</td><td>Structure(s) containing value(s) and on which <code>f</code> is applied. The number of structures must match the arity of the functions in the <code>f</code> structure.</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="ap_8hpp.html">boost/hana/ap.hpp</a>></span></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="config_8hpp.html">boost/hana/config.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>></span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <functional></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"> <span class="comment">// with tuples</span></div><div class="line"> static_assert(</div><div class="line"> <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">hana::ap</a>(hana::make_tuple(std::plus<>{}), hana::make_tuple(1, 2),</div><div class="line"> hana::make_tuple(3, 4, 5))</div><div class="line"> ==</div><div class="line"> hana::make_tuple(</div><div class="line"> 1 + 3, 1 + 4, 1 + 5,</div><div class="line"> 2 + 3, 2 + 4, 2 + 5</div><div class="line"> )</div><div class="line"> , <span class="stringliteral">""</span>);</div><div class="line"></div><div class="line"> <span class="comment">// with optional values</span></div><div class="line"> BOOST_HANA_CONSTEXPR_LAMBDA <span class="keyword">auto</span> multiply = [](<span class="keyword">auto</span> a, <span class="keyword">auto</span> b, <span class="keyword">auto</span> c) {</div><div class="line"> <span class="keywordflow">return</span> a * b * c;</div><div class="line"> };</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#gac7aafc41e4dcc7d1f1929fb00f010d2a">BOOST_HANA_CONSTEXPR_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">hana::ap</a>(hana::just(multiply), hana::just(1),</div><div class="line"> hana::just(2),</div><div class="line"> hana::just(3))</div><div class="line"> ==</div><div class="line"> hana::just(1 * 2 * 3)</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Applicative.html#ga6176a32953dbbdee96e3ab3c73e4c890">hana::ap</a>(hana::just(multiply), hana::just(1),</div><div class="line"> hana::nothing,</div><div class="line"> hana::just(3))</div><div class="line"> ==</div><div class="line"> hana::nothing</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --><dl class="todo"><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>Consider giving access to all the arguments to the tag-dispatched implementation for performance purposes. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga712038d7abbc7159f8792788f7cd0c73"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename A > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">constexpr auto boost::hana::lift</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p><code>#include <<a class="el" href="fwd_2lift_8hpp.html">boost/hana/fwd/lift.hpp</a>></code></p>
|
|
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& x) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
|
|
<p>Lift a value into an <code>Applicative</code> structure.<code>lift<A></code> takes a normal value and embeds it into a structure whose shape is represented by the <code>A</code> <code>Applicative</code>. Note that the value may be a function, in which case the created structure may be <code>ap</code>plied to another <code>Applicative</code> structure containing values. </p>
|
|
<h2>Signature </h2>
|
|
<p>Given an Applicative <code>A</code>, the signature is \( \mathtt{lift}_A : T \to A(T) \).</p>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">A</td><td>A tag representing the <code>Applicative</code> into which the value is lifted.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">x</td><td>The value to lift into the applicative.</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="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="lift_8hpp.html">boost/hana/lift.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="tuple_8hpp.html">boost/hana/tuple.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(hana::lift<hana::tuple_tag>(<span class="charliteral">'x'</span>) == hana::make_tuple(<span class="charliteral">'x'</span>), <span class="stringliteral">""</span>);</div><div class="line">static_assert(hana::lift<hana::optional_tag>(<span class="charliteral">'x'</span>) == hana::just(<span class="charliteral">'x'</span>), <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>
|