<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">In this conversation I didn't mean that IO is not a monad (a separate topic), but rather that the "definition" of IO is incompatible with the truth of IO. (It's perhaps akin to "the Ken Thompson hack"; see <a href="http://wiki.c2.com/?TheKenThompsonHack">http://wiki.c2.com/?TheKenThompsonHack</a>.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">As for IO being a monad, I think the claim is not only not true but is ill-defined and hence "not even false". For a well-defined claim/question, one would need an agreed-upon notion of equality, since the Monad laws are equalities.</div><div class="gmail_extra"><br></div><div class="gmail_extra">(Of course there are *other* input-output-like types, perhaps subsets of Haskell IO, for which we can define equality usefully, even based on a denotation. But those types are not IO. Some related remarks at <a href="http://conal.net/blog/posts/notions-of-purity-in-haskell#comment-442">http://conal.net/blog/posts/notions-of-purity-in-haskell#comment-442</a>.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Conal</div></div><div class="gmail_extra"><br></div></div><div class="gmail_extra"><br></div><div class="gmail_quote">On Wed, Jul 11, 2018 at 6:59 PM, Vanessa McHale <span dir="ltr"><<a href="mailto:vanessa.mchale@iohk.io" target="_blank">vanessa.mchale@iohk.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>I'm not sure I follow. Do you mean that IO is not a monad because
equivalence of values cannot be defined? Or is it something
deeper? <br>
</p><div><div class="gmail-h5">
<div class="gmail-m_-3281874218148984040moz-cite-prefix">On 07/11/2018 05:19 PM, Conal Elliott
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">> <span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The
fact that you can define the IO monad in Haskell was quite a
revelation.</span>
<div><br>
</div>
<div>But it's *not* a fact. It's a lie. And one of the most
devious sort, since the source code appears to agree. The
purported definition couldn't possibly explain concurrency.<br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jul 11, 2018 at 7:21 AM,
Vanessa McHale <span dir="ltr"><<a href="mailto:vanessa.mchale@iohk.io" target="_blank">vanessa.mchale@iohk.io</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>I find it quite elegant! The fact that you can
define the IO monad in Haskell was quite a
revelation. And it's especially nice when paired
with a demonstration of C FFI (where you might
*need* to sequence side effects such as freeing a
value after it has been read).<br>
</p>
<pre><span></span><a name="m_-3281874218148984040_m_297526233649517979_line-175"></a><span class="gmail-m_-3281874218148984040m_297526233649517979hs-keyword">newtype</span><span> </span><a name="m_-3281874218148984040_m_297526233649517979_IO"></a><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Types.html#IO" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier">IO</span></a><span> </span><a name="m_-3281874218148984040_m_297526233649517979_local-6989586621679009802"></a><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Types.html#local-6989586621679009802" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier">a</span></a><span> </span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-glyph">=</span><span> </span><a name="m_-3281874218148984040_m_297526233649517979_IO"></a><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Types.html#IO" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier">IO</span></a><span> </span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-special">(</span><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Prim.html#State%23" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier gmail-m_-3281874218148984040m_297526233649517979hs-type">State#</span></a><span> </span><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Prim.html#RealWorld" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier gmail-m_-3281874218148984040m_297526233649517979hs-type">RealWorld</span></a><span> </span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-glyph">-></span><span> </span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-special">(#</span><span> </span><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Prim.html#State%23" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier gmail-m_-3281874218148984040m_297526233649517979hs-type">State#</span></a><span> </span><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Prim.html#RealWorld" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier gmail-m_-3281874218148984040m_297526233649517979hs-type">RealWorld</span></a><span class="gmail-m_-3281874218148984040m_297526233649517979hs-special">,</span><span> </span><a href="http://hackage.haskell.org/package/ghc-prim-0.5.2.0/docs/src/GHC.Types.html#local-6989586621679009802" target="_blank"><span class="gmail-m_-3281874218148984040m_297526233649517979hs-identifier gmail-m_-3281874218148984040m_297526233649517979hs-type">a</span></a><span> </span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-special">#)</span><span class="gmail-m_-3281874218148984040m_297526233649517979hs-special">)</span><span></span></pre>
<div>
<div class="gmail-m_-3281874218148984040h5"> <br>
<div class="gmail-m_-3281874218148984040m_297526233649517979moz-cite-prefix">On
07/11/2018 09:14 AM, Stefan Monnier wrote:<br>
</div>
<blockquote type="cite">
<blockquote type="cite">
<pre>In a few weeks I'm giving a talk to a bunch of genomics folk at the Sanger
Institute<a class="gmail-m_-3281874218148984040m_297526233649517979moz-txt-link-rfc2396E" href="https://www.sanger.ac.uk/" target="_blank"><https://www.sanger.a<wbr>c.uk/></a> about Haskell. They do lots of
programming, but they aren't computer scientists.
I can tell them plenty about Haskell, but I'm ill-equipped to answer the
main question in their minds: why should I even care about Haskell? I'm too
much of a biased witness.
</pre>
</blockquote>
<pre>I don't much like the monad solution for side-effects, but if those guys
might have some knowledge of the horror of concurrent programming with
locks, the STM system would be a good candidate.
Stefan
______________________________<wbr>_________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="gmail-m_-3281874218148984040m_297526233649517979moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/haskell-caf<wbr>e</a>
Only members subscribed via the mailman list are allowed to post.</pre>
</blockquote>
<br>
</div>
</div>
<div class="gmail-m_-3281874218148984040m_297526233649517979moz-signature">-- <br>
<br>
<br>
<br>
<strong style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:116%">Vanessa
McHale</strong><br>
<span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:100%"><span style="color:rgb(255,0,0)">Functional Compiler Engineer
|</span> Chicago, IL</span> <br>
<br>
<span style="color:rgb(153,153,153);font-family:Helvetica,Arial;font-size:85%">Website:
<a href="http://iohk.io" style="color:rgb(255,0,0)" target="_blank">www.iohk.io</a></span><br>
<span style="color:rgb(153,153,153);font-family:Helvetica,Arial;font-size:85%">Twitter:
@vamchale</span><br>
<span style="color:rgb(153,153,153);font-family:Helvetica,Arial;font-size:85%">PGP
Key ID: 4209B7B5</span><br>
<br>
<a href="http://iohk.io" target="_blank"><img src="https://static.iohk.io/logo/logo-email.png" alt="Input Output" height="46" width="200"></a> <br>
<br>
<a href="https://twitter.com/InputOutputHK" target="_blank"><img src="https://static.iohk.io/images/ic-tw.png" alt="Twitter" height="16" width="18"></a> <a href="https://github.com/input-output-hk" target="_blank"><img src="https://static.iohk.io/images/ic-gh.png" alt="Github" height="16" width="21"></a> <a href="https://www.linkedin.com/company/input-output-global" target="_blank"><img src="https://static.iohk.io/images/ic-li.png" alt="LinkedIn" height="16" width="19"></a> <br>
<br>
<br>
<span style="color:rgb(68,68,68);font-family:Helvetica,Arial;font-size:77%"><small>This
e-mail and any file transmitted with it are
confidential and intended solely for the use of
the recipient(s) to whom it is addressed.
Dissemination, distribution, and/or copying of
the transmission by anyone other than the
intended recipient(s) is prohibited. If you have
received this transmission in error please
notify IOHK immediately and delete it from your
system. E-mail transmissions cannot be
guaranteed to be secure or error free. We do not
accept liability for any loss, damage, or error
arising from this transmission</small></span></div>
</div>
<br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/haskell-caf<wbr>e</a><br>
Only members subscribed via the mailman list are allowed
to post.<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div></div></div>
</blockquote></div><br></div></div>