On 8 Oct, Joe English wrote:
> [I wrote]:
> > Just now I thought of .~ from . for composition and ~ (tilde, but
> > commonly called twiddle) for twiddling the order about.
> I've also seen .| and |. used for this purpose (by
> analogy with Unix pipes.)
> John Hughes' Arrow library spells it ">>>",
Oh well, I thought it might be cute enough to solve the argument, but
obviously not...
> Along the same lines, are there accepted conventional infix operators
> for the functions with types:
>
> (a0 -> b0) -> (a1 -> b1) -> (a0,a1) -> (b0,b1)
> (a -> b0) -> (a -> b1) -> a -> (b0,b1))
>
> (a0 -> b0) -> (a1 -> b1) -> Either a0 a1 -> Either b0 b1
> (a0 -> b) -> (a1 -> b) -> Either a0 a1 -> b
>
> (the last one is called "either" in the standard Prelude).
These were on my list to think of names as well. In ponder I had `
(like a raised comma) and >< (product of functions).
> I personally like:
>
> (f <*> g) (x,y) = (f x, g y)
> (f <&> g) x = (f x, g x)
> (f <+> g) (Left x) = Left (f x)
> (f <+> g) (Right y) = Right (g y)
> (f <|> g) (Left x) = f x
> (f <|> g) (Right y) = g y
I'd go along with those -- if for no other reason than you being first
to suggest them, and wishing for less argument. They look OK too.
--
Jón Fairbairn [EMAIL PROTECTED]
18 Kimberley Road [EMAIL PROTECTED]
Cambridge CB4 1HH +44 1223 570179 (pm only, please)