formatting and guarded expressions
Wittie <[email protected]> Thu, 23 Mar 2006 10:14:50 -0500 (EST)
| Newsgroups | gmane.comp.lang.haskell.hugs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, Are there special formatting constraints for using guards in Hugs? My students are learning Haskell in lab and the following simple function sometimes fails >fact n > | n == 0 = 1 > | otherwise = n * (fact(n-1)) Hugs complains about an unexpected ; Sometimes code after a guarded expression fixes the problem. We've tried putting the | up against the > or underneath the parameter. The same code seems to work for some students but not for others. Any ideas? - Lea