[Haskell-cafe] re: monads with take-out options

2008-11-25 Thread Greg Meredith
John, You write: Yes, you are describing 'co-monads'. Good catch, but actually, that's too weak. i'm requesting something that is both a monad and a co-monad. That makes it something like a bi-algebra, or a Hopf algebra. This, however, is not the full story. i'm looking for a reference to the

Re[2]: [Haskell-cafe] Windows vs. Linux x64

2008-11-25 Thread Bulat Ziganshin
Hello Don, Tuesday, November 25, 2008, 1:59:02 AM, you wrote: Is Windows running in 32 bit? What gcc versions are you using on each system? there is no 64-bit ghc for windows yet, and i think that 64-bit windows runs 32-bit programs as fast as 32-bit windows this problem naturally splits into

Re: [Haskell-cafe] Hackage/Cabal/Haddock question

2008-11-25 Thread David Waern
2008/11/25 Thomas Hartman [EMAIL PROTECTED]: I've noticed that many of the packages I upload to haddock don't build documentation properly, although the documentation builds fine locally when I run cabal haddock. For example:

Re: [Haskell-cafe] Hackage/Cabal/Haddock question

2008-11-25 Thread Ross Paterson
On Tue, Nov 25, 2008 at 10:52:48AM +0100, David Waern wrote: 2008/11/25 Thomas Hartman [EMAIL PROTECTED]: I've noticed that many of the packages I upload to haddock don't build documentation properly, although the documentation builds fine locally when I run cabal haddock. For example:

[Haskell-cafe] Unique functor instance

2008-11-25 Thread Luke Palmer
I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the same using the laws. Thanks, Luke

Re: [Haskell-cafe] Unique functor instance

2008-11-25 Thread Janis Voigtlaender
Luke Palmer wrote: I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the same using the laws. For

Re: [Haskell-cafe] Unique functor instance

2008-11-25 Thread Janis Voigtlaender
Janis Voigtlaender wrote: Luke Palmer wrote: I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the

Re: [Haskell-cafe] Unique functor instance

2008-11-25 Thread Claus Reinke
Luke Palmer wrote: I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the same using the laws. For

Re: [Haskell-cafe] Unique functor instance

2008-11-25 Thread Claus Reinke
Are identity and composition sufficient to guarantee that the mapped function is actually applied? eek - f :: a - b, not f :: a - a, so that example doesn't work !! Sorry for the noise, Claus ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Unique functor instance

2008-11-25 Thread Janis Voigtlaender
Claus Reinke wrote: Luke Palmer wrote: I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the same

[Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
If you have a giant unboxed array that will never become garbage, it would be nice to put it somewhere where the GC won't bother with it. Since Data.Array.Storable arrays are allocated in the C heap, I thought it would be a good choice. However, I am getting very poor performance due to the GC

Re: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread Bulat Ziganshin
Hello David, Tuesday, November 25, 2008, 4:45:28 PM, you wrote: However, I am getting very poor performance due to the GC copying 6G in each run. The only explanation that I can think of is that it is copying my giant array. each GC run? each program run? try to increase size of your array

[Haskell-cafe] Re: Unique functor instance

2008-11-25 Thread DavidA
Luke Palmer lrpalmer at gmail.com writes: I've been wondering, is it ever possible to have two (extensionally) different Functor instances for the same type? I do mean in Haskell; i.e. (,) doesn't count. I've failed to either come up with any examples or prove that they all must be the

[Haskell-cafe] Re: Problem getting code from AFP08 parallel tutorial to run in parallel

2008-11-25 Thread Simon Marlow
Don Stewart wrote: Which version of GHC are you using? This particular example triggers a boundary condition in ghc 6.10 where, with only one spark, GHC doesn't fire up the extra cpu. Try it with 6.8.x to see that in action. Simon Marlow may be able to comment more. Yes, it's a scheduling

Re: [Haskell-cafe] Re: Unique functor instance

2008-11-25 Thread Janis Voigtlaender
DavidA wrote: I suspect that the answer to the question is, yes, you can have different Functor instances. All you need is a sum-product type that it's possible to interpret as two different abstractions, leading to two different Functor instances. The sum-product types are exactly the

[Haskell-cafe] (no subject)

2008-11-25 Thread apostolos flessas
hi, i am looking for someone to help me with an assignment! can anyone help me? i am looking forward to your reply. sincerely, Tolis _ BigSnapSearch.com - 24 prizes a day, every day - Search Now!

Re: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
On Tue, 2008-11-25 at 16:51 +0300, Bulat Ziganshin wrote: Hello David, Hello Bulat, Tuesday, November 25, 2008, 4:45:28 PM, you wrote: However, I am getting very poor performance due to the GC copying 6G in each run. The only explanation that I can think of is that it is copying my

Re: [Haskell-cafe] (no subject)

2008-11-25 Thread Dougal Stanton
2008/11/25 apostolos flessas [EMAIL PROTECTED]: hi, i am looking for someone to help me with an assignment! can anyone help me? Hi Tolis! Have a look at the homework help policy, so you know what people will and will not answer. http://www.haskell.org/haskellwiki/Homework_help Then let us

Re: Re[2]: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread David F. Place
On Tue, 2008-11-25 at 17:32 +0300, Bulat Ziganshin wrote: Hello David, Tuesday, November 25, 2008, 5:27:51 PM, you wrote: When I was researching how to do this, I was really hoping for something like static areas from the Lisp Machine operating system. You could allocate any normal

Re[2]: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread Bulat Ziganshin
Hello David, Tuesday, November 25, 2008, 5:27:51 PM, you wrote: When I was researching how to do this, I was really hoping for something like static areas from the Lisp Machine operating system. You could allocate any normal object in an area of the heap where the GC would not bother with

[Haskell-cafe] Re: Problem getting code from AFP08 parallel tutorial to run in parallel

2008-11-25 Thread Olivier Boudry
On Tue, Nov 25, 2008 at 3:07 PM, Simon Marlow [EMAIL PROTECTED] wrote: Yes, it's a scheduling bug. I'll make sure it gets fixed for 6.10.2. If you have more sparks then you shouldn't see this problem. Also, GHC HEAD is quite a lot better with parallel programs than 6.10.1, I'll try to get

[Haskell-cafe] Re: Unique functor instance

2008-11-25 Thread DavidA
Janis Voigtlaender voigt at tcs.inf.tu-dresden.de writes: DavidA wrote: I suspect that the answer to the question is, yes, you can have different Functor instances. All you need is a sum-product type that it's possible to interpret as two different abstractions, leading to two

Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
What does haskell cafe think of the following module for drop-in password hasing for webapps? Seem reasonable? import Data.Digest.SHA512 (hash) import qualified Data.ByteString as B' import qualified Data.ByteString.Char8 as B -- store passwords as md5 hash, as a security measure scramblepass ::

Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
Just to note, the comment about md5 is incorrect. I switched to SHA512 as you can see in the code. 2008/11/25 Thomas Hartman [EMAIL PROTECTED]: What does haskell cafe think of the following module for drop-in password hasing for webapps? Seem reasonable? import Data.Digest.SHA512 (hash)

Re: [Haskell-cafe] Re: Unique functor instance

2008-11-25 Thread Janis Voigtlaender
DavidA wrote: Okay, I see. Well that's interesting, because it suggests that your proof might break under modest extensions to the language. Yes. The free theorem used was a naive one, for the simplest possible model of Haskell, not even taking care of possible nontermination and seq. But

Re[4]: [Haskell-cafe] Password hashing

2008-11-25 Thread Bulat Ziganshin
Hello Thomas, Tuesday, November 25, 2008, 6:39:27 PM, you wrote: Just to note, the comment about md5 is incorrect. I switched to SHA512 as you can see in the code. really? :) Right s - -- return . show . md5 . L.pack $ p ++ s typical salt usage is generation of new salt for every

Re: [Haskell-cafe] Hackage/Cabal/Haddock question

2008-11-25 Thread Thomas Hartman
How come I get documentation output when I build locally then? I'm also using ghc 6.10.1 and haddock 2.3.0. 2008/11/25 Ross Paterson [EMAIL PROTECTED]: On Tue, Nov 25, 2008 at 10:52:48AM +0100, David Waern wrote: 2008/11/25 Thomas Hartman [EMAIL PROTECTED]: I've noticed that many of the

Re: Re[4]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
ah thanks, I'll try again. typical salt usage is generation of new salt for every encryption operation and storing together with encrypted data 2008/11/25 Bulat Ziganshin [EMAIL PROTECTED]: Hello Thomas, Tuesday, November 25, 2008, 6:39:27 PM, you wrote: Just to note, the comment about

Re: Re[4]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
How about the following? The main doubts I'm having at this point concern the takerandom part. Does this seem reasonable? Also, someone in the thread mentioned that a calculation that took a couple of seconds to complete was a good thing because it makes dictionary cracking harder. But

Re[6]: [Haskell-cafe] Password hashing

2008-11-25 Thread Bulat Ziganshin
Hello Thomas, Tuesday, November 25, 2008, 9:13:53 PM, you wrote: don't reinvent the wheel, use PBKDF2 from PKCS #5 http://www.truecrypt.org/docs/pkcs5v2-0.pdf How about the following? The main doubts I'm having at this point concern the takerandom part. Does this seem reasonable? Also,

Re: [Haskell-cafe] Interactive

2008-11-25 Thread Andrew Coppin
Thomas DuBuisson wrote: Here are the links that hold the information you desire: http://www.haskell.org/haskellwiki/Frag http://www.cse.unsw.edu.au/~pls/thesis/munc-thesis.pdf http://www.cse.unsw.edu.au/%7Epls/thesis/munc-thesis.pdf In short: FRP http://www.haskell.org/frp/ On Wed, Nov 12,

Re: [Haskell-cafe] Interactive

2008-11-25 Thread Jonathan Cast
On Tue, 2008-11-25 at 18:43 +, Andrew Coppin wrote: Thomas DuBuisson wrote: Here are the links that hold the information you desire: http://www.haskell.org/haskellwiki/Frag http://www.cse.unsw.edu.au/~pls/thesis/munc-thesis.pdf http://www.cse.unsw.edu.au/%7Epls/thesis/munc-thesis.pdf

Re: [Haskell-cafe] monads with take-out options

2008-11-25 Thread Jonathan Cast
On Mon, 2008-11-24 at 15:06 -0800, Greg Meredith wrote: Jonathan, Nice! Thanks. In addition to implementations, do we have more mathematical accounts? Let me expose more of my motives. * i am interested in a first-principles notion of data. Hunh. I have to say I'm not. The difference

Re[2]: [Haskell-cafe] Interactive

2008-11-25 Thread Bulat Ziganshin
Hello Andrew, Tuesday, November 25, 2008, 9:43:11 PM, you wrote: OOP seems like such a natural fit for describing the behaviour of a network of independent objects. But Haskell seems to require you to make a new, modified copy of the entire game state at each frame, which sounds... highly

Re: [Haskell-cafe] Windows vs. Linux x64

2008-11-25 Thread Bartosz Wójcik
On Monday 24 November 2008 23:59:02 Don Stewart wrote: bartek: Hi Everybody, while working on my resent project I've noticed that my code seems to be faster under Windows than under Linux x64. Is Windows running in 32 bit? What gcc versions are you using on each system? Windows is 32

Re: [Haskell-cafe] build tools and Cabal

2008-11-25 Thread Duncan Coutts
On Tue, 2008-11-25 at 01:30 +, John Lato wrote: Hello, Cabal allows specifying arguments for tools it recognizes on the command line, e.g. runhaskell Setup.hs configure --c2hs-option=some_option Unfortunately, I can't find a way to make this work with .cabal (or .buildinfo) files,

Re: [Haskell-cafe] Windows vs. Linux x64

2008-11-25 Thread Ketil Malde
Bartosz Wójcik [EMAIL PROTECTED] writes: while working on my resent project I've noticed that my code seems to be faster under Windows than under Linux x64. Is Windows running in 32 bit? What gcc versions are you using on each system? Windows is 32 bit with GHC-6.8.3. Linux is 64 bit with

[Haskell-cafe] Re: Problem getting code from AFP08 parallel tutorial to run in parallel

2008-11-25 Thread Don Stewart
olivier.boudry: On Tue, Nov 25, 2008 at 3:07 PM, Simon Marlow [EMAIL PROTECTED] wrote: Yes, it's a scheduling bug. I'll make sure it gets fixed for 6.10.2. If you have more sparks then you shouldn't see this problem. Also, GHC HEAD is quite a lot better with parallel programs than

Re: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread John Meacham
GHC has 'pinned arrays' that have this behavior. however, you probably don't want to use them as they simply give the garbage collector less choices about what to do possibly decreasing its efficiency. The garbage collector already is free to not copy arrays if it feels it isn't worth it, by

Re: [Haskell-cafe] Windows vs. Linux x64

2008-11-25 Thread John Meacham
On Tue, Nov 25, 2008 at 09:39:35PM +0100, Ketil Malde wrote: This corresponds to my experiences - 64 bits is slower, something I've ascribed to the cost of increased pointer size. ghc unfortunatly also uses 64 bit integers when in 64 bit mode, so the cost paid is increased due to that as well,

Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
OK, I went ahead and implemented pbkdf2, following the algorithm linked to by bulat and Michael. If there are any crypto gurus who can code-review this I would be much obliged, and when I'm confident enough that this does the right thing I'll put it up on hackage. I don't do much crypto so this

Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-25 Thread Thomas Hartman
Sorry about the hideous formatting above. Reattached as a text file. t. 2008/11/26 Thomas Hartman [EMAIL PROTECTED]: OK, I went ahead and implemented pbkdf2, following the algorithm linked to by bulat and Michael. If there are any crypto gurus who can code-review this I would be much

[Haskell-cafe] ANN: Real World Haskell, now shipping

2008-11-25 Thread Bryan O'Sullivan
Good evening - John Goerzen, Don Stewart and I are delighted to announce the availability of our book, Real World Haskell. It is 710 pages long, and published by O'Reilly Media. This is the first book to comprehensively cover modern Haskell programming. From an introduction to functional

[Haskell-cafe] IRC question

2008-11-25 Thread Galchin, Vasili
Hello, I am using Ubuntu Linux and I want to get the Haskell IRC feed. What IRC client can I use and how to configure? Thanks, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] IRC question

2008-11-25 Thread Aapo Lehtinen
Galchin, Vasili kirjoitti: Hello, I am using Ubuntu Linux and I want to get the Haskell IRC feed. What IRC client can I use and how to configure? Thanks, Vasili ___

Re: [Haskell-cafe] IRC question

2008-11-25 Thread Don Stewart
aapo: Galchin, Vasili kirjoitti: Hello, I am using Ubuntu Linux and I want to get the Haskell IRC feed. What IRC client can I use and how to configure? Thanks, Vasili

[Haskell-cafe] Re: [Haskell] ANN: Real World Haskell, now shipping

2008-11-25 Thread Donnie Jones
Mine arrives in two days; I can't wait! :) Thanks for all your hard work, and to all the members of the community which provided comments/suggestions to improve the book. __ Donnie Jones On Wed, Nov 26, 2008 at 12:15 AM, Bryan O'Sullivan [EMAIL PROTECTED]wrote: Good evening - John Goerzen,

Re: [Haskell-cafe] IRC question

2008-11-25 Thread Jason Dagit
On Tue, Nov 25, 2008 at 11:04 PM, Don Stewart [EMAIL PROTECTED] wrote: aapo: Galchin, Vasili kirjoitti: Hello, I am using Ubuntu Linux and I want to get the Haskell IRC feed. What IRC client can I use and how to configure? Thanks, Vasili