Ashley Yakeley wrote:
Simon Marlow wrote:

Simon & I have discussed doing some form of thread-local state, which covers many uses of implicit parameters and is much preferable IMO. Thread-local state doesn't change your types, and it doesn't require passing any extra parameters at runtime. It works perfectly well for the OS example you give, for example.

Interesting. What would that look like in code?

No concrete plans yet. There have been proposals for thread-local variables in the past on this list and haskell-cafe, and other languages have similar features (eg. Scheme's support for dynamic scoping). Doing something along these lines is likely to be quite straightforward to implement, won't require any changes to the type system, and gives you a useful form of implicit parameters without any of the drawbacks.

The main difference from implicit parameters would be that thread-local variables would be restricted to the IO monad.

Haskell mailing list

Reply via email to