[Haskell-cafe] Re: the real world of Haskell books (Re: Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Gour
> "Bryan" == Bryan O'Sullivan <[EMAIL PROTECTED]> writes: Bryan> Other tech books face the same problem, which, if they sell Bryan> successfully and the authors haven't moved into caves afterwards Bryan> to recover, they address with subsequent editions. If readers Bryan> find that specific pi

Re: the real world of Haskell books (Re: [Haskell-cafe] Online RealWorld Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 7:50 PM, Derek Elkins <[EMAIL PROTECTED]> wrote: > To make what (I believe) Claus is saying more explicit and direct, add a > note to the beginning of the book (or somewhere reasonably prominent) > that states something along the lines [...] We will add a link to an errata

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Derek Elkins
On Fri, 2008-09-05 at 20:11 -0700, Tim Chevalier wrote: > On Fri, Sep 5, 2008 at 7:23 PM, Derek Elkins <[EMAIL PROTECTED]> wrote: > > > > This attitude is wrong. Many potentially significant performance > > problems can easily be spotted and solved during construction without > > affecting the rea

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Tim Chevalier
On Fri, Sep 5, 2008 at 7:23 PM, Derek Elkins <[EMAIL PROTECTED]> wrote: > > This attitude is wrong. Many potentially significant performance > problems can easily be spotted and solved during construction without > affecting the readability of the code, problems that would be much > harder to diag

Re: the real world of Haskell books (Re: [Haskell-cafe] Online RealWorld Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Derek Elkins
On Fri, 2008-09-05 at 20:55 +0100, Claus Reinke wrote: > >> Seriously, though, what is the RWH authors' plan for tackling > >> the eternal frustration of Haskell book authors, a moving target? > > > > Other tech books face the same problem, which, if they sell > > successfully and the authors have

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Derek Elkins
On Thu, 2008-09-04 at 08:19 -0700, Tim Chevalier wrote: > On 9/3/08, wren ng thornton <[EMAIL PROTECTED]> wrote: > > If you want the datatype to be strict in state and rec, then you should add > > strictness annotations to those fields directly: > > > > data Query state rec = Query !state !rec

[Haskell-cafe] ANNOUNCE: xmonad 0.8 released!

2008-09-05 Thread Don Stewart
http://xmonad.org The xmonad dev team is pleased to announce xmonad 0.8! The headlines: * A general purpose replacement for "gaps" has been adopted. * Floating windows pop up on the current screen by default * Locale support * Rock solid code: No new c

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Tim Newsham
It's especially bad when modules are extremely likely to be used together, like Control.Monad.State & FRef, or Data.Map & the Prelude. You end up being required to import one or the other qualified. I think in the case of State vs. FRef a simple solution is to make two modules: FRef, which uses

Re: [Haskell-cafe] Re: 2 modules in one file

2008-09-05 Thread Brandon S. Allbery KF8NH
On 2008 Sep 5, at 19:36, Aaron Denney wrote: On 2008-08-30, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: On 2008 Aug 30, at 4:22, Aaron Denney wrote: On 2008-08-27, Henrik Nilsson <[EMAIL PROTECTED]> wrote: And there are also potential issues with not every legal module name being a l

[Haskell-cafe] Re: 2 modules in one file

2008-09-05 Thread Aaron Denney
On 2008-08-30, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: > On 2008 Aug 30, at 4:22, Aaron Denney wrote: >> On 2008-08-27, Henrik Nilsson <[EMAIL PROTECTED]> wrote: >>> And there are also potential issues with not every legal module name >>> being a legal file name across all possible file

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Ryan Ingram
On Fri, Sep 5, 2008 at 1:39 PM, Henning Thielemann <[EMAIL PROTECTED]> wrote: > Haskell already supports qualification, why manual prefixing? This is just a stylistic opinion, but I absolutely hate "required" qualifications; it is a waste of typing and, in my opinion, it makes the resulting code l

Re: [Haskell-cafe] Reducing code for efficient ShowS

2008-09-05 Thread Sean Leather
> > That's an interesting idea. It appears to use the same idea as ShowS, but > > more generally with lists and not just strings. > > The difference-list approach to solving the appending problem is classic. > There's a variant for unification-based logic languages as well. Both are > functional ta

Re: [Haskell-cafe] Reducing code for efficient ShowS

2008-09-05 Thread wren ng thornton
Sean Leather wrote: >> Why not use the dlist library: >> >>http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dlist >> >> With something like (untested code): >> >> > xs +++ ys = showsxs `append` showsys >> > x .++ ys = showChar x `cons` showsys >> > xs ++. y = shows

Re: [Haskell-cafe] Reducing code for efficient ShowS

2008-09-05 Thread Sean Leather
> Why not use the dlist library: > >http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dlist > > With something like (untested code): > > > xs +++ ys = showsxs `append` showsys > > x .++ ys = showChar x `cons` showsys > > xs ++. y = showsxs `snoc` showChar y >

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Don Stewart
allbery: > On 2008 Sep 5, at 12:45, Bryan O'Sullivan wrote: > >On Fri, Sep 5, 2008 at 5:04 AM, Claus Reinke > ><[EMAIL PROTECTED]> wrote: > >>Seriously, though, what is the RWH authors' plan for tackling > >>the eternal frustration of Haskell book authors, a moving target? > > > >Other tech books

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Brandon S. Allbery KF8NH
On 2008 Sep 5, at 12:45, Bryan O'Sullivan wrote: On Fri, Sep 5, 2008 at 5:04 AM, Claus Reinke <[EMAIL PROTECTED]> wrote: Seriously, though, what is the RWH authors' plan for tackling the eternal frustration of Haskell book authors, a moving target? Other tech books face the same problem, whic

Re: [Haskell-cafe] Re: Functional references

2008-09-05 Thread Henning Thielemann
On Fri, 5 Sep 2008, Jean-Philippe Bernardy wrote: I think it would be worth spending some time (on this mailing list, perhaps, or in another forum) trying to hash out a decent API which meets most people's requirements, rather than ending up with 4 or 5 slightly different ones. Indeed. I ha

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Henning Thielemann
On Thu, 4 Sep 2008, Ryan Ingram wrote: Nice. I've written similar stuff a couple of times before, but the formulation using Maybe and modify definitely solves some problems I started to notice as I used it on bigger structures. However, it might be better to separate a class of "never failing

Re: the real world of Haskell books (Re: [Haskell-cafe] Online RealWorld Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Claus Reinke
Seriously, though, what is the RWH authors' plan for tackling the eternal frustration of Haskell book authors, a moving target? Other tech books face the same problem, which, if they sell successfully and the authors haven't moved into caves afterwards to recover, they address with subsequent ed

Re: [Haskell-cafe] Top Level <-

2008-09-05 Thread Ganesh Sittampalam
On Fri, 5 Sep 2008, Ashley Yakeley wrote: Sittampalam, Ganesh wrote: Ashley Yakeley wrote: I really don't know enough about the RTS to know. The alternative would be to keep all initialised values when the module is unloaded. I'm guessing this is more feasible. Easier, but a guaranteed mem

Re: [Haskell-cafe] Reducing code for efficient ShowS

2008-09-05 Thread wren ng thornton
Sean Leather wrote: > There's the obvious approach that's described in every tutorial, book, and > research paper (for didactic purposes, of course). > >> ex1 = "(" ++ show n ++ " " ++ s ++ ")" > > It's pretty concise, but it's horribly inefficient due to the use of (++). > > Then, there's the Show

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-05 Thread Ashley Yakeley
Sittampalam, Ganesh wrote: Ashley Yakeley wrote: I really don't know enough about the RTS to know. The alternative would be to keep all initialised values when the module is unloaded. I'm guessing this is more feasible. Easier, but a guaranteed memory leak. But it's limited to the initialis

Re: [Haskell-cafe] Re: Functional references

2008-09-05 Thread wren ng thornton
Jean-Philippe Bernardy wrote: >> I think it would be worth spending some time (on this mailing list, >> perhaps, or in another forum) trying to hash out a decent API which >> meets most people's requirements, rather than ending up with 4 or 5 >> slightly different ones. > > Indeed. I have my own ve

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Ganesh Sittampalam
On Fri, 5 Sep 2008, Jules Bean wrote: I think it would be worth spending some time (on this mailing list, perhaps, or in another forum) trying to hash out a decent API which meets most people's requirements, rather than ending up with 4 or 5 slightly different ones. This sounds like a good p

[Haskell-cafe] Re: Functional references

2008-09-05 Thread Jean-Philippe Bernardy
> I think it would be worth spending some time (on this mailing list, > perhaps, or in another forum) trying to hash out a decent API which > meets most people's requirements, rather than ending up with 4 or 5 > slightly different ones. Indeed. I have my own version here: http://code.haskell.

Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 3:45 AM, david48 <[EMAIL PROTECTED]> wrote: > In the online version of Real world Haskell, there's a problem with > examples in ghci when the module Database.HDBC.Sqlite3 is imported. Oops, should be fixed now. ___ Haskell-Cafe mai

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 5:04 AM, Claus Reinke <[EMAIL PROTECTED]> wrote: > Seriously, though, what is the RWH authors' plan for tackling > the eternal frustration of Haskell book authors, a moving target? Other tech books face the same problem, which, if they sell successfully and the authors have

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-05 Thread David Roundy
On Thu, Sep 04, 2008 at 08:04:25PM -0500, Austin Seipp wrote: > Excerpts from Justin Bailey's message of Thu Sep 04 17:00:58 -0500 2008: > > > Looking at the package, I think would be pretty painful though. It > > seems I'd have to build the AST by hand, > > The AST Language.C defines for C is actu

[Haskell-cafe] Reducing code for efficient ShowS

2008-09-05 Thread Sean Leather
It happens very often that I want to convert a number of values to strings and concatenate those strings into one. No surprise there, of course. Well, I'd prefer to do it efficiently and with as little code as necessary. > {-# LANGUAGE TypeSynonymInstances #-} > module ShowsDemo where Let's say I

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread John Goerzen
On Fri, Sep 05, 2008 at 01:04:03PM +0100, Claus Reinke wrote: > Now that is "real world" - problems even before release!-) > > Seriously, though, what is the RWH authors' plan for tackling > the eternal frustration of Haskell book authors, a moving target? Hope that enough copies are sold that O'R

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Ross Paterson
On Fri, Sep 05, 2008 at 01:04:03PM +0100, Claus Reinke wrote: > Seriously, though, what is the RWH authors' plan for tackling > the eternal frustration of Haskell book authors, a moving target? > > There used to be a time when one could guess the poster's > Haskell book from their question topics:

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Duncan Coutts
On Fri, 2008-09-05 at 13:04 +0100, Claus Reinke wrote: > Now that is "real world" - problems even before release!-) > > Seriously, though, what is the RWH authors' plan for tackling > the eternal frustration of Haskell book authors, a moving target? > > There used to be a time when one could gues

the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Claus Reinke
Now that is "real world" - problems even before release!-) Seriously, though, what is the RWH authors' plan for tackling the eternal frustration of Haskell book authors, a moving target? There used to be a time when one could guess the poster's Haskell book from their question topics: - 'HGL

Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters

2008-09-05 Thread Janis Voigtlaender
See John's comment, right there in the online version: "The system that generated this webpage didn't have HDBC installed at the time. We'll get that fixed and re-post this chapter. In the meantime, unfortunately, all of the examples on this page will look that way." david48 wrote: In the onlin

[Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters

2008-09-05 Thread david48
In the online version of Real world Haskell, there's a problem with examples in ghci when the module Database.HDBC.Sqlite3 is imported. It goes on like this for all of chapter 21 and 22. Example : ( note: this is not me trying to reproduce the examples, it's an actual copy & paste from the site ur

[Haskell-cafe] RE: [Haskell] Top Level <-

2008-09-05 Thread Sittampalam, Ganesh
Ashley Yakeley wrote: > I really don't know enough about the RTS to know. The > alternative would be to keep all initialised values > when the module is unloaded. I'm guessing this is more > feasible. Easier, but a guaranteed memory leak. Ganesh =

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-05 Thread Ashley Yakeley
Sittampalam, Ganesh wrote: Sounds plausible, although dynamic relocations do slow down linking. Unloading is another interesting problem. Are we allowed to re-run <- if the module that contained it is unloaded and then reloaded? I'm not quite sure what the conditions for allowing a module to be

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Jules Bean
You should package this up and put it on hackage. It is nice, but there is already another FRef package on hackage (Data.Accessor) and I have a home-grown one of my own, which uses different notation / combinators to either the hackage one or Tim's. There are also fragments of FRef-like th

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Ketil Malde
Jules Bean <[EMAIL PROTECTED]> writes: On Sep 4, 2008, at 10:19 AM, Tim Chevalier wrote: > The master programmer does not add strictness annotations, for she has > not yet run the profiler. >> The compiler will certainly be able to infer the strictness itself > As far as I am aware

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Jules Bean
Jake Mcarthur wrote: On Sep 4, 2008, at 9:52 PM, Tim Chevalier wrote: I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I imagine one. I'm no master either, but how about these simple examples? data Stream

[Haskell-cafe] RE: [Haskell] Top Level <-

2008-09-05 Thread Sittampalam, Ganesh
Ashley Yakeley wrote: > Sittampalam, Ganesh wrote: >>> Oh dear. To fix this, I suppose the RTS would have to be able to keep >>> track of all static initialisers. But it shouldn't otherwise affect >>> program optimisation. >> >> What would the RTS actually do? > I don't know enough about the