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
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
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
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
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
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
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).
> >
> >
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
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
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
> 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,
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 !
__
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
> 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
14 matches
Mail list logo