Eugene Kirpichov wrote:
No, a functor is a more wide notion than that, it has nothing to do
with collections.
An explanation more close to truth would be "A structure is a functor
if it provides a way to convert a structure over X to a structure over
Y, given a function X -> Y, while preserving the underlying
'structure'", where preserving structure means being compatible with
composition and identity.

As far as I'm aware, constraints like "while preserving the underlying structure" are not expressible in Haskell.

instance (Monad m) => Functor m where
  fmap f ma = do a <- ma; return (f a)

While that's quite interesting from a mathematical point of view, how is this "useful" for programming purposes?

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to