<div class="im">> The indentation on the second line would generate a parse error, the same as it does now.<br></div>What parser error is that? Both<div class="im"><br><span style="font-family: courier new,monospace;">function 0 = 0 where</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> fun 1 = 1</span><br style="font-family: courier new,monospace;"></div><span style="font-family: courier new,monospace;">function 2 = 2</span><br><br>and<div class="im">
<br><span style="font-family: courier new,monospace;">function 0 = 0 where</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> fun 1 = 1</span><br style="font-family: courier new,monospace;"></div><span style="font-family: courier new,monospace;"> fun 2 = 2</span><br><br>works for me.<br>
<br>/J<br><br><div class="gmail_quote">On 23 August 2010 11:46, John Smith <span dir="ltr"><<a href="mailto:voldermort@hotmail.com">voldermort@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The indentation on the second line would generate a parse error, the same as it does now.<div class="im"><br>
<br>
On 23/08/2010 12:32, Jonas Almström Duregård wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Maybe because of this:<br>
<br>
function 0 = 0 where<br>
fun 1 = 1<br>
2 = 2<br>
<br>
The last declaration (2=2) can define either fun or function. I'm not saying this is a major problem, but there may be<br>
other problems like these.<br>
<br>
/J<br>
<br></div><div class="im">
On 23 August 2010 11:15, Brent Yorgey <<a href="mailto:byorgey@seas.upenn.edu" target="_blank">byorgey@seas.upenn.edu</a> <mailto:<a href="mailto:byorgey@seas.upenn.edu" target="_blank">byorgey@seas.upenn.edu</a>>> wrote:<br>
> On Mon, Aug 23, 2010 at 09:33:13AM +0300, John Smith wrote:<br>
>> Why doesn't Haskell allow something like this?<br>
>><br>
>> fac 0 = 0<br>
>> 1 = 1<br>
>> x = x * fac (x-1)<br>
>><br>
>> This would be clearer than repeating the function name each time,<br>
>> and follow the same pattern as guards and case.<br>
><br>
> Good question. I don't know of any particular reason.<br>
><br>
> -Brent<br>
</div></blockquote><div><div></div><div class="h5">
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br>