[Haskell-cafe] Buttons and Clicks - State Monad
Hi, in this piece here http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=1083#a1083 I'm trying to create a button that, every time when clicked, increases a counter by one and does a putStrLn of the counters current value. I'm trying to write this without any use of IORef but merely using the state monad. Can anybody show me how to do this? Günther The UI Code is wxHaskell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] UI-state, using State Monad or IORef?
Hi, at one point I generate n elements of dropdowns dynamically. Whenever I make a selection in any of those choices the others should also be updated, ie. the list of available choices needs to be altered. But I also need to update in place the model that is associated with each individual dropdown. Should I simply use IORefs for this purpose, or should I rather use a more functional code with the State Monad? Is there a tutorial or an example on how to use the State monad? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: databases in Haskell type-safety
Hi Austin, could you post the patch please? So far there is no updated version of takusen that builds with ghc 6.10 Günther On 3 Jan., 11:25, Austin Seipp mad@gmail.com wrote: Excerpts from Gour's message of Sat Jan 03 03:48:44 -0600 2009: Hi! I'd like to use sqlite3 as application storage in my haskell project... Browsing the available database options in Haskell it seems that: a) HSQL is dead (hackage reports build-failure with 6.8 6.10) b) haskelldb is also not in a good shape - build fails with 6.8 6.10 For Haskell-newbie as myself, it looks that haskelldb is the one which provide(ed)s the most secure API (I was reading draft paper about MetaHDBC but, apparently, the type inference support in open-source databases is poor and that's why, according to the author This is unfortunately as it makes MetaHDBC a lot less valuable. What remains is: c)Takusenwhich is also not up-to-date (it fails with 6.10) and d) HDBC and sqlite bindings which are the only packages which build with 6.10. Have you tried the simple sqlite3 bindings available?http://hackage.haskell.org/cgi-bin/hackage-scripts/package/sqlite I'm not familiar withTakusenwhich says: Takusen'sunique selling point is safety and efficiency... and I would appreciate if someone could shed some more light to its 'safety' and the present status? Takusenis based on the (unique) concept of a left-fold enumerator. Having a left-fold interface guarantees timely (nearly perfect, really) deallocation of resources while still having the benefits of a 'lazy' stream. This interface has (as shown by Oleg and others) proven to be very efficient in a number of cases as well as favorable for many. The idea is very novel, and truly worth exploring if you ask me. For more information about left-fold enumerators andtakusen, see here: http://okmij.org/ftp/papers/LL3-collections-enumerators.txthttp://okmij.org/ftp/Haskell/fold-stream.lhshttp://okmij.org/ftp/Haskell/misc.html#takusen NB: I have *just* (about 5 minutes ago) sent in a patch fortakusen to get it to build on GHC 6.10.1 to Oleg. Hopefully an updated version will appear on hackage in the next few days. Austin ___ Haskell-Cafe mailing list haskell-c...@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: databases in Haskell type-safety
Hi Alistair, yes, please, pretty please do! I really am desparate, I'm running into so much trouble because I have to export to MS-Access and I'm a little out of luck with HDBC. HDBC works like a charm unless you have to use MS-Access. Günther On 29 Jan., 22:24, Alistair Bayley alist...@abayley.org wrote: I recently got an email back from Alstair Bayley who is one of the Takusen authors, and they said they are preparing a GHC 6.10 release (I was *not* the only person to submit a patch for ghc 6.10 building) but it may take a little while. You might want to get in contact with Alstair and ask what the current progress is. I've got it building (tests pass etc) but the haddock docs won't build at present (with ghc-6.10.1). I want to get these little problems sorted out before I package up the next release. If you're desperate then I could push what I have so far into the repo and you could build from that. Alistair ___ Haskell-Cafe mailing list haskell-c...@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe