<div dir="ltr">I'm following LYHFGG and I have this<div><br></div><div><font face="monospace">class YesNo a where  <br>    yesno :: a -> Bool<br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">instance YesNo Int where  <br>    yesno 0 = False  <br>    yesno _ = True</font><br></div><div><br></div><div>but then I have to specify<font face="monospace"> Int </font>here</div><div><br></div><div><font face="monospace">> yesno (5 :: Int)</font></div><div><font face="monospace">True</font></div><div><br></div><div>Just with 5 gives this error</div><div><br></div><div><font face="monospace">Ambiguous type variable ‘a0’ arising from the literal ‘5’<br>      prevents the constraint ‘(Num a0)’ from being solved.<br>      Probable fix: use a type annotation to specify what ‘a0’ should be.<br></font></div><div><br></div><div>I tried this</div><div><br></div><div>instance YesNo (Num a) where  <br>    yesno 0 = False  <br>    yesno _ = True<br></div><div><br></div><div>but got cryptic errors. What can I do to make <font face="monospace">yesno</font> take any of <font face="monospace">Num</font>'s numbers?</div><div><br></div><div>LB</div><div><br></div></div>