>
> I am trying to write some primitives to make it easy to manipulate haskell
> datatypes without knowing what they are.
>
> However the following class:
>
> > 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.
>
Well nothing...except for the fact Monad and its cousins are higher order
types. Consider our favorite instance of the Monad classes, i.e. good ol'
lists. Substituting in the above type specification, we'd get a type of
(b->[])->a->[[]] for mapArgs. What would that _mean_? (Curried applications
of higher-order types cannot exist in isolation).
HTH,
--Artie Gold