Version française
Home     About     Download     Resources     Contact us    
Browse thread
Having '<<', why to use '|>' ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice Marchant <fabrice.marchant@o...>
Subject: Re: [Caml-list] Having '<<', why to use '|>' ?
  Thanks Julien !

> Have a look at this:
> 	http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#infix-symbol
> With the keywords below.
"Note that the following identifiers are keywords of the Camlp4 extensions and should be avoided for compatibility reasons.

    parser    <<    <:    >>    $     $$    $:
"
So no doubt, I'll edit my old programs and replace "<<".

> > ... a composition operator ... ( <<< ) ?
> > What else ?

> I would personally double the '@':
> 	let (@@) f g x = f @ g x

 ( or f (g x) : it is practically the same thing. )

A 3 chars operator (<<<) doesn't look smart. Simpler is better.
However, about (@@), I preferred to see the direction of the asymmetric composition operator.
( <| ) instead of ( << ) ? Is this a possible idea ?

  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.

Cheers,

Fabrice