caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] We need a rich standard library distributed with OCaml, really
Date: Thu, 27 Aug 2015 23:51:49 +0200	[thread overview]
Message-ID: <20150827235149.Horde.bl0KoI85Wwz2hwhmcaeUltR@webmail.in-berlin.de> (raw)
In-Reply-To: <CAPzAKVA=W+8-HPF=1C7esp08RQQwNG2OL8POfeD_kqQtGc8oLQ@mail.gmail.com>


Zitat von Paolo Donadeo <p.donadeo@gmail.com> (Thu, 27 Aug 2015  
23:17:50 +0200)

> I'm possibly the only one considering a small, essential, base library a
> *value* for the OCaml language and community?

No, I also prefer the slim lib approach ;-)


But nevertheless, some more functions would make sense to me too.

The String.split, mentioned by the orig-poster, is a good idea, IMHO.
Adding this as Feature-wish in the Bugtracking system would be a good  
idea, I think.

Some things need a while... sometimes too long, IMHO, e.g. feature  
wish Hashtbl.keys
is in the bugtracker since june 2013. :(
I hope it will be added before 2020 ;-)

But sometimes, it's surprising, what has ben added.
After looking at the documentation after long time (didn't awaited new  
things *ahem*)
I found String.trim for example.
Very useful, but I did not expected that this would be added.

So, even though I prefer a slim std-lib, some functions are still so common,
that they should be added.

I also was surprised to see ( |> ) was added.


Someone in this thread mentioned opt_apply (opt_eval) functions.
Very useful, and even though very simple, it's very powerful.
Especially combined with ( |> ).
( ( |> ) also is easy to write, but soooo helpful, that it's a good  
idea, to have it
  coming with OCaml system itself.)

So, opt_apply functions are of the same kind as ( |> ) ---> easy to write, but
should be part of the OCaml distribution.


For the advantages of opt_apply, see

    "Scott Wlaschin - Railway Oriented Programming -- error handling  
in functional languages"
       https://vimeo.com/97344498

I really enjoyed that talk.
It started me thinking about my code, seeing option-type not as
something strange, that sometimes makes sense, but as something,
which is really great and might be used more frequently ...

There are also slides accompaning the talk somewhere, but I don't have  
the link at hand.



>
> The OCaml standard library let the user free to decide what library is the
> best choice for each project. I'm currently using Batteries, or Core, for
> very different tasks. And sometimes none of the two.

I rely on OCaml's standard lib and a lot of smaller libs.
When thinking about Batteries, Core and others, I just could not decide
for one of them.
Looking at them in detail might eat more time than writing the needed  
code by myself.
And it saves much space, NOT to use BIG libraries... especially, if  
most of that stuff
is not needed.
I prefer finer grained solutions.
But of course, it's good to have all these libraries, just in case, it would
match the needs (of someone).


>
> I'm very happy and grateful not to have an OCaml counterpart of the STL or,
> worse, the Java Platform!

heheh.


Ciao,
   Oliver


  reply	other threads:[~2015-08-27 21:51 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 [this message]
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
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=20150827235149.Horde.bl0KoI85Wwz2hwhmcaeUltR@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --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).