<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2>Hi Alberto,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2>Take a look at ESC/Haskell and Sound Haskell, which provide
mechanisms for doing some of the things you want. I don't think they integrate
with type classes in the way you mention, but I think that is just a question of
syntax.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2><A
href="http://www.cl.cam.ac.uk/~nx200/">http://www.cl.cam.ac.uk/~nx200/</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2>Thanks</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=988170614-22102008><FONT face=Arial
color=#0000ff size=2>Neil</FONT></SPAN></DIV>
<DIV> </DIV>
<P><FONT face="Times New Roman" size=2>This material is sales and trading
commentary and does not constitute investment research. Please follow the
attached hyperlink to an important disclaimer</FONT> <BR><U><FONT
face="Times New Roman" color=#0000ff size=2><<A
href="outbind://4/www.credit-suisse.com/emea/legal"
target=www.credit-suisse.com/emea/legal>www.credit-suisse.com/emea/legal</A>></FONT></U>
</P>
<DIV> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> haskell-cafe-bounces@haskell.org
[mailto:haskell-cafe-bounces@haskell.org] <B>On Behalf Of </B>Alberto G.
Corona <BR><B>Sent:</B> 22 October 2008 1:43 pm<BR><B>To:</B>
haskell-cafe@haskell.org<BR><B>Subject:</B> [Haskell-cafe] Fwd: enhancing type
classes with properties<BR></FONT><BR></DIV>
<DIV></DIV>I´m just thinking aloud, but, because incorporating deeper
mathematics concepts has proven to be the best solution for better and more
flexible programming languages with fewer errors, I wonder if raising the type
classes incorporating axioms can solve additional problems. <BR><BR>At
first sight it does:<BR>
<DIV class=gmail_quote><BR><BR>class Abelian a
where<BR> (+) :: a -> a -> a<BR> property
((+))= a+b == b+a<BR><BR><BR><BR>this permits:<BR> 1- safer
polimorphism: I can safely reuse the operator + if the type and
the property is obeyed. The lack of ability to redefine operators is a problem
for DSLs that must use wreid symbols combinations with unknow meanings. To use
common operators with fixed properties is very good. the same aplies for
method names.<BR><BR> 2- the compiler can use the axions as
rewrite rules. <BR><BR> 3- in debugging mode, it is possible to verify
the axiom for each value a generated during execution. Thus, a
generator is not needed like in quickcheck. The logic to
quickcheck can be incorporated in the debugging executable. <BR><BR>3
guaranties that 1 and 2 are safe.<BR><BR><BR><BR><BR> <BR>a type
class can express a relation between types, but it is not possible to
define relation between relations.<BR></DIV><BR></BLOCKQUOTE>
<P><pre wrap>==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
</pre></P></BODY></HTML>