Skip to content
  • Simon Marlow's avatar
    [project @ 1997-10-13 16:12:54 by simonm] · df10403c
    Simon Marlow authored
    Changes to unbox the state in the ST and IO monads.
    
    ST now has type
    
    	newtype ST s a = ST (State# s -> STret s a)
    	data STret s a = STret (State# s) a
    
    IO now has type
    
    	newtype IO a = IO (State# RealWorld -> IOResult a)
    	data IOResult a = IOok   (State# RealWorld) a
    	                | IOfail (State# RealWorld) IOError
    
    So ST should be slightly more efficient, and IO should be nearly as
    efficient as ST.
    df10403c