On Mon, Jul 28, 2003 at 03:42:11PM +0200, Konrad Hinsen wrote: > On Friday 25 July 2003 21:48, Dylan Thurston wrote: > > > Another approach is to make Universe a multi-parameter type class: > > > > class (RealFrac a, Floating a) => Universe u a | u -> a where > > distanceVector :: u -> Vector a -> Vector a -> Vector a > > ... > > > > You need to use ghc with '-fglasgow-exts' for this. > > What is the general attitude in the Haskell community towards > compiler-specific extensions? My past experience with Fortran and > C/C++ tells me to stay away from them. Portability is an important > criterion for me.
I think it depends on the extension. I find multi-parameter type classes genuinely very useful, and the functional dependencies notation (the '| u -> a' above) has been around for a while and seems to be becoming standard. Hugs, for instance, implements these same extensions, and it seems very likely to me to be part of the next Haskell standard. On the other hand, some ghc extensions, like generic Haskell, seem much more preliminary to me; if you want portable code, I would stay away from them. There was some discussion earlier about formalising some of these extensions. As far as I know, the FFI is the only one for which this has been completed; but I think multi-parameter type classes would be a natural next choice. Peace, Dylan
pgp00000.pgp
Description: PGP signature