The below code is able to successfully convert an integer file to a list however i need to convert an integer to a list such as. Can anyone assist please ?
readint 134516; result should be a list [1,3,4,5,1,6];
fun readint(infile : string) =
let
val ins = TextIO.openIn infile
fun loop ins =
case TextIO.scanStream (Int.scan StringCvt.DEC) ins of
SOME int => int :: loop ins
| NONE => []
in
loop ins before TextIO.closeIn ins
end;