u.stenzel at web.de
Sun Nov 26 09:21:29 EST 2006
Bulat Ziganshin wrote:
> you shouldn't mix C++ template system with Haskell classes. C++ can't
> check templates at the time where template defined that leads to
> too late error messages. just imagine that improper definition of
> 'sum' will barks on each call site with a message that you can't use
> (&&) on Ints.
Instead it will tell you that there is no instance for (Boolean Int),
and it will do so at every call site, assuming (&&) was indeed
overloaded. Where's the difference? And conversely, a properly defined
'sum' will tell you that there is no instance for (Num String) at every
wrong call site, which again is just the same, of course assuming that
nobody made String into an instance of Num. Sounds like we're actually
in violent agreement here.
"Let me be the first Common Lisp troll to mount the pulpit and scream,
Greenspuns 10th Law waved high in my clenched fist, 'Been there, done that'."
-- Will Hartung, in response to the Meta Programming System for Java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/libraries/attachments/20061126/8b9e9f93/attachment.bin
More information about the Libraries