OK, I changed the line code as suggested. It is successfully compiled.<br>But it still has one warning:<br>stdm.lhs:38:10:<br>    Warning: In the use of `catch&#39;<br>             (imported from Prelude, but defined in System.IO.Error):<br>
             Deprecated: &quot;Please use the new exceptions variant, Control.Exception.catch&quot;<br><br>I don&#39;t know the effect but as long as I can use it for my course, I don&#39;t mind. Thank you for your help.<br>
<br><div class="gmail_quote">On Tue, Sep 4, 2012 at 1:46 PM, Eugene Perederey <span dir="ltr">&lt;<a href="mailto:eugene.perederey@gmail.com" target="_blank">eugene.perederey@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What version of ghc are you using?<br>
In recent versions ghc doesn&#39;t support pattern matching of expressions<br>
like (n+1).<br>
You can rewrite that factorial function as<br>
 factorial n = n * factorial (n-1)<br>
instead.<br>
<br>
best,<br>
Eugene<br>
<div><div class="h5"><br>
On 3 September 2012 22:08, Iwan Awaludin &lt;<a href="mailto:awaludin@gmail.com">awaludin@gmail.com</a>&gt; wrote:<br>
&gt; Dear Sir/Madam<br>
&gt; I Installed Haskell Platform 2012.2.0.0 for Windows and try to load Stdm.lhs<br>
&gt; which is downloaded from<br>
&gt; <a href="http://www.dcs.gla.ac.uk/~jtod/discrete-mathematics/Stdm.lhs" target="_blank">http://www.dcs.gla.ac.uk/~jtod/discrete-mathematics/Stdm.lhs</a><span onmouseout="cancel = false; window.setTimeout(WRCHideContent, 1000); clearTimeout(showTimer);" onmouseover=" var self = this; showTimer = window.setTimeout(function(){WRCShowContent({&#39;rating&#39;:{&#39;value&#39;:100,&#39;weight&#39;:13},&#39;flags&#39;:{},&#39;single&#39;:false,&#39;ttl&#39;:7200,&#39;expireTime&#39;:&#39;20120906114225&#39;}, self.className)},600);" class="wrc11" style="padding-right:16px;width:16px;height:16px"></span><br>

&gt; I have this error:<br>
&gt; stdm.lhs:1160:14: Parse error in pattern: n + 1<br>
&gt; Failed, modules loaded: none.<br>
&gt;<br>
&gt; Is there anything I should do to make it right?<br>
&gt; Thank you.<br>
&gt;<br>
&gt; --<br>
&gt; Iwan Awaludin<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Beginners mailing list<br>
&gt; <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><span onmouseout="cancel = false; window.setTimeout(WRCHideContent, 1000); clearTimeout(showTimer);" onmouseover=" var self = this; showTimer = window.setTimeout(function(){WRCShowContent({&#39;rating&#39;:{&#39;value&#39;:99,&#39;weight&#39;:14},&#39;flags&#39;:{},&#39;single&#39;:true,&#39;ttl&#39;:7200,&#39;expireTime&#39;:&#39;20120906114001&#39;}, self.className)},600);" class="wrc11" style="padding-right:16px;width:16px;height:16px"></span><br>

&gt;<br>
</blockquote></div><br><br clear="all"><br>-- <br>Iwan Awaludin<br><a href="http://www.schoolofuniverse.com">http://www.schoolofuniverse.com</a><br><br><br>