[Haskell-cafe] Pattern matching on lazy bytestrings: how does it work?

2011-04-23 Thread Tom Brow
I noticed today that I can pattern match against lazy bytestrings when using the OverloadedStrings extension: import Data.ByteString.Char8 () import Data.ByteString.Lazy.Char8 f :: ByteString - Bool f abc = True f _ = False main = do print $ f $ fromChunks [abc] print $ f $

Re: [Haskell-cafe] Pattern matching on lazy bytestrings: how does it work?

2011-04-23 Thread Stephen Tetley
Surely `fromChunks` is making the both lines in the code snippet the same? Also, in your last sentence I think you've miscalculated the shape of the initial input. Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Pattern matching on lazy bytestrings: how does it work?

2011-04-23 Thread Helgi Kristvin Sigurbjarnarson
On Fri, Apr 22, 2011 at 11:52:32PM -0700, Tom Brow wrote: I noticed today that I can pattern match against lazy bytestrings when using the OverloadedStrings extension: [..] Given that pattern matching is based on data constructors, how is it possible that (Chunk abc Empty) and (Chunk a (Chunk

Re: [Haskell-cafe] ANN: Leksah 0.10.0

2011-04-23 Thread Joachim Breitner
Hi Hamish, Am Freitag, den 22.04.2011, 22:40 +1200 schrieb Hamish Mackenzie: Yesterday we uploaded our official 0.10.0 release (0.10.0.4) to Hackage and we have Windows and OS X installers at http://leksah.org/download.html I am checking what is to be done to get this new release into Debian,

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.2.0.0

2011-04-23 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators including flushing (using John Lato's implementation). Currently only gzip and bzip is provided but LZMA is planned. Changes from previous version: - Add BZip support Next goals: - LZMA support - Generic interface for

Re: [Haskell-cafe] Why not Darcs?

2011-04-23 Thread Heinrich Apfelmus
David Terei wrote: Good chance you've already read this but if not here is a good post by Linus about his take on the problems with darcs: http://markmail.org/message/vk3gf7ap5auxcxnb I always have to smile at the complaint that something is academic. :D You know, like purely functional

Re: [Haskell-cafe] ANN: Leksah 0.10.0

2011-04-23 Thread Hamish Mackenzie
On 23 Apr 2011, at 21:48, Joachim Breitner wrote: I am checking what is to be done to get this new release into Debian, and I notice quite a few changes to the dependencies, including some duplication of existing libraries (haddock-leksah, haddock-process). That is something we would

Re: [Haskell-cafe] Why not Darcs?

2011-04-23 Thread Henning Thielemann
On Sat, 23 Apr 2011, Heinrich Apfelmus wrote: David Terei wrote: Good chance you've already read this but if not here is a good post by Linus about his take on the problems with darcs: http://markmail.org/message/vk3gf7ap5auxcxnb I always have to smile at the complaint that something is

[Haskell-cafe] Berlin Haskell Meeting

2011-04-23 Thread Sönke Hahn
Hi all! The next Berlin Haskell Meeting will be next wednesday: Date: Wednesday, April 27th Time: from 20:00 Location: c-base, Rungestrasse 20, 10179 Berlin I hope, this is not on too short notice. Cheers, Sönke ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Why not Darcs?

2011-04-23 Thread Maciej Marcin Piechotka
On Sat, 2011-04-23 at 12:31 +0200, Heinrich Apfelmus wrote: David Terei wrote: Good chance you've already read this but if not here is a good post by Linus about his take on the problems with darcs: http://markmail.org/message/vk3gf7ap5auxcxnb I always have to smile at the complaint

Re: [Haskell-cafe] Why not Darcs?

2011-04-23 Thread Andrew Coppin
On 21/04/2011 11:16 PM, John Millikin wrote: My chief complaint is that it's built on patch theory, which is ill-defined and doesn't seem particularly useful. The Bazaar/Git/Mercurial DAG model is much easier to understand and work with. Possibly as a consequence of its shaky foundation, Darcs

[Haskell-cafe] Storing failing testcases for QuickCheck

2011-04-23 Thread Sönke Hahn
Hi! I would like to have a library that would allow to use QuickCheck in the normal manner, but it would save test data for failing properties on the filesystem (maybe using the shiny new acid-state?). On consecutive test runs, the saved test data would be used first (before generating new

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-23 Thread Ketil Malde
Evan Laforge qdun...@gmail.com writes: Most of the (non-IO) runtime errors I get using Haskell software is due to head or fromJust, it's actually quite annoying. Just singling this one out because I've heard it before. I've never gotten a runtime error from these. It seems quite easy to

Re: [Haskell-cafe] How to use cabal's data-files feature and run in-place?

2011-04-23 Thread Richard Cobbe
On Thu, Apr 21, 2011 at 11:27:10PM -0500, Antoine Latter wrote: 2. Here's what I do for the paths situation: In the package description, create a CPP option so you know you're compiling via Cabal: Cpp-options: -DCABAL Then create a module to wrap around the autogenerated paths module,

Re: [Haskell-cafe] Why not Darcs?

2011-04-23 Thread Chris Smith
I'm a great fan of darcs, and also have never run into the performance and reliability issues that GHC has. That said, it's clear that they *have* run into them, and if something else makes GHC development go more smoothly, then I'm 100% supportive of their using it. It is disappointing, though

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-23 Thread Henning Thielemann
Ketil Malde schrieb: Maybe is in a sense easier, as 'Maybe a' and 'a' are different types, while there isn't a similarly elegant type distinction between lists that may be empty and lists with at least one element. Maybe is really quite brilliant. type NonEmptyList a = (a, [a]) data

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-23 Thread Evan Laforge
On Sat, Apr 23, 2011 at 5:57 PM, Ketil Malde ke...@malde.org wrote: Evan Laforge qdun...@gmail.com writes: Most of the (non-IO) runtime errors I get using Haskell software is due to head or fromJust, it's actually quite annoying. Just singling this one out because I've heard it before.  I've

Re: [Haskell-cafe] Storing failing testcases for QuickCheck

2011-04-23 Thread wren ng thornton
On 4/23/11 8:02 AM, Sönke Hahn wrote: Hi! I would like to have a library that would allow to use QuickCheck in the normal manner, but it would save test data for failing properties on the filesystem (maybe using the shiny new acid-state?). On consecutive test runs, the saved test data would be

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-04-23 Thread Globules
brad clawsie clawsie at fastmail.fm writes: hi all i was wondering if anyone could post some minimal examples on using mutable Vectors in the ST monad. i've been digging around in the usual places but haven't been able to find anything to get me over the hump thanks in advance brad