[Haskell-cafe] [Fwd: Termination Competition 2009 live on the web!]

2009-12-18 Thread Janis Voigtländer
Hi all, This contest should be of interest to Haskellers. There is an FP Category in which termination of Haskell programs is automatically checked. The current state can be observed by following the corresponding View Results link from the page

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-18 Thread Miguel Mitrofanov
On 18 Dec 2009, at 06:39, Richard O'Keefe wrote: My experience has been that in order to make sense of someone else's code you *HAVE* to break identifiers into their component words. With names like (real example) ScatterColorPresetEditor, the eye *can't* take it in at once, and telling the

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-18 Thread Jason Dagit
On Thu, Dec 17, 2009 at 6:58 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: (Why do people call baStudly syle camel? Is there somewhere in the world a species of camel with three or four humps, like XmlNodeSansChildren?) As near as I can tell (from googling) you're the one calling it

[Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread András Mocsáry
Hello, I was advised respectfully to post my query here. Please, read the whole letter before you do anything, because I tried to construct the problem step by step. Also keep in mind, that the problem I query here is more general, and similar cases occur elsewhere, not just in this particular

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Jochem Berndsen
András Mocsáry wrote: *My concern* is about predictable failure of sw written in Haskell. To illustrate it let's see a Haskell pattern matching example: And in Haskell pattern matching: switch 1 = Unchecked switch 2 = Checked switch 3 = Unknown Let's say, these are clearly

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Serguey Zefirov
I would like to have a way for Haskell, not to crash, when my coders write pattern matching without the above mentioned general case. Like having the compiler auto-include those general cases for us, but when those cases got hit, then instead of crashing, it should report some error on stdout 

[Haskell-cafe] ANN: lhs2tex-1.15 (was: lhs2tex, Haskell Platform and cygwin)

2009-12-18 Thread Andres Loeh
Also, it would be nice if there were an lhs2tex version which worked out-of-the-box with base=4, since hacking the Makefile for that seems, er, sub-optimal? I've just uploaded 1.15 which should work better on Windows. Sorry, I should have released a new version a long time ago. Please let me

Re: [Haskell-cafe] naming naming conventions (was: Re: Allowing hyphens in identifiers)

2009-12-18 Thread Evan Laforge
I used to refer to them as dromedaryCase and BactrianCase, but the names never caught on :( ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Ketil Malde
András Mocsáry amo...@gmail.com writes: Now we have a problem, which is most generally fixed in these ways: C-like: switch ( x ) { Case 0: Unchecked Case 1: Checked Case 2: Unknown Default: Nothing } This is not a fix, this is a workaround for a design bug, namely

Re: [Haskell-cafe] Double free-ing (was: Reading from a process)

2009-12-18 Thread Mitar
Hi! On Fri, Dec 18, 2009 at 8:16 AM, Jason Dusek jason.du...@gmail.com wrote:  Concatenating two `ByteString`s is O(n)? This is what it is written here: http://haskell.org/ghc/docs/latest/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#v%3Aappend Mitar

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-18 Thread John Lato
Hello, Date: Fri, 18 Dec 2009 13:04:47 +0100 From: Andr?s Mocs?ry amo...@gmail.com switch 1 =  Unchecked switch 2 =  Checked switch 3 =  Unknown switch x =  Nothing These general ways really avoid this particular crash, but does something real bad to the code in my opinion.

Re: [Haskell-cafe] Re: Pattern matching, and bugs

2009-12-18 Thread Felipe Lessa
On Fri, Dec 18, 2009 at 02:13:02PM +, John Lato wrote: So now the program needs a result of some type (String in your example) and gets an undefined, and then immediately crashes with an Exception - undefined error. I think this is the second time this is said in this thread, but please

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-18 Thread Steve Schafer
On Fri, 18 Dec 2009 16:39:21 +1300, you wrote: My experience has been that in order to make sense of someone else's code you *HAVE* to break identifiers into their component words. With names like (real example) ScatterColorPresetEditor, the eye *can't* take it in at once, and telling the

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-18 Thread Henning Thielemann
Patai Gergely schrieb: I have a function for mixing sounds at different (relative) start times. I feel that it does not get maximum speed in GHC, but is still ready for realtime application.

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-18 Thread Maciej Piechotka
On Fri, 2009-12-18 at 13:04 +0100, András Mocsáry wrote: Hello, I was advised respectfully to post my query here. Please, read the whole letter before you do anything, because I tried to construct the problem step by step. Also keep in mind, that the problem I query here is more general, and

[Haskell-cafe] Largest types in SYB

2009-12-18 Thread Paul Keir
I was looking for a simple generic technique targeting and transforming the largest terms of a particular type. For example, with Expr and Val declared as: data Expr = Val Val | Add Expr Expr | Sub Expr Expr deriving (Show, Eq, Typeable, Data) data Val = Var String | Struct [Expr] deriving

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-18 Thread Vladimir Zlatanov
I would do resampling (with some of the Interpolation routines) and mixing in two steps, that is I would prepare (lazy) storable vectors with the resampled sounds and mix them. Since Haskell is lazy, this is still somehow on the fly, although one could still wish to eliminate the interim

Re: [Haskell-cafe] Re: parallel and distributed haskell?

2009-12-18 Thread Murray Gross
Please note: We have a version of GUM in which PVM has been replaced by direct network communication. However, this project has been idle since the appearance of GHC-6, and I have not been able to get a binary of the parallel version (which is based on GHC-5) to compile itself. Murray Gross

Re: [Haskell-cafe] Cabal

2009-12-18 Thread Duncan Coutts
On Thu, 2009-12-17 at 18:08 +, Nils Anders Danielsson wrote: I was hoping that I could make use of this feature now: $ cabal --version cabal-install version 0.7.5 using version 1.8.0.2 of the Cabal library However, when I try to use it I get the following error: So there's two

Re: [Haskell-cafe] Double free-ing

2009-12-18 Thread Mitar
Hi! On Fri, Dec 18, 2009 at 8:29 AM, Ketil Malde ke...@malde.org wrote: Lazy ByteStrings should be able to append with O(1).  (Or use strict BS hGetNonBlocking, and Lazy ByteString fromChunks.) Oh, true. Thanks! But ... lazy ByteString's hGetNonBlocking is probably not lazy? Could it be? It

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

2009-12-18 Thread Patai Gergely
I would do resampling (with some of the Interpolation routines) and mixing in two steps, that is I would prepare (lazy) storable vectors with the resampled sounds and mix them. And is that straightforward considering the peculiarities of tracked music? After all, frequency can change between

[Haskell-cafe] sizeOf on a type

2009-12-18 Thread Gregory Crosswhite
Hey everyone, I would like to write a routine like nextPtr :: Storable a = Ptr a - Ptr a nextPtr = (`plusPtr` sizeOf (undefined :: a)) which increments a pointer by the correct amount, but GHC complains that the type variable a is ambiguous. I can see what's going on: it

[Haskell-cafe] getPtrSize works, but is annoying

2009-12-18 Thread Gregory Crosswhite
Ugh, I figured out how to write code to do what I wanted, but it seems like an ugly solution: getPtrSize :: Ptr a - Int getPtrSize = getFrom dummy where getFrom :: a - Ptr a - Int getFrom dummy _ = sizeOf dummy Any thoughts on a less

Re: [Haskell-cafe] sizeOf on a type

2009-12-18 Thread Thomas DuBuisson
I would like to write a routine like nextPtr :: Storable a = Ptr a - Ptr a nextPtr = (`plusPtr` sizeOf (undefined :: a)) How about: getA :: Ptr a - a getA _ = undefined nextPtr ptr = (`plusPtr` sizeOf (getA ptr)) ptr -Thomas

Re: [Haskell-cafe] sizeOf on a type

2009-12-18 Thread Sean Leather
I can see what's going on: it can't tell that the a I am writing there is the same a that's in the type specification, but is there any way that I can make it identify a with the a in the specification for nextPtr? Lexically scoped type variables:

Re: [Haskell-cafe] getPtrSize works, but is annoying

2009-12-18 Thread Luke Palmer
On Fri, Dec 18, 2009 at 12:20 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Ugh, I figured out how to write code to do what I wanted, but it seems like an ugly solution:        getPtrSize :: Ptr a - Int        getPtrSize = getFrom dummy          where                getFrom :: a

Re: [Haskell-cafe] sizeOf on a type

2009-12-18 Thread Patai Gergely
Hi, I would like to write a routine like nextPtr :: Storable a = Ptr a - Ptr a nextPtr = (`plusPtr` sizeOf (undefined :: a)) which increments a pointer by the correct amount, but GHC complains that the type variable a is ambiguous. Maybe Foreign.Marshal.Array.advancePtr is

Re: [Haskell-cafe] sizeOf on a type

2009-12-18 Thread Gregory Crosswhite
Yay, advancePtr is exactly what I needed! I totally missed that one in the docs. Also thanks to those of you who pointed me to the scoped type variables feature, since I had figured that a feature liked that had to exist but I just didn't know where to look for it. You guys rock! Cheers,

Re: [Haskell-cafe] Double free-ing

2009-12-18 Thread Mitar
Hi! On Fri, Dec 18, 2009 at 6:54 PM, Mitar mmi...@gmail.com wrote: On Fri, Dec 18, 2009 at 8:29 AM, Ketil Malde ke...@malde.org wrote: Lazy ByteStrings should be able to append with O(1).  (Or use strict BS hGetNonBlocking, and Lazy ByteString fromChunks.) Oh, true. Thanks! But ... lazy

[Haskell-cafe] Problem with cabal install zlib

2009-12-18 Thread Ozgur Akgun
Hi, When I run cabal install zlib or cabal upgrade zlib I get the following error: Resolving dependencies... Configuring zlib-0.5.2.0... Preprocessing library zlib-0.5.2.0... Only one output file may be specified cabal: Error: some packages failed to install: zlib-0.5.2.0 failed during the