Check out the awesome prelude, used to define ESDLs: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://tom.lokhorst.eu/2010/02/awesomeprelude-presentation-video">http://tom.lokhorst.eu/2010/02/awesomeprelude-presentation-video</a><br>

<br><div class="gmail_quote">On 22 November 2010 07:48, Magicloud Magiclouds <span dir="ltr">&lt;<a href="mailto:magicloud.magiclouds@gmail.com">magicloud.magiclouds@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
  For example, I have a data A defined. Then I want to add (+) and (-)<br>
operators to it, as a sugar (compared to addA/minusA). But * or other<br>
stuff defined in class Num is meanless to A. So I just do:<br>
(+) :: A -&gt; A -&gt; A<br>
(+) a b =<br>
  A (elem1 a + elem1 b) (elem2 a + elem2 b) -- I got errors here, for<br>
the (+) is ambiguous.<br>
<br>
  So, just wondering, does this way work in Haskell?<br>
<font color="#888888">--<br>
竹密岂妨流水过<br>
山高哪阻野云飞<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br>