Re: [Haskell-cafe] Parsec and Text

2011-10-09 Thread Yves Parès
Yes, thanks ! When I saw it, I wondered if Antoine added the instance for Stream Text because of my question ;) The thing is that it adds a dependency to parsec, but since Text is more efficient than String it might not me much of a congestion. 2011/10/9 Ozgur Akgun ozgurak...@gmail.com Hi.

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Roman Beslik
I am not aware of such a library, but IMHO this code will be very simple. data Bits b = BitList b = BitList Int {- number of used bits in the next component -} b [b] Write an isomorphism between @BitList b@ and @ListStep (BitList b)@ where data ListStep e rc = Nil | Cons e rc On 07.10.11

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Ryan Newton
Yep, it is simple. But I prefer to only use well-tested data structure libraries where I can! Here's an example simple implementation (partial -- missing some common functions): module Data.BitList ( BitList , cons, head, tail, empty , pack, unpack, length, drop ) where import

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Joachim Breitner
Hi, Am Freitag, den 07.10.2011, 10:52 -0400 schrieb Ryan Newton: What about just using the Data.Bits instance of Integer? Well, presently, the setBit instance for very large integers creates a whole new integer, shifts, and xors:

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Daniel Fischer
On Sunday 09 October 2011, 15:54:14, Joachim Breitner wrote: Hi, Am Freitag, den 07.10.2011, 10:52 -0400 schrieb Ryan Newton: What about just using the Data.Bits instance of Integer? Well, presently, the setBit instance for very large integers creates a whole new integer, shifts, and

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Thomas Schilling
On 9 October 2011 14:54, Joachim Breitner m...@joachim-breitner.de wrote: Hi, Am Freitag, den 07.10.2011, 10:52 -0400 schrieb Ryan Newton: What about just using the Data.Bits instance of Integer?  Well, presently, the setBit instance for very large integers creates a whole new integer,

Re: [Haskell-cafe] SMP parallelism increasing GC time dramatically

2011-10-09 Thread Thomas Schilling
It would be really useful to see the threadscope output for this. Apart from cache effects (which may well be significant at 12 cores), the usual problems with parallel GHC are synchronisation. When GHC wants to perform a parallel GC it needs to stop all Haskell threads. These are lightweight

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Roman Beslik
Yes, if you do not use high-level concepts and optimize everything by hand, it requires a lot of testing. :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread KC
Must it be a list? What about a Bloom Filter? On Sun, Oct 9, 2011 at 9:11 AM, Roman Beslik ber...@ukr.net wrote: Yes, if you do not use high-level concepts and optimize everything by hand, it requires a lot of testing. :) ___ Haskell-Cafe mailing

[Haskell-cafe] thespian thoughts

2011-10-09 Thread Simon Michael
Hi Alexander, I went looking for something to clean up rss2irc's thread management, and your recently released thespian package looks like the simplest, most practical actors/erlang/OTP-ish lib for haskell so far. Thanks! I need to restart threads (actors) in a controlled way when they die or

[Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-09 Thread Max Rabkin
Hi all Following a link from the Yesod book, I arrived at [1], curious to find out what groundhog was. Once there, I learned... nothing: This library provides just the general interface and helper functions. You must use a specific backend in order to make this useful. [1]

Re: [Haskell-cafe] Best bit LIST data structure

2011-10-09 Thread Yves Parès
data *(Bits b) =* BitList b Is deprecated and soon to be removed from the language. I fail to understand. Why not just: data BitList b = Nil | BitList Int b (BitList b) ?? 2011/10/9 Roman Beslik ber...@ukr.net I am not aware of such a library, but IMHO this code will be very simple. data

[Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Arnaud Bailly
Hello, I am trying to move a web application I wrote that initially used raw sockets for doing HTTP by hand to a more sensible Wai-based framework, and I am running into a design issue. I initially thought it would be a good idea to be able to support various I/O methods so I defined a layer

Re: [Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Antoine Latter
On Sun, Oct 9, 2011 at 3:57 PM, Arnaud Bailly arnaud.oq...@gmail.com wrote: Hello, I am trying to move a web application I wrote that initially used raw sockets for doing HTTP by hand to a more sensible Wai-based framework, and I am running into a design issue. I initially thought it would be

Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-09 Thread John Millikin
The package summary is Type-safe ADT-database mapping library., which gives some idea about what it does. In my experience, any package that starts its source files with {-# LANGUAGE GADTs, TypeFamilies, ExistentialQuantification, StandaloneDeriving, TypeSynonymInstances,

Re: [Haskell-cafe] Trouble using State Monad.

2011-10-09 Thread Captain Freako
Hi David, Thanks for the reply. In trying to follow your advice, I arrived at this code: 17 newtype Filter e a = F { 18 runFilter :: EitherT e (State FilterState) a 19 } deriving (Monad, MonadState FilterState) 20 21 applyFilter :: Filter e a - FilterState - a - (Either e a,

Re: [Haskell-cafe] Trouble using State Monad.

2011-10-09 Thread David Barbour
On Sun, Oct 9, 2011 at 7:57 PM, Captain Freako capn.fre...@gmail.comwrote: 21 applyFilter :: Filter e a - FilterState - a - (Either e a, FilterState) 22 applyFilter f s x = runState (runEitherT (runFilter f)) s I still don't understand how I'm supposed to feed the input, `x', into the

Re: [Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Arnaud Bailly
Hi Antoine, Thanks for your interest. On Sun, Oct 9, 2011 at 11:57 PM, Antoine Latter aslat...@gmail.com wrote: interpret :: (CommandIO io, Map t) = Commands t io CommandResult What is the 'Commands' type? What is the 'Map' class? More details here :

[Haskell-cafe] Seeking Feedback on Crypto Learning Project Ideas

2011-10-09 Thread Daniel Kelly
Hi, I am a Haskell newbie looking for a small to medium size Haskell project that I can use as a learning tool, and would appreciate some feedback. I want to design and build something new, from scratch, that could actually be of practical use and that hasn't been done before (in Haskell, that