hi, just a few silly remarks...
[EMAIL PROTECTED] wrote:
actually i think this is a good approximation. not all polymorphic functions are naturalFor two functors F, G: C -> D, there is a natural transformation tau from F to G, if for every object a in C, there is morphism tau[a]: F(a) -> G(a) in D.
In Haskell, natural transformations are polymorphic functions, tau :: f
a -> g a. For example, maybeToList :: Maybe a -> [a].
transformations, but "simple" ones usually are.
it is not a good idea to have a _class_ for natural transformations as they have little to do with overloading.Not quite. A natural transformation is a mapping between _functors_. In this case, maybeToList is a natural transformation between Maybe and []. Expressing this as a typeclass is left as an exercise, but here's a start:
class (Functor f, Functor g) => NaturalTransformation ... where
...
there can be many different natural transformations between two functors, so it does not make sense
to give them all the same name.
-iavor _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
