Chris King wrote:
> On 5/1/07, skaller <[EMAIL PROTECTED]> wrote:
>> You'd use distinct types I think. Consider a matrix of 100 * 100
>> elements -- the whole matrix would either be polar or cartesian
>> surely, not individual elements.
>
> Good point, I'll have to see how much I can work into the type system
> and still keep the conversion "automatic".  Hopefully with typeclasses
> + overloading + reductions it shouldn't be too hard :)

Does this problem occur if we do proper conversions to and from polar 
coordinates? Are polar coordinates uniformly better than cartesian? If 
so, could we just fix this by making the underlying system implemented 
with them, and convenience functions to get the cartesian form?

Another idea is to have two distinct types with their own functions, a 
pcomplex for polar, and a ccomplex for cartesian, and join the two via a 
Complex typeclass to capture all the shared functions? It's a little 
ugly though since they really are just two views of the same data.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to