Re: [Haskell-cafe] Re: Difference between div and /

2010-06-03 Thread Henning Thielemann
Richard O'Keefe schrieb: On Jun 3, 2010, at 1:13 AM, Maciej Piechotka wrote: On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point operations, *approximating* operations

Re: [Haskell-cafe] Sockets get bound to wrong port on Windows

2010-06-03 Thread Ketil Malde
Antoine Latter aslat...@gmail.com writes:   *Main PortNum   47138 The PortNum constructor should rarely be used directly So, shouldn't the constructor be hidden, and exported from an .Internal module? - it contains the port number in network-order. You should try: Or perhaps even

Re: [Haskell-cafe] The state of Hackage: what are we doing about it?

2010-06-03 Thread Uwe Schmidt
On Thursday 03 June 2010 06:27:43 am Don Stewart wrote: I've been posting CSV files of the download statistics here: http://www.galois.com/~dons/hackage/hackage-downloads.csv The next quarter's aggregated downloads are due soon. The Arch Haskell site uses these stats to compute some

[Haskell-cafe] Process priority

2010-06-03 Thread Andrew Coppin
I've had a hunt around in System.Process, but I can't discover any way to adjust the priority of the process you just spawned. Am I missing something, or has this just not been implemented yet? (I must confess, I don't know whether Windows and Unix both have the same ideas about priority

Re: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC

2010-06-03 Thread Jasper Van der Jeugt
On Thu, May 27, 2010 at 8:31 PM, Matt Parker moonmaster9...@gmail.com wrote: will it be possible to easily interleave IO values into the HTML? like instead of the [1,2,3] ul $ forM_ [1, 2, 3] (li . string . show) what if it was a function that returned IO [1,2,3] (maybe 1,2,3 came out of a

Re: [Haskell-cafe] How to build an Indicator Type for a type class?

2010-06-03 Thread Steffen Schuldenzucker
On 06/02/2010 03:59 AM, Brent Yorgey wrote: Perhaps something here may be of use? http://okmij.org/ftp/Haskell/types.html#class-based-overloading Enlightening. Thanks a lot. For the curious, here is my solution: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=25907#a25907 I'm gonna read the

[Haskell-cafe] Re: Problems with Haskell Platform

2010-06-03 Thread Pete Chown
Ivan Lazar Miljenovic wrote: Pete Chown 1...@234.cx writes: Is there a way of making Cabal install dependencies using the system package manager, then? If you mean cabal-install, then no, there's no integration on either side. That's what I thought. As a result of this, you may find

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-03 Thread Maciej Piechotka
On Thu, 2010-06-03 at 12:44 +1200, Richard O'Keefe wrote: On Jun 3, 2010, at 1:13 AM, Maciej Piechotka wrote: On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point

[Haskell-cafe] Re: Re: Difference between div and /

2010-06-03 Thread Maciej Piechotka
On Wed, 2010-06-02 at 16:11 +0200, Henning Thielemann wrote: Sorry, I missed this post. Maciej Piechotka schrieb: Well - i tried to write some package dealing with distributions etc. If you have something like that: instance ... = Distribution (Linear a) a where rand

[Haskell-cafe] cabal update doesn't work on Windows XP

2010-06-03 Thread John O'Donnell
Hi, Has anyone managed to get cabal to run on Windows? I'm running Windows XP. There are lots of other things, including old version of Haskell tools, installed, but it's too costly to try installing cabal on a fresh machine image. Whenever I do cabal update, the response is Unsuccessful

Re: [Haskell-cafe] Wire GUI

2010-06-03 Thread Chaddaï Fouché
On Wed, Jun 2, 2010 at 5:29 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Thanks to the people who replied about this. I would also like to thank my ISP for classifying the entire lot as spam and not showing it to me. *sigh* Blobs sounds interesting, but seems to require wxHaskell

RE: [Haskell-cafe] cabal update doesn't work on Windows XP

2010-06-03 Thread Bayley, Alistair
Whenever I do cabal update, the response is Unsuccessful HTTP code 403. That looks like the hackage server isn't responding, but other software tools (browsers, etc) on the computer can download the hackage database; the only program that can't get it is cabal. Do you use an http proxy?

Re: [Haskell-cafe] Re: Re: Difference between div and /

2010-06-03 Thread Henning Thielemann
On Thu, 3 Jun 2010, Maciej Piechotka wrote: Hmm. Thanks - however I fail to figure out how to do something like: generate a random number with normal distribution with average avg and standard deviation stdev. Unfortunately the package is restricted to discrete distributions so far.

[Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread mokus
Announcing the 0.1.0.0 release of the random-fu library for random number generation[1]. This release hopefully stabilizes the core interfaces (those exported from the base module Data.Random). Warning to anyone upgrading from earlier releases: 'Discrete' has been renamed 'Categorical', the

Re: [Haskell-cafe] Re: Re: Difference between div and /

2010-06-03 Thread mokus
On Thu, 3 Jun 2010, Maciej Piechotka wrote: Hmm. Thanks - however I fail to figure out how to do something like: generate a random number with normal distribution with average avg and standard deviation stdev. Unfortunately the package is restricted to discrete distributions so far.

[Haskell-cafe] Efficient string construction

2010-06-03 Thread Kevin Jardine
(I've done a basic Google search on this with no results. Apologies if this has been asked before.) I am coding a web application in which the content is a Unicode string built up over multiple functions and maintained in a State structure. I gather that the String module is inefficient and

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Daniel Fischer
On Thursday 03 June 2010 16:03:11, Kevin Jardine wrote: (I've done a basic Google search on this with no results. Apologies if this has been asked before.) I am coding a web application in which the content is a Unicode string built up over multiple functions and maintained in a State

[Haskell-cafe] Simplest reference for how to build GHC head + get it running w/ cabal/haskell-platform?

2010-06-03 Thread Ryan Newton
What's the easiest reference for how to build GHC head and get it up and running with cabal/haskell-platform? I simply installed 6.12 + haskell-platform then built ghc-6.13.xx and rebuilt only the packages I needed with cabal install --reinstall. Perhaps this is not the recommended way. Indeed,

[Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Gabriel Riba
Extending sum types with data constructors would spare runtime errors or exception control, when applying functions to inappropriate branches, as in the example ... data List a = Nil | Cons a (List a) -- List!Nil and List!Cons -- as extended types

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Kevin Jardine
--- On Thu, 6/3/10, Daniel Fischer daniel.is.fisc...@web.de wrote: Perhaps Data.ByteString[.Lazy].UTF8 is an even better choice than Data.Text (depends on what you do). I thought that I had the differences between the three libraries figured out but I guess not now from what you say. I had

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Thomas Davie
On 3 Jun 2010, at 16:14, Gabriel Riba wrote: Extending sum types with data constructors would spare runtime errors or exception control, when applying functions to inappropriate branches, as in the example ... data List a = Nil | Cons a (List a) -- List!Nil and List!Cons

Re: [Haskell-cafe] Parselib sample

2010-06-03 Thread C K Kashyap
Hey Doaitse, Could you please post the full code available? On Thu, Jun 3, 2010 at 1:01 AM, S. Doaitse Swierstra doai...@swierstra.netwrote: If you want to use the easier long-standing libraries from Utrecht, we can provide you with a parser for full Haskell, which you can find in the Utrecht

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Daniel Fischer
On Thursday 03 June 2010 17:26:36, Kevin Jardine wrote: --- On Thu, 6/3/10, Daniel Fischer daniel.is.fisc...@web.de wrote: Perhaps Data.ByteString[.Lazy].UTF8 is an even better choice than Data.Text (depends on what you do). I thought that I had the differences between the three libraries

Re: [Haskell-cafe] design question/font metrics

2010-06-03 Thread Christopher Done
Maybe you could check out the FTGL package for inspiration on using the freetype as a conventional C library. I was going to try to write a Hackage package but realised I know nothing about typography and had to start reading the intro. on Freetype's homepage (which is pretty good, actually).

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Edward Kmett
You might also look at Data.Rope from the rope library, which provides an O(1) append for strict bytestring chunks, and the ability to decode UTF-8 chars from the result. http://hackage.haskell.org/packages/archive/rope/0.6.1/doc/html/Data-Rope.html I'd also be happy to work with you if the

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Ozgur Akgun
On 3 June 2010 16:14, Gabriel Riba griba2...@gmail.com wrote: Maybe we could take out importance on the number of _ wildcards (constructor arity) with a syntax like. li @ (Cons ...) li @ (Nil ...) can't you already use {} to get rid of the underscores? li@(Cons {})

Re: [Haskell-cafe] The state of Hackage: what are we doing about it?

2010-06-03 Thread Don Stewart
si: On Thursday 03 June 2010 06:27:43 am Don Stewart wrote: I've been posting CSV files of the download statistics here: http://www.galois.com/~dons/hackage/hackage-downloads.csv The next quarter's aggregated downloads are due soon. The Arch Haskell site uses these stats to

Re: [Haskell-cafe] Re: Sockets get bound to wrong port on Windows

2010-06-03 Thread Matthias Reisner
Am 03.06.2010 07:34 schrieb Bardur Arantsson: On 2010-06-03 05:10, Matthias Reisner wrote: Hi, there's something wrong with port numbers in the Network.Socket module of package network. Printing values gives: *Main PortNum 47138 *Main PortNum 47138 Try (fromIntegral ) ::

Re: [Haskell-cafe] Sockets get bound to wrong port on Windows

2010-06-03 Thread Matthias Reisner
Am 03.06.2010 08:05 schrieb Ketil Malde: Antoine Latter aslat...@gmail.com writes: *Main PortNum 47138 The PortNum constructor should rarely be used directly So, shouldn't the constructor be hidden, and exported from an .Internal module? - it contains the

Re: [Haskell-cafe] Process priority

2010-06-03 Thread Roman Cheplyaka
* Andrew Coppin andrewcop...@btinternet.com [2010-06-03 08:27:21+0100] I've had a hunt around in System.Process, but I can't discover any way to adjust the priority of the process you just spawned. Am I missing something, or has this just not been implemented yet? (I must confess, I don't know

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Jake McArthur
On 06/03/2010 10:14 AM, Gabriel Riba wrote: No need for runtime errors or exception control hd :: List!Cons a - a hd (Cons x _) = x This is already doable using GADTs: data Z data S n data List a n where Nil :: List a Z Cons :: a - List a n - List a (S n)

[Haskell-cafe] Cabal -j

2010-06-03 Thread Louis Wasserman
What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Louis Wasserman wasserman.lo...@gmail.com http://profiles.google.com/wasserman.louis ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Weird socket problem on Mac OS X

2010-06-03 Thread Arnaud Bailly
Hello, I have the following code which works ok on Linux and Windows XP, but fails on Mac OS X with error message: Connect: does not exist (connection refused) The server: doStartstate = do pr - liftIO $ runProcess ... liftIO $ threadDelay 50

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 6:34 AM, mo...@deepbondi.net wrote: Announcing the 0.1.0.0 release of the random-fu library for random number generation[1]. This release hopefully stabilizes the core interfaces (those exported from the base module Data.Random). Great work, I'm upgrading now. The only

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Don Stewart
wasserman.louis: What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Parallelizing ghc --make http://vimeo.com/6572966 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Christopher Done
On 4 June 2010 00:05, Don Stewart d...@galois.com wrote: wasserman.louis: What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Parallelizing ghc --make    http://vimeo.com/6572966 Unless Louis meant what's stopping cabal-install from installing dependancies

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Bryan O'Sullivan
On Thu, Jun 3, 2010 at 9:16 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: String can be quite memory efficient. As a stupid example, length (replicate 1000 'a') will need less memory than the equivalents using ByteString or Text. Actually, this will be fused with Data.Text, and

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Don Stewart
chrisdone: On 4 June 2010 00:05, Don Stewart d...@galois.com wrote: wasserman.louis: What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Parallelizing ghc --make    http://vimeo.com/6572966 Unless Louis meant what's stopping cabal-install from

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Louis Wasserman
Heh, I'm interested in both, but I'm feeling like I needed a new project, and I thought this might make a good one =) Louis Wasserman wasserman.lo...@gmail.com http://profiles.google.com/wasserman.louis On Thu, Jun 3, 2010 at 5:42 PM, Don Stewart d...@galois.com wrote: chrisdone: On 4 June

Re: [Haskell-cafe] Data.ByteString.Lazy.hPut and timeouts?

2010-06-03 Thread Bryan O'Sullivan
On Wed, Jun 2, 2010 at 7:55 PM, Jeremy Shaw jer...@n-heptane.com wrote: I know that some OSes provide a per socket timeout that I can set in my application code (instead of a system-wide timeout that can only be set by root). But that does not seem like a very portable solution.

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread wren ng thornton
Jake McArthur wrote: On 06/03/2010 10:14 AM, Gabriel Riba wrote: No need for runtime errors or exception control hd :: List!Cons a - a hd (Cons x _) = x This is already doable using GADTs: data Z data S n data List a n where Nil :: List a Z Cons :: a -

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Marc Weber
Excerpts from Christopher Done's message of Fri Jun 04 00:39:23 +0200 2010: On 4 June 2010 00:05, Don Stewart d...@galois.com wrote: wasserman.louis: What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Parallelizing ghc --make    

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread mokus
The only feature suggestion I can suggest is the addition of a convolution operator to combine distributions (reified as RVar's in this implementation, though of course the difference between a random variable over a distribution and the distribution is rather thin) I don't think I

Re: [Haskell-cafe] Language Shootout reverse-complement benchmark

2010-06-03 Thread Martin Drautzburg
Inspired by this post I looked at the language shootout. There is one thing which strikes me: On http://shootout.alioth.debian.org/u64/performance.php?test=spectralnorm#about It sais for the spectralnorm benchmark that both Haskel GHC #4 and HaskellGHC produce bad output. For GHC I connt see

Re: [Haskell-cafe] Weird socket problem on Mac OS X

2010-06-03 Thread Antoine Latter
Hi Arnaud, One thing you might want to try is to stop using the PortNumber data constructor, and instead rely on 'fromInteger' to do the right thing. The data constructor assumes that it's argument is in network byte order, which won't always be the case. It's not obvious that the constructor

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 4:19 PM, mo...@deepbondi.net wrote: I don't think I understand. My familiarity with probability theory is fairly light. Are you referring to the fact that the PDF of the sum of random variables is the convolution of their PDFs? If so, the sum of random variables can

Re: [Haskell-cafe] Re: Problems with Haskell Platform

2010-06-03 Thread Jens Petersen
On 31 May 2010 20:14, Pete Chown 1...@234.cx wrote: I was just thinking, interactions between Cabal and the distribution package manager could get worse, as shared Haskell libraries become more common.  Suppose a distribution ships a package 'foo', but not a package 'bar' which depends on it.  

Re: [Haskell-cafe] Simplest reference for how to build GHC head + get it running w/ cabal/haskell-platform?

2010-06-03 Thread Ivan Miljenovic
On 4 June 2010 00:57, Ryan Newton new...@mit.edu wrote: What's the easiest reference for how to build GHC head and get it up and running with cabal/haskell-platform? I simply installed 6.12 + haskell-platform then built ghc-6.13.xx and rebuilt only the packages I needed with cabal install

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Ivan Miljenovic
On 4 June 2010 03:18, Ozgur Akgun ozgurak...@gmail.com wrote: On 3 June 2010 16:14, Gabriel Riba griba2...@gmail.com wrote: Maybe we could take out importance on the number of _ wildcards (constructor arity) with a syntax like.         li @ (Cons ...)         li @ (Nil ...) can't you

Re: [Haskell-cafe] Re: Problems with Haskell Platform

2010-06-03 Thread Ivan Miljenovic
On 4 June 2010 10:27, Jens Petersen peter...@haskell.org wrote: On 31 May 2010 20:14, Pete Chown 1...@234.cx wrote: I was just thinking, interactions between Cabal and the distribution package manager could get worse, as shared Haskell libraries become more common.  Suppose a distribution

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread mokus
On the other hand, it might be kind of nice if RVar's knew which PDF they are over. It's hard for me to see how that would be done with Haskell. If anyone knows a way this could be done while still allowing general functions to be mapped over RVars, I'd love to hear about it. My suspicion

Re: [Haskell-cafe] Proposal: Sum type branches as extended types (as Type!Constructor)

2010-06-03 Thread Jason Dagit
On Thu, Jun 3, 2010 at 8:14 AM, Gabriel Riba griba2...@gmail.com wrote: Extending sum types with data constructors would spare runtime errors or exception control, when applying functions to inappropriate branches, as in the example ... data List a = Nil | Cons a (List a) -- List!Nil and

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread wren ng thornton
Richard O'Keefe wrote: There's something in that package that I don't understand, and I feel really stupid about this. data RVarT m a type RVar = RVarT Identity class Distribution d t where rvar :: d t - RVar t rvarT :: d t - RVarT n t Where does n come from? Presumably from

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread mokus
There's something in that package that I don't understand, and I feel really stupid about this. data RVarT m a type RVar = RVarT Identity class Distribution d t where rvar :: d t - RVar t rvarT :: d t - RVarT n t Where does n come from? There's no reason to feel stupid when

[Haskell-cafe] Issue with connectTo function in network package

2010-06-03 Thread aditya siram
Hi all, I had an issue where using the connectTo [1] function would fail to connect to localhost if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with 127.0.0.1 [2] with my network off it works. I confirmed that localhost'

Re: [Haskell-cafe] Cabal -j

2010-06-03 Thread Evan Laforge
On Thu, Jun 3, 2010 at 3:05 PM, Don Stewart d...@galois.com wrote: wasserman.louis: What, if anything, stands in the way of parallelizing Cabal installs, make -j style? Parallelizing ghc --make    http://vimeo.com/6572966 Something I wondered from watching that talk, rather than trying to

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 6:40 PM, mo...@deepbondi.net wrote: If anyone knows a way this could be done while still allowing general functions to be mapped over RVars, I'd love to hear about it. My suspicion though is that it is not possible. It would be a very similar problem to computing the