[Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Martin DeMello
I finally ditched sabayon for ubuntu (one wireless problem too many), and now I'm slowly getting stuff set up on it. Any Ubuntu people care to share their experiences? I'm especially looking for guidelines on what to install via apt-get and what to install independently. Also, while I'm making

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Jules Bean
Achim Schneider wrote: You don't come across space-leaks in strict programs often because data is usually allocated statically even if execution is non-strict. Piping /dev/zero into a program that just sleeps does leak space, though. It only leaks 8K or whatever size your system buffers

[Haskell-cafe] Re: library for drawing charts

2008-06-05 Thread Neal Alexander
Tim Docker wrote: Neal Alexander wrote: I was using the HaskellCharts library and needed the same two things; so i rolled a quick and dirty pie chart generator (Barchart is on the TODO list). http://72.167.145.184:8000/Screenshot.png http://72.167.145.184:8000/PieChart.hs Nice! Do you mind

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Ketil Malde
Albert Y. C. Lai [EMAIL PROTECTED] writes: I haven't heard the terms laziness leak and strictness leak before Leak refers to a surprise. I the meaning of leak is in a bit of flux. Originally, I believe it refers to a memory leak, where the programmer forgot to call free() before losing the

[Haskell-cafe] example of FFI FunPtr

2008-06-05 Thread Galchin, Vasili
Hello, I want to model a Haskell function that is a callback from C. I have only found one example in the unix package's Semaphore.hsc, which apparently is not used. I want to be able to marshall a Haskell function that is a first class citizen residing in a Haskell data type and pass to a

Re: cabal and platform-independent haskell installation management (again) (Re: [Haskell-cafe] Re: Ubuntu and ghc)

2008-06-05 Thread Ketil Malde
Claus Reinke [EMAIL PROTECTED] writes: 1. there are no systems where packages just work! there are systems where a few people ensure that many people can live in such an illusion, though. Exactly. Integrating Cabal packages into the system package manager is still non-trivial, and a

Re: [Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Ketil Malde
Martin DeMello [EMAIL PROTECTED] writes: Any Ubuntu people care to share their experiences? Ask, and ye shall receive..at least some kind of answer. I'm especially looking for guidelines on what to install via apt-get and what to install independently. I'd get as much as possible via

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-05 Thread Simon Marlow
Ketil Malde wrote: The most usable one I've seen is Steam from Valve, IIRC. It'd be cool if Haskell packages were provided this way. Cygwin's installer seems to work pretty well, too. Cheers, Simon ___ Haskell-Cafe mailing list

[Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Cetin Sert
Hi ^_^, Let's say we have the following data type and functions: data Tab a = (:↺:) | a :↓: Tab a | Tab a :↙↘: (Tab a,Tab a) deriving (Eq, Show, Read) map f (:↺:) = (:↺:) map f (a :↓: t) = f a :↓: map f t map f (h :↙↘: (l,r)) = map f h

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-05 Thread Simon Marlow
Achim Schneider wrote: Simon Marlow [EMAIL PROTECTED] wrote: Claus Reinke wrote: - i don't want to have to remove anything explicitly, because that would mean bypassing the haskell installation managers - i would want to see a single haskell installation manager for each system, I think

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-05 Thread Simon Marlow
Duncan Coutts wrote: On Wed, 2008-06-04 at 11:33 +0100, Simon Marlow wrote: Claus Reinke wrote: - i don't want to have to remove anything explicitly, becausethat would mean bypassing the haskell installation managers - i would want to see a single haskell installation manager for each

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Miguel Mitrofanov
Well, it's certainly not possible for filter, at least, not without additional hints to the compiler. For example, consider this type: data Weird a = A | B a (Weird a) (Weird a) filter p A = A filter p (B x w1 w2) | p x = B x (filter p w1) (filter p w2) | otherwise =

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Thomas Davie
Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? Bob On 5 Jun 2008, at 10:28, Miguel Mitrofanov wrote: Well, it's certainly not

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Janis Voigtlaender
Thomas Davie wrote: Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? But for many datatypes it is quite natural. Just google for

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Loup Vaillant
2008/6/4 apfelmus [EMAIL PROTECTED]: [...] But it can waste space (- space leak), for instance by accumulating a big expression like (..) - ((..)+1) - (((..) + 1) + 1) - etc. instead of evaluating x+1 immediately 5 - 6- 7- etc. So, it is called a space leak

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Miguel Mitrofanov
It can be even worse: data X a b = X (X b a - b) Here (X a) is certainly a functor, but the implementation must also act on a contravariantly: mapX :: (a - a') - X a' b - X a b mapX f (X h) = X $ h . fmap f instance Functor (X a) where fmap f (X h) = X $ f . h . mapX f On 5 Jun 2008, at

[Haskell-cafe] Re: Ubuntu and ghc

2008-06-05 Thread Duncan Coutts
On Thu, 2008-06-05 at 09:16 +0100, Simon Marlow wrote: As I see it we need both. We need to make it easy to translate cabal packages into distro packages. We do have tools to do that at the moment for Gentoo, Debian and Fedora. I'm sure they could be improved. However we cannot expect

Re: [Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-05 Thread Greg Matheson
On Wed, 04 Jun 2008, John Goerzen wrote: Prelude Database.HDBC Database.HDBC.ODBC conn - connectODBC dictation Please note that this is not a valid connection string. I need to remember the connection functions are specific to the drivers and there are differences between connectODBC and

Re: [Haskell-cafe] example of FFI FunPtr

2008-06-05 Thread Claude Heiland-Allen
Galchin, Vasili wrote: Hello, I want to model a Haskell function that is a callback from C. I have only found one example in the unix package's Semaphore.hsc, which apparently is not used. I want to be able to marshall a Haskell function that is a first class citizen residing in a

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-05 Thread Edsko de Vries
On Wed, Jun 04, 2008 at 10:30:49PM -0400, Paul L wrote: Pardon me to hijack this thread, but I have an idea to build a different kind of Web Framework and am not sure if somebody has already done it. Have a look at iTasks, written in Clean. Not *quite* Haskell, I know, but close enough. I does

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Edsko de Vries
On Thu, Jun 05, 2008 at 10:39:16AM +0200, Thomas Davie wrote: Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? Generic Haskell can

Re: [Haskell-cafe] example of FFI FunPtr

2008-06-05 Thread Galchin, Vasili
thank you, Claude! Vasili On Th, Jun 5, 2008 at 4:21 AM, Claude Heiland-Allen [EMAIL PROTECTED] wrote: Galchin, Vasili wrote: Hello, I want to model a Haskell function that is a callback from C. I have only found one example in the unix package's Semaphore.hsc, which apparently

Re: [Haskell-cafe] Re: Ubuntu and ghc

2008-06-05 Thread Claus Reinke
Well, that's true. I guess what I'm really objecting to in Claus's message is the implication that we should always use a Haskell Installation Manager, even on systems with good built-in package management. what was implied was that haskell installation manager (HIM) and native package

Re: [Haskell-cafe] Re: How would you hack it?

2008-06-05 Thread Jules Bean
Achim Schneider wrote: If you run one over obscure academic papers, you can even generate publishable results. I don't have a link ready, but there was a fun incident involving this. http://www.physics.nyu.edu/faculty/sokal/dawkins.html ___

[Haskell-cafe] Re: What is the maturity of Haskell Web Frameworks

2008-06-05 Thread apfelmus
Paul L wrote: Pardon me to hijack this thread, but I have an idea to build a different kind of Web Framework and am not sure if somebody has already done it. The idea is to take REST further: every HTML page you see is a program in its running state (as a continuation monad). Each click on its

[Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Achim Schneider
Jules Bean [EMAIL PROTECTED] wrote: Achim Schneider wrote: You don't come across space-leaks in strict programs often because data is usually allocated statically even if execution is non-strict. Piping /dev/zero into a program that just sleeps does leak space, though. It

[Haskell-cafe] Re: How would you hack it?

2008-06-05 Thread Achim Schneider
Henning Thielemann [EMAIL PROTECTED] wrote: Sounds like a generator for scientific articles. :-) Maybe http://hackage.haskell.org/cgi-bin/hackage-scripts/package/markov-chain can be of help for you. It's also free of randomIO. I once invented this, though ungeneralised, for a map

Re: [Haskell-cafe] Re: What is the maturity of Haskell Web Frameworks

2008-06-05 Thread Peter Gammie
On 05/06/2008, at 5:31 PM, apfelmus wrote: WASH/CGI has something in that direction. I don't know a short introduction, but have a look at sections 4 and 8 of the implementation notes http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf I think there is also some work done

[Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread apfelmus
Ketil Malde wrote: I the meaning of leak is in a bit of flux. Originally, I believe it refers to a memory leak, where the programmer forgot to call free() before losing the pointer, thus making the program consume memory it can't recover, and can't use. With automatic memory management,

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Jonathan Cast
On 5 Jun 2008, at 1:39 AM, Thomas Davie wrote: Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? class Functor (f :: * - *) where ...

Re: [Haskell-cafe] Re: hmatrix

2008-06-05 Thread Alberto Ruiz
Hello Bulat and Anatoly, I have written a first version of an interface to inplace updates in the ST monad for the hmatrix vectors and matrices. Many things must be improved (range checking, documentation, etc.) but I hope that the general idea makes sense. A few usage examples:

[Haskell-cafe] Design your modules for qualified import

2008-06-05 Thread Johan Tibell
Hi! The last two weeks I've seen two new packages that add suffixes to identifiers instead of relying on them being imported qualified to distinguish them from identifiers in other modules. This is not a new thing in Haskell community and there are examples of this practice in libraries shipped

[Haskell-cafe] File locking wishlist

2008-06-05 Thread Joachim Breitner
Hi, for a program of mine (darcswatch[1]), a rather long running process is run at certain events (by cron, and by new emails). I want to achieve that: * Only one instance of the program runs at a time. * If new events come in while the program runs, it should re-run itself * There is

Re: [Haskell-cafe] Re: cabal and platform-independent haskell installation management (again) (Re: Re: Ubuntu and ghc)

2008-06-05 Thread Darrin Thompson
On Wed, Jun 4, 2008 at 7:48 PM, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 17:22 +0200, Achim Schneider wrote: The question, IMHO, seems to be How would a package manager for a posix-compilant kinetic look like? http://nixos.org/index.html How well does that coexist

[Haskell-cafe] GHCi gives type signature that won't compile.

2008-06-05 Thread A A
Hi All I can successfully compile the following code using ghci import Data.Array.IArray makeArray (lower, upper) f = listArray (lower, upper) [(f i) | i - [lower..upper] tridiagonal_solve (a, b, c, d, (lower, upper)) = x where gen_array f = (makeArray (lower, upper) f) x =

Re: [Haskell-cafe] GHCi gives type signature that won't compile.

2008-06-05 Thread Miguel Mitrofanov
Check your types for typos. On 5 Jun 2008, at 20:31, A A wrote: Hi All I can successfully compile the following code using ghci import Data.Array.IArray makeArray (lower, upper) f = listArray (lower, upper) [(f i) | i - [lower..upper] tridiagonal_solve (a, b, c, d, (lower, upper)) = x

Re: [Haskell-cafe] GHCi gives type signature that won't compile.

2008-06-05 Thread Philip Weaver
On Thu, Jun 5, 2008 at 9:36 AM, Miguel Mitrofanov [EMAIL PROTECTED] wrote: Check your types for typos. On 5 Jun 2008, at 20:31, A A wrote: Hi All I can successfully compile the following code using ghci import Data.Array.IArray makeArray (lower, upper) f = listArray (lower, upper) [(f

Re: [Haskell-cafe] File locking wishlist

2008-06-05 Thread Bulat Ziganshin
Hello Joachim, Thursday, June 5, 2008, 7:22:44 PM, you wrote: * Only one instance of the program runs at a time. * If new events come in while the program runs, it should re-run itself * There is information attached to the events (only one Bool ATM) So I’d like to implement something

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Neil Mitchell
Hi PS Why isn't Functor derivable? Derive can do it: http://www.cs.york.ac.uk/~ndm/derive I believe that Twan (the author of Functor deriving in Derive) is trying to get this suggested for Haskell' as a proper deriving. As for the original question, Uniplate will certainly do map, and will

Re: [Haskell-cafe] How would you hack it?

2008-06-05 Thread Lanny Ripple
Wow. Did I really quote the article as Communcations? (A new, little known work by Shannon! :/ The link is correct anyway. -ljr Evan Laforge wrote: On Wed, Jun 4, 2008 at 3:23 PM, Lanny Ripple [EMAIL PROTECTED] wrote: You might want to skim Shannon's 'A Mathematical Theory of

Re: [Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Paul Johnson
Achim Schneider wrote: There won't ever be a space leak without a time leak nor a time leak without a space leak. I'd just call it a leak. Actually I think you can have a space leak without a time leak. For instance if every time around the main loop I cons data onto a linked list that

[Haskell-cafe] Re: Laziness leaks

2008-06-05 Thread Achim Schneider
Paul Johnson [EMAIL PROTECTED] wrote: Achim Schneider wrote: There won't ever be a space leak without a time leak nor a time leak without a space leak. I'd just call it a leak. Actually I think you can have a space leak without a time leak. For instance if every time around the main

[Haskell-cafe] re: very hard to build darcs with win32 ghc-6.8.2!

2008-06-05 Thread Tim Newsham
Here's the wrapup, thanks to those who replied: - the haskell zlib package on hackage no longer requires that zlib (the C library) be prebuilt. It includes sources itself and builds and installs them using Cabal. - the haskell zlib package is not used by darcs. It links against

Re: [Haskell-cafe] Re: hmatrix

2008-06-05 Thread Anatoly Yakovenko
Thanks, that's exactly what i was looking for. On Thu, Jun 5, 2008 at 8:16 AM, Alberto Ruiz [EMAIL PROTECTED] wrote: Hello Bulat and Anatoly, I have written a first version of an interface to inplace updates in the ST monad for the hmatrix vectors and matrices. Many things must be improved

Re: [Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Martin DeMello
On Thu, Jun 5, 2008 at 12:47 AM, Ketil Malde [EMAIL PROTECTED] wrote: Martin DeMello [EMAIL PROTECTED] writes: I'm especially looking for guidelines on what to install via apt-get and what to install independently. I'd get as much as possible via apt-get, and only install manually when that

[Haskell-cafe] Analysing music

2008-06-05 Thread Achim Schneider
The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets from its mean, so that melodies fall and raise

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Dipankar Ray
a somewhat random sample of work done in this direction: http://arts.ucsc.edu/faculty/cope/experiments.htm On Thu, 5 Jun 2008, Achim Schneider wrote: The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics

[Haskell-cafe] Re: Re: cabal and platform-independent haskell installation management (again) (Re: Re: Ubuntu and ghc)

2008-06-05 Thread Ben Franksen
Darrin Thompson wrote: On Wed, Jun 4, 2008 at 7:48 PM, Duncan Coutts [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 17:22 +0200, Achim Schneider wrote: The question, IMHO, seems to be How would a package manager for a posix-compilant kinetic look like? http://nixos.org/index.html How

[Haskell-cafe] Re: getting set up in ubuntu

2008-06-05 Thread Achim Schneider
Martin DeMello [EMAIL PROTECTED] wrote: Thanks! Did you have any conflicts between manual and apt-got stuff? Is there any equivalent to gentoo's package.provided (which basically says 'I have installed this manually; please don't try to update it for me')? package.provided is bad, mkay? It

Re: [Haskell-cafe] More on performance

2008-06-05 Thread Kim-Ee Yeoh
Jon Harrop wrote: On Wednesday 04 June 2008 11:05:52 Luke Palmer wrote: Given unbounded time and space, you will still arrive at the same result regardless of the complexity. Given that the set of computers with unbounded time and space is empty, is it not fruitless to discuss its

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Kenn Knowles
David Cope's early research seems relevant. Some LISP code to train a Markov chain on Bach is available from the web page for his current class. http://arts.ucsc.edu/faculty/cope/music206b.html He eschews higher-order functions; using them, you should be able to port it to very concise and

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Sterling Clover
Hofstadter (he of Godel Escher Bach) naturally has a lovely essay on Chopin reproduced in Metamagical Themas, which might be helpful as well. Regards, Sterl. On Jun 5, 2008, at 2:46 PM, Kenn Knowles wrote: David Cope's early research seems relevant. Some LISP code to train a Markov chain

[Haskell-cafe] Re: How would you hack it?

2008-06-05 Thread Ben Franksen
Achim Schneider wrote: Andrew Coppin [EMAIL PROTECTED] wrote: Achim Schneider wrote: Andrew Coppin [EMAIL PROTECTED] wrote: I have a file that contains several thousand words, seperated by white space. [I gather that on Unix there's a standard location for this file?] Looking at

Re: [Haskell-cafe] How would you hack it?

2008-06-05 Thread Andrew Coppin
Henning Thielemann wrote: Markov chain means, that you have a sequence of random experiments, where the outcome of each experiment depends exclusively on a fixed number (the level) of experiments immediately before the current one. Right. So a Markov chain is actually a technical way of

Re: [Haskell-cafe] Re: hmatrix

2008-06-05 Thread Don Stewart
Good work, Alberto. hmatrix looks like a good solution answer to some of the nested arrays questions we have in Haskell aruiz: Hello Bulat and Anatoly, I have written a first version of an interface to inplace updates in the ST monad for the hmatrix vectors and matrices. Many things must

Re: [Haskell-cafe] Design your modules for qualified import

2008-06-05 Thread Henning Thielemann
On Thu, 5 Jun 2008, Johan Tibell wrote: Hi! The last two weeks I've seen two new packages that add suffixes to identifiers instead of relying on them being imported qualified to distinguish them from identifiers in other modules. This is not a new thing in Haskell community and there are

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Conor McBride
Hi Statutory mathematics warning: lots. On 5 Jun 2008, at 15:40, Jonathan Cast wrote: On 5 Jun 2008, at 1:39 AM, Thomas Davie wrote: Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should

Re: [Haskell-cafe] getting set up in ubuntu

2008-06-05 Thread Ketil Malde
Martin DeMello [EMAIL PROTECTED] writes: Thanks! Did you have any conflicts between manual and apt-got stuff? Not yet, but I haven't really hammered my system with packages yet. Is there any equivalent to gentoo's package.provided (which basically says 'I have installed this manually; please

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Henning Thielemann
On Thu, 5 Jun 2008, Achim Schneider wrote: The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously, which follow others and in which way the pitch offsets

[Haskell-cafe] Package updates on haskell.org

2008-06-05 Thread Don Stewart
The HWN, which I'm sadly too busy to maintain now, had a useful function of generating recent package releases and getting them on the wiki, and to people's inboxes. This facility has been replaced by two processes: 1) Users can subscribe to recent package updates via RSS:

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Achim Schneider
Henning Thielemann [EMAIL PROTECTED] wrote: On Thu, 5 Jun 2008, Achim Schneider wrote: The recent discussion about Markoff chains inspired me to try to train one with all the Bach midi's I have on my disk, collecting statistics on what intervals tend to get played simultaneously,

Re: [Haskell-cafe] Analysing music

2008-06-05 Thread Murray
What I need is basically one view of the data as list of used chords, and one graph of all possible time-linear progressions... that is, voices, for a definition of voice that makes the guitarist in me shudder. Seems like I'm going to make close acquaintance with fgl, after all. Sorry if

Re: [Haskell-cafe] How would you hack it?

2008-06-05 Thread ajb
G'day. Quoting Andrew Coppin [EMAIL PROTECTED]: Right. So a Markov chain is actually a technical way of describing something that's intuitively pretty obvious? (E.g., PPM compression works by assuming that the input data is some sort of Markov chain with as-yet unknown transition

[Haskell-cafe] Re: Analysing music

2008-06-05 Thread Achim Schneider
Murray [EMAIL PROTECTED] wrote: What I need is basically one view of the data as list of used chords, and one graph of all possible time-linear progressions... that is, voices, for a definition of voice that makes the guitarist in me shudder. Seems like I'm going to make close

Re: [Haskell-cafe] Re: What is the maturity of Haskell Web Frameworks

2008-06-05 Thread Paul L
Thank you guys for all the good references! To address a few concerns with this approach: 1. By stateless I don't mean to strip away any persistency. The program can access file storage or DBMS just like any ordinary I/O operation. 2. If we take it to the extreme side, the entire program

Re: [Haskell-cafe] Vancouver Haskell users meeting

2008-06-05 Thread Asumu Takikawa
Hi. I'd be interested in a meeting like this, but unfortunately since UBC is done for winter term I'm out of Canada for the summer. If anyone organizes a meet-up come fall I'd happily attend. Cheers, AT On 12:48 Mon 02 Jun , Jon Strait wrote: Anyone else here from Vancouver (Canada)? I