>>        (f∘g)(x) ≡ f(g(x))
>
> Definitions do not eliminate ambiguity.

Speaking of formal definitions, I would say they ought to.  There is
not much use of defining formally and ambiguously.

> One issue, here, is that the definitions of f, g and x are contextual.

What do you mean by 'contextual'?  Is it related to the above
definition of ∘ (composition)?  Because f, g and x are just formal
names there, locally bound within the definition – none of them is a
free variable, so there is no context.
(Expressed in plain language, the definition says the following:
composition (∘) of f on g, where f and g are any two functions such
that the domain of f includes the codomain of g, is a function which,
given any argument from the domain of g, returns the result of
applying f to the result of applying g to x.)

> A variant on this issue is
> that in the realm of general mathematics, a function that maps from A
> to B can also map from C to D.  And, A and C might have a non-empty
> intersection and yet not have a subset relationship between them and
> composition might be valid for A and not C.

How can a function have two different domains without being in fact
two different functions?  Doesn't make sense to me.

> All of these J phrases can be used to
> represent composition between functions represented by f and g, if f
> and g are verbs:
>    f at g
>    f@:g
>    f&g
>    f&:g
>    ([: f g)
>    f(g(x))

I assume that by 'f at g' you mean f@g ...
Now, not all of the above represent a composition.  f@g and f&g,
in their monadic cases, are equivalent by definition, and are
compositions.  f@:g and f&:g (in their monadic cases) are equivalent
but are not the composition of f on g; what they compose is the
results of changing (the ranks of) their arguments rather than the
arguments themselves.  The same holds of [: f g (in its monadic case).

> Note also that that last phrase
> represents composition if x is a noun.  It might also represent
> composition if x was an appropriate adverb (for example: x=:1 :'@u')

In neither case is it a composition.  If x is a noun, f(g(x)) does
not even represent a verb.  If x is an adverb, so that g(x) is a
verb, then f(g(x)) is a hook – again, not a composition.

We have to stick to the mathematical meaning of composition because
this is what the definition of functor depends on, and we were
discussing functors ...

>> 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.
>
> You seem to be saying that context is irrelevant.

The context of what?  In defining composition, I see no context at all.

> And, some operations can be performed efficiently in compiled
> haskell and are inefficient in interpreted haskell.

Yes, but that is nothing to wonder at – the same can be said of
any language that admits both modes of execution.  And it doesn't
necessarily mean that such a language, when interpreted, is slower
than a language which is only interpreted.  Whichever is faster
would also depend, I guess, on the problem being solved, as well as
on the language constructs and programming techniques used in the
solutions.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to