Discussion:
Functors
(too old to reply)
Jon Harrop
2009-01-10 00:02:59 UTC
Permalink
Functors are a powerful feature of the ML family of languages yet they are
seriously under exploited.

What is the best tutorial that explains what problems functors solve and
gives examples of functors in use?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
Ertugrul Söylemez
2009-01-11 09:09:18 UTC
Permalink
Post by Jon Harrop
Functors are a powerful feature of the ML family of languages yet they
are seriously under exploited.
Why are they underexploited? Remember that every monad is a functor.
Post by Jon Harrop
What is the best tutorial that explains what problems functors solve
and gives examples of functors in use?
I liked the "Monads as containers" tutorial by Cale Gibbard [1].

[1] http://haskell.org/haskellwiki/Monads_as_containers


Greets,
Ertugrul.
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://blog.ertes.de/
Paul Rubin
2009-01-11 09:21:52 UTC
Permalink
Post by Ertugrul Söylemez
Post by Jon Harrop
Functors are a powerful feature of the ML family of languages yet they
are seriously under exploited.
Why are they underexploited? Remember that every monad is a functor.
He is talking about ML functors, which operate on modules. Haskell
functors are something else entirely.

Lennart Augustssen had some interesting blog posts starting here:

http://augustss.blogspot.com/2008/12/somewhat-failed-adventure-in-haskell.html
Ertugrul Söylemez
2009-01-11 09:37:03 UTC
Permalink
Post by Paul Rubin
Post by Ertugrul Söylemez
Post by Jon Harrop
Functors are a powerful feature of the ML family of languages yet
they are seriously under exploited.
Why are they underexploited? Remember that every monad is a
functor.
He is talking about ML functors, which operate on modules. Haskell
functors are something else entirely.
Haskell belongs to the ML family of languages, at least partly. And I
didn't know that there are functors outside of category theory.


Greets,
Ertugrul.
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://blog.ertes.de/
Jon Harrop
2009-01-11 12:12:36 UTC
Permalink
Post by Ertugrul Söylemez
Haskell belongs to the ML family of languages, at least partly.
Actually they have very little in common and, in the context of functors,
nothing at all in common.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
Thant Tessman
2009-01-11 14:55:43 UTC
Permalink
Post by Ertugrul Söylemez
Post by Paul Rubin
Post by Ertugrul Söylemez
Post by Jon Harrop
Functors are a powerful feature of the ML family of languages yet
they are seriously under exploited.
Why are they underexploited? Remember that every monad is a
functor.
He is talking about ML functors, which operate on modules. Haskell
functors are something else entirely.
Haskell belongs to the ML family of languages, at least partly. And I
didn't know that there are functors outside of category theory.
In Standard ML, a 'functor' is a structure with one or more free type
variables. I suppose they're not used that often, but when they are
used, it's usually in a situation where it's hard imagining getting the
job done well without them. ml-lex and ml-yacc are a good example.

As for why they aren't used more than they are, I suspect it's because
plain old generic polymorphism is enough to get the job done most of the
time.

-thant

Continue reading on narkive:
Loading...