I have this SML/NJ code that reads a single line from a text file and then it will return a list for me, but I am having trouble making it do the same thing to every single line and stop when there are no more lines. Can anyone please help me by giving me a looping sample here?
fun readlist(infile : string) =
let val ins = TextIO.openIn infile
val list = []
fun listing() = [TextIO.inputLine ins]::list;
in listing()
end