<div dir="ltr"><div>Hi,</div><div>I am trying, without sucess, to run the code below from [1] (Section 4.3).</div><div>Obviouly I am missing something.</div><div>I would like to keep as close to the original code as possible.</div><div>Any help would be apreciated.</div><div>Regards,</div><div>Pat</div><div>[1] <a href="http://publik.tuwien.ac.at/files/pub-geo_2321.pdf">http://publik.tuwien.ac.at/files/pub-geo_2321.pdf</a></div><div><br></div><div>data MyNumbers a = MyNum a deriving Show</div><div><br></div><div>class (Floating a) => Numbers a where</div><div> sqr :: a -> a</div><div> </div><div>-- Not sure if i need these</div><div>-- instance Num (MyNumbers a) where</div><div>-- instance Fractional (MyNumbers a) where</div><div><br></div><div>class Lifts b a where</div><div> lift0 :: a -> b a</div><div> lift1 :: (a -> a) -> b a -> b a</div><div><br></div><div>instance Lifts MyNumbers a where</div><div> lift0 x = MyNum x</div><div> lift1 o x = MyNum (o x) -- **  Couldn't match expected type `a' with actual type `MyNumbers a' **</div><div> </div><div>instance (Floating (MyNumbers Float)) => Numbers (MyNumbers Float) where</div><div>  sqr x = lift1 sqr x  -- **  could not deduce (Numbers Float) arising from a use of `sqr' **</div><div> </div></div>

<br>
<p><span lang="EN-GB"><font size="2">This email originated from DIT. If you received this email in error, please delete it from your system. Please note that if you are not the named addressee, disclosing, copying, distributing or taking any action based on the contents of this email or attachments is prohibited. <a href="http://www.dit.ie/" target="_blank">www.dit.ie</a></font></span></p><p><font size="2">Is ó ITBÁC
a tháinig an ríomhphost seo. Má fuair tú an ríomhphost seo trí earráid, scrios
de do chóras é le do thoil. Tabhair ar aird, mura tú an seolaí ainmnithe, go
bhfuil dianchosc ar aon nochtadh, aon chóipeáil, aon dáileadh nó ar aon ghníomh
a dhéanfar bunaithe ar an ábhar atá sa ríomhphost nó sna hiatáin seo. <a href="http://www.dit.ie/" target="_blank">www.dit.ie</a></font></p><p><a href="http://www.dit.ie/grangegorman" target="_blank"><font size="2">Tá ITBÁC ag aistriú go Gráinseach Ghormáin – DIT is on the move to Grangegorman</font></a></p>