<div dir="ltr">Hi All,<div><br></div><div style>Referring to the following, which is taken from the <i>Control.Newtype </i>documentation page:</div><div style><br></div><div style><p class="" style="margin:0.8em 0px;padding:0.2em 0.5em;font-family:monospace;line-height:16px;background-color:rgb(240,240,240);border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204);color:rgb(0,0,0);font-size:13px">
<a name="v:op" class="" style="margin:0px;padding:0px;font-weight:bold">op</a> :: <a href="http://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype" style="margin:0px;padding:0px;text-decoration:none;color:rgb(171,105,84)">Newtype</a> n o =&gt; (o -&gt; n) -&gt; n -&gt; o<a href="http://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/src/Control-Newtype.html#op" class="" style="padding:0px 0.5em 0.2em;text-decoration:none;font-size:11px;color:rgb(145,145,145);float:right;border-left-width:1px;border-left-style:solid;border-left-color:rgb(145,145,145)">Source</a></p>
<div class="" style="margin:0px;padding:0px 0px 0px 2em;color:rgb(0,0,0);font-family:sans-serif;font-size:13px;line-height:18px"><p style="margin:0.8em 0px;padding:0px">This function serves two purposes:</p><ol style="margin:0.8em 0px 0.8em 2em;padding:0px">
<li style="margin:0px;padding:0px">Giving you the unpack of a newtype without you needing to remember the name.</li><li style="margin:0px;padding:0px">Showing that the first parameter is <em style="margin:0px;padding:0px">completely ignored</em> on the value level, meaning the only reason you pass in the constructor is to provide type information. Typeclasses sure are neat.</li>
</ol></div></div><div style>As point #2, above, emphasizes, the only purpose for the first argument to the function (i.e. - the constructor &quot;(o -&gt; n)&quot;) is to specify the type of &#39;n&#39;. However, being a <i>newtype</i>, &#39;n&#39; can have only one constructor. So, why is it necessary to pass in the constructor to this function, when we&#39;re already passing in &#39;n&#39;?</div>
<div style><br></div><div style>Thanks,<br></div><div style>-db</div><div style><br></div><div style><br></div><div style><div class="" style="margin:0px;padding:0px 0px 0px 2em"><font color="#000000" face="sans-serif"><span style="line-height:18px"><br>
</span></font></div><div class="" style="margin:0px;padding:0px 0px 0px 2em"><font color="#000000" face="sans-serif"><span style="line-height:18px"><br></span></font></div></div></div>