ELEC60015-HLP-CW/docs/reference/global-helpers.html

199 lines
7.4 KiB
HTML
Raw Permalink Normal View History

2022-02-10 23:15:22 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Helpers - issie</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content=""/>
<meta name="author" content="tomcl"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://tomcl.github.io/issie//content/style.css" />
<script type="text/javascript" src="https://tomcl.github.io/issie//content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="http://fsharp.org">fsharp.org</a></li>
</ul>
<h3 class="muted"><a href="https://tomcl.github.io/issie//index.html">issie</a></h3>
</div>
<hr />
<div class="row">
<div class="span9" id="main">
<h1>Helpers</h1>
<p>
<span>Namespace: global</span><br />
</p>
<div class="xmldoc">
</div>
<!-- Render nested types and modules, if there are any -->
<h3>Functions and values</h3>
<table class="table table-bordered member-list">
<thead>
<tr><td>Function or value</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '3', 3)" onmouseover="showTip(event, '3', 3)">
assertThat cond msg
</code>
<div class="tip" id="3">
<strong>Signature:</strong> cond:bool -&gt; msg:string -&gt; unit<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L9-9" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '4', 4)" onmouseover="showTip(event, '4', 4)">
cropToLength len fromStart str
</code>
<div class="tip" id="4">
<strong>Signature:</strong> len:int -&gt; fromStart:bool -&gt; str:string -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L45-45" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Crop a string to the specified length.
fromStart indicates whether you want the first <len> characters or the last
<len> characters.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '5', 5)" onmouseover="showTip(event, '5', 5)">
listSet lst item idx
</code>
<div class="tip" id="5">
<strong>Signature:</strong> lst:&#39;a list -&gt; item:&#39;a -&gt; idx:int -&gt; &#39;a list<br />
<strong>Type parameters:</strong> 'a </div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L33-33" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Set an element of the list at the specified position.
This function is slow: O(n). Do not use unless necessary.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '6', 6)" onmouseover="showTip(event, '6', 6)">
pow2(exponent)
</code>
<div class="tip" id="6">
<strong>Signature:</strong> exponent:int -&gt; int<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L24-24" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Return 2^exponent.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '7', 7)" onmouseover="showTip(event, '7', 7)">
pow2int64(exponent)
</code>
<div class="tip" id="7">
<strong>Signature:</strong> exponent:int -&gt; int64<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L28-28" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Return 2^exponent, packed into an int64.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '8', 8)" onmouseover="showTip(event, '8', 8)">
tryFindError(lst)
</code>
<div class="tip" id="8">
<strong>Signature:</strong> lst:Result&lt;&#39;a,&#39;b&gt; list -&gt; Result&lt;&#39;a list,&#39;b&gt;<br />
<strong>Type parameters:</strong> 'a, 'b </div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Common/Helpers.fs#L15-15" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Return the first error found in a list of results, or the list of Oks if
there are none.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu" style="margin-top: 20px;">
<li class="nav-header">issie</li>
<li class="divider"></li>
<li><a href="https://github.com/tomcl/ISSIE">Source Code</a></li>
<li><a href="https://tomcl.github.io/issie//release-notes.html">Release Notes</a></li>
<li><a href="https://tomcl.github.io/issie//contributing.html">Contributing</a></li>
<li class="nav-header">Documentation</li>
<li><a href="https://tomcl.github.io/issie//index.html">Introduction</a></li>
<li class="divider"></li>
<li><a href="https://tomcl.github.io/issie//community.html">Community</a></li>
<li class="nav-header">Reference</li>
<li><a href="https://tomcl.github.io/issie//reference/index.html">API Reference</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>