[Haskell-cafe] Re: Doing without IORef

Peter Hercek phercek at gmail.com
Thu Apr 3 14:08:09 EDT 2008


Jinwoo Lee wrote:
> Is there any way in which I can do without IORef in tabHandler and 
> commandLoop (written in red and bold, if you can see)?

You could just always redefine the key binding for \t with
  a new closure which contains the updated "pwd" value (or
  the whole state if you like it more that way). I suppose
  readline supports key binding redefinition (???).
But I do not think I like it more that IORef, I rather
  use IORefs with imperative interfaces  :-)

Peter.



More information about the Haskell-Cafe mailing list