packages feed

Cabal-2.4.0.1: doc/API/Cabal/Distribution-Compat-Newtype.html

<!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/html; charset=UTF-8" /><title>Distribution.Compat.Newtype</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">Cabal-2.4.0.1: A framework for packaging Haskell software</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Distribution.Compat.Newtype</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Per Conor McBride, the <code><a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a></code> typeclass represents the packing and
 unpacking of a newtype, and allows you to operatate under that newtype with
 functions such as <code><a href="Distribution-Compat-Newtype.html#v:ala" title="Distribution.Compat.Newtype">ala</a></code>.</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><span class="keyword">class</span> <a href="#t:Newtype">Newtype</a> n o | n -&gt; o <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><a href="#v:ala">ala</a> :: (<a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o, <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n' o') =&gt; (o -&gt; n) -&gt; ((o -&gt; n) -&gt; b -&gt; n') -&gt; b -&gt; o'</li><li class="src short"><a href="#v:alaf">alaf</a> :: (<a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o, <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n' o') =&gt; (o -&gt; n) -&gt; ((a -&gt; n) -&gt; b -&gt; n') -&gt; (a -&gt; o) -&gt; b -&gt; o'</li><li class="src short"><a href="#v:pack-39-">pack'</a> :: <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o =&gt; (o -&gt; n) -&gt; o -&gt; n</li><li class="src short"><a href="#v:unpack-39-">unpack'</a> :: <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o =&gt; (o -&gt; n) -&gt; n -&gt; o</li></ul></details></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:Newtype" class="def">Newtype</a> n o | n -&gt; o <span class="keyword">where</span> <a href="#t:Newtype" class="selflink">#</a></p><div class="doc"><p>The <code>FunctionalDependencies</code> version of <code><a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a></code> type-class.</p><p><em>Note:</em> for actual newtypes the implementation can be
 <code>pack = coerce; unpack = coerce</code>. We don't have default implementation,
 because <code>Cabal</code> have to support older than <code>base &gt;= 4.7</code> compilers.
 Also, <code><a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a></code> could witness a non-structural isomorphism.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Distribution-Compat-Newtype.html#v:pack" title="Distribution.Compat.Newtype">pack</a>, <a href="Distribution-Compat-Newtype.html#v:unpack" title="Distribution.Compat.Newtype">unpack</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:pack" class="def">pack</a> :: o -&gt; n <a href="#v:pack" class="selflink">#</a></p><p class="src"><a id="v:unpack" class="def">unpack</a> :: n -&gt; o <a href="#v:unpack" class="selflink">#</a></p></div><div class="subs instances"><details id="i:Newtype" open="open"><summary>Instances</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:1"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:FilePathNT" title="Distribution.Parsec.Newtypes">FilePathNT</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:FilePathNT" title="Distribution.Parsec.Newtypes">FilePathNT</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:FilePathNT" title="Distribution.Parsec.Newtypes">FilePathNT</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:2"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:FreeText" title="Distribution.Parsec.Newtypes">FreeText</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:2"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:FreeText" title="Distribution.Parsec.Newtypes">FreeText</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:FreeText" title="Distribution.Parsec.Newtypes">FreeText</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:3"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:Token-39-" title="Distribution.Parsec.Newtypes">Token'</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:3"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:Token-39-" title="Distribution.Parsec.Newtypes">Token'</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:Token-39-" title="Distribution.Parsec.Newtypes">Token'</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:4"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:Token" title="Distribution.Parsec.Newtypes">Token</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:4"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:Token" title="Distribution.Parsec.Newtypes">Token</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:Token" title="Distribution.Parsec.Newtypes">Token</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:5"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:TestedWith" title="Distribution.Parsec.Newtypes">TestedWith</a> (<a href="Distribution-Compiler.html#t:CompilerFlavor" title="Distribution.Compiler">CompilerFlavor</a>, <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a>)</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:5"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: (<a href="Distribution-Compiler.html#t:CompilerFlavor" title="Distribution.Compiler">CompilerFlavor</a>, <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a>) -&gt; <a href="Distribution-Parsec-Newtypes.html#t:TestedWith" title="Distribution.Parsec.Newtypes">TestedWith</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:TestedWith" title="Distribution.Parsec.Newtypes">TestedWith</a> -&gt; (<a href="Distribution-Compiler.html#t:CompilerFlavor" title="Distribution.Compiler">CompilerFlavor</a>, <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a>) <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:6"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:SpecLicense" title="Distribution.Parsec.Newtypes">SpecLicense</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-SPDX-License.html#t:License" title="Distribution.SPDX.License">License</a> <a href="Distribution-License.html#t:License" title="Distribution.License">License</a>)</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:6"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-SPDX-License.html#v:License0" title="Distribution.SPDX.License">License0</a> <a href="Distribution-License.html#t:License" title="Distribution.License">License</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:SpecLicense" title="Distribution.Parsec.Newtypes">SpecLicense</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:SpecLicense" title="Distribution.Parsec.Newtypes">SpecLicense</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-SPDX-License.html#v:License0" title="Distribution.SPDX.License">License0</a> <a href="Distribution-License.html#t:License" title="Distribution.License">License</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:7"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> <a href="Distribution-Parsec-Newtypes.html#t:SpecVersion" title="Distribution.Parsec.Newtypes">SpecVersion</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-Types-Version.html#t:Version" title="Distribution.Types.Version">Version</a> <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a>)</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:7"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-Types-Version.html#t:Version" title="Distribution.Types.Version">Version</a> <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a> -&gt; <a href="Distribution-Parsec-Newtypes.html#t:SpecVersion" title="Distribution.Parsec.Newtypes">SpecVersion</a> <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:SpecVersion" title="Distribution.Parsec.Newtypes">SpecVersion</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Either" title="Distribution.Compat.Prelude.Internal">Either</a> <a href="Distribution-Types-Version.html#t:Version" title="Distribution.Types.Version">Version</a> <a href="Distribution-Types-VersionRange.html#t:VersionRange" title="Distribution.Types.VersionRange">VersionRange</a> <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:8"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Functor-Identity.html#t:Identity" title="Data.Functor.Identity">Identity</a> a) a</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:8"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Compat-Newtype.html">Distribution.Compat.Newtype</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: a -&gt; <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Functor-Identity.html#t:Identity" title="Data.Functor.Identity">Identity</a> a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Functor-Identity.html#t:Identity" title="Data.Functor.Identity">Identity</a> a -&gt; a <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:9"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Sum" title="Data.Monoid">Sum</a> a) a</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:9"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Compat-Newtype.html">Distribution.Compat.Newtype</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: a -&gt; <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Sum" title="Data.Monoid">Sum</a> a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Sum" title="Data.Monoid">Sum</a> a -&gt; a <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:10"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Product" title="Data.Monoid">Product</a> a) a</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:10"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Compat-Newtype.html">Distribution.Compat.Newtype</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: a -&gt; <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Product" title="Data.Monoid">Product</a> a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Product" title="Data.Monoid">Product</a> a -&gt; a <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:11"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="Distribution-Parsec-Newtypes.html#t:MQuoted" title="Distribution.Parsec.Newtypes">MQuoted</a> a) a</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:11"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: a -&gt; <a href="Distribution-Parsec-Newtypes.html#t:MQuoted" title="Distribution.Parsec.Newtypes">MQuoted</a> a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:MQuoted" title="Distribution.Parsec.Newtypes">MQuoted</a> a -&gt; a <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:12"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Endo" title="Data.Monoid">Endo</a> a) (a -&gt; a)</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:12"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Compat-Newtype.html">Distribution.Compat.Newtype</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: (a -&gt; a) -&gt; <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Endo" title="Data.Monoid">Endo</a> a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///opt/ghc/8.4.3/share/doc/ghc-8.4.3/html/libraries/base-4.11.1.0/Data-Monoid.html#t:Endo" title="Data.Monoid">Endo</a> a -&gt; a -&gt; a <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Newtype:Newtype:13"></span> <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> (<a href="Distribution-Parsec-Newtypes.html#t:List" title="Distribution.Parsec.Newtypes">List</a> sep wrapper a) [a]</span> <a href="#t:Newtype" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:Newtype:Newtype:13"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Parsec-Newtypes.html">Distribution.Parsec.Newtypes</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pack">pack</a> :: [a] -&gt; <a href="Distribution-Parsec-Newtypes.html#t:List" title="Distribution.Parsec.Newtypes">List</a> sep wrapper a <a href="#v:pack" class="selflink">#</a></p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="Distribution-Parsec-Newtypes.html#t:List" title="Distribution.Parsec.Newtypes">List</a> sep wrapper a -&gt; [a] <a href="#v:unpack" class="selflink">#</a></p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:ala" class="def">ala</a> :: (<a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o, <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n' o') =&gt; (o -&gt; n) -&gt; ((o -&gt; n) -&gt; b -&gt; n') -&gt; b -&gt; o' <a href="#v:ala" class="selflink">#</a></p><div class="doc"><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>ala Sum foldMap [1, 2, 3, 4 :: Int]
</code></strong>10
</pre><p><em>Note:</em> the user supplied function for the newtype is <em>ignored</em>.</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>ala (Sum . (+1)) foldMap [1, 2, 3, 4 :: Int]
</code></strong>10
</pre></div></div><div class="top"><p class="src"><a id="v:alaf" class="def">alaf</a> :: (<a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o, <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n' o') =&gt; (o -&gt; n) -&gt; ((a -&gt; n) -&gt; b -&gt; n') -&gt; (a -&gt; o) -&gt; b -&gt; o' <a href="#v:alaf" class="selflink">#</a></p><div class="doc"><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>alaf Sum foldMap length [&quot;cabal&quot;, &quot;install&quot;]
</code></strong>12
</pre><p><em>Note:</em> as with <code><a href="Distribution-Compat-Newtype.html#v:ala" title="Distribution.Compat.Newtype">ala</a></code>, the user supplied function for the newtype is <em>ignored</em>.</p></div></div><div class="top"><p class="src"><a id="v:pack-39-" class="def">pack'</a> :: <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o =&gt; (o -&gt; n) -&gt; o -&gt; n <a href="#v:pack-39-" class="selflink">#</a></p><div class="doc"><p>Variant of <code><a href="Distribution-Compat-Newtype.html#v:pack" title="Distribution.Compat.Newtype">pack</a></code>, which takes a phantom type.</p></div></div><div class="top"><p class="src"><a id="v:unpack-39-" class="def">unpack'</a> :: <a href="Distribution-Compat-Newtype.html#t:Newtype" title="Distribution.Compat.Newtype">Newtype</a> n o =&gt; (o -&gt; n) -&gt; n -&gt; o <a href="#v:unpack-39-" class="selflink">#</a></p><div class="doc"><p>Variant of <code><a href="Distribution-Compat-Newtype.html#v:pack" title="Distribution.Compat.Newtype">pack</a></code>, which takes a phantom type.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.20.0</p></div></body></html>