<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Another thing worth mentioning is the following:<div class=""><br class=""></div><div class="">An enormous amount of programmer time is spent on managing memory and scheduling computations. </div><div class=""><br class=""></div><div class="">1) Automatic garbage collection has freed us from de necessity to think about WHEN THE LIFE OF A VALUE ENDS</div><div class="">2) Lazy evaluation frees of having to think about WHEN THE LIFE OF A VALUE STARTS.</div><div class=""><br class=""></div><div class="">So a lazy purely functional language like Haskell frees the programmer from having to think about scheduling computations.</div><div class=""><br class=""></div><div class="">Just as you can make garbage collection explicit in your code by using assignments (making explicit that you do not need the value stored in the variable anymore) you can make evaluation in your program explicit by making arguments strict and using `seq` etc. Both these make life more complicated in the first place, although they may lead to faster code taking less memory, but they are optimisations that only should be applied when unavoidable.</div><div class=""><br class=""></div><div class="">Doaitse</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Op 11 jul. 2018, om 14:10 heeft Simon Peyton Jones via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org" class="">haskell-cafe@haskell.org</a>> het volgende geschreven:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Friends<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">In a few weeks I’m giving a talk to a bunch of genomics folk at the<span class="Apple-converted-space"> </span><a href="https://www.sanger.ac.uk/" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Sanger Institute</a><span class="Apple-converted-space"> </span>about Haskell. They do lots of programming, but they aren’t computer scientists.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">I can tell them plenty about Haskell, but I’m ill-equipped to answer the main question in their minds:<span class="Apple-converted-space"> </span><i class="">why should I even care about Haskell</i>? I’m too much of a biased witness.<br class=""><br class=""><o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">So I thought I’d ask you for help. War stories perhaps – how using Haskell worked (or didn’t) for you. But rather than talk generalities, I’d love to illustrate with copious examples of beautiful code.<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></p><ul type="disc" style="margin-bottom: 0cm; margin-top: 0cm;" class=""><li class="MsoListParagraph" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Can you identify a few lines of Haskell that best characterise what you think makes Haskell distinctively worth caring about? Something that gave you an “aha” moment, or that feeling of joy when you truly make sense of something for the first time.<o:p class=""></o:p></span></li></ul><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">The challenge is, of course, that this audience will know no Haskell, so muttering about Cartesian Closed Categories isn’t going to do it for them. I need examples that I can present in 5 minutes, without needing a long setup.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">To take a very basic example, consider Quicksort using list comprehensions, compared with its equivalent in C. It’s so short, so obviously right, whereas doing the right thing with in-place update in C notoriously prone to fencepost errors etc. But it also makes much less good use of memory, and is likely to run slower. I think I can do that in 5 minutes.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Another thing that I think comes over easily is the ability to abstract: generalising sum and product to fold by abstracting out a functional argument; generalising at the type level by polymorphism, including polymorphism over higher-kinded type constructors. Maybe 8 minutes.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">But you will have more and better ideas, and (crucially) ideas that are more credibly grounded in the day to day reality of writing programs that get work done.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Pointers to your favourite blog posts would be another avenue. (I love the Haskell Weekly News.)<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Finally, I know that some of you use Haskell specifically for genomics work, and maybe some of your insights would be particularly relevant for the Sanger audience.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Thank you! Perhaps your responses on this thread (if any) may be helpful to more than just me.<o:p class=""></o:p></span></p><p class="MsoNormal" style="margin: 6pt 0cm; font-size: 12pt; font-family: "Times New Roman", serif;"><span style="font-family: Calibri, sans-serif;" class="">Simon<o:p class=""></o:p></span></p></div><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Haskell-Cafe mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">To (un)subscribe, modify options or view archives go to:</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></div><br class=""></div></body></html>