Created
February 3, 2011 01:51
-
-
Save alexy/808895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let printShowTable: tex -> ?verbose:bool -> | |
('a BatInnerIO.output -> 'b -> unit) -> | |
'c list list -> string -> unit = | |
fun tex ?(verbose=false) printOne table tableName -> | |
let oc = open_out tableName in | |
printTable oc tex printOne table tableName; | |
close_out oc; | |
if verbose then | |
printTable stdout tex printOne table tableName | |
else () | |
(* TODO this binds to Int.print, doesn't take floatPrint anymore -- why? *) | |
let printShowTable2: tex -> ?verbose:bool -> | |
~printOne:('a BatInnerIO.output -> 'b -> unit) -> | |
'c list list -> string -> unit = | |
fun tex ?(verbose=false) ?(printOne=Int.print) table tableName -> | |
let oc = open_out tableName in | |
printTable oc tex printOne table tableName; | |
close_out oc; | |
if verbose then | |
printTable stdout tex printOne table tableName | |
else () | |
(* works: *) | |
printShowTable tex ~verbose floatPrint floatTable name | |
printShowTable2 tex ~verbose intTable name | |
(* FAILS: *) | |
printShowTable2 tex ~verbose ~printOne:floatPrint floatTable name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment