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

Hans Aberg haberg at math.su.se
Wed Apr 9 10:48:22 EDT 2008


On 9 Apr 2008, at 16:26, Henning Thielemann wrote:
> I think a classical example are number sequences which can be  
> considered as rings in two ways:
>  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) ?

For that problem to arise, one must have, when defining Sequence
   class Ring (a; o, e, add, mult)
   ...
   class (Ring(a; o, e, add, (*)), Ring(a; o, e, add, (**)) =>  
Sequence a

It is a good question, but can be avoided by not admitting such  
constructs. - I will think a bit more on it.

   Hans




More information about the Haskell-Cafe mailing list