Browse thread
Having '<<', why to use '|>' ?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jon Harrop <jon@f...> |
| Subject: | Re: [Caml-list] Having '<<', why to use '|>' ? |
On Tuesday 18 September 2007 15:12:46 Fabrice Marchant wrote: > A 3 chars operator (<<<) doesn't look smart. That is actually the F# for lsl. There are also ||| and &&& for bitwise ops. > Simpler is better. > However, about (@@), I preferred to see the direction of the asymmetric > composition operator. ( <| ) instead of ( << ) ? Is this a possible idea ? But "<<" is the converse of ">>" (in F#) and "|>" has no converse (or you could say that "x |> f" is the converse of "f x"). > But maybe your idea is good. Maths use a kind of small 'o' : (f o g) (x) > = f (g (x)). It's symmetric like (@@), and that doesn't raise any problem. If an OCaml front-end handled unicode with appropriate symbol settings then you could use an "o" symbol to mean that infix operator. I think that is a good solution, provided you use an editor that supports suitable unicode and there is an easy way to enter such things. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/?e