On Fri, Oct 16, 2009 at 11:59 AM, Alan Carter <alangcar...@gmail.com> wrote:
> > Trouble is, my function is (ultimately) being called from the C kernel > stuff. It isn't on the bottom of a call graph coming from a Haskell main. A > driver really needs to know where it's at. So I seem to need some kind of > global, persistent state, and Control.Monad.State seems to be out because I > can't pass a State around my call graph. > You don't need anything special for this. A Linux kernel "struct device" has a "void *driver_data" member which is private for your use, and intended for precisely this purpose. Global persistent state makes no more sense for kernel drivers than for most other code: how would it work if you had two mice plugged into your system? If you want a decent reference on writing Linux driver code, see http://lwn.net/Kernel/LDD3/ Your friendly kernel and Haskell hacker, Bryan.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe