Stephan and Daniel, Thank you both very much. It worked! cheers, M ________________________________ From: Daniel Fischer <daniel.is.fischer@web.de> To: Mohamed <bishrma@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
participants (1)
-
Mohamed