<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div>Hello folks,</div><div><br></div><div>just a quickie here and would appreciate any help...</div><div><br></div><div>In this expression:</div><div><br></div><div><div><br></div><div>instance OBSERVATIONS Drinkability WaterWell Volunteer where</div><div>&nbsp;&nbsp; &nbsp;observe (Drinkability waterWell) volunteer = volunteer {vReport =&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; if (odorQuale (perceive (Odor waterWell) volunteer) == True &amp;&amp; clarityQuale (perceive (Clarity waterWell) volunteer) == True &amp;&amp; fullnessQuale (perceive (Fullness waterWell) volunteer) == True) then (if (honesty) then "drinkable" else "undrinkable") else (if (honesty) then "undrinkable" else "drinkable")}</div></div><div><br></div><div>I get the following
 error:</div><div><br></div><div><div>&nbsp;&nbsp;Couldn't match expected type `Bool'</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; against inferred type `Volunteer -&gt; Bool'</div><div>&nbsp;&nbsp; &nbsp;In the expression: honesty</div><div>&nbsp;&nbsp; &nbsp;In the expression: (if honesty then "drinkable" else "undrinkable")</div><div>&nbsp;&nbsp; &nbsp;In the `vReport' field of a record</div></div><div><br></div><div>It is worth mention that Volunteer id defined as follows:</div><div><br></div><div>data Volunteer = Volunteer {vid:: Id, vloc:: Id, odorQuale:: Bool, clarityQuale:: Bool, fullnessQuale:: Bool, vQuale:: Bool, vReputation:: Float, honesty:: Bool, vReport:: Report} deriving Show&nbsp;</div><div><br></div><div>Where Report is defined as:</div><div><br></div><div>type Report = String</div><div><br></div><div>I understand that the vReport field is not receiving a String as it should, but I have completely failed in knowing why! I just
 think the nesting of the if statements is correct but wonder why is it not working. What is the correct code to do what I intend from the abofe nonfunctioning if statements?</div><div><br></div><div>cheers,</div><div>m</div><div><br></div><div style="position:fixed"></div>


</div><br>

      </body></html>