caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Zheng Li <zheng_li@users.sourceforge.net>
To: Alexy Khrabrov <deliverable@gmail.com>
Cc: "Mikkel Fahnøe Jørgensen" <mikkel@dvide.com>, OCaml <caml-list@inria.fr>
Subject: Re: prelude.ml as another standard extension to   Pervasives?
Date: Sat, 20 Dec 2008 11:53:50 +0100	[thread overview]
Message-ID: <494CCEBE.2020900@users.sourceforge.net> (raw)
In-Reply-To: <CF36E289-EC85-45E0-8A0A-34BC7DFCFC30@gmail.com>

Hi,

Alexy Khrabrov wrote:
> I agree its solution to parallelism via a simple forking map/reduce is 
> not universal, but in fact I am wondering about having other functional 

coThreads is comparatively low-level. You might be able to write your 
own schedule on top of it. A no-brainer pmap can be defined as follows:

Toplevel trace:
----
# :load unix.cma;;
# :path +process;;
# :load cothreads.cma;;
# let pmap f a =
   let ea = Array.map (Cothread.spawn f) a in
   Array.map Event.sync ea;;
val pmap : ('a -> 'b) -> 'a array -> 'b array = <fun>
# pmap ((+) 1) (Array.init 10 (fun i -> i));;
- : int array = [|1; 2; 3; 4; 5; 6; 7; 8; 9; 10|]
----

> combinators available in shorthand.  Prelude.ml is a
> superb crash course in FP, and in fact I catch myself reinventing these 
> idioms ad hoc quite often.  I'm very tempted to just include it always, 
> making it my own Pervasives.

Maybe you should also look at some of Haskell's standard lib.
Pros: Haskell guys are really good at naming;
Cons: costs are always hidden and combinators composition can be terse.

Just my 2 cents.

--
Zheng


  reply	other threads:[~2008-12-20 10:53 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19 13:04 More cores Mikkel Fahnøe Jørgensen
2008-12-19 14:04 ` [Caml-list] " Dario Teixeira
2008-12-19 15:06   ` Alexy Khrabrov
2008-12-19 15:54     ` The Axis of Eval (was: More cores) Dario Teixeira
2008-12-19 16:26       ` [Caml-list] " Paolo Donadeo
2008-12-19 17:01       ` Dario Teixeira
2008-12-19 18:01         ` Christophe Raffalli
2008-12-19 18:50     ` [Caml-list] More cores Ulf Wiger (TN/EAB)
2008-12-19 19:10   ` Richard Jones
2008-12-19 22:31   ` Jon Harrop
2008-12-19 22:36     ` Erik de Castro Lopo
2008-12-19 22:53       ` Jon Harrop
2008-12-22 17:00         ` [Caml-list] More Caml Jon Harrop
2008-12-22 21:44           ` Richard Jones
2008-12-23  6:07             ` Jon Harrop
2008-12-23  9:59               ` Jon Harrop
2008-12-23 15:32                 ` Ashish Agarwal
2008-12-23 17:33                   ` Jon Harrop
2008-12-24 13:12                 ` Mikkel Fahnøe Jørgensen
2008-12-24 16:47                   ` Jon Harrop
2008-12-23 10:04               ` Richard Jones
2008-12-23 10:38                 ` Jon Harrop
2008-12-23  9:43           ` Oliver Bandel
2008-12-23 11:53             ` Jon Harrop
2008-12-19 22:42     ` [Caml-list] More cores Richard Jones
2008-12-20 19:33     ` Mikkel Fahnøe Jørgensen
2008-12-20 19:41       ` Mikkel Fahnøe Jørgensen
2008-12-19 20:37 ` Oliver Bandel
2008-12-19 21:27   ` Richard Jones
2008-12-19 22:03     ` Hezekiah M. Carty
2008-12-19 22:47       ` Richard Jones
2008-12-19 23:00         ` Alexy Khrabrov
2008-12-19 23:56         ` prelude.ml as another standard extension to Pervasives? Alexy Khrabrov
2008-12-20  1:40           ` [Caml-list] " Mikkel Fahnøe Jørgensen
2008-12-20  4:50             ` Alexy Khrabrov
2008-12-20 10:53               ` Zheng Li [this message]
2008-12-20 12:37         ` [Caml-list] More cores Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=494CCEBE.2020900@users.sourceforge.net \
    --to=zheng_li@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=deliverable@gmail.com \
    --cc=mikkel@dvide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).