<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Le 12/07/2018 à 15:01, Brett Gilio reacts :<br>
</p>
<blockquote type="cite"
cite="mid:cd8763f5-8f06-6007-46f6-5c0d59b58191@posteo.net">Alexey,
could you expand on what you mean in your first point? I am quite
intrigued. I do not use Haskell often, but that could be something
of interest to me in-and-out of Haskell.
<br>
<br>
Brett Gilio
<br>
</blockquote>
<br>
Alexey Raga wrote:
<br>
<blockquote type="cite">...major reasons<br>
<br>
1. The ability to <font color="#990000"><b>define the
specification (types) and then "just" follow them in
implementation.</b></font> Sometimes even without having a
clear understanding of the things I was using, I felt (and still
feel) guided towards the right solution.
<br>
</blockquote>
I am not Alexey Raga, who precises:<br>
<blockquote type="cite">when I wrote a signature for my function,
the compiler will make its best to help me implement it. It will
yell at me, it will not let me use things that I am not supposed
to use (according to constraints), etc. <br>
</blockquote>
===<br>
... but I think that there is more to tell, since in *all languages*
the compiler makes its best to profit from typing in order to
optimize the implementation... <br>
With polymorphic typing and automatic type inference, the compiler
can do a little more, it seems that people forgot already the "toy"
(not so...) of Lennart Augustsson, named Djinn, which takes a type
and proposes an object of this type, using the intuitionistic logic
theorem prover (the current Djinn library dates back to 2014, but
Lennart manufactured it already in 2006, or before, if I am not
mistaken. He quotes Roy Dyckhoff, and Don Stewart). Here is a test:<br>
<br>
<blockquote><b><font size="+1"><tt>Djinn> <font color="#3333ff">f
? (a,b) -> (b,a) </font></tt></font><font size="+1"><tt>--
my input</tt></font><font size="+1"><tt><br>
</tt><font color="#cc0000"><tt>f :: (a, b) -> (b, a)</tt><tt><br>
</tt><tt>f (a, b) = (b, a)</tt></font></font></b><br>
</blockquote>
Doaitse Swierstra comments:<br>
<blockquote type="cite">
<pre wrap="">swap (a, b) = (b, a)
Once you ask for the type you get (a, b) -> (b, a), hence the type completely specifies what swap computes, and <i><b>the function is even more general than the version of the type above</b></i>.</pre>
</blockquote>
I don't see that last point... Anyway, the typing power of Haskell
should be known.<br>
Thx.<br>
<br>
Jerzy Karczmarczuk<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /> <table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 18px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 17px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Garanti sans virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a> </td>
</tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>