Re: [Haskell-cafe] debugging memory corruption

2012-12-02 Thread Evan Laforge
Thanks for the response. On Sat, Dec 1, 2012 at 5:23 PM, Alexander Kjeldaas wrote: > > What I've mostly done in similar circumstances (jni) > > 1. Create an interface (virtual functions or template) for the FFI in C++ > that covers everything you use. Then create one test implementation and one >

[Haskell-cafe] Fwd: Conduit and pipelined protocol processing using a threadpool

2012-12-02 Thread Alexander V Vershilov
Forwarding to maillist: Hi, Nicolas. Just my 2 cents. You can try to 'break' your server side application in two parts, reader and writer then you can have: main = do ch1 <- ... -- inbound channel of type (message ,outchannel) replicateM n $ forkIO $ sourceTBMChan ch1 $$ loop1 -- ^^ yo

Re: [Haskell-cafe] Can not use ST monad with polymorphic function

2012-12-02 Thread Heinrich Apfelmus
David Menendez wrote: On Thu, Nov 29, 2012 at 7:50 AM, Dmitry Kulagin wrote: Thank you, MigMit! If I replace your type FoldSTVoid with: data FoldMVoid = FoldMVoid {runFold :: Monad m => (Int -> m ()) -> m ()} then everything works magically with any monad! That is exactly what I wanted, thoug

[Haskell-cafe] Design of a DSL in Haskell

2012-12-02 Thread Joerg Fritsch
This is probably a very basic question. I am working on a DSL that eventuyally would allow me to say: import language.cwmwl main = runCWMWL $ do eval ("isFib::", 1000, ?BOOL) I have just started to work on the interpreter-function runCWMWL and I wonder whether it is possible to escape to re

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-02 Thread Rustom Mody
On Sun, Dec 2, 2012 at 7:31 PM, Joerg Fritsch wrote: > This is probably a very basic question. > > I am working on a DSL that eventuyally would allow me to say: > > import language.cwmwl > > main = runCWMWL $ do > > eval ("isFib::", 1000, ?BOOL) > > > I have just started to work on the interp

[Haskell-cafe] Is there any movement/need in new 'base' package and co?

2012-12-02 Thread Евгений Пермяков
It is clear, that current 'core' Haskell packages bear some weight of legacy and back-compatibility, and accumulates garbage/problems over time. Some of the garbage can be dropped and some was here for so long, that it can't be dropped without major buzz. For example, we have *Monad* type-clas

Re: [Haskell-cafe] Is there any movement/need in new 'base' package and co?

2012-12-02 Thread Stephen Tetley
Haskell 2010 avoided library revisions - 12 years had elapsed since the last language definition and updating the language was deemed the priority. There have been suggestions on the Libraries list that the next major language revision should also look at the core libraries. On 2 December 2012 1

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-02 Thread Joerg Fritsch
Rusi, I have "read" Fowler's book.(that is focusing on Java by the way) and could not find the answer there, I think it is a typical textbook. I think this is a good start by the way: http://www.cse.chalmers.se/edu/year/2011/course/TIN321/lectures/bnfc-tutorial.html --Joerg On Dec 2, 2012, at

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Albert Y. C. Lai
On 12-11-30 01:16 PM, Mark Thom wrote: Is there a paper or other single resource that will help me thoroughly understand non-strictness in Haskell? See my http://www.vex.net/~trebla/haskell/lazy.xhtml ___ Haskell-Cafe mailing list Haskell-Cafe@haskel

[Haskell-cafe] Help optimize fannkuch program

2012-12-02 Thread Branimir Maksimovic
Well, playing with Haskell I have literally trasnlated my c++ program http://shootout.alioth.debian.org/u64q/program.php?test=fannkuchredux&lang=gpp&id=3and got decent performance but not that good in comparisonwith c++ On my machine Haskell runs 52 secs while c++ 30 secs.(There is Haskell entr

[Haskell-cafe] Vector mysteries

2012-12-02 Thread Fixie Fixie
Hi I am trying to implement Show for a storable-mutable-vector. Does anyone have a clue why the type-system is killing me :-) Code is below... Cheers Felix {-# LANGUAGE ExistentialQuantification #-} import Control.Monad (liftM2) import qualified Data.Vector.Unboxed as V import qualifie

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Mark Thom
Thanks Albert, I believe that's the second time you've helped me this weekend. I'm meiji11 in #haskell. Cheers. On Sun, Dec 2, 2012 at 1:34 PM, Albert Y. C. Lai wrote: > On 12-11-30 01:16 PM, Mark Thom wrote: > >> Is there a paper or other single resource that will help me thoroughly >> underst

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Mark Thom
And thanks to everyone for the links and other suggestions, of course.. On Sun, Dec 2, 2012 at 5:09 PM, Mark Thom wrote: > Thanks Albert, I believe that's the second time you've helped me this > weekend. I'm meiji11 in #haskell. > > Cheers. > > > On Sun, Dec 2, 2012 at 1:34 PM, Albert Y. C. Lai

[Haskell-cafe] [ANN] xmobar 0.16 released

2012-12-02 Thread Jose A. Ortega Ruiz
I've just released xmobar 0.16, the lightweight text-based system monitor written in Haskell. See http://projects.haskell.org/xmobar, and full release notes below. As always, thanks a bunch to the many contributors, who keep helping me improving xmobar and making it more and more useful. The co

Re: [Haskell-cafe] Is anyone working on a sparse matrix library in Haskell?

2012-12-02 Thread wren ng thornton
On 12/1/12 11:58 PM, Kim-Ee Yeoh wrote: On Sun, Dec 2, 2012 at 10:52 AM, wren ng thornton wrote: My goal for all this is in setting up the type system, not performance. I figure there are other folks who know and care a lot more about the numerical tricks of giving the actual implementations.

Re: [Haskell-cafe] Is anyone working on a sparse matrix library in Haskell?

2012-12-02 Thread Mark Flamer
Thanks to all for the feedback. As I investigate the structures for organizing a library of sparse matrix representations a bit more and look into the repa 3 library, I cant help but wonder if these spare matrix types could just be additional instances of Source and Target in repa. Does anyone know

[Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-02 Thread Clark Gaebel
Hello cafe, I've recently started learning about cuda and hetrogenous programming, and have been using accelerate [1] to help me out. Right now, I'm running into trouble in that I can't call parallel code from sequential code. Turns out GPUs aren't exactly like Repa =P. Here's what I have so far:

Re: [Haskell-cafe] To my boss: The code is cool, but it is about 100 times slower than the old one...

2012-12-02 Thread Ivan Salazar
I see. I read some chapters from Purely Functional Data Structures when I was in college in order to understand some tree algorithms, but not the whole book. Do you think that could help me to understand performance problems with code (poorly) written in Haskell? >From reading your post, I can gu

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-02 Thread Trevor L. McDonell
Hi Clark, The trick is that most accelerate operations work over multidimensional arrays, so you can still get around the fact that we are limited to flat data-parallelism only. Here is matrix multiplication in Accelerate, lifted from the first Repa paper [1]. import Data.Array.Accelerate as