nanoscope
Version:
A Lens Library for Javascript
408 lines (207 loc) • 6.91 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>nanoscope Class: Compose</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.spacelab.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top ">
<div class="navbar-inner">
<a class="brand" href="index.html">nanoscope</a>
<ul class="nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Compose.html">Compose</a>
</li>
<li>
<a href="Getter.html">Getter</a>
</li>
<li>
<a href="IndexedLens.html">IndexedLens</a>
</li>
<li>
<a href="IndexedLens.Unsafe.html">IndexedLens.Unsafe</a>
</li>
<li>
<a href="Lens.html">Lens</a>
</li>
<li>
<a href="MultiLens.html">MultiLens</a>
</li>
<li>
<a href="Optional.html">Optional</a>
</li>
<li>
<a href="PathLens.html">PathLens</a>
</li>
<li>
<a href="PathLens.Unsafe.html">PathLens.Unsafe</a>
</li>
<li>
<a href="Setter.html">Setter</a>
</li>
<li>
<a href="SliceLens.html">SliceLens</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#get">get</a>
</li>
<li>
<a href="global.html#IdLens">IdLens</a>
</li>
<li>
<a href="global.html#map">map</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Class: Compose</h1>
<section>
<header>
<h2>
Compose
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Compose"><span class="type-signature"></span>new Compose<span class="signature">(lensA, lensB)</span><span class="type-signature"> → {<a href="Compose.html">Compose</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Create the composite of two <code>Lens</code>es. For instance, to create a <code>Lens</code> for <code>arr[i][j]</code>:</p>
<pre class="prettyprint source lang-javascript"><code>arrIJLens = new Compose(
new IndexedLens(1),
new IndexedLens(0)
);</code></pre><p>Then <code>arrIJLens.get</code>, <code>.set</code>, and <code>.map</code> first call the appropriate function for the first <code>Lens</code>, then
the appropriate function for the second <code>Lens</code> and return the result.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>lensA</code></td>
<td class="type">
<span class="param-type"><a href="Lens.html">Lens</a></span>
</td>
<td class="description last"><p>The first <code>Lens</code> to call functions on</p></td>
</tr>
<tr>
<td class="name"><code>lensB</code></td>
<td class="type">
<span class="param-type"><a href="Lens.html">Lens</a></span>
</td>
<td class="description last"><p>The second <code>Lens</code> to call functions on</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Compose.html">Compose</a></span>
</dd>
</dl>
</dd>
</div>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha11</a>
on 2014-12-17T09:37:57-05:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<!--<script src="scripts/sunlight.js"></script>-->
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : "100px"
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
// $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" );
$( ".tutorial-section pre, .readme-section pre" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
lang = "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : false,
showMenu : true,
enableDoclinks : true
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
</body>
</html>