[Haskell-cafe] Are all arrows functors?

Eugene Kirpichov ekirpichov at gmail.com
Tue Nov 3 07:48:57 EST 2009

2009/11/3 Neil Brown <nccb2 at kent.ac.uk>:
> Hi,
> I was thinking about some of my code today, and I realised that where I have
> an arrow in my code, A b c, the type (A b) is also a functor.  The
> definition is (see
> http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Arrow.html):
> fmap = (^<<)
> -- Or, in long form:
> fmap f x = arr f <<< x
> Out of curiosity, and since this is a typical haskell-cafe question, does
> this definition of fmap hold for all arrows?
> And is there a wiki page somewhere that has a table of all of these Haskell
> type-classes (Functor, Monad, Category, Arrow, Applicative and so on), and
> says that if you are an instance of class A you must have some corresponding
> instance of B? (e.g. all Monads are Functors and Applicatives)  I'm fairly
> certain my arrow isn't a Monad or Applicative, although of course it must be
> a Category, given the type-class dependency, but it would be nice when using
> one of these things to see what other instances you should automatically
> supply.

What about the Typeclassopedia

> Thanks,
> Neil.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Eugene Kirpichov
Web IR developer, market.yandex.ru

More information about the Haskell-Cafe mailing list