On Sep 2, 2006, at 3:00 AM, skaller wrote: > 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 :)
Heheh :) To a set theorist or a category theorist these might all be different because the notations are different; they are all trying to describe the same phenomena. You (as the creator) *could* define Composition's associative property however you want but if you define it in terms of the application operator, as in the definition f @ g x = f(g(x)), then those terms are the fundamental controls. > 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). How will pattern calculus solve it? (This is a real question, not a jibe.) Felix is unlike other functional languages in that the operators have definite types (in Haskell the tuple operator is not a type but an operation; vestiges of old Hindley-Milner which, depending on the implementer, may also follow theories of Luca Cardelli--in 1988). As I have said before the *basic* definition seems more like a parsing problem. Describing what the definition does to a type of a certain size is different: with the tokenisation in place, a programmer may specify how it operates. > But whilst I can define say > > (f,g,h) @@ (a,b,c) = (f a, g b, h c) > > Of course in the compiler I can do it easily. Do you think it would be feasible to create an extension where a programmer working in Felix could do this? (Meta-programming, see below.) It shouldn't matter in the end, if the result of defining these operators is to create a programming language that *is* category theory. Want a user-base? Introduce this to researchers :) In any case, I asked how you are implementing this because if it seems like a laborious project maybe another set of hands would help. > 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 :) This is where template (meta-)programming comes in: you don't have to define the entire list, just a buildable set for the compiler to wrap over a programmer-defined structure of arbitrary size. Perhaps you would be able to incorporate MetaOCaml into the Felix compiler? The expansion should terminate when it reaches the final ')' and the final expansion is the current definition. The programmer has the responsibility of understanding the compiler will not terminate if he describes a structure of infinite size. (I really need to look at the inner workings of the Felix compiler.) > 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 :) Nice :) -Pete ------------------------------------------------------------------------- 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
