type error: converting input channel to string list

From: Lyn A Headley (laheadle@midway.uchicago.edu)
Date: Fri Mar 14 1997 - 02:25:22 MET


Message-Id: <199703140125.TAA15399@kimbark.uchicago.edu>
To: caml-list@inria.fr
Subject: type error: converting input channel to string list
Date: Thu, 13 Mar 1997 19:25:22 -0600
From: Lyn A Headley <laheadle@midway.uchicago.edu>

hi all,

I can't seem to make sense of this type error. Sorry to air my
dirty laundry but I was hoping I could get some assistance with this
one, as I am stumped.

the code is merely:

(* turn an input channel into a list of strings *)
let string_list_of_chann chann =
  let rec slof_aux (ch: in_channel) (l: string list) =
    try
      let readstr = input_line ch in
      slof_aux ch readstr::l
    with End_of_file -> l
  in slof_aux chann []

and the error is:

File "query.ml", line 11, characters 19-155:
This expression has type in_channel -> string list -> string list
but is here used with type in_channel -> string -> string
make: *** [all] Error 2

Is this a problem with relying on an exception to type a function?

thanks,
Lyn



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET