On Feb 18, 10:35am, Gavin Wraith wrote:
> Subject: 
> Concerning Haskell 1.3 + n
> --------------------------
> Am I alone in finding the standard prelude for Haskell unsatisfactory
> when it comes to dealing with different sorts of numbers and how they
> are related? 

..
 
> I have no class Num. Instead I have
> 
> class Add a where
>      (+),(-) :: BinOp a
>      negate  :: a -> a
>      zero    :: a
>      negate x = zero - x
> 
> because there are lots of things you want to use additive notation with
> (vectors, functions taking values in additive types, etc) besides
> numbers.

Strange that you should post.  I was doing almost exactly this
yesterday for vectors and second order tensors.


> I am not suggesting that everybody would want to do this, but the
> present use of Num is far too monolithic and inflexible for sensible
> exploitation of Haskell for mathematical purposes. I would be interested
> to hear what others feel about this.
>

I agree based on my work with tensors.  I don't think that such changes
would hamper those doing fundamentally different kinds of work, e.g.,
symbolic manipulation.  The main concern would be performance if
it proved more difficult for partial evaluation to eliminate dictionaries.


-- 


                                        George Beshers
                                        [EMAIL PROTECTED]

Hibbitt, Karlsson, & Sorensen, inc.
1080 Main St. Pawtucket, RI 02860
Tel (401) 727-4200; Fax: (401) 727-4208

Reply via email to