On Aug 31, 2006, at 8:30 PM, skaller wrote:

> Composition is but one of a host of what I call 'categorical
> combinators'. Here is another one:
>
>       <f,g> (a,b) = (f a, g b)
>
> And now we have a law (using . for composition):
>
>       <f,g> . <h,k> = <f . h, g . k>
>
> in other words <_,_> commutes with _ . _
> [If you draw a picture you get a commuting square]

Right on!

> There are a LOT of these operators. I plan to add them all,
> but before I do I need to list them and try to figure a systematic
> notation.

I will try to help, if you want.  Of course you know your creation best.

> The HARD part is every such 'executable' expression has a
> corresponding typing .. the type terms ALSO have to be
> combined.

Even after reading the rest of your message, I still don't understand  
the problem.  The operator is executable, so it has the type:

<,>:( a -> b) -> (c -> d) -> (b, d)

  which is a function taking two arguments and returning a single  
result: a tuple of two separate types.   All that is left for the  
system is to match the return types of the respective functions with  
the types of each respective tupled result (fst, snd).

>       typedef fun pair (U: TYPE, V: TYPE): TYPE => U * V;
>       typedef pis = pair (int, string);
>
> You see that 'int,string' is actually a pair of types.
> This is NOT the same thing as a tuple type. The 'pair'
> above is a bifunctor
>
>       pair: TYPE * TYPE -> TYPE
>
> and so its argument is a pair (int, string) which is tuple
> one level up in the kinding system. [Unlike Ocaml or Haskell,
> Felix has an explicit kinding system, but the work on it
> isn't finished]

I think my confusion is with the type system.  Following the tutorial  
example, no. 209:

typedef fun pair (a:TYPE,b:TYPE):TYPE => a * b;

a*b is a tuple type, which (in the Caml system) explains the  
unification, but the tuple is a record type, so you should be able to  
examine the type of its contents, correct?

-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

Reply via email to