(* stdin.sml
 *
 * Sample code for CMSC 32102 Project-1
 *
 * This module provides a work around for a bug in the current
 * implementation of CML.  Use the operations from this module
 * instead of the TextIO event constructors on stdIn.  Note
 * that if you use this module, you will have to call RunCML.shutdown
 * to exit the vsh.
 *)

structure StdIn : sig

    type console

    val init : unit -> console

    val inputLine : console -> string
    val inputLineEvt : console -> string CML.event
    val inputEvt : console -> string CML.event

  end = struct

    type console = Input.instream

    fun init () = Input.init TextIO.stdIn

    val inputEvt = Input.inputEvt
    val inputLineEvt = Input.inputLineEvt
    val inputLine = Input.inputLine

  end
