(Responding in chat, because this is no longer about programming.) My impression is that "functors" are an attempt to take an expression like:
A=: F A which modifies a locale and turn it into a pure function (where the before and after values are technically available, though of course either can be discarded at need). This seems to be related to the problem we encounter in J when we start trying to define pure tacit functions which deal with more than two independent values. And, as long as the discussion is expressed in terms of functions operating on data, I think it's a fairly general discussion. There's a complication though, that I think you are running into, where instead of "functions", "types" are used. "Types" have some characteristics rather like functions (or, more precisely, function domains), but they have their own [language specific] restrictions. In some cases (COQ, for example), a type approaches the concept of "an arbitrary set of values" and a type is specified by the code which generates those values. But it's not clear to me that the current implementation would work well for J verbs, adverbs, conjunctions and nouns. (It might, but it might not, I do not know enough to comment further.) Anyways, when discussing a general issue (functions that do FOO) with someone working in a specific language (with type system imposed constraints), it can be difficult to distinguish between general issue concepts and type system specific concepts. This gets worse when the discussion explicitly involves types. Personally, I believe that the meaning of the word "type" varies depending on which language or languages the speakers have in mind. I might be wrong? But, I usually find myself opting out of most discussions where people make general statements about "types", or I find myself asking questions which make the other participants impatient. Put differently, if a type describes a representable set of values, it's the language where the type that is implemented that is doing the representation. But it's also the mind of the observer where the representation takes place. This combination seems to favor people making deep assumptions about the subject. Anyways, my canonical example of a "type" that I would like to deal with in a programming language is a relational algebra subspace -- these are data dependent in some interesting ways and (depending on the computation and the data) can impose some significant constraints on static analysis. -- Raul On Mon, Mar 26, 2012 at 1:51 PM, Tracy Harms <[email protected]> wrote: > When I read about functor, in the sense used in that blogpost, I think that > at least one such functor is built in to J so that it is somewhere between > stilted and impossible to create examples that *don't* involve functor. > > It seems that way to me because mapping is implied by the underlying > relationship between nouns and verbs, a relationship that may best be > called rank. The description of functor, with its scalar assumptions about > values, makes things like shape a context of values that can be preserved. > Thus, my sense is that functors permeate J to such a degree that it would > make little sense to try to "implement" one to serve as an example. The > most basic computations already involve it. > > If my interpretation can be criticized, I'd love to hear strong criticism. > This is the sort of discussion that often comes up with people who come at > programming from an ML perspective, so any mistakes I can avoid will help > me as such conversations go on. > > -- > Tracy > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
