Re: [Haskell-cafe] How can i run darcs in ghci?

2010-02-16 Thread Marc Weber
Any help on how to load the .h is greatly appreciated. I tried -i with path to the src directory but it didn't work (should it?). Try -I -i is used for .hs files only (?). I am also very curious how others approach a new code base. What do the you do to figure out an implementation?

Re: [Haskell-cafe] Undecidable instances with functional dependencies

2010-02-16 Thread Yves Parès
However, TypeFamilies seems too be non portable as according to this http://www.haskell.org/haskellwiki/GHC/Type_families, it works only as from GHC 6.10.1. Henning Thielemann-4 wrote: Miguel Mitrofanov schrieb: -- {-# LANGUAGE FunctionalDependencies#-} -- {-# LANGUAGE

[Haskell-cafe] Efficient M to N conversion on fusion?

2010-02-16 Thread iquiw
Hi, Is there any efficient way to convert M-length ByteString, Text or Vector into N-length one? For example, (a) converting byte array into array of their hex representations. (abc = 616263) (b) escaping some specific characters in string. (a\bc = a\\bc) The only way I found is to use

Re: [Haskell-cafe] Efficient M to N conversion on fusion?

2010-02-16 Thread Ivan Miljenovic
On 16 February 2010 21:52, iquiw iku.iw...@gmail.com wrote: Is there any efficient way to convert M-length ByteString, Text or Vector into N-length one? I don't believe so, no. Maybe the lazy variants would have better efficiency than the strict ones though... -- Ivan Lazar Miljenovic

Re: [Haskell-cafe] Notes on migrating from uvector to vector

2010-02-16 Thread Ozgur Akgun
Wikipedia claims in short that Year Zero is the year before 1 A.D. used in astronomical calculations.. In full: http://en.wikipedia.org/wiki/Year_zero Seems like no calendar, other than astronomical things include it. On 16 February 2010 04:32, Richard O'Keefe o...@cs.otago.ac.nz wrote: On

Re: [Haskell-cafe] Efficient M to N conversion on fusion?

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 07:52:51PM +0900, iquiw wrote: Is there any efficient way to convert M-length ByteString, Text or Vector into N-length one? This is just a guess, but in vector at least it should be possible to use sized[1] to tell how much space should be allocated on the final vector.

Re: [Haskell-cafe] Notes on migrating from uvector to vector

2010-02-16 Thread Martijn van Steenbergen
Ivan Miljenovic wrote: On 16 February 2010 08:35, Don Stewart d...@galois.com wrote: Enjoy the new decade of flexible, fusible, fast arrays for Haskell! /me points out that 2010 is actually the last year of the decade, and not the first year of a new decade... There certainly is /a/ decade

[Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
I tried the way described in http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html and i got this error message: ghc -shared -o test.dll --make test.hs [1 of 1] Compiling Test

Re: [Haskell-cafe] Interpreting profiling results

2010-02-16 Thread Jean-Marie Gaillourdet
Hi, Daniel Fischer wrote: total alloc = 165,728 bytes (excludes profiling overheads) COST CENTREMODULE %time %alloc CAFGHC.Handle 0.0 10.7 CAFText.Read.Lex 0.02.1

Re: [Haskell-cafe] Interpreting profiling results

2010-02-16 Thread Daniel Fischer
Am Dienstag 16 Februar 2010 15:45:38 schrieb Jean-Marie Gaillourdet: Warning: speculation ahead, but is based on my knowledge on other profilers. Many profilers work statistically, they interrupt a program at more less random (or equal) intervals and inspect the stack, whick is of course

[Haskell-cafe] RFC: concurrent-extra

2010-02-16 Thread Roel van Dijk
Hello, We wrote a small library (1) which offers a few extra synchronization primitives. These primitives are found in the standard libraries of languages like Java and Python, but not in Haskell. Before releasing concurrent-extra on hackage, we would like some comments on its name, design,

Re: [Haskell-cafe] Interpreting profiling results

2010-02-16 Thread Johan Tibell
On Tue, Feb 16, 2010 at 3:45 PM, Jean-Marie Gaillourdet j...@gaillourdet.net wrote: Hi, Daniel Fischer wrote: total alloc = 165,728 bytes (excludes profiling overheads) COST CENTREMODULE %time %alloc CAF

Re: [Haskell-cafe] RFC: concurrent-extra

2010-02-16 Thread Neil Brown
Hi, I had a look at the code for Event (both versions) and Lock (but not the others just yet) and it seemed fine. If you do lots of calls to waitTimeout before a set you will accumulate old locks in the list, but that won't cause any error that I can see, so it would only be a problem in

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Neil Mitchell
Hi Serguey, I notice you are using GHC 6.10.3, I suggest you try 6.10.4 which I know does work. I rewrote that section of the manual recently. I haven't had time to merge it back in, but it might give you more help: http://neilmitchell.blogspot.com/2009/11/haskell-dlls-on-windows.html Thanks,

Re: [Haskell-cafe] Interpreting profiling results

2010-02-16 Thread Malcolm Wallace
So for me the question remains open, is entries a precisely counted value or a statistically determined one? The entry count is precise. It is only the time (and allocation) counts that are determined statistically. (If the entry count _were_ statistically sampled, it would give exactly

[Haskell-cafe] Re: RFC: concurrent-extra

2010-02-16 Thread Simon Marlow
On 16/02/2010 15:51, Roel van Dijk wrote: Hello, We wrote a small library (1) which offers a few extra synchronization primitives. These primitives are found in the standard libraries of languages like Java and Python, but not in Haskell. Before releasing concurrent-extra on hackage, we would

[Haskell-cafe] Re: on finding abstractions ...

2010-02-16 Thread Heinrich Apfelmus
Günther Schmidt wrote: I've got a problem, in short my haskell code sucks. While it does work and I do manage to use higher-orderish aspects quite extensively to make my code more concise it still is nowhere abstract, always concrete and thus always with lots of boilerplate. Oh I have

[Haskell-cafe] Threading and FFI

2010-02-16 Thread Yves Parès
Hello! I was wondering: is the Haskell default runtime (that which uses only one processor) scheduler able to interrupt a thread which is currently calling to a C function in order to enable another haskell thread to progress? I think it can't, because I have starvation problems when I have a

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
I'd like to, but I cannot. My code is tied to gtk2hs, which supports either 6.10.1 or 6.10.3. I put it another way: could I build DLL using ghc 6.12.*? If I can, I'll use 6.10.3 for gtk2hs code and 6.12 for all new stuff. 2010/2/16 Neil Mitchell ndmitch...@gmail.com: Hi Serguey, I notice you

[Haskell-cafe] Microsoft Research PhD Scholarship, University of Leeds

2010-02-16 Thread David Duke
I'm pleased to announce a PhD Scholarship within the Visualization and VR group at Leeds, generously funded by Microsoft Research. We are seeking a student to investigate how visualization techniques can be further developed to understand and improve the performance of parallel Haskell

[Haskell-cafe] Re: Implementing unionAll

2010-02-16 Thread Heinrich Apfelmus
Leon Smith wrote: With the urging and assistance of Omar Antolín Camarena, I will be adding two functions to data-ordlist: mergeAll and unionAll, which merge (or union) a potentially infinite list of potentially infinite ordered lists, under the assumption that the heads of the non-empty

Re: [Haskell-cafe] What is the meaning of tilde (~) symbol

2010-02-16 Thread Neil Mitchell
Hi The symbols that are not specified in a library can be found here:  http://www.haskell.org/haskellwiki/Keywords Hoogle used to show links to this page, when a keyword was searched, but not anymore. And that's a bug: http://code.google.com/p/ndmitchell/issues/detail?id=280 (that I only

Re: [Haskell-cafe] Threading and FFI

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 09:00:08AM -0800, Yves Parès wrote: I was wondering: is the Haskell default runtime (that which uses only one processor) scheduler able to interrupt a thread which is currently calling to a C function in order to enable another haskell thread to progress? I think it

Re: [Haskell-cafe] Linguistic hair-splitting

2010-02-16 Thread Gregg Reynolds
On Sat, Jan 30, 2010 at 1:24 AM, Conal Elliott co...@conal.net wrote: I call it an m or (more specifically) an Int m or a list of Int. For instance, a list or an Int list or a list of Int. - Conal On Wed, Jan 27, 2010 at 12:14 PM, Luke Palmer lrpal...@gmail.com wrote: On Wed, Jan 27,

Re: [Haskell-cafe] Category Theory woes

2010-02-16 Thread Gregg Reynolds
On Tue, Feb 2, 2010 at 5:26 AM, Mark Spezzano mark.spezz...@chariot.net.auwrote: Hi all, Has anyone else found it frustratingly difficult to find details on easy-to-diget material on Category theory. The Chapter that I'm stuck on is actually labeled Preliminaries and so I reason that if I

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Neil Mitchell
Hi Serguey, A GHC 6.10.4 version of Gtk2hs: http://www.mail-archive.com/gtk2hs-de...@lists.sourceforge.net/msg00340.html I used to recommend Gtk2hs over wxHaskell for GUI development as there was always a version that worked on Windows with the latest GHC release. I think I might have to switch

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
Thank you very much. How do you use C# for GUI development? Do you use hs-dotnet? 2010/2/16 Neil Mitchell ndmitch...@gmail.com: Hi Serguey, A GHC 6.10.4 version of Gtk2hs: http://www.mail-archive.com/gtk2hs-de...@lists.sourceforge.net/msg00340.html I used to recommend Gtk2hs over

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Neil Mitchell
Oh no, I just give up on Haskell and use C# entirely - I'd much rather program in Haskell, but if all you are doing is a simple Windows app then a nice GUI is easy in C# with the form designer. Thanks, Neil On Tue, Feb 16, 2010 at 6:01 PM, Serguey Zefirov sergu...@gmail.com wrote: Thank you

Re: [Haskell-cafe] Threading and FFI

2010-02-16 Thread Yves Parès
Well I tried both 'unsafe' and 'safe', and actually I saw no difference... Even with 'safe', I see a huge difference between calling a C function which sleeps and another which doesn't. When there is a sleep, the other thread is really slower (it just prints numbers, and I look at which pace

Re: [Haskell-cafe] Threading and FFI

2010-02-16 Thread Yves Parès
There is a minimal code which produces this issue: http://old.nabble.com/file/p27613138/func.c func.c http://old.nabble.com/file/p27613138/main.hs main.hs Yves Parès wrote: Well I tried both 'unsafe' and 'safe', and actually I saw no difference... Even with 'safe', I see a huge

Re: [Haskell-cafe] Category Theory woes

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 9:43 AM, Gregg Reynolds wrote: I've looked through at least a dozen. For neophytes, the best of the bunch BY FAR is Goldblatt, Topoi: the categorial analysis of logic . Don't be put off by the title. He not only explains the stuff, but he explains the problems that

[Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Louis Wasserman
Is there a nice package out there somewhere with a linear programming implementation? Preferably with a nicely functional interface? Kthxbai, Louis Wasserman wasserman.lo...@gmail.com http://profiles.google.com/wasserman.louis ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 01:37:54PM -0600, Louis Wasserman wrote: Is there a nice package out there somewhere with a linear programming implementation? Preferably with a nicely functional interface? hmatrix? Cheers, -- Felipe. ___ Haskell-Cafe

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Daniel Peebles
How would you use hmatrix? By linear programming I assume he means systems of linear inequalities, as typically solved by the simplex algorithm. I too am interested in this question (and the more general one of nonlinear optimization)! Thanks, Dan On Tue, Feb 16, 2010 at 2:54 PM, Felipe Lessa

[Haskell-cafe] Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-16 Thread Günther Schmidt
Hi, I've been thinking a lot lately about heterogeneous and extensible data structures for which HList certainly offers a solution. While HList is implemented through type-level programming I wonder if I can achieve similar results through value-level programming alone. This is where I was

Re: [Haskell-cafe] pandoc code bocks not working

2010-02-16 Thread Anatoly Yakovenko
Thanks, that solved it. I am also seening that pandoc compiled with 6.12 seems to barf on the .css file that is used in the examples. commitAndReleaseBuffer: invalid argument (Invalid or incomplete multibyte or wide character) On Sun, Feb 14, 2010 at 5:48 PM, Walter De Jonge w...@skynet.be

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Jeremy Shaw
On Sun, Feb 14, 2010 at 2:04 PM, Bardur Arantsson s...@scientician.netwrote: I've tested this extensively during this weekend and not a single leaked FD so far. I think we can safely say that polling an FD for read readiness is sufficient to properly detect a disconnected client regardless

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 03:12:53PM -0500, Daniel Peebles wrote: How would you use hmatrix? By linear programming I assume he means systems of linear inequalities, as typically solved by the simplex algorithm. I too am interested in this question (and the more general one of nonlinear

Re: [Haskell-cafe] Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 12:14 PM, Günther Schmidt wrote: Let's say there was some clever monad ... someMonad = do h1 - add twenty h2 - add False h3 - add 16 . modify h2 True and get a (twenty,(True, 16)) back. And while *in* the monad some

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Bryan O'Sullivan
On Tue, Feb 16, 2010 at 12:37 PM, Jeremy Shaw jer...@n-heptane.com wrote: I think this goes beyond just a sendfile issue -- anyone trying to write non-blocking network code should run into this issue, right ? What's a fairly concise description of the issue at hand? I haven't been paying

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Daniel Peebles
As far as I can see, you'd use that for systems of linear *equalities*, but for systems of linear *inequalities* with a linear objective function, it's not suitable. I may be wrong though :) On Tue, Feb 16, 2010 at 3:37 PM, Felipe Lessa felipe.le...@gmail.comwrote: On Tue, Feb 16, 2010 at

[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Bardur Arantsson
Jeremy Shaw wrote: On Sun, Feb 14, 2010 at 2:04 PM, Bardur Arantsson s...@scientician.netwrote: Not sure what the best solution for this would be, API-wise... Maybe actually have sendfile read the data and supply it to a user-defined function which could react to the data in some way? (Could

[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Bardur Arantsson
Bardur Arantsson wrote: Jeremy Shaw wrote: [--snip--] Re: a test case, you'll probably need to run the test case code on a client whose OS allows (from userspace) the sudden dropping of connections without sending a proper connection shutdown sequence. I'm not sure that that OS would be.

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Taru Karttunen
Excerpts from Bardur Arantsson's message of Tue Feb 16 22:57:23 +0200 2010: As far as I can tell, all nonblocking networking code is vulnerable to this issue (unless it actually does use threadWaitRead, obviously :)). There are a few easy fixes: 1) socket timeouts with

Re: [Haskell-cafe] Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 12:48 PM, Alexander Solla wrote: (Accumulator String)s are (Accumulator value)s for any value. So you can build things like: Sorry, I made a typo. I meant StringAccumulator Strings are Accumulator values for any value.

[Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Bardur Arantsson
Taru Karttunen wrote: Excerpts from Bardur Arantsson's message of Tue Feb 16 22:57:23 +0200 2010: As far as I can tell, all nonblocking networking code is vulnerable to this issue (unless it actually does use threadWaitRead, obviously :)). There are a few easy fixes: 1) socket timeouts with

[Haskell-cafe] Re: pandoc code bocks not working

2010-02-16 Thread John MacFarlane
Why don't you direct your pandoc-related questions to the pandoc-discuss mailing list? http://groups.google.com/group/pandoc-discuss In this case, it would also be helpful to have more information -- such as a sample input file and instructions on how to reproduce the problem you're seeing.

Re: [Haskell-cafe] Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-16 Thread Stephen Tetley
Hi Alexander Your monad looks equivalent to the Identity monad but over a much bigger syntax. What advantages do you get from it being a monad, rather than just a functor? Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

GUI (was: Re: [Haskell-cafe] DLL on Windows)

2010-02-16 Thread Henk-Jan van Tuyl
On Tue, 16 Feb 2010 18:57:20 +0100, Neil Mitchell ndmitch...@gmail.com wrote: I used to recommend Gtk2hs over wxHaskell for GUI development as there was always a version that worked on Windows with the latest GHC release. I think I might have to switch back to recommending C# for GUI

Re: [Haskell-cafe] Notes on migrating from uvector to vector

2010-02-16 Thread Ivan Miljenovic
On 17 February 2010 01:26, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Ivan Miljenovic wrote: On 16 February 2010 08:35, Don Stewart d...@galois.com wrote: Enjoy the new decade of flexible, fusible, fast arrays for Haskell! /me points out that 2010 is actually the last year of

Re: [Haskell-cafe] Efficient M to N conversion on fusion?

2010-02-16 Thread iquiw
I'll try it, thanks! iquiw On Tue, Feb 16, 2010 at 11:12 PM, Felipe Lessa felipe.le...@gmail.com wrote: On Tue, Feb 16, 2010 at 07:52:51PM +0900, iquiw wrote: Is there any efficient way to convert M-length ByteString, Text or Vector into N-length one? This is just a guess, but in vector at

Re: [Haskell-cafe] Notes on migrating from uvector to vector

2010-02-16 Thread Richard O'Keefe
On Feb 17, 2010, at 2:26 AM, Ozgur Akgun wrote: Wikipedia claims in short that Year Zero is the year before 1 A.D. used in astronomical calculations.. In full: http://en.wikipedia.org/wiki/Year_zero Seems like no calendar, other than astronomical things include it That's not what that

Re: [Haskell-cafe] What is the meaning of tilde (~) symbol

2010-02-16 Thread Patrick LeBoutillier
Hi, The symbols that are not specified in a library can be found here:  http://www.haskell.org/haskellwiki/Keywords I noticed that \ is not in that list, should it be? Patrick -- = Patrick LeBoutillier Rosemère, Québec, Canada

Re: GUI (was: Re: [Haskell-cafe] DLL on Windows)

2010-02-16 Thread Thomas DuBuisson
On Tue, Feb 16, 2010 at 3:48 PM, Henk-Jan van Tuyl hjgt...@chello.nl wrote: On Tue, 16 Feb 2010 18:57:20 +0100, Neil Mitchell ndmitch...@gmail.com wrote: I used to recommend Gtk2hs over wxHaskell for GUI development as there was always a version that worked on Windows with the latest GHC

Re: [Haskell-cafe] Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 2:11 PM, Stephen Tetley wrote: Your monad looks equivalent to the Identity monad but over a much bigger syntax. What advantages do you get from it being a monad, rather than just a functor? I replied to Stephen, but forgot to include the list. I took the liberty of

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-16 Thread Leon Smith
I see no obvious deficiencies. :) Personally, I'd probably structure it like http://www.haskell.org/haskellwiki/Prime_numbers#Implicit_Heap This variant, based on the wiki article, is cleaner, slightly simpler, appears to be just as fast, and allocates slightly less memory: import

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-16 Thread Jeremy Shaw
On Tue, Feb 16, 2010 at 3:48 PM, Bardur Arantsson s...@scientician.netwrote: The problem is that the sendfile library *doesn't* wake up when the connection is terminated (because of threadWaitWrite) -- it doesn't matter what the timeout is. Have we actually confirmed this? We know that with

Re: [Haskell-cafe] What is the meaning of tilde (~) symbol

2010-02-16 Thread Neil Mitchell
Hi Patrick, The symbols that are not specified in a library can be found here:  http://www.haskell.org/haskellwiki/Keywords I noticed that \ is not in that list, should it be? Yes! Add it. If it would help a beginner understand what something means, it should be on that list. Thanks, Neil