Re: [Haskell-cafe] Darcs or Perforce

2009-03-01 Thread Erik de Castro Lopo
Colin Paul Adams wrote: > Any advantages over Perforce? I have used Bzr, CVS, Darcs, Git, Hg (Mercurial), Perforce and SVN. While Perforce is definitely better than CVS (anything is better than CVS), Perforce's client workspace concept is a bad idea for complex projects (it bit my group of 4 dev

[Haskell-cafe] Can't install mkcabal because of pcre-lite

2009-03-01 Thread Colin Paul Adams
cabal: Error: some packages failed to install: mkcabal-0.4.2 depends on pcre-light-0.3.1 which failed to install. pcre-light-0.3.1 failed during the configure step. The exception was: exit: ExitFailure 1 Downloading pcre-light-0.3.1... Configuring pcre-light-0.3.1... cabal: Missing dependency on a

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread wren ng thornton
Phil wrote: | After some googling it looked like the answer may be Monad Transformers. | Specifically we could add a StateT transform for our Box Muller state to our | VanDerCorput State Monad. | Google didn¹t yield a direct answer here ­ so I¹m not even sure if my | thinking is correct, Ignori

Re: [Haskell-cafe] Can't install mkcabal because of pcre-lite

2009-03-01 Thread Colin Paul Adams
> "Colin" == Colin Paul Adams writes: Colin> library: * Missing C library: pcre This problem can usually Colin> be solved by installing the system package that provides Colin> this library (you may need the "-dev" version). If the Colin> library is already installed but in a n

Re: [Haskell-cafe] type universes (was Re: MPTC inheritance

2009-03-01 Thread wren ng thornton
Larry Evans wrote: Except that a kind sounds like a universe at level 2 or 3. IOW, I guess haskell types are at level 1, and kines at level 2? Then I guess values would be at level 0? Exactly. Is there some version of haskell that has more levels in its type universe. If not, it there some r

[Haskell-cafe] a newbies confusion with repositories - darcs or git

2009-03-01 Thread Eric Y. Kow
Hi Günther, > But since I have the ambition to become a real haskeller I was gonna > make myself acquainted with darcs. Should I skip that and head straight > for git? My extremely biased opinion is that you skip git and go straight for darcs ;-) Why I love darcs Git is a fine r

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hello, I'm not sure that I would call it a general-purpose resource preserving technique. As I understand it, the general concept is a means to handle strict data processing in a functional manner. Any "resource preserving" that comes from this is actually from the use of strict IO rather than l

Re: [Haskell-cafe] Can't install mkcabal because of pcre-lite

2009-03-01 Thread Duncan Coutts
On Sun, 2009-03-01 at 09:08 +, Colin Paul Adams wrote: > > "Colin" == Colin Paul Adams writes: > > Colin> library: * Missing C library: pcre This problem can usually > Colin> be solved by installing the system package that provides > Colin> this library (you may need the "-dev

Re: [Haskell-cafe] differences between Data.Array and Data.Vector

2009-03-01 Thread Manlio Perillo
Don Stewart ha scritto: manlio_perillo: Hi. In Hackage there are some packages named "*array*", and others named "*vector*". What are the differences? Is available a guide to the various data structures available in Haskell? The vector packages tend to be either easily growable, or eas

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-03-01 Thread Manlio Perillo
Bryan O'Sullivan ha scritto: On behalf of the Data.Text team, I am delighted to announce the release of preview versions of two new packages: [...] text-icu 0.1 Augments text with comprehensive character set conversion support and normalization (and soon more), via bindings to the ICU library.

Re: [Haskell-cafe] Problem with haddock - it dislikes my comments

2009-03-01 Thread David Waern
2009/2/28 Colin Paul Adams : >> "Colin" == Colin Paul Adams writes: > >> "Gwern" == Gwern Branwen writes: >    Gwern> On Sat, Feb 28, 2009 at 2:59 PM, Colin Paul Adams >    Gwern> wrote: >    >>> Having just read the Haddock manual , I am haddocking (may I >    >>> copyleft that verb?) m

[Haskell-cafe] Re: Basic problem in Haskell language design?

2009-03-01 Thread Achim Schneider
"Nicu Ionita" wrote: > Hi, > > Today I found the following problem when writing a simple function: > > > -- Whole info from a word8 list to moves > > movesFromWord8s :: [Word8] -> [Move] > > movesFromWord8s (f:t:ws) = (f, t) : movesFromWord8s ws > > moverFromWord8s _ = [] > > Here I made a sma

Re: [Haskell-cafe] Re: Basic problem in Haskell language design?

2009-03-01 Thread Stuart Cook
On Mon, Mar 2, 2009 at 12:35 AM, Achim Schneider wrote: > -Wall? The number of -W options enabled should scale (at least) > linearly with code size. To make this a little more clear: You should probably be using the -Wall compiler option, which will produce a message for code constructs that the

[Haskell-cafe] Basic problem in Haskell language design?

2009-03-01 Thread Nicu Ionita
Hi, Today I found the following problem when writing a simple function: > -- Whole info from a word8 list to moves > movesFromWord8s :: [Word8] -> [Move] > movesFromWord8s (f:t:ws) = (f, t) : movesFromWord8s ws > moverFromWord8s _ = [] Here I made a small typo in the second equation, writing "mo

AW: [Haskell-cafe] Re: Basic problem in Haskell language design?

2009-03-01 Thread Nicu Ionita
Ok, thanks, compiling from Eclipse I totally forgot to check the compiler flags. Nicu Ionita > -Ursprüngliche Nachricht- > Von: haskell-cafe-boun...@haskell.org > [mailto:haskell-cafe-boun...@haskell.org] Im Auftrag von Stuart Cook > Gesendet: Sonntag, 1. März 2009 14:45 > An: haskell-c

Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-03-01 Thread Manlio Perillo
Kenneth Hoste ha scritto: Hello, I'm having a go at the Netflix Prize using Haskell. Yes, I'm brave. I kind of have an algorithm in mind that I want to implement using Haskell, but up until now, the main issue has been to find a way to efficiently represent the data... For people who are not

[Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Manlio Perillo
Hi. Maybe I'm missing something, but I don't understand why the following program: module Main where import System.IO (Handle, withFile, ReadMode) main = do return fails to compile, with a Module `System.IO' does not export `ReadMode' Thanks Manlio Perillo

Re: [Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Johan Tibell
On Sun, Mar 1, 2009 at 3:07 PM, Manlio Perillo wrote: > Hi. > > Maybe I'm missing something, but I don't understand why the following > program: > > module Main where > import System.IO (Handle, withFile, ReadMode) You want to import IOMode(..), not ReadMode. The latter is a data constructor of t

Re: [Haskell-cafe] Basic problem in Haskell language design?

2009-03-01 Thread Adrian Neumann
You could turn on -Wall to get a whole bunch of such warnings. Am 01.03.2009 um 14:26 schrieb Nicu Ionita: Hi, Today I found the following problem when writing a simple function: -- Whole info from a word8 list to moves movesFromWord8s :: [Word8] -> [Move] movesFromWord8s (f:t:ws) = (f, t) :

Re: [Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Manlio Perillo
Johan Tibell ha scritto: On Sun, Mar 1, 2009 at 3:07 PM, Manlio Perillo wrote: Hi. Maybe I'm missing something, but I don't understand why the following program: module Main where import System.IO (Handle, withFile, ReadMode) You want to import IOMode(..), not ReadMode. The latter is a data

Re: [Haskell-cafe] Basic problem in Haskell language design?

2009-03-01 Thread Daniel Fischer
Am Sonntag, 1. März 2009 15:46 schrieb Adrian Neumann: > You could turn on -Wall to get a whole bunch of such warnings. And explicitely turn off those warnings that you're not interested in, like ghc -O2 -Wall -fno-warn-type-defaults --make Somefile.hs Cheers, Daniel ___

[Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
Hi. I have started to use Cabal for a small project where I have to build several executables. The project layout is something like this: / bin/ a.hs b.hs src/ X.hs Y.hs The Cabal configuration file is something like: executable a build-depends: haskell98, base, ...

Re: [Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Brandon S. Allbery KF8NH
On 2009 Mar 1, at 9:55, Manlio Perillo wrote: Johan Tibell ha scritto: On Sun, Mar 1, 2009 at 3:07 PM, Manlio Perillo > wrote: Hi. Maybe I'm missing something, but I don't understand why the following program: module Main where import System.IO (Handle, withFile, ReadMode) You want to impo

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Gwern Branwen
On Sun, Mar 1, 2009 at 10:45 AM, Manlio Perillo wrote: Hi. ... One last thing: is it possible to define "macros" in Cabal? In my package, I have n executables, that have many dependencies in common. I would like to avoid having to repeat the same dependencies for each executable block. Tha

Re: [Haskell-cafe] differences between Data.Array and Data.Vector

2009-03-01 Thread Nicolas Pouillard
Excerpts from Manlio Perillo's message of Sun Mar 01 14:03:06 +0100 2009: > Don Stewart ha scritto: > > manlio_perillo: > >> Hi. > >> > >> In Hackage there are some packages named "*array*", and others named > >> "*vector*". > >> > >> What are the differences? > >> > >> > >> Is available a guide

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
Gwern Branwen ha scritto: [...] You can hoist the common build-depends out of the executable stanzas. ie. from xmonad-utils.cabal: build-depends: base<4, X11>=1.3, ghc>=6.8, unix, random>=1.0 ... executable: hxsel main-is:Hxsel.hs hs-source-dirs: src ghc-options:

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Gwern Branwen
On Sun, Mar 1, 2009 at 12:10 PM, Manlio Perillo wrote: Gwern Branwen ha scritto: [...] You can hoist the common build-depends out of the executable stanzas. ie. from xmonad-utils.cabal: build-depends:      base<4, X11>=1.3, ghc>=6.8, unix, random>=1.0 ... executable:         hxsel main-is:

Re: [Haskell-cafe] Re: memory issues

2009-03-01 Thread Martin Huschenbett
ChrisK schrieb: Bulat is right about making Block's fields strict. -- | Get the offsets between entries in a list getSizes :: [Integer] -> [Integer] getSizes (x:y:[]) = [y - x] getSizes (x:y:ys) = (y - x):(getSizes (y:ys)) You should change the first part to add maxSize: > getSizes :: [In

Re: [Haskell-cafe] Supplying a default implementation for a typeclass based on another class

2009-03-01 Thread Martin Huschenbett
Hi, you could do something like > instance (Show a,Read a) => Binary a where > put = put . show > get = fmap read get But then you will need the following language extensions: FlexibleInstances, OverlappingInstances, UndecidableInstances I don't know how safe this is but it seems to work.

[Haskell-cafe] ANNOUNCE: tar 0.3.0.0

2009-03-01 Thread Duncan Coutts
All, I'm pleased to announce a major new release of the tar package for handling ".tar" archive files. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/tar This release has a completely new and much improved API. See the hackage page for the API documentation. There are high level "al

[Haskell-cafe] monadic MapReduce

2009-03-01 Thread Manlio Perillo
Hi. I have a function that do some IO (take a file path, read the file, parse, and return some data), and I would like to parallelize it, so that multiple files can be parsed in parallel. I would like to use the simple mapReduce function, from Real Word Haskell: mapReduce :: Strategy b--

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Duncan Coutts
On Sun, 2009-03-01 at 18:10 +0100, Manlio Perillo wrote: > Gwern Branwen ha scritto: > > [...] > > > > You can hoist the common build-depends out of the executable stanzas. > > ie. from xmonad-utils.cabal: > > > > build-depends: base<4, X11>=1.3, ghc>=6.8, unix, random>=1.0 > > ... > > exec

Re: [Haskell-cafe] monadic MapReduce

2009-03-01 Thread Anish Muttreja
On Sun, Mar 01, 2009 at 07:25:56PM +0100, Manlio Perillo wrote: > Hi. > > I have a function that do some IO (take a file path, read the file, > parse, and return some data), and I would like to parallelize it, so > that multiple files can be parsed in parallel. > > I would like to use the simpl

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
Duncan Coutts ha scritto: > [...] Notice that though hxput and hxsel need the packages in the top-level build-depends, they don't need to declare it. Thanks. From documentation it was not clear this feature. That's because it's a bug, not a feature. :-) Be careful of using this "feature"

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Phil
Hi, Thanks for the replies - I haven't had a chance to try out everything suggested yet - but your explanations of transformers nailed it for me. However, in terms of performance when stacking, I've come across something I'm struggling to explain - I was wondering if anyone could offer up and exp

Re: [Haskell-cafe] Supplying a default implementation for a typeclass based on another class

2009-03-01 Thread Svein Ove Aas
On Sun, Mar 1, 2009 at 6:42 PM, Martin Huschenbett wrote: > Hi, > > you could do something like > >> instance (Show a,Read a) => Binary a where >>  put = put . show >>  get = fmap read get > > But then you will need the following language extensions: FlexibleInstances, > OverlappingInstances, Unde

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Andrew Wagner
I know very little about profiling, but your comment about spending a lot of time garbage collecting rang a bell with me - the example on RWH talks about that exact issue. Thus, I would recommend walking through the profiling techniques described on http://book.realworldhaskell.org/read/profiling-a

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hi Don, Would you please elaborate on what features or capabilities you think are missing from left-fold that would elevate it out of the special purpose category? I think that the conception is so completely different from bytestrings that just saying it's not a bytestring equivalent doesn't giv

Re: [Haskell-cafe] Re: Hidden module?

2009-03-01 Thread John Meacham
On Fri, Feb 27, 2009 at 09:53:28PM +0100, Achim Schneider wrote: > Cristiano Paris wrote: > > > I had to append process and directory as dependencies but then it > > worked. How can I submit a patch to Hackage? Do I have to contact the > > owner? > > > In general, just try the maintainer and/or a

RE: [Haskell-cafe] A foray into type-level programming, and getting stuck

2009-03-01 Thread Brian Bloniarz
Hi George, Since none of the type metaprogramming specialists have answered you on-list, I took a crack at this -- I think you can work around the issue by avoiding overlapping instances entirely. I learned about this technique from the HList paper & this message: http://okmij.org/ftp/Haskell/key

RE: [Haskell-cafe] A foray into type-level programming, and getting stuck

2009-03-01 Thread Brian Bloniarz
Actually, it's not necessary to remove the overlap, it's enough to add the ImplementsPrev constraint: > instance (Pred x x', Nthable b x' r, ImplementsPrev (Tuple n a b) x) ⇒ > Nthable (Tuple n a b) x r where > nth _ (Tuple _ b) = nth (undefined ∷ x') b It looks like this typechecks too --

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Daniel Fischer
Am Sonntag, 1. März 2009 21:03 schrieb Phil: > Hi, > > Thanks for the replies - I haven't had a chance to try out everything > suggested yet - but your explanations of transformers nailed it for me. > > However, in terms of performance when stacking, I've come across something > I'm struggling to e

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Phil
On 01/03/2009 20:16, "Andrew Wagner" wrote: I know very little about profiling, but your comment about spending a lot of time garbage collecting rang a bell with me - the example on RWH talks about that exact issue. Thus, I would recommend walking through the profiling techniques described on http

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Phil
Thanks very much for your patient explanations - this has really helped again! A few final questions in-line. On 01/03/2009 21:46, "Daniel Fischer" wrote: > > One thing that helps much is to use > > import Control.Monad.State.Strict > > Using the default lazy State monad, you build enor

[Haskell-cafe] major speed improvement: regex-tdfa reaches 1.0.0

2009-03-01 Thread ChrisK
Announcing the version 1.0.0 release of regex-tdfa. I am proud of this release. This is not just a bug fix release. It is a serious improvement in the asymptotic running time. The previous versions allowed bad combinations of pattern and searched text length to scale badly in the length of the t

Re: [Haskell-cafe] Re: Hidden module?

2009-03-01 Thread Duncan Coutts
On Sun, 2009-03-01 at 13:08 -0800, John Meacham wrote: > On Fri, Feb 27, 2009 at 09:53:28PM +0100, Achim Schneider wrote: > > Cristiano Paris wrote: > > > > > I had to append process and directory as dependencies but then it > > > worked. How can I submit a patch to Hackage? Do I have to contact

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread Daniel Fischer
Am Sonntag, 1. März 2009 23:18 schrieb Phil: > Thanks very much for your patient explanations - this has really helped > again! > > A few final questions in-line. > > On 01/03/2009 21:46, "Daniel Fischer" wrote: > > One thing that helps much is to use > > > > import Control.Monad.State.Strict

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread Gü?nther Schmidt
Hi everyone, after reading all the responses I would like to ask someone, anyone, to kind of summarize the merits of the left-fold-enumerator approach. From all that I read so far about it all I was able to gather was that it has significance but I'm still not even sure what for and what not

[Haskell-cafe] nubBy changed?

2009-03-01 Thread Tim Newsham
Did nubBy change recently? In 6.8.2 I could generate primes as: nubBy (\a b -> b `mod` a == 0) [2..] but in 6.10.1 I have to use nubBy (\a b -> a `mod` b == 0) [2..] Is this change intentional? If so, what is the reason? Tim Newsham http://www.thenewsh.com/~newsham/ __

Re: [Haskell-cafe] nubBy changed?

2009-03-01 Thread Ross Paterson
On Sun, Mar 01, 2009 at 02:30:34PM -1000, Tim Newsham wrote: > Did nubBy change recently? In 6.8.2 I could generate primes as: > >nubBy (\a b -> b `mod` a == 0) [2..] > > but in 6.10.1 I have to use > >nubBy (\a b -> a `mod` b == 0) [2..] > > Is this change intentional? If so, what is the

[Haskell-cafe] Re: a newbies confusion with repositories - darcs or git

2009-03-01 Thread Trent W. Buck
Max Battcher writes: > +1. For the most part this was a great email. It probably belongs > immortalized on the darcs blog and elsewhere. It could even go in the manual! I think the first two chapters of the manual should be 1. Why Darcs? 2. Quick Start ...and the stuff about compiling

[Haskell-cafe] How to work with date?

2009-03-01 Thread Magicloud Magiclouds
Hi,   I am working on some calendar GUI thing. And I cannot find a library to operate the "date". Like, when `now <- getZonedTime`, how could I get all the dates of the week. Or when I got `today`, how to get the date of 10 days ago? Thanks. -- 竹密岂妨流水过 山高哪阻野云飞 ___

[Haskell-cafe] Hint & Cabal Install weirdness.

2009-03-01 Thread Joseph Fredette
I'm attempting to install hint, I started by doing: cabal install hint and it gives me the following error: cabal: dependencies conflict: ghc-6.10.1 requires process ==1.0.1.1 however process-1.0.1.1 was excluded because ghc-6.10.1 requires process ==1.0.1.0 So I decided to try installing it v

Re: [Haskell-cafe] Hint & Cabal Install weirdness.

2009-03-01 Thread Daniel Fischer
Am Montag, 2. März 2009 05:24 schrieb Joseph Fredette: > I'm attempting to install hint, I started by doing: > > cabal install hint > > and it gives me the following error: > > cabal: dependencies conflict: ghc-6.10.1 requires process ==1.0.1.1 however > process-1.0.1.1 was excluded because ghc-6.1

Re: [Haskell-cafe] Supplying a default implementation for a typeclass based on another class

2009-03-01 Thread wren ng thornton
Svein Ove Aas wrote: Martin Huschenbett wrote: > >> instance (Show a,Read a) => Binary a where >> put = put . show >> get = fmap read get > But then you will need the following language extensions: FlexibleInstances, > OverlappingInstances, UndecidableInstances Well, isn't there a good chance

Re: [Haskell-cafe] Hint & Cabal Install weirdness.

2009-03-01 Thread Joseph Fredette
Unregistering and then reinstalling the packages it broke seems to have fixed it, Thanks Dan! /Joe Daniel Fischer wrote: Am Montag, 2. März 2009 05:24 schrieb Joseph Fredette: I'm attempting to install hint, I started by doing: cabal install hint and it gives me the following error: cab

Re: [Haskell-cafe] Stacking State on State.....

2009-03-01 Thread wren ng thornton
Phil wrote: Again I understand that foldl' is the strict version of foldl, and as we are summing elements we can use either foldl or foldr. I'm assuming this is another thunk optimisation. Does foldl not actually calculate the sum, but moreover it creates an expression of the form a+b+c+d+e+...

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread Eugene Kirpichov
OK, I'm far from being a supergeek, but anyways. I'm not considering the lazy IO approach, as it doesn't involve any form of control over resources. With the traditional approach, you manually ask a stream do to something (read a block of bytes, seek to a position etc.), and your program is a mixt

[Haskell-cafe] Re: Take a break: write an essay for Onward! Essays

2009-03-01 Thread Benjamin L . Russell
On Thu, 12 Feb 2009 09:41:49 +, Simon Peyton-Jones wrote: >PS: To get your imagination going, here are a couple of (strongly-contrasting) >past essays: > * Dan Grossman "The transactional memory / garbage collection analogy" >http://www.cs.washington.edu/homes/djg/papers/analogy_oop

Re: [Haskell-cafe] major speed improvement: regex-tdfa reaches 1.0.0

2009-03-01 Thread Martijn van Steenbergen
ChrisK wrote: The previous versions allowed bad combinations of pattern and searched text length to scale badly in the length of the text. Previously the worst case for text of length N was O(N^3). The new worst case asymptotic runtime scaled as O(N). There is never any backtracking. And the wo