<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    13.07.2018 02:40, Tony Morris wrote:<br>
    <blockquote type="cite"
      cite="mid:c87a6f99-1182-2f9a-a49d-99b3bf7ef38a@gmail.com">
      <pre wrap="">On python, we are fixing it (WIP):
<a class="moz-txt-link-freetext" href="https://github.com/qfpl/hpython">https://github.com/qfpl/hpython</a>

Did you see the recent "default mutable arguments" post?
<a class="moz-txt-link-freetext" href="https://lethain.com/digg-v4/">https://lethain.com/digg-v4/</a>

Here is a Haskell program that transforms any python program that uses
default mutable arguments:
<a class="moz-txt-link-freetext" href="https://github.com/qfpl/hpython/blob/master/example/FixMutableDefaultArguments.hs">https://github.com/qfpl/hpython/blob/master/example/FixMutableDefaultArguments.hs</a>

Someone once said that python will never have tail call optimisation.
Here is the Haskell program that transforms any Python (direct only)
tail call into a loop:
<a class="moz-txt-link-freetext" href="https://github.com/qfpl/hpython/blob/master/example/OptimizeTailRecursion.hs">https://github.com/qfpl/hpython/blob/master/example/OptimizeTailRecursion.hs</a>

Two python programmers once argued over preferred indentation levels.
Let's put their disagreement into a Haskell function so that they can
stop arguing:
<a class="moz-txt-link-freetext" href="https://github.com/qfpl/hpython/blob/master/example/Indentation.hs">https://github.com/qfpl/hpython/blob/master/example/Indentation.hs</a>
</pre>
    </blockquote>
    <br>
    IMHO will be good to port such successful "experiments" to PyPy
    project in some way, if it's possible<br>
    <br>
    <blockquote type="cite"
      cite="mid:c87a6f99-1182-2f9a-a49d-99b3bf7ef38a@gmail.com">
      <pre wrap="">

On 07/12/2018 07:58 PM, Brett Gilio wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Python is poison, indeed. ;)

Brett Gilio
<a class="moz-txt-link-abbreviated" href="mailto:brettg@posteo.net">brettg@posteo.net</a> | <a class="moz-txt-link-abbreviated" href="mailto:bmg@member.fsf.org">bmg@member.fsf.org</a>
Free Software -- Free Society!

On 07/12/2018 04:56 AM, Graham Klyne wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Although I don't program regularly in Haskell these days (my poison
is Python, mainly for Web framework support), I do occasionally find
myself coding tricky manipulations in Haskell first as I find it
easier to concentrate on the essentials of an algorithm.  Once I have
the Haskell code written and tested, I generally find it fairly easy
to map the algorithm into Python (using higher order functions as
appropriate).

Here are some examples:

<a class="moz-txt-link-freetext" href="https://github.com/gklyne/annalist/blob/master/spike/rearrange-list/move_up.lhs">https://github.com/gklyne/annalist/blob/master/spike/rearrange-list/move_up.lhs</a>

<a class="moz-txt-link-freetext" href="https://github.com/gklyne/annalist/blob/master/spike/tree-scan/tree_scan.lhs">https://github.com/gklyne/annalist/blob/master/spike/tree-scan/tree_scan.lhs</a>


And the corresponding code in the actual application:

<a class="moz-txt-link-freetext" href="https://github.com/gklyne/annalist/blob/4d21250a3457c72d4f6525e5a4fac40d4c0ca1c8/src/annalist_root/annalist/views/entityedit.py#L2489">https://github.com/gklyne/annalist/blob/4d21250a3457c72d4f6525e5a4fac40d4c0ca1c8/src/annalist_root/annalist/views/entityedit.py#L2489</a>


<a class="moz-txt-link-freetext" href="https://github.com/gklyne/annalist/blob/master/src/annalist_root/annalist/models/entity.py#L245">https://github.com/gklyne/annalist/blob/master/src/annalist_root/annalist/models/entity.py#L245</a>


#g
-- 


On 11/07/2018 13:10, Simon Peyton Jones via Haskell-Cafe wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">Friends
In a few weeks I'm giving a talk to a bunch of genomics folk at the
Sanger Institute<a class="moz-txt-link-rfc2396E" href="https://www.sanger.ac.uk/"><https://www.sanger.ac.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.

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.

   *   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.
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.
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.
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.
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.
Pointers to your favourite blog posts would be another avenue.  (I
love the Haskell Weekly News.)
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.
Thank you!  Perhaps your responses on this thread (if any) may be
helpful to more than just me.
Simon



_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.

</pre>
          </blockquote>
          <pre wrap="">_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.
</pre>
        </blockquote>
        <pre wrap="">_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.
</pre>
      </blockquote>
      <pre wrap="">

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
    </blockquote>
    <br>
  </body>
</html>