On Fri, 2011-06-10 at 19:53 -0700, KC wrote: > I've never seen such an easy description in Haskell books. > > Is there more going on with Haskell functors?
You could make an analogous statement by saying that Haskell functors produce and consume types... but we don't, because that's a much more general concept than a functor really is. Rather, types of kind (* -> *) are what produce and consume types. Functors are types of kind (* -> *) that also come with a built-in notion of lifting functions between two types into functions between the types the functor gives you from them, in a way that preserves function composition. Some (perhaps most) types with the expected kind are functors; but being a functor is extra structure beyond merely having that kind. I'm not familiar enough with ML to say anything for sure about the ML version of a functor; but I suspect that such a short description there is also inadequate, and there's also a kind of structure-preserving property that needs to be stated there as well. -- Chris Smith _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
