Re: [Haskell-cafe] Haskell with all the safeties off

2012-09-06 Thread Edward Z. Yang
Haskell already does this, to some extent, in the design of imprecise exceptions. But note that bottom *does* have well defined behavior, so these "optimizations" are not very desirable. Edward Excerpts from David Feuer's message of Thu Sep 06 19:35:43 -0400 2012: > I have no plans to do such a

[Haskell-cafe] Haskell with all the safeties off

2012-09-06 Thread David Feuer
I have no plans to do such a thing anytime soon, but is there a way to tell GHC to allow nasal demons to fly if the program forces bottom? This mode of operation would seem to be a useful optimization when compiling a program produced by Coq or similar, enabling various transformations that can tur

Re: [Haskell-cafe] performance issues with popCount

2012-09-06 Thread Johan Tibell
Hi Harald, On Thu, Sep 6, 2012 at 9:46 AM, Harald Bögeholz wrote: > Anyway, I tried this version > > popCount :: Integer -> Int > popCount = go 0 > where > go c 0 = c > go c w = go (c+1) (w .&. (w - 1)) > > and profiling showed that my program spent 80 % of its time counting b

Re: [Haskell-cafe] performance issues with popCount

2012-09-06 Thread Thomas DuBuisson
What _should_ be happening is we should be calling GMP's popcount function when using integer-gmp. As for your code I worry about it: * being too lazy, so add some bang patterns or seq * using boxed arrays, so use unboxed * indexing arrays by Integer comparison even when those are small integers -

[Haskell-cafe] performance issues with popCount

2012-09-06 Thread Harald Bögeholz
Dear Haskell Cafe, I am struggling with the performance of the popCount function from Data.Bits. To be more precise: I downloaded the Haskell Platform 2012.2.0.0 from http://hackage.haskell.org/platform/ (64 bit, Mac OS X). In this version I found the popCount function to be broken. If I look in

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Amy de Buitléir
Brent Yorgey seas.upenn.edu> writes: > Looks neat! By the way, the URLs within the Haddock documentation are > formatted improperly... Cheers! I'll fix that. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listi

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Amy de Buitléir
> It seems like you should be able to stick this behind some abstraction > so that you can support multiple implementations for grids (i.e., > currently storing indices as you mention, but could support other > implementations with different trade offs ...)? > > kris Yes, there's a Grid typeclass

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Kristopher Micinski
On Thu, Sep 6, 2012 at 8:04 AM, Amy de Buitléir wrote: > Paul Visschers paulvisschers.net> writes: > >> Looks nice. Does it scale well to millions of elements, and can it handle 3D? > > The current implementation wouldn't scale well to millions of elements, but it > shouldn't take much tweaking t

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Brent Yorgey
On Thu, Sep 06, 2012 at 09:42:19AM +, Amy de Buitléir wrote: > I'm happy to announce a new package called grid: > > http://hackage.haskell.org/package/grid > https://github.com/mhwombat/grid/wiki (wiki) Looks neat! By the way, the URLs within the Haddock documentation are formatted i

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Amy de Buitléir
Paul Visschers paulvisschers.net> writes: > Looks nice. Does it scale well to millions of elements, and can it handle 3D? The current implementation wouldn't scale well to millions of elements, but it shouldn't take much tweaking to support that. Currently, when a grid is constructed, the list o

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Paul Visschers
Looks nice. Does it scale well to millions of elements, and can it handle 3D? On Thu, Sep 6, 2012 at 12:37 PM, Alfredo Di Napoli < alfredo.dinap...@gmail.com> wrote: > It seems cool, looking forward to play with it! > > > On 6 September 2012 09:42, Amy de Buitléir wrote: > >> I'm happy to announ

Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Alfredo Di Napoli
It seems cool, looking forward to play with it! On 6 September 2012 09:42, Amy de Buitléir wrote: > I'm happy to announce a new package called grid: > > http://hackage.haskell.org/package/grid > https://github.com/mhwombat/grid/wiki (wiki) > > Grid provides tools for working with regular

[Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Amy de Buitléir
I'm happy to announce a new package called grid: http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki) Grid provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supp

Re: [Haskell-cafe] From monads to monoids in a small category

2012-09-06 Thread Alberto G. Corona
Moreover, `m a` is 'a' plus some terminal element , for example Nothing, [], Left _ etc, So a morphism (a -> m a) contains all the morphisms of (m a -> m a). 2012/9/5 Alberto G. Corona : > Alexander, > > > In my post (excuses for my dyslexia) I try to demonstrate that the > codomain (m a),