> In essence the Haskell definition of "Functor" is meaningless until we > nail down the definition of "Composition". > Of course, if we are working in Haskell, it comes with an > implementation and, thus, a definition for composition.
The definition of composition in Haskell comes with the definition (not an implementation) of the language, and that definition is the one of mathematics (the same is in ML and other languages): (f∘g)(x) ≡ f(g(x)) > Still, for the examples here, I imagine we could define an operation > on some of the structures here which we could think of as a > composition operator. The domain of a composition operator are functions themselves, not the data structures that are domains of those functions. A 'composition' that has to do with data structures is anything else but composition of functions. > Or, we could think of some of J's conjunctions (especially > @ @: & and &:) as being compositions. Hooks and forks might > also be thought of as compositions. Speaking informally, we really call all these and other J constructs 'compositions', but this is irrelevant here. The structure preservation rule fmap (f ∘ g) ≡ (fmap f) ∘ (fmap g) refers to the usual notion of composition in mathematics, and there is a reason for that. We cannot arbitrarily pick up any operation in its place just because we like to call it a composition. > Haskell, on the other hand, is a compiler ... It is a language, and its definition does not prescribe a specific kind of language processor. And certainly there are interpreters. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm