[Haskell-cafe] instance Monad m => Functor m

Hans Aberg haberg at math.su.se
Wed Apr 9 11:05:20 EDT 2008

On 9 Apr 2008, at 16:26, Henning Thielemann wrote:
>  1. elementwise multiplication
>  2. convolution
> and you have some function which invokes the ring multiplication
> f :: Ring a => a -> a
> and a concrete sequence
> x :: Sequence Integer
> what multiplication (elementwise or convolution) shall be used for  
> computing (f x) ?

In math, if there is a theorem about a ring, and one wants to apply  
it to an object which more than one ring structure, one needs to  
indicate which ring to use. So if I translate, then one might get  
something like
   class Ring (a; o, e, add, mult) ...
   class Ring(a; o, e, add, (*)) => Sequence.mult a
         Ring(a; o, e, add, (**) => Sequence.conv a
   where ...
Then Sequence.mult and Sequence.conv will be treated as different  
types whenever there is a clash using Sequence only. - I am not sure  
how this fits into Haskell syntax though.

This might be useful, if it can be worked out.


More information about the Haskell-Cafe mailing list