Re: [Caml-list] Infix function composition operator

2010-11-14 Thread Till Varoquaux
...@yquem.inria.fr] On Behalf Of m...@proof-technologies.com Sent: 10 November 2010 07:00 To: ymin...@gmail.com; ar...@noblesamurai.com Cc: caml-l...@inria.fr Subject: Re: [Caml-list] Infix function composition operator on 10/11/10 3:45 AM, ymin...@gmail.com wrote: This is probably a minority

RE: [Caml-list] Infix function composition operator

2010-11-10 Thread Jon Harrop
] Infix function composition operator on 10/11/10 3:45 AM, ymin...@gmail.com wrote: This is probably a minority opinion, but I have written and read quite a lot of OCaml code over the years, and I've seen surprisingly few effective uses of the composition operator. Somehow, I usually

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread Michael Ekstrand
On 11/09/2010 09:19 PM, Arlen Christian Mart Cuss wrote: Hi all, I know this was asked at least 12 years ago[1], but is there any consensus or reason for there not being a compose function in standard OCaml, nor an infix operator? At the moment I tend to let compose or let (-) f g x = f

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread DS
On 10 Nov 2010, at 4:45, Yaron Minsky wrote: let ( |! ) x f = f x This is the same as F#'s pipe operator (|) which I find extremely useful because with it code reads the way it works, not backwards: 2 | tenfold | add 1 | double = 42 (ok, this is a ridiculous example, but you get the point).

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread mark
...@inria.fr Subject: Re: [Caml-list] Infix function composition operator on 10/11/10 3:45 AM, ymin...@gmail.com wrote: This is probably a minority opinion, but I have written and read quite a lot of OCaml code over the years, and I've seen surprisingly few effective uses of the composition

RE: [Caml-list] Infix function composition operator

2010-11-10 Thread Jon Harrop
...@inria.fr Subject: Re: [Caml-list] Infix function composition operator So how does value restriction affect things here? (excuse my lack of knowledge) One thing about using a pipeline like this is that it relies on '|' being left-associative (which it is due to OCaml's convention

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread mark
. Cheers, Jon. -Original Message- From: m...@proof-technologies.com [mailto:m...@proof-technologies.com] Sent: 10 November 2010 13:44 To: jonathandeanhar...@googlemail.com; ymin...@gmail.com; ar...@noblesamurai.com Cc: caml-l...@inria.fr Subject: Re: [Caml-list] Infix function

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread Stephan Tolksdorf
To: jonathandeanhar...@googlemail.com; ymin...@gmail.com; ar...@noblesamurai.com Cc: caml-l...@inria.fr Subject: Re: [Caml-list] Infix function composition operator So how does value restriction affect things here? (excuse my lack of knowledge) One thing about using a pipeline like

RE: [Caml-list] Infix function composition operator

2010-11-10 Thread Jon Harrop
Of Stephan Tolksdorf Sent: 10 November 2010 16:11 To: caml-l...@inria.fr Subject: Re: [Caml-list] Infix function composition operator On Wed, Nov 10, 2010 at 14:13 -, Jon Harrop wrote: However, I don't see it as a useful advantage in practice because parser combinators are so tedious

Re: [Caml-list] Infix function composition operator

2010-11-10 Thread Stephan Tolksdorf
- From: caml-list-boun...@yquem.inria.fr [mailto:caml-list- boun...@yquem.inria.fr] On Behalf Of Stephan Tolksdorf Sent: 10 November 2010 16:11 To: caml-l...@inria.fr Subject: Re: [Caml-list] Infix function composition operator On Wed, Nov 10, 2010 at 14:13 -, Jon Harrop wrote: However, I

[Caml-list] Infix function composition operator

2010-11-09 Thread Arlen Christian Mart Cuss
Hi all, I know this was asked at least 12 years ago[1], but is there any consensus or reason for there not being a compose function in standard OCaml, nor an infix operator? At the moment I tend to let compose or let (-) f g x = f (g x), but I wish I didn't have to! Thanks, Arlen [1]

Re: [Caml-list] Infix function composition operator

2010-11-09 Thread Yaron Minsky
This is probably a minority opinion, but I have written and read quite a lot of OCaml code over the years, and I've seen surprisingly few effective uses of the composition operator. Somehow, I usually find that code that avoids it is simpler and easier to read. I'm not averse to infix operators.

Re: [Caml-list] Infix function composition operator

2010-11-09 Thread Arlen Christian Mart Cuss
Hi Yaron, On Tue, 2010-11-09 at 22:45 -0500, Yaron Minsky wrote: This is probably a minority opinion, but I have written and read quite a lot of OCaml code over the years, and I've seen surprisingly few effective uses of the composition operator. Somehow, I usually find that code that avoids

Re: [Caml-list] Infix function composition operator

2010-11-09 Thread mark
on 10/11/10 3:45 AM, ymin...@gmail.com wrote: This is probably a minority opinion, but I have written and read quite a lot of OCaml code over the years, and I've seen surprisingly few effective uses of the composition operator. Somehow, I usually find that code that avoids it is simpler and