caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: r.3@libertysurf.fr
To: caml-list@inria.fr
Subject: Re: [Caml-list] We need a rich standard library distributed with OCaml, really
Date: Fri, 28 Aug 2015 11:07:30 +0200 (CEST)	[thread overview]
Message-ID: <95750525.83374316.1440752850493.JavaMail.root@zimbra27-e5.priv.proxad.net> (raw)
In-Reply-To: <CAMCFErS+RQLz=dR6is6xOt9Tyy68qOMu=NmVNKLm_iM=SeBH7w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4342 bytes --]


+1 for 80% of it 

and I would add : 
- String.split : char list -> string -> string list 
- Hashtbl.keys 

I also think it is very valuable that inria maintains the stdlib. I prefer to see it kept maintained as inria standard distribution packaged with ocaml, even if that would imply less features on the compiler. 



On 27/08/2015 11:34, Edouard Evangelisti wrote: 




Dear all, 

Thanks for this inspiring discussion. 

The integration of large pieces of code into OCaml standard library is maybe not the best solution as it will never fulfill everyone's needs. I like the idea of having a Swiss army knife standard library rather than a heavy weight set of tools. However, filling existing minor gaps in the standard library would probably improve programmers day-to-day experience. Below are some examples: 

- Integers, floats and options, for instance, would deserve their own module for functor application. 

- More functions on option type, such as eval, iter, map. Something like this: 
let eval f x = try Some (f x) with _ -> None 
let iter f = function None -> () | Some x -> f x 
let map f = function None -> None | Some x -> eval f x 

- The standard library includes incr and decr on integer references, but none of the useful C-like operators with assignment such as += that save a lot of time in situations (there are some) where references are heavily used. 
let ( += ) r n = r := !r + n 

- An efficient set of string searching functions would help a lot (no regexp). Something like Boyer-Moore, KMP or even Rabin-Karp algorithms. 
- String.explode / implode to convert to/from char list. 
- Trivial functions such as read_file or read_text_file . 
- The identity function! 

- All fold functions should have a foldi counterpart, and the same set of iterators should occur in all modules. 



Then, for more specialized requirements, I think it may be better to contribute directly to improve third party libraries. 


Kind regards, 
Edouard 




2015-08-27 9:20 GMT+01:00 Daniil Baturin < daniil@baturin.org > : 

<blockquote>

-----BEGIN PGP SIGNED MESSAGE----- 
Hash: SHA256 

It often provokes exact same feelings as OCaml standard library, 
especially the prelude. There are also reimplementations of it, e.g. 
https://hackage.haskell.org/package/classy-prelude 

GHC authors also keep the old stuff for backwards compatibility. 

What I think can serve as a source of inspiration is the Haskell 
Platform or the Python distribution. They are distributed with a set of 
more or less self-contained modules that once were or still are 
third-party libraries. This is especially convenient on platforms not 
friendly to automatic package management. 

On 08/27/2015 02:07 PM, Sébastien Hinderer wrote: 
> Hi, 
> 
> Thanks for having started this thread. 
> 
> I am wondering to which extent the standard library of a language such 
> as Haskell could be a source of inspiration for OCaml? 
> 
> Cheers, 
> 
> Sébastien. 
> 


-----BEGIN PGP SIGNATURE----- 
Version: GnuPG v2 

iQIcBAEBCAAGBQJV3shSAAoJEEcm35UR4K8fSmwP+wURGWzi/onbTmr0dltA8aRK 
XB6FKEyiwLarEMHKnLPiT3uZhDVbaSvDolPGzPuU3eq0/kih0z/0R4l2WAUG8QuP 
cbdcVAd0Po+fSfSrgNtl+luH9fpUiE0EtDWcZxviZSerZoObcPcIK68FkgQbBs5T 
vlJ7MjuNguYI26tDrBsSAzDZ+FqFGYj9/ykmUNF42aPUqD7GQXFKY6iBgFoTCpze 
v9zbPnDoPjShe1Guk72GbmHU+b5xwEXe0bFpWj3O6pM5sXOnQ9jbLNRM70wSvGkX 
V17NexWd4HyqVhoSRHy+CnrFUHuzEhBJQARhq1nYoypY6DiYyOSg58uw5EWJC/vH 
YXl0LP60sXrhY4ZJ4YUvv86DFpqGGtNftRThNRTq0o7LULXIt3JRyVp9f+fVhxB4 
FW8dk2xzbyMijKCLMdbrbLJhbQ7znTfCt8PLnyemVFdc+Ficne/j+D0YOoWCyX+b 
vyc7xAQn14ZvywMxS/Ii9SRKZO8jqmjlhnoTa+AiF9Ve9KYbIJ3d9hX/9cw+blmo 
3EuUbo0K3DbIWUvNYMFsR+03mY5WyfO9UX5zcI/j5hP+DqxqrHEvNeHo/7/8IYiZ 
nI2B0cGwk5JX58+htaaR1rs3FDT7YI3mdoDzmLjVtdnqlRLhUvmHHqraZJQt/QhR 
DOx3brrv1loX0DPvr0SM 
=Fpx0 
-----END PGP SIGNATURE----- 





-- 
Caml-list mailing list. Subscription management and archives: 
https://sympa.inria.fr/sympa/arc/caml-list 
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners 
Bug reports: http://caml.inria.fr/bin/caml-bugs 




-- 









Edouard Evangelisti 
Post doctoral Research Associate 
Sainsbury Laboratory, Cambridge University (SLCU) 
Bateman Street 
Cambridge CB2 1LR (United Kingdom) 

</blockquote>


[-- Attachment #2: Type: text/html, Size: 9247 bytes --]

  reply	other threads:[~2015-08-28  9:07 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  2:52 Hongbo Zhang
2015-08-27  6:59 ` Christoph Höger
2015-08-27  7:18 ` Anthony Tavener
2015-08-27  8:17   ` Gabriel Scherer
2015-08-27 10:35     ` Romain Bardou
2015-08-27 19:55       ` Martin DeMello
2015-08-27 20:10         ` Yotam Barnoy
2015-08-27 23:24           ` Drup
2015-08-28 13:23           ` Philippe Veber
2015-08-27 20:17         ` Raoul Duke
2015-08-27 23:10       ` Martin Jambon
     [not found]     ` <20150827174554.14858.6618@localhost>
2015-08-27 18:42       ` [Caml-list] Fwd: " Emmanuel Surleau
2015-08-27 21:17     ` [Caml-list] " Paolo Donadeo
2015-08-27 21:51       ` Oliver Bandel
2015-08-27 21:56         ` Oliver Bandel
2015-08-27 22:04           ` Oliver Bandel
2015-08-28  0:50     ` Hongbo Zhang
2015-08-31 16:06     ` Stéphane Glondu
2015-08-31 16:14       ` Francois Berenger
2015-08-31 16:44         ` Hendrik Boom
2015-08-31 18:04           ` Ian Zimmerman
2015-08-31 17:26         ` Stéphane Glondu
2015-09-01 15:06           ` Anil Madhavapeddy
2015-08-31 17:34       ` Oliver Bandel
2015-09-01 13:46       ` Gabriel Scherer
2015-08-27  8:07 ` Sébastien Hinderer
2015-08-27  8:20   ` Daniil Baturin
2015-08-27  9:34     ` Edouard Evangelisti
2015-08-28  9:07       ` r.3 [this message]
2015-08-27  8:12 ` Francois Berenger
2015-08-27 11:57   ` Drup
2015-08-27 14:17 ` Yaron Minsky
2015-08-27 16:00   ` Jesse Haber-Kucharsky
2015-08-28  0:33     ` Hongbo Zhang
2015-08-28  1:53       ` Daniel Bünzli
     [not found]       ` <20150828.140826.2157566405742612169.Christophe.Troestler@umons.ac.be>
2015-08-28 12:38         ` Thomas Braibant
2015-08-28 13:00           ` [Caml-list] opam license field (was Re: We need a rich standard library distributed with OCaml, really) Daniel Bünzli
2015-08-28 13:06             ` David Sheets
2015-08-28 14:01         ` [Caml-list] We need a rich standard library distributed with OCaml, really Oliver Bandel
2015-08-31 15:26           ` Hendrik Boom
2015-08-28 14:35         ` Alain Frisch
2015-08-29 19:02           ` David MENTRÉ
2015-08-31 12:37             ` Jon Harrop
2015-08-31 15:05               ` Emmanuel Surleau
2015-08-31 17:31                 ` Oliver Bandel
2015-08-28 15:02         ` Simon Cruanes
2015-08-28 15:27           ` Gabriel Scherer
2015-08-28 15:51         ` Oliver Bandel
2015-08-31 18:40       ` Ashish Agarwal
2016-03-27 20:54     ` Jon Harrop
2016-03-27 21:21       ` Simon Cruanes
2016-03-27 23:48       ` Yaron Minsky

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=95750525.83374316.1440752850493.JavaMail.root@zimbra27-e5.priv.proxad.net \
    --to=r.3@libertysurf.fr \
    --cc=caml-list@inria.fr \
    /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).