Beginner: error when using multiple where stmts in hugs98

Sebastian Schulz schulzs@uni-freiburg.de
Fri, 01 Dec 2000 17:23:57 +0000


Wim-Jan Hilgenbos wrote:
> 
> Hi,
> 
> I've been trying some examples in functional programming. Most things
> work fine,
> but I have trouble with expressions with 'where' clauses that define
> more then one
> local definition.
> (I work with hugs98 version september 1999 under Linux)
> 
> For example:
> 
> ----------[ Mydiff.hs ]----------------------
> module Mydiff where
> 
> mydiff f = f'
>         where f' x = ( f (x+h) - f x) / h
>                     h = 0.0001
> 
> ----------[ end Mydiff.hs ]-------------------
> 

Try this:

 mydiff f = f'
     where 
     f' x = ( f (x+h) - f x) / h
     h = 0.0001
 
It works fine with Hugs98 (feb2000).

regards
seb