On Fri, 2006-09-01 at 21:04 -0400, Peter Tanski wrote:
> On Aug 31, 2006, at 11:11 PM, skaller wrote:
> Composition is associative not as a property of the composition
> operator but as a property of function application.
That depends whether you're a set theorist struggling to
understand category theory, or a category theorist struggling
to understand applicative programming :)
> Anyway, here is the problem with the Distribution operator as I
> understand it (not to be pedantic but because I am probably too
> stupid to grasp what you mean). The Distribution operator may
> operate differently over different numbers of arguments:
> <a, b, c> . <x, y, z> =
> (1) < (a . x), (b . y), (c . z) >
> OR
> (2) < ((a . x),(b . y)), (c . z) > ??
> (I hope these diagrams are readable). This seems to be the problem
> you are describing, correct?
No, the problem is I never defined
<a,b,c>
The <> here has 3 arguments. The 'obvious' definition is
<f,g,h> (a,b,c) = (f a, g b, h c)
which is what we want. Etc for 4, 5. I can easily
define <> in the Felix *compiler*. There is no way to
define it in *Felix*.
You can't even write out its type.
The pattern calculus will solve this. (I hope).
> As a practical note, how are you implementing these operators?
As above. Most generic operators have to be defined in the
compiler at the moment. The only exception is when the
operator is associative, in which case a user defined
binary operator suffices.
So I can happily define _ @ _ as composition in Felix.
But whilst I can define say
(f,g,h) @@ (a,b,c) = (f a, g b, h c)
for tuples of length 0,1,2,3 .. n .. I can't write ONE
definition for all of these.
Of course in the compiler I can do it easily.
The Felix *macro* processor considers tuple as list
and can therefore elaborate an infinite set of definitions,
but that is not very useful because it would take forever
to do so :)
To solve this problem requires a polyadic programming language,
and even Ocaml is not. Hence .. I shall try pattern calculus
because it seems to provide everything required, but I'm
not sure yet.. the calculator is implemented now :)
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language