[Haskell-beginners] small question
Mohamed
bishrma at yahoo.com
Tue Oct 19 11:35:10 EDT 2010
Stephan and Daniel,
Thank you both very much. It worked!
cheers,
M
________________________________
From: Daniel Fischer <daniel.is.fischer at web.de>
To: Mohamed <bishrma at yahoo.com>
Sent: Tue, October 19, 2010 4:36:37 PM
Subject: Re: [Haskell-beginners] small question
Hi,
On Tuesday 19 October 2010 16:13:05 you wrote:
> Hello folks,
>
> just a quickie here and would appreciate any help...
Stephen already told you that it should be
if (honesty volunteer) ...
, so
>
> In this expression:
>
> instance OBSERVATIONS Drinkability WaterWell Volunteer where
> observe (Drinkability waterWell) volunteer = volunteer {vReport =
> if (odorQuale (perceive (Odor waterWell) volunteer) == True &&
> clarityQuale (perceive (Clarity waterWell) volunteer) == True &&
> fullnessQuale (perceive (Fullness waterWell) volunteer) == True) then
> (if (honesty) then "drinkable" else "undrinkable") else (if (honesty)
> then "undrinkable" else "drinkable")}
Don't use 'if condition == True'.
For Bool values, (== True) is the identity function, so
'condition == True' is exactly the same as 'condition'.
Cheers,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20101019/2e2137cd/attachment.html
More information about the Beginners
mailing list