<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Warning: I'll be overly harsh in this mail because I assume some
people that are new to Haskell might browse this thread now and in
the future. I don't mean my comments to be considered personal. On
the contrary, I think some of us can learn for their own teaching
endeavours.<br>
<br>
<blockquote type="cite"
cite="mid:6B7E13E5-BAB9-4CD2-A763-C071E992C275@kent.ac.uk">
<pre wrap="">#!/usr/bin/env stack
-- stack script --resolver lts-10.1 --install-ghc
</pre>
</blockquote>
<p>Imagine a "newbie" running this script just to see what it does.
After 15 minutes they'll be disappointed why your small demo took
so long to build. Only <i>then</i> do they realize that, what is
it today, about half a gigabyte maybe, of their monthly "high
speed" bandwidth and of their precious space on the cheap but
decade-old hard drive is gone.</p>
<p>Of course you need all that data because there's a ghc in that
data, but it should say so on the tin. So please never send a
script with this line to a "newbie" without big warnings so they
can make an informed decision. Maybe they would want to install
ghc at their uni to save on that precious bandwidth at home or
something similar.<br>
</p>
<p>In fact don't even send scripts with this line to seasoned
haskellers. If your code is compatible with the ghc 8.2.1 on my
system, why should your script assume I want stack to install
8.2.2 right now?</p>
<p>Of course this behaviour is ingrained in the DNA of stack – after
all it values convenience for the professional user more than
convenience for the unprivileged newcomer – but AFAIU it <i>can</i>
be persuaded to be more inclusive. So especially here, we should
maybe try to do that.<br>
</p>
<blockquote type="cite"
cite="mid:6B7E13E5-BAB9-4CD2-A763-C071E992C275@kent.ac.uk">
<pre wrap=""> interact
( show @Double
. sum
. mapMaybe readMaybe
. words
)
</pre>
</blockquote>
<p>Also, while I do like the scripting possibilities, <tt>interact</tt>
is possibly the worst way to introduce a newcomer to it because
you can't really test it in ghci. Apart from all the other
shortcomings it has. It is nice in that it hides IO, but… <br>
</p>
<p>Again, not meant as an attack, but since we're talking about
giving newcomers a good experience, I thought these two points
important.</p>
<p>Cheers,<br>
MarLinn<br>
</p>
</body>
</html>