Current section
Files
Jump to
Current section
Files
priv/static/docs/Newt.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="Newt v0.1.0">
<title>Newt — Newt v0.1.0</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
<script src="dist/handlebars.templates-K7URE6B4.js"></script>
<script src="dist/sidebar_items-1BF91242.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/html-YIPIRHGU.js"></script>
</head>
<body data-type="modules" class="page-behaviour">
<script>
try {
var settings = JSON.parse(localStorage.getItem('ex_doc:settings') || '{}');
if (settings.theme === 'dark' ||
((settings.theme === 'system' || settings.theme == null) &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.body.classList.add('dark')
}
} catch (error) { }
</script>
<div class="body-wrapper">
<button id="sidebar-menu" class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
</button>
<nav id="sidebar" class="sidebar">
<div class="sidebar-header">
<div class="sidebar-projectInfo">
<div>
<a href="https://github.com/jwilger/newt/blob/main/README.md" class="sidebar-projectName" translate="no">
Newt
</a>
<div class="sidebar-projectVersion" translate="no">
v0.1.0
</div>
</div>
</div>
<ul id="sidebar-listNav" class="sidebar-listNav" role="tablist">
<li>
<button id="extras-list-tab-button" role="tab" data-type="extras" aria-controls="extras-tab-panel" aria-selected="true" tabindex="0">
Pages
</button>
</li>
<li>
<button id="modules-list-tab-button" role="tab" data-type="modules" aria-controls="modules-tab-panel" aria-selected="false" tabindex="-1">
Modules
</button>
</li>
</ul>
</div>
<div id="extras-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="extras-list-tab-button">
<ul id="extras-full-list" class="full-list"></ul>
</div>
<div id="modules-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="modules-list-tab-button" hidden>
<ul id="modules-full-list" class="full-list"></ul>
</div>
</nav>
<main class="content">
<output role="status" id="toast"></output>
<div id="content" class="content-inner">
<div class="top-search">
<div class="search-settings">
<form class="search-bar" action="search.html">
<label class="search-label">
<span class="sr-only">Search documentation of Newt</span>
<input name="q" type="text" class="search-input" placeholder="Press / to search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</label>
<button type="submit" class="search-button" aria-label="Submit Search">
<i class="ri-search-2-line ri-lg" aria-hidden="true" title="Submit search"></i>
</button>
<button type="button" tabindex="-1" class="search-close-button" aria-hidden="true">
<i class="ri-close-line ri-lg" title="Cancel search"></i>
</button>
</form>
<div class="autocomplete">
</div>
<button class="icon-settings display-settings">
<i class="ri-settings-3-line"></i>
<span class="sr-only">Settings</span>
</button>
</div>
</div>
<div id="top-content">
<h1>
<a href="https://github.com/jwilger/newt/blob/main/lib/newt.ex#L1" title="View Source" class="icon-action" rel="help">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
<span translate="no">Newt</span> <small>behaviour</small>
<small class="app-vsn" translate="no">(Newt v0.1.0)</small>
</h1>
<section id="moduledoc">
<p>A low-cost abstraction implementing the NewType pattern in Elixir</p><p>There is no way (currently) to define zero-cost NewTypes in Elixir (like you
can in Rust, Haskell, F#, etc.) because Elixir is dynamically typed. However,
this library provides a low-cost abstraction that allows you to define
NewTypes in Elixir with minimal boilerplate.</p>
</section>
</div>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Summary</span>
</h1>
<div class="summary-callbacks summary">
<h2>
<a href="#callbacks">Callbacks</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#c:validate/1" data-no-tooltip translate="no">validate(value)</a>
</div>
</div>
</div>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#newtype/2" data-no-tooltip translate="no">newtype(type_name, typespec)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#newtype/3" data-no-tooltip translate="no">newtype(type_name, typespec, list)</a>
</div>
</div>
</div>
</section>
<section id="callbacks" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#callbacks">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Callbacks</span>
</h1>
<div class="callbacks-list">
<section class="detail" id="c:validate/1">
<div class="detail-header">
<a href="#c:validate/1" class="detail-link" data-no-tooltip title="Link to this callback">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this callback</span>
</a>
<h1 class="signature" translate="no">validate(value)</h1>
<a href="https://github.com/jwilger/newt/blob/main/lib/newt.ex#L119" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@callback</span> validate(value :: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()) :: {:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()} | {:error, <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}</pre>
</div>
</section>
</section>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Functions</span>
</h1>
<div class="functions-list">
<section class="detail" id="newtype/2">
<div class="detail-header">
<a href="#newtype/2" class="detail-link" data-no-tooltip title="Link to this macro">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this macro</span>
</a>
<h1 class="signature" translate="no">newtype(type_name, typespec)</h1>
<a href="https://github.com/jwilger/newt/blob/main/lib/newt.ex#L97" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
<span class="note">(macro)</span>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> newtype(<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">term</a>()) :: <a href="https://hexdocs.pm/elixir/Macro.html#t:t/0">Macro.t</a>()</pre>
</div>
</section>
</section>
<section class="detail" id="newtype/3">
<div class="detail-header">
<a href="#newtype/3" class="detail-link" data-no-tooltip title="Link to this macro">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this macro</span>
</a>
<h1 class="signature" translate="no">newtype(type_name, typespec, list)</h1>
<a href="https://github.com/jwilger/newt/blob/main/lib/newt.ex#L106" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
<span class="note">(macro)</span>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> newtype(<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">term</a>(), [{:do, <a href="https://hexdocs.pm/elixir/Macro.html#t:t/0">Macro.t</a>()}]) :: <a href="https://hexdocs.pm/elixir/Macro.html#t:t/0">Macro.t</a>()</pre>
</div>
</section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
<a href="https://hex.pm/packages/newt/0.1.0" class="footer-hex-package">Hex Package</a>
<a href="https://preview.hex.pm/preview/newt/0.1.0">Hex Preview</a>
</span>
<span class="line">
<button class="a-main footer-button display-quick-switch" title="Search HexDocs packages">
Search HexDocs
</button>
<a href="Newt.epub" title="ePub version">
Download ePub version
</a>
</span>
</p>
<p class="built-using">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener" translate="no">ExDoc</a> (v0.34.2) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
</p>
</footer>
</div>
</main>
</div>
</body>
</html>