Re: [Haskell-cafe] Complex numbers and (**)

2009-08-09 Thread Paul Sargent
On Sat, Aug 8, 2009 at 18:17, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 8 Aug 2009, Paul Sargent wrote: First post to the cafe, so Hello everybody!. Hope this is reasonable subject matter and not too long. I've been working on some algorithms that involved taking

Re: [Haskell-cafe] Complex numbers and (**)

2009-08-09 Thread Henning Thielemann
On Sun, 9 Aug 2009, Paul Sargent wrote: Well, I'm an engineer rather than a mathematician, so I'm not 100% sure I followed everything on that page, but you seem to be saying that nth-root can't be done because we're using floating point, and floating point isn't accurate enough to represent

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-09 Thread John Van Enk
http://github.com/sw17ch/EnumMap/tree/master Perhaps you could patch what I have? :) On Sun, Aug 9, 2009 at 12:08 AM, Thomas DuBuissonthomas.dubuis...@gmail.com wrote: Inflating the number of elements in the test, I see: IntMap inserts: 5.3 seconds lookups: 2.0 seconds EnumMap inserts:

Re: [Haskell-cafe] Parsec: using two different parser for the same string

2009-08-09 Thread S. Doaitse Swierstra
The uu-parsinglib: http://hackage.haskell.org/packages/archive/uu-parsinglib/2.2.0/doc/html/Text-ParserCombinators-UU-Core.html contains a combinator to achieve just this: -- parsing two alternatives and returning both rsults pAscii = pSym ('\000', '\254') pIntList = pParens

[Haskell-cafe] ANNOUNCE: cabal-query 0.1

2009-08-09 Thread Max Desyatov
This package was written to assist you at finding a set of packages, which satisfy your needs. At the moment it doesn't have a standalone executable, but you can do the queries from your Haskell code. It uses Data.Generics.PlateData, so * when Cabal package format changes, we don't have to

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-09 Thread Job Vranish
Inlining natFromInt and intFromNat improves things considerably. Using Thomas DuBuisson's benchmarking code (with a larger number of keys): IntMap: buildMap:12.2 lookupMap:2.7 Original EnumMap: buildMap:13.0s lookupMap:3.6s EnumMap built with -O2 (not sure the implications of

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-09 Thread Thomas DuBuisson
On Sun, Aug 9, 2009 at 11:44 AM, Job Vranishjvran...@gmail.com wrote: Inlining natFromInt and intFromNat improves things considerably. EnumMap built with -O2 (not sure the implications of building libraries with -O2) Nice work Job, for some reason it didn't occur to me that the .cabal omitted

RE: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-09 Thread Simon Peyton-Jones
Oh, now I get it, thanks. This message concerns design choices for record-syntax-related GHC extensions. Lennart, pls tune in. You don’t need to have read the thread to understand this message. | I think that Even refers to an example like this: | | module A where | data A = A { a :: Int

[Haskell-cafe] Re: Request for Changelogs

2009-08-09 Thread John MacFarlane
Agreed! I put in a request for this about a year ago: http://hackage.haskell.org/trac/hackage/ticket/299 There is a bit of follow-up discussion there. John +++ Joachim Breitner [Aug 06 09 16:27 ]: Hi, (this is mostly a rant, but hopefully a constructive one) the Haskell/cabal/hackage eco

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-09 Thread Lennart Augustsson
At a minimum I think the error message should be better. I also think it would be natural to use the DisambiguateRecordFields for the places where RecordWildcards are used. I mean, if I change from unqualified import to a qualified one, and then change all visible names to be qualified I would

[Haskell-cafe] Quickcheck for common typeclass laws

2009-08-09 Thread Job Vranish
Is there a hackage package that contains quickcheck properties for the laws of common typeclasses? (Functor, Monad, Num, Ord, Eq, Applicative, etc...) so that one could quickly check (har har) that their new instances satisfy the appropriate laws? It would be very nice to have a isValidMonad

Re: [Haskell-cafe] Quickcheck for common typeclass laws

2009-08-09 Thread Jeremy Shaw
This perhaps? http://hackage.haskell.org/package/checkers - jeremy At Sun, 9 Aug 2009 17:44:05 -0400, Job Vranish wrote: [1 multipart/alternative (7bit)] [1.1 text/plain; ISO-8859-1 (7bit)] Is there a hackage package that contains quickcheck properties for the laws of common

Re: [Haskell-cafe] Parsec: using two different parser for the same string

2009-08-09 Thread Paul Sujkov
Hi Doaitse, that is very interesting, and I'll take a precise look at the uu-parsinglib. Regarding my original question there exist (I believe) one serious problem: existing code is written exclusively using Parsec and it's already quite complex. At first glimpse I don't see an obvious way to use

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
Usually I include the example program in the package, but make its compilation conditional using a Cabal flag like buildExamples. But then the binaries generated from the example program get installed. I think the poster wants to share the source code, not install a demo. I haven't figure

Re: [Haskell-cafe] Examples

2009-08-09 Thread Thomas DuBuisson
John D. Ramsdell wrote: Usually I include the example program in the package, but make its compilation conditional using a Cabal flag like buildExamples. But then the binaries generated from the example program get installed.  I think the poster wants to share the source code, not install a

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
On Sun, Aug 9, 2009 at 8:15 PM, Thomas DuBuissonthomas.dubuis...@gmail.com wrote: ... Another option: test code (or any other source) can easily be included in the source dist by adding them to the extra-source-files: line in the .cabal file. But then cabal doesn't know how to build binaries

Re: [Haskell-cafe] Examples

2009-08-09 Thread John D. Ramsdell
Maybe in addition to having a buildable boolean in a library or executable section, there should be an installable boolean. It would default to true, but when false, the library or executable section is ignored during package installation. John ___

Re: [Haskell-cafe] Examples

2009-08-09 Thread Mark Wotton
On 10/08/2009, at 9:29 AM, John D. Ramsdell wrote: Usually I include the example program in the package, but make its compilation conditional using a Cabal flag like buildExamples. But then the binaries generated from the example program get installed. I think the poster wants to share the

Re: [Haskell-cafe] haskell embedded

2009-08-09 Thread Kevin Smith
Hello, I checked the Hugs User Manual and I didn't find any notes on this in section 4. Other Ways of Running Hugs. can you point me to this section or reference ? thanks On Sat, Aug 8, 2009 at 9:37 PM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello Kevin, Sunday, August 9, 2009,