Rename functions to be more idiomatic.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
let nums_from_string s = List.map int_of_string (Str.split (Str.regexp " +") s)
|
||||
let ints_of_string s = List.map int_of_string (Str.split (Str.regexp " +") s)
|
||||
let distance1 a b = abs (a - b)
|
||||
|
||||
let strings_from_file fname =
|
||||
let strings_of_file fname =
|
||||
In_channel.with_open_text fname In_channel.input_lines
|
||||
|
||||
let main prep parts =
|
||||
|
@@ -1,11 +1,11 @@
|
||||
val nums_from_string : string -> int list
|
||||
val ints_of_string : string -> int list
|
||||
(** [nums_from_string s] takes a string of space separated integers and gives
|
||||
back a list of the integers. *)
|
||||
|
||||
val distance1 : int -> int -> int
|
||||
(** [distance1 a b] returns the absolute difference between [a] and [b]. *)
|
||||
|
||||
val strings_from_file : string -> string list
|
||||
val strings_of_file : string -> string list
|
||||
(** [strings_from_file fname] returns a list of strings from the file
|
||||
[fname]. Each string represents a line from the file. *)
|
||||
|
||||
|
Reference in New Issue
Block a user