Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# sprintf won't print in interactive console

Tags:

f#

I'm trying to print an int using the F# interactive console.

let x = sprintf "%d", 3
printf x

gives:

stdin(12,8): error FS0001: The type '(int -> string) * System.Numerics.BigIntege r' is not compatible with the type 'Printf.TextWriterFormat<'a>'

What am i doing wrong?

like image 434
Paul Nikonowicz Avatar asked Mar 22 '12 15:03

Paul Nikonowicz


1 Answers

try

let x = sprintf "%d" 3
printf "%s" x

because the way you wrote it x is tuple of a function and a number

like image 193
Random Dev Avatar answered Oct 13 '22 01:10

Random Dev