Re: Type design question

2003-07-30 Thread Ross Paterson
On Wed, Jul 30, 2003 at 02:04:22PM +1000, Andrew J Bromage wrote: > On Tue, Jul 29, 2003 at 12:11:29PM +0200, Konrad Hinsen wrote: > > I think that C++ was a lot worse, even the accepted features (e.g. templates) > > didn't work the same with all compilers. All non-trivial code came with a > > li

Re: Type design question

2003-07-29 Thread Andrew J Bromage
G'day all. On Tue, Jul 29, 2003 at 12:11:29PM +0200, Konrad Hinsen wrote: > I think that C++ was a lot worse, even the accepted features (e.g. templates) > didn't work the same with all compilers. All non-trivial code came with a > list of supported compilers. True. If we had more Haskell imp

Re: Type design question

2003-07-29 Thread Dylan Thurston
On Mon, Jul 28, 2003 at 03:23:30PM +1000, Andrew J Bromage wrote: > G'day all. > > On Sun, Jul 27, 2003 at 10:36:46PM -0400, Dylan Thurston wrote: > > > However, I would be sure to distinguish between an inner product space > > and a vector space. > > That's true. If you're after a completely g

Re: Type design question

2003-07-29 Thread Konrad Hinsen
On Tuesday 29 July 2003 04:10, Andrew J Bromage wrote: > There is no ISO standard Haskell. There is Haskell 98, but that was > deliberately designed to be a simpler language than what came before > it, with no experimental features, partly to make teaching the language > easier. (You can't write

Re: Type design question

2003-07-28 Thread Andrew J Bromage
G'day all. On Mon, Jul 28, 2003 at 03:42:11PM +0200, Konrad Hinsen wrote: > 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. T

Re: Type design question

2003-07-28 Thread Graham Klyne
At 15:40 28/07/03 +0200, Konrad Hinsen wrote: > This is beginning to get a little ugly, but I think that's largely > because you're using type classes in too much of an OO style (this is I am coming from OO indeed... Me too. Twice now I have used Haskell classes in a way suggested by an OO progra

Re: Type design question

2003-07-28 Thread Dylan Thurston
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

Re: Type design question

2003-07-28 Thread Derek Elkins
On Mon, 28 Jul 2003 09:54:11 -0400 (EDT) Mark Carroll <[EMAIL PROTECTED]> wrote: It would be > interesting to see a list of what people think will make it into > Haskell 2 though. http://haskell.org/hawiki/HaskellTwo ___ Haskell-Cafe mailing list [EMA

Re: Type design question

2003-07-28 Thread Malcolm Wallace
Konrad Hinsen <[EMAIL PROTECTED]> writes: > More fundamentally, I consider the module system in its present form a major > weak point of Haskell. There is only one global module namespace, which > therefore is a scarce resource. If, as I have seen proposed in some book, I > use up a global modul

Re: Type design question

2003-07-28 Thread Mark Carroll
On Mon, 28 Jul 2003, Konrad Hinsen wrote: > 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. It depends which ones. Some are impl

Re: Type design question

2003-07-28 Thread Konrad Hinsen
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'

Re: Type design question

2003-07-28 Thread Konrad Hinsen
> Well, I may not exactly qualify, but I can give you a few suggestions, > nonetheless... Thanks! > > data Floating a => Vector a = Vector !a !a !a > > deriving (Eq, Show) > > Here. Do not use 'data C x =>'. It's essentially a useless part of the > language that really should have gone awa

Re: Type design question

2003-07-27 Thread Andrew J Bromage
G'day all. On Sun, Jul 27, 2003 at 10:36:46PM -0400, Dylan Thurston wrote: > However, I would be sure to distinguish between an inner product space > and a vector space. That's true. If you're after a completely generic solution, this might be an issue. > An inner product space has the 'innerP

Re: Type design question

2003-07-27 Thread Dylan Thurston
On Mon, Jul 28, 2003 at 11:59:48AM +1000, Andrew J Bromage wrote: > G'day all. > > On Fri, Jul 25, 2003 at 03:48:15PM -0400, 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 > >

Re: Type design question

2003-07-27 Thread Andrew J Bromage
G'day all. On Fri, Jul 25, 2003 at 03:48:15PM -0400, 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 > ... Actually, this is a

Re: Type design question

2003-07-26 Thread Wolfgang Jeltsch
On Friday, 2003-07-25, 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 '-fglasg

Re: Type design question

2003-07-25 Thread Dylan Thurston
On Fri, Jul 25, 2003 at 08:31:26AM -0700, Hal Daume wrote: > However, once we fix this, we can see the real problem. Your Universe > class has a method, distanceVector, of type: > > | distanceVector :: Universe u, Floating a => u -> Vector a -> Vector a > -> Vector a > > And here's the problem.

RE: Type design question

2003-07-25 Thread Hal Daume
Hi Konrad, > I am a Haskell newbie working on my first serious test case, > and I would like > some feedback from the experts to make sure I am not doing > anything stupid > ;-) Well, I may not exactly qualify, but I can give you a few suggestions, nonetheless... > data Floating a => Vector

Type design question

2003-07-25 Thread Konrad Hinsen
I am a Haskell newbie working on my first serious test case, and I would like some feedback from the experts to make sure I am not doing anything stupid ;-) My applications are numerical (one goal of my current tests being to check how much of a performance penalty I will pay for using Haskell