> I cannot find there the subject. Could you citate?

Sorry, it turns out I missed your point entirely.  

  class (Ring r,AddGroup (m r)) => RightModule m r where  
    cMul :: m r -> r -> m r

So here, m :: *->*

What you really want is to say

  instance Ring r => RightModule (\t->t) r where
     cMul = mul

so that now you can use cMul at type

        cMul :: Foo -> Foo -> Foo

(provided Foo is an instance of Ring).



The '(\t->t)::*->*' is your 'transparent newtype' function.  It makes
perfect sense to have lambda abstractions at the type level;
indeed type synonyms define such things.  I've seen quite a few
other occasions in which I wanted a (\t->t) type constructor 
in particular.

What I don't know how to do is to perform type inference on such systems.  (The
restriction that type synonyms must be fully applied is to avoid lambdas in
type inference.)  There is some work on it, but I believe the story is "It's
complicated".


So, yes it's a reasonable question, but I for one don't know
a tractable design.  And it's known swampy territory.

sorry for missing the point the first time.

Simon


Reply via email to