<p><br>
Am 21.12.2011 14:10 schrieb &quot;Ivan Perez&quot; &lt;<a href="mailto:ivanperezdominguez@gmail.com">ivanperezdominguez@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; In general, I like haskell the way it is, but there are a few things<br>
&gt; that I would like to see:<br>
&gt; (I am no language designer, so I don&#39;t know about the theoretical<br>
&gt; implications that these<br>
&gt; might have. Also, let me know if there exists a clean way to do any of<br>
&gt; the following):<br>
&gt;<br>
&gt; - Using subranges of instances of Ord in type definitions, a la Ada.<br>
&gt; For instance, saying:<br>
&gt;<br>
&gt; type MyNumber = [2..6]<br>
&gt;<br>
&gt; (maybe &quot;data MyNumber&quot; would be more appropriate, I don&#39;t know).<br>
&gt;<br>
&gt; I really don&#39;t want to have to write<br>
&gt; data MyNumber = Two | Three | Four | Five | Six<br>
&gt; and implement all the necessary operations for them.<br>
&gt;<br>
&gt; - Guards wherever I want, for instance:<br>
&gt;<br>
&gt; myFunction = do<br>
&gt;  monadicRes &lt;- monadicOp<br>
&gt;  | monadicRes == 1 || monadicRes == 7 = doA<br>
&gt;  | monadicRes == 6 || monadicRes == 8 = doB<br>
&gt;  | otherwise = doC<br>
&gt;<br>
&gt; This is easily avoidable with an aux function, but sometimes there&#39;s just<br>
&gt; too many variables in the conditions and you don&#39;t want to carry them<br>
&gt; all in the aux function&#39;s signature. I could (painfully) live with<br>
&gt;<br>
&gt; myFunction = do<br>
&gt;  monadicRes &lt;- monadicOp<br>
&gt;  if monadicRes == 1 || monadicRes == 7<br>
&gt;  then doA<br>
&gt;  elseif monadicRes == 6 || monadicRes == 8<br>
&gt;  then doB<br>
&gt;  else doC<br>
&gt;<br>
&gt; even though it&#39;s way too verbose and reminds me of java.<br>
&gt;<br>
&gt; I often end up finding that the following construction is cleaner than<br>
&gt; the possible alternatives:<br>
&gt;<br>
&gt; myFunction = do<br>
&gt;  monadicRes &lt;- monadicOp<br>
&gt;  case () of<br>
&gt;   _ | monadicRes == 1 || monadicRes == 7 = doA<br>
&gt;      | monadicRes == 6 || monadicRes == 8 = doB<br>
&gt;      | otherwise = doC<br>
&gt;<br>
&gt; even though it&#39;s very ugly to have those useless () _ there.<br>
&gt;<br>
&gt; Unfortunately, my proposal could give way to slightly ugly nested guards<br>
&gt; (which are cleaner than nested ifs, but not very nice anyway).<br>
&gt; myFunction arg<br>
&gt;  | arg == 1<br>
&gt;    | arg == 7 = doA<br>
&gt;    | arg == 8 = doB<br>
&gt;  | otherwise = doC<br>
&gt;<br>
&gt; - Function overloading without classes. If it&#39;s not done, there must<br>
&gt; be a good reason for it<br>
&gt; (many good reasons, probably), but I really miss it.</p>
<p>That does not play well with type inference. Also, see type-directed name resolution (TDNR)<br>
&gt; Most other features I need, such as easy-to-use nested-record access<br>
&gt; methods, my own deriving definitions, compile-time expansion of<br>
&gt; expressions, etc. are covered by existing libraries and extensions.<br>
&gt;<br>
&gt; I really have no problems with the monad/functor separation that<br>
&gt; somebody mentioned.<br>
&gt; Maybe Monad is not the best name for that class if it&#39;s not true that<br>
&gt; every Monad is a<br>
&gt; Functor, but it&#39;s not very confusing anyway.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Ivan<br>
&gt;<br>
&gt; On 19 December 2011 20:20, Robert Clausecker &lt;<a href="mailto:fuzxxl@gmail.com">fuzxxl@gmail.com</a>&gt; wrote:<br>
&gt; &gt; Image you would create your own language with a paradigm similar to<br>
&gt; &gt; Haskell or have to chance to change Haskell without the need to keep any<br>
&gt; &gt; compatibility. What stuff would you add to your language, what stuff<br>
&gt; &gt; would you remove and what problems would you solve completely different?<br>
&gt; &gt;<br>
&gt; &gt; Thanks in advance for all answers, yours<br>
&gt; &gt;<br>
&gt; &gt;        Robert Clausecker<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Haskell-Cafe mailing list<br>
&gt; &gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</p>