caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Vagaries of Printf variants
@ 2014-10-27 17:56 David Allsopp
  2014-10-27 18:51 ` Daniel Bünzli
  0 siblings, 1 reply; 7+ messages in thread
From: David Allsopp @ 2014-10-27 17:56 UTC (permalink / raw)
  To: OCaml List

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-29 10:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-27 17:56 [Caml-list] Vagaries of Printf variants David Allsopp
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

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).