resetLib.reset : ('a,'b) istream -> ('a,'b) istream
Restart an istream.
An application reset istrm replaces the current state of
istrm with the value supplied when istrm was
constructed.
Never fails.
> reset(next(next
(mk_istream (fn x => x+1) 0 (concat "gsym" o int_to_string))));
Exception- Type error in function application.
Function: concat : string list -> string
Argument: "gsym" : string
Reason:
Can't unify string list (*In Basis*) with string (*In Basis*)
(Different type constructors)
Type error in function application.
Function: o : ('a -> 'b) * ('c -> 'a) -> 'c -> 'b
Argument: (concat "gsym", int_to_string) : string * (int -> string)
Reason: Can't unify string to 'a -> 'b (Incompatible types)
Fail "Static Errors" raised
> state it;
Exception- Type error in function application.
Function: state : ('a, 'b) istream -> 'b
Argument: it : unit
Reason: Can't unify ('a, 'b) istream to {} (Incompatible types)
Fail "Static Errors" raised
Perhaps the type of reset should be
('a,'b) istream -> unit.
Lib.mk_istream, Lib.next, Lib.state