Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "OCaml List" <caml-list@inria.fr>
Subject: [Caml-list] Vagaries of Printf variants
Date: Mon, 27 Oct 2014 17:56:28 -0000	[thread overview]
Message-ID: <000001cff20f$57052560$050f7020$@metastack.com> (raw)

Given:

let f fmt = Printf.printf fmt;;

[f] will have type ('a, out_channel, unit, unit) format4

Given:

let f fmt = Printf.ksprintf print_string fmt

[f] will have type ('a, unit, string, unit) format4

They do exactly the same thing (at least in terms of side effects) - what's
the fundamental reason for having to suffer their having incompatible format
types? It becomes excessively irritating when trying to switch between
different formatters (as a given format string cannot be used in a way in
which it appears to have more than one type, obviously), but I'm sure
there's a reason for its being that way!


David


             reply	other threads:[~2014-10-27 17:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 17:56 David Allsopp [this message]
2014-10-27 18:51 ` Daniel Bünzli
2014-10-28  9:04   ` David Allsopp
2014-10-28  9:19     ` Gabriel Scherer
2014-10-28  9:33       ` David Allsopp
2014-10-28 20:18       ` [Caml-list] <DKIM> " Pierre Chambart
2014-10-29 10:34         ` David Allsopp

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='000001cff20f$57052560$050f7020$@metastack.com' \
    --to=dra-news@metastack.com \
    --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