Re: Tuples or Record

2003-08-18 Thread Derek Elkins
On Mon, 18 Aug 2003 16:21:46 +0100 Keith Wansbrough <[EMAIL PROTECTED]> wrote: > > Hello, > > When I have started my project, I use a Tuples but i would know if > > it is possible to create a record such C or Ocaml provide. I mean > > creating a structure where variables are accessible by a '.' o

Re: More type design questions

2003-08-18 Thread Remi Turk
On Mon, Aug 18, 2003 at 07:33:47PM +0200, Konrad Hinsen wrote: > Well, yes, because my original example was cut down to illustrate the problem > I had. The full version of the class Vect is > > class Vect v a where > (<+>) :: Floating a => v a -> v a -> v a > (<->) :: Floating a => v a -> v

Re: More type design questions

2003-08-18 Thread Konrad Hinsen
On Monday 18 August 2003 19:26, Brandon Michael Moore wrote: > I think what you want are functional dependencies. ... Bingo! That's what I needed. I had tried something like that before, but I had started from a fundamental misunderstanding: I had assumed that class Vect v a where... would

Re: New Haskell and FPO merchandise available

2003-08-18 Thread John Peterson
All of this is now directly available through haskell.org. Thanks again to Fritz! John ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: More type design questions

2003-08-18 Thread Andre Pang
On Tuesday, August 19, 2003, at 03:33 AM, Konrad Hinsen wrote: On Monday 18 August 2003 19:10, Andre Pang wrote: This seems to work (with -fglasgow-exts): module Foo where class Vect v where (<+>) :: v -> v -> v data Vector a = Vector a a a deriving (Show, Eq) instance Floating a => Vect

Re: More type design questions

2003-08-18 Thread Konrad Hinsen
On Monday 18 August 2003 19:10, Andre Pang wrote: > This seems to work (with -fglasgow-exts): > > module Foo where > > class Vect v where >(<+>) :: v -> v -> v > > data Vector a = Vector a a a >deriving (Show, Eq) > > instance Floating a => Vect (Vector a) where >(<+>) (Vector x1 y1 z1

Re: More type design questions

2003-08-18 Thread Brandon Michael Moore
I think what you want are functional dependencies. On Mon, 18 Aug 2003, Konrad Hinsen wrote: > On Monday 18 August 2003 09:25, Bernard James POPE wrote: > > > The kinds are there to help the compiler check whether types are well > > formed (including such things as instance declarations). > > > >

Re: More type design questions

2003-08-18 Thread Andre Pang
On Monday, August 18, 2003, at 04:56 PM, Konrad Hinsen wrote: Continuing in my quest to understand type design in Haskell, here's another episode that leaves me scratching my head: module Foo where class Vect v a where (<+>) :: Floating a => v a -> v a -> v a data Vector a = Vector a a a in

Re: More type design questions

2003-08-18 Thread Konrad Hinsen
On Monday 18 August 2003 09:25, Bernard James POPE wrote: > The kinds are there to help the compiler check whether types are well > formed (including such things as instance declarations). > > The syntax for kinds is very simple: ... Thanks for the explanation! It seems that what I need (but what

Updated monad tutorial

2003-08-18 Thread Jeff Newbern
Hello, I would like to thank everyone for their feedback on the monad tutorial I posted earlier. Based on that feedback, I have expanded and corrected the tutorial at www.nomaware.com/monads/html/index.html The primary changes are: - vastly expanded section on monad transformers - additional e

Re: Tuples or Record

2003-08-18 Thread Keith Wansbrough
> Hello, > When I have started my project, I use a Tuples but i would know if it > is possible to create a record such C or Ocaml provide. I mean creating > a structure where variables are accessible by a '.' or something > like that. Yes. Like this: data Tree a = Node { key :: Int,

Tuples or Record

2003-08-18 Thread Frederic BELLOC
Hello, When I have started my project, I use a Tuples but i would know if it is possible to create a record such C or Ocaml provide. I mean creating a structure where variables are accessible by a '.' or something like that. -- BELLOC Frederic EPITA 2005 STUDENT C, socks and sun ! __

New Haskell and FPO merchandise available

2003-08-18 Thread K. Fritz Ruehr
Newly-designed Haskell, FP and related merchandise (mostly T-shirts) are now available at the URLs below. I didn't receive many specific requests on logo/product combinations from my last post, so I have tried to pick and choose as best I can (I've included at least men's and women's white T-shirts

Re: More type design questions

2003-08-18 Thread Bernard James POPE
> module Foo where > > class Vect v a where > (<+>) :: Floating a => v a -> v a -> v a > > data Vector a = Vector a a a > > instance Vect Vector a where > (<+>) (Vector x1 y1 z1) (Vector x2 y2 z2) > = Vector (x1+x2) (y1+y2) (z1+z2) > > instance Vect [Vector a] a where > (<+>) l1