Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Alexander Solla
On Tue, Aug 7, 2012 at 11:03 AM, Daniel Trstenjak < daniel.trsten...@gmail.com> wrote: > > Hi all, > > it should be possible a call a function on all elements of the data > structure, to add and remove elements. > > What I currently have: > > the type class: > > class Foo a where >hasId :: a -

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Daniel Trstenjak
Hi Joey, On Tue, Aug 07, 2012 at 02:13:09PM -0400, Joey Adams wrote: > Are you looking for existential quantification [1]? > > data SomeFoo = forall a. Foo a => a > > [1]: > http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#existential-quantification Thank

Re: [Haskell-cafe] HUnit and table-driven tests

2012-08-07 Thread Matthew
On Tue, Aug 7, 2012 at 12:51 AM, Dean Herington wrote: > At 4:30 PM -0700 8/5/12, Matthew wrote: >> >> On Sun, Aug 5, 2012 at 12:32 AM, Henk-Jan van Tuyl >> wrote: >>> >>> On Sun, 05 Aug 2012 03:21:39 +0200, Matthew >>> wrote: >>> I've got a function which takes in two chars, describing a

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Joey Adams
On Tue, Aug 7, 2012 at 2:03 PM, Daniel Trstenjak wrote: > Data structure containing elements which are instances of the same type class Are you looking for existential quantification [1]? data SomeFoo = forall a. Foo a => a [1]: http://www.haskell.org/ghc/docs/latest/html/users_guide/data

[Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Daniel Trstenjak
Hi all, it should be possible a call a function on all elements of the data structure, to add and remove elements. What I currently have: the type class: class Foo a where hasId :: a -> Int -> Maybe a a few instances: data A = A deriving Show instance Foo A where hasId a 1 = Just a

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-07 Thread Aleksey Khudyakov
On 07.08.2012 18:16, Till Berger wrote: Dear all, I may have stumbled upon a bug in the Criterion package. When running the attached Haskell program (Benchmark.hs, a simple test case) on multiple cores (with +RTS -N, +RTS -N2, +RTS -N3 etc.) it sooner or later crashes with the following exceptio

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-07 Thread Johan Tibell
Hi Till, This would make an excellent bug report at: https://github.com/bos/criterion/issues Cheers, Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-07 Thread Till Berger
Dear all, I may have stumbled upon a bug in the Criterion package. When running the attached Haskell program (Benchmark.hs, a simple test case) on multiple cores (with +RTS -N, +RTS -N2, +RTS -N3 etc.) it sooner or later crashes with the following exception: Benchmark: thread blocked inde

Re: [Haskell-cafe] Benchmark of DFT libraries in Haskell

2012-08-07 Thread Erik de Castro Lopo
Takayuki Muranushi wrote: > >> * vector-fftw with wisdom was more than 1/2 times faster than fftw in > >> C with wisdom (and with communication overhead.) > > > I would be suspicious of that result. Calling a C function from a library > > should be slower from Haskell than from C. > > Sorry for

Re: [Haskell-cafe] [Haskell] ANNOUNCE: tardis

2012-08-07 Thread Ben Millwood
On Tue, Aug 7, 2012 at 7:04 AM, Dan Burton wrote: > As a side note, since the code base is relatively small, it can also serve > as a simple demonstration of how to use a cabal flag > in conjunction with CPP to selectively include swaths of code > (see Control/Monad/Tardis.hs and tardis.cabal). E

Re: [Haskell-cafe] HUnit and table-driven tests

2012-08-07 Thread Dean Herington
At 4:30 PM -0700 8/5/12, Matthew wrote: On Sun, Aug 5, 2012 at 12:32 AM, Henk-Jan van Tuyl wrote: On Sun, 05 Aug 2012 03:21:39 +0200, Matthew wrote: I've got a function which takes in two chars, describing a playing card and a suit. An example would be 4C or TH for a 4 of Clubs or a Ten