Well, in this example I don't see how this would even be close to possible.  How would it know that 1 is supposed to be an Int a2.0 a Float?  1 has type 'Num a => a'  and 2.0 has type 'Fractional a => a' so how the compiler know you want Int and Float?
<br><br>&nbsp; -- Lennart<br><br><div><span class="gmail_quote">On 6/16/07, <b class="gmail_sendername">Anatoly Yakovenko</b> &lt;<a href="mailto:aeyakovenko@gmail.com">aeyakovenko@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If I define something like this:<br><br>data Bar = Bi Int<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Bf String<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deriving Show<br><br>data Foo = Fi Int<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Fs Float<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deriving Show<br><br>func::Foo -&gt; Bar<br>func (Fi xx) = Bi xx
<br>func (Fs ff) = Bf (show ff)<br><br>I can do:<br>&gt; map func [(Fi 1), (Fs 2.0)]<br>[Bi 1,Bf &quot;2.0&quot;]<br><br>but what i really want to do is just do<br>map func [1, 2.0]<br>[1, &quot;2.0&quot;]<br><br>I understand that this is impossible in haskell, but why cant the
<br>compiler generate the Foo and Bar data types for me and just require<br>that i have a func defined for Int -&gt; Int and Float -&gt; String?<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">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>