Problems adding a vector class to Haskell 
Author Message
 Problems adding a vector class to Haskell

You might have a look at the Fran library - it's distributed with Hugs
and has examples of vectors and such for you to look at.  


Tue, 30 Jan 2001 03:00:00 GMT  
 Problems adding a vector class to Haskell


> Ideally, I'd add two types, Vector2D and Vector3D.  Making them
> superclasses of Num seems the best way to do this, but I'm very tangled up

Start by getting the semantics right. Look at how array languages
have defined primitives first. Check out:




The latter two have downloadable demo/test versions available
that should give you good starting points.

In general, array languages do not explicitly deal with
the dimension of the array, but treat it implicitly.
That is, we don't have "2d" or "3d" objects -- just arrays,
and a property you can look at to tell you its dimensionality.

The key here is to establish definitions that are invariant
under dimension change. This design gives you definitions
that have:
   - simple rules
   - consistent rules
   - few rules

None of these are of great import to a computer. They are, however,
of great import to a human brain trying to write programs using


Fri, 02 Feb 2001 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Haskell type classes, adding extra constraints

2. Adding classes in Haskell

3. blt vectors and itcl class problem (tcl4.2 based)

4. Vector set!, void vector problem

5. Problems adding iVar to ListView Column class

6. Problems with classes and __add__ and __mul__...

7. Problem with __add__ methond in UserList Class

8. bit-vectors in haskell?

9. bit-vectors in Haskell?

10. bit-vectors in haskell

11. no vector = vector*vector in BLAS?

12. FP Vector multiply and add


Powered by phpBB® Forum Software