> > class MetaData a where
> >  constructorName::a->String
> >  mapArgs::(MetaData b,MonadPlus c) => (b->c)->a->[c]
> 
> results in the error
> Illegal type "[c]" in constructor application
> 
> If I replace MonadPlus with Show or Num there is no error.
> (Replacing MonadPlus with Monad also result in an error)
> 
> What is so special about MonadPlus and Monad that they result in an error,
> but Show or Num don't.

The problem is that MonadPlus expects a type constructor and Show
expects just a type.
As your variable c is not applied in the right hand side, it is
considered to be a variable for a type, and not for a type constructor.
You should say something as

    mapArgs::(MetaData b,MonadPlus c) => (b->c a)->a->[c a]

or similar.
In the paper 

Functional Programming with Overloading and Higher-Order Polymorphism,
Mark P. Jones, First International Spring School on Advanced Functional
Programming Techniques, B{\aa}stad, Sweden, Springer-Verlag Lecture
Notes in Computer Science 925, May 1995.

you can find a very good explanation of this stuff (about kinds, and
kind inference). It is available at
http://www.cs.nott.ac.uk/~mpj/springschool.html

Fidel.


Reply via email to