<div dir="ltr"><div>For me there were two important "aha" moments. Right at the
beginning I was drawn in by using ADTs and pattern-matching on them.
It's so simple and plain and now it's the first thing I miss in any
other language I have to work with. I feel like this would make a short, compelling example for programmers coming from any other background.<br></div><div><br></div><div>The second
was reading Wadler's "Monads for Functional Progamming" (and reading it a
second and third time, if we're being honest). The ways in which he
takes three seemingly disconnected examples and reduces them to this
broader mathematical abstraction: I found it quite beautiful and
surprising once I fully appreciated it.</div><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 11, 2018 at 7:29 AM Ionuț G. Stan <<a href="mailto:ionut.g.stan@gmail.com">ionut.g.stan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is not necessarily related to Haskell, as I've had this A-HA moment <br>
while watching the 1984 SIPC lectures from MIT.<br>
<br>
Anyway, at some point, Mr Sussman (or was it Mr Abelson?) used `+` as an <br>
argument to another function. I was bedazzled!<br>
<br>
First of all, it was the syntactic novelty — `+` was not some rigid part <br>
of the syntax, it was just a name — secondly, it was not any name, it <br>
was the name of a *function* that was sent to another function. It was <br>
probably my first encounter with higher-order functions.<br>
<br>
If I remember correctly, the code was along the lines of:<br>
<br>
foldl (+) 0 [1,2,3]<br>
<br>
<br>
On 11/07/2018 15:10, Simon Peyton Jones via Haskell-Cafe wrote:<br>
> Friends<br>
> <br>
> In a few weeks I’m giving a talk to a bunch of genomics folk at the <br>
> Sanger Institute <<a href="https://www.sanger.ac.uk/" rel="noreferrer" target="_blank">https://www.sanger.ac.uk/</a>> about Haskell. They do <br>
> lots of programming, but they aren’t computer scientists.<br>
> <br>
> I can tell them plenty about Haskell, but I’m ill-equipped to answer the <br>
> main question in their minds: /why should I even care about Haskell/? <br>
> I’m too much of a biased witness.<br>
> <br>
> So I thought I’d ask you for help. War stories perhaps – how using <br>
> Haskell worked (or didn’t) for you. But rather than talk generalities, <br>
> I’d love to illustrate with copious examples of beautiful code.<br>
> <br>
> * Can you identify a few lines of Haskell that best characterise what<br>
> you think makes Haskell distinctively worth caring about? <br>
> Something that gave you an “aha” moment, or that feeling of joy when<br>
> you truly make sense of something for the first time.<br>
> <br>
> The challenge is, of course, that this audience will know no Haskell, so <br>
> muttering about Cartesian Closed Categories isn’t going to do it for <br>
> them. I need examples that I can present in 5 minutes, without needing <br>
> a long setup.<br>
> <br>
> To take a very basic example, consider Quicksort using list <br>
> comprehensions, compared with its equivalent in C. It’s so short, so <br>
> obviously right, whereas doing the right thing with in-place update in C <br>
> notoriously prone to fencepost errors etc. But it also makes much less <br>
> good use of memory, and is likely to run slower. I think I can do that <br>
> in 5 minutes.<br>
> <br>
> Another thing that I think comes over easily is the ability to abstract: <br>
> generalising sum and product to fold by abstracting out a functional <br>
> argument; generalising at the type level by polymorphism, including <br>
> polymorphism over higher-kinded type constructors. Maybe 8 minutes.<br>
> <br>
> But you will have more and better ideas, and (crucially) ideas that are <br>
> more credibly grounded in the day to day reality of writing programs <br>
> that get work done.<br>
> <br>
> Pointers to your favourite blog posts would be another avenue. (I love <br>
> the Haskell Weekly News.)<br>
> <br>
> Finally, I know that some of you use Haskell specifically for genomics <br>
> work, and maybe some of your insights would be particularly relevant for <br>
> the Sanger audience.<br>
> <br>
> Thank you! Perhaps your responses on this thread (if any) may be <br>
> helpful to more than just me.<br>
> <br>
> Simon<br>
> <br>
> <br>
> <br>
> _______________________________________________<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-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
> <br>
<br>
<br>
-- <br>
Ionuț G. Stan | <a href="http://igstan.ro" rel="noreferrer" target="_blank">http://igstan.ro</a> | <a href="http://bucharestfp.ro" rel="noreferrer" target="_blank">http://bucharestfp.ro</a><br>
_______________________________________________<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-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Erik Aker</div></div>