Is this a bug?

charles.huthwaite@aonconsulting.co.uk charles.huthwaite@aonconsulting.co.uk
Wed, 3 Sep 2003 07:11:30 +0100


infixr 5 ~=
a ~= b = a-b<h && b-a<h
      where h = 0.000001

zero f = until goodEnough improve 1.0
      where improve b = b - f b / diff f b
            goodEnough b = (f b ~= 0.0)

gives

ERROR "train2c.hs":7 - Syntax error in input (unexpected `=')

Is this a bug or have I coded it wrong?

Thanks

C

PS: Taken from page 39 of Functional Programming by Jeroen Fokker 1995


This email, together with any attachments, is for the exclusive and
confidential use of the addressee(s) and may contain legally privileged
information.  Any other distribution, use or reproduction without the
sender's prior consent is unauthorised and strictly prohibited.  If you
have received this message in error, please notify the sender by email
immediately and delete the message from your computer without making any
copies.
Aon Limited
Company Number: 210725
Registered Address: 8 Devonshire Square, London, EC2M 4PL

Aon Limited is a member of the General Insurance Standards Council
(registration 2239).