[Haskell-cafe] Why Haskell?

Brian Hulley brianh at metamilk.com
Sun Jul 23 07:32:46 EDT 2006

Matthew Bromberg wrote:
> 3)  The problem here is existing code.  I don't want to add every
> function that I use into a class just to maintain simple polymorphism
> over closely related numeric types.  This would take longer than just
> calling the coercion routines.  It's funny how trivial stuff likes
> this gets irritating when you are writing a lot of code.  Maybe I'm
> just in a bad mood or something.

It would be better to just use the Haskell numeric types in the first place 
ie replace all CInt, CDouble etc by Int, Double etc and change your C code 
accordingly to use HsInt, HsDouble instead of plain int, double etc. 
Hopefully this should just be a trivial matter of changing a few typedefs in 
a C header as long as the C functions don't refer to 'int' 'double' etc 

Regards, Brian.

Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.


More information about the Haskell-Cafe mailing list