Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of forall

2011-02-05 Thread Max Bolingbroke
On 5 February 2011 02:35, Sebastian Fischer fisc...@nii.ac.jp wrote: I have not used monad-peel before so please ignore my comment if I am missing something obvious. The documentation mentions that Instances of MonadPeelIO should be constructed via MonadTransPeel, using peelIO = liftPeel

Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of forall

2011-02-05 Thread Max Bolingbroke
On 5 February 2011 04:19, Anders Kaseorg ande...@mit.edu wrote: Just to demonstrate that I didn’t use the triviality of ReaderT (), here’s a less trivial example with ReaderT and StateT: This is superb, thank you! I would never have come up with that :-) It still seems to fail somehow on my

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Claus Reinke
Lately I've been trying to go the other direction: make a large section of formerly strict code lazy. There used to be a couple of tools trying to make suggestions when a function could be made less strict (Olaf Chitil's StrictCheck and another that escapes memory at the moment). Often, it

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread wren ng thornton
On 2/5/11 4:26 AM, Claus Reinke wrote: Lately I've been trying to go the other direction: make a large section of formerly strict code lazy. There used to be a couple of tools trying to make suggestions when a function could be made less strict (Olaf Chitil's StrictCheck and another that

[Haskell-cafe] Concurrency best practices?

2011-02-05 Thread wren ng thornton
So I'm working on a project that uses STM to run a lot of things in parallel without the headaches of locks. So far it's working beautifully, STM rocks. But there's one snag... Sometimes I need those threads to do some IO like printing logging info. I'd like to make these IO chunks atomic

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Janis Voigtländer
On 2/5/11 4:26 AM, Claus Reinke wrote: Lately I've been trying to go the other direction: make a large section of formerly strict code lazy. There used to be a couple of tools trying to make suggestions when a function could be made less strict (Olaf Chitil's StrictCheck and another that

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Sebastian Fischer
Hi Wren, maybe Twilight STM is for you: http://hackage.haskell.org/package/twilight-stm Sebastian On Sat, Feb 5, 2011 at 6:46 PM, wren ng thornton w...@freegeek.org wrote: So I'm working on a project that uses STM to run a lot of things in parallel without the headaches of locks. So far it's

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Annette Bieniusa
Hi Wren, I am maintaining Twilight STM, and it seems that it might indeed solve your problem. We also use it for logging, locks, and other advanced STM stuff like inconsistency repair. If you are interested, let me know. There is a new version coming up soon, with new features and improved

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Jesper Louis Andersen
On Sat, Feb 5, 2011 at 10:46, wren ng thornton w...@freegeek.org wrote: Sometimes I need those threads to do some IO like printing logging info. Logging is easy, especially if you don't mind a performance hit. Create an STM.TChan and throw each log message on it. Have a separate forkIO'ed

Re: [Haskell-cafe] community server hasktags learned recursing into directories

2011-02-05 Thread Roman Cheplyaka
* Marc Weber marco-owe...@gmx.de [2011-02-04 22:35:53+] hasktags learned about how to recurse into subdirectories itself. This is especially useful for windows because writing scripts can be done but is less well known (http://stackoverflow.com/questions/4865391/answer/submit) Thanks

[Haskell-cafe] Problem with xhtml 1.5.1.1: html tags are split

2011-02-05 Thread Gwern Branwen
On Thu, May 13, 2010 at 11:38 AM, Gwern Branwen gwe...@gmail.com wrote: On Tue, May 11, 2010 at 3:00 AM, Bjorn Bringert bj...@bringert.net wrote: I support finding a new maintainer. Alright; as the old maintainer, I guess it falls on you to advertise on -cafe and libraries. Has a request

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Andrew Coppin
On 03/02/2011 09:37 PM, Daniel Fischer wrote: To illustrate your prediction about the side-issues: On Thursday 03 February 2011 22:10:51, Andrew Coppin wrote: Consider for a moment the original implementation with Data.Map. Adding a seq or two here will do no good at all; seq reduces to WHNF.

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Andrew Coppin
That got me thinking... What would happen if, instead of Integer, we had two types, evaluated Integer and possibly unevaluated Integer? What if the strictness or otherwise of a data structure were exposed at the type level? Oh, you mean like !Int and Int in Clean? I used to find bang *types*

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Andrew Coppin
On 03/02/2011 10:15 PM, Johan Tibell wrote: First, we need to stop pretending that you can use Haskell effectively without first learning to reason about program evaluation order. Writing a program in *any* language without understanding the performance implications of different language

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Andrew Coppin
For what it's worth I saw the problems in your counting examples right away, without reading the explanatory text below. Yes, they were pretty obvious with enough experience. For beginners I expect it to be a rather insidious trap. Beginners or anybody coding Haskell while not completely

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Andrew Coppin
On 04/02/2011 07:30 AM, Johan Tibell wrote: Right. It can still be tricky. I think we can get rid of a large number of strictness issues by using strict data structures more often, this should help beginners in particular. For the rest better tooling would help. For example, a lint tool that

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread aditya siram
There's the stm-io-hooks [1] package but it looks like it hasn't been updated in a while. -deech [1]http://hackage.haskell.org/package/stm-io-hooks On Sat, Feb 5, 2011 at 3:46 AM, wren ng thornton w...@freegeek.org wrote: So I'm working on a project that uses STM to run a lot of things in

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Andrew Coppin
On 05/02/2011 12:56 PM, Jesper Louis Andersen wrote: On Sat, Feb 5, 2011 at 10:46, wren ng thorntonw...@freegeek.org wrote: Sometimes I need those threads to do some IO like printing logging info. Logging is easy, especially if you don't mind a performance hit. Create an STM.TChan and throw

Re: [Haskell-cafe] combined parsing pretty-printing

2011-02-05 Thread Ozgur Akgun
Tillmann, I've been looking into you packages, very neat ideas and a nice implementation really. I've already implemented a toy example and it worked great. Now I am trying to use your library in a more serious piece of code, and I've realised that defineIsomorphisms doesn't support record

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Jesper Louis Andersen
On Sat, Feb 5, 2011 at 17:13, Andrew Coppin andrewcop...@btinternet.com wrote: On 05/02/2011 12:56 PM, Jesper Louis Andersen wrote: Presumably messages added to the channel appear immediately after the transaction commits. The problem is, I think GHC's STM implementation might mean that if

Re: [Haskell-cafe] Concurrency best practices?

2011-02-05 Thread Evan Laforge
On Sat, Feb 5, 2011 at 8:19 AM, Jesper Louis Andersen jesper.louis.ander...@gmail.com wrote: On Sat, Feb 5, 2011 at 17:13, Andrew Coppin andrewcop...@btinternet.com wrote: On 05/02/2011 12:56 PM, Jesper Louis Andersen wrote: Presumably messages added to the channel appear immediately after

Re: [Haskell-cafe] combined parsing pretty-printing

2011-02-05 Thread Ozgur Akgun
Great! That was pretty fast :) Are you going to update invertible-syntax to use partial-isomorphisms-0.2? 2011/2/5 Tillmann Rendel tillm...@rendel.net Hi Ozgur, Ozgur Akgun wrote: I've already implemented a toy example and it worked great. Now I am trying to use your library in a more

[Haskell-cafe] Storing passwords securely

2011-02-05 Thread Peter Scott
The usual advice on how to store passwords securely is use bcrypt, but since there seem to be no Haskell bindings for bcrypt, the other good option is to iterate a salted hash function at least 1000 times. In order for people to get this right, there should be a library with a really simple API

Re: [Haskell-cafe] Storing passwords securely

2011-02-05 Thread Jeremy Shaw
Have you seen the PBKDF2 library? http://hackage.haskell.org/package/PBKDF2 Does that look like a reasonable way to store passwords securely? - jeremy On Feb 5, 2011, at 8:12 PM, Peter Scott wrote: The usual advice on how to store passwords securely is use bcrypt, but since there seem to

Re: [Haskell-cafe] Storing passwords securely

2011-02-05 Thread Peter Scott
On Sat, Feb 5, 2011 at 10:54 PM, Jeremy Shaw jer...@n-heptane.com wrote: Have you seen the PBKDF2 library? http://hackage.haskell.org/package/PBKDF2 http://hackage.haskell.org/package/PBKDF2 Does that look like a reasonable way to store passwords securely? Yes, I looked at it before I

Re: [Haskell-cafe] AES on 32-bit system

2011-02-05 Thread Michael Snoyman
OK, now I'm sure I tried it before: I tried switching Haskellers over to AES with that code change you mention, and it results in runtime crashes (I assume segfaults, I didn't really look into it too much). So Svein, please disregard my requested code change, it's a bad idea. Michael On Fri, Feb