On Mon, 27 Jul 1998, S.D.Mechveliani wrote:

> Obstacle 2:
> ------------
> Haskell rejects this  `=> RightModule r r'  
> 
> How can we express the meaning  
>            ... RightModule m r  where  m  is the identical constructor
>                                                              (m a = a)
> ?
> Scripting
>   newtype Id a = Id a  deriving(...)
> 
>   instance Ring r => RightModule Id r  where 
>                                        cMul (Id r) r' =  Id (mul r r')
> is an awkward way-out.
> Because from this point on, the programmer has to convert the data
> explicitly between  r  and  Id r.  This is not exactly what the 
> application domain means.

Actually and strictly speaking, the `awkward' way out is here the correct
one, because it makes explicit the difference between the ring and the
canonical module over itself it determines. 
The instance Ring r => RightMod Id r can be regarded as an expression of
the fact that Id : Rng -> Mod is a functor, (which can't be an identity
functor, because domain and codomain aren't the same!) 

cheers,

-- m

-----------------------------------------------------------------------
Mariano Suarez Alvarez
Departamento de Matematica  
Universidad Nacional de Rosario
Pellegrini 250                
2000 Rosario - Argentina     
e-mail: [EMAIL PROTECTED]

    El autor no responde de las molestias que puedan ocasionar sus escritos:
    Aunque le pese
    El lector tendra que darse siempre por satisfecho.

    Nicanor Parra, `Poemas y antipoemas' (Advertencia al lector)

-----------------------------------------------------------------------




Reply via email to