[GHC] #897: Missing instance declaration on Mac OS X (PPC)

2006-09-14 Thread GHC
#897: Missing instance declaration on Mac OS X (PPC) +--- Reporter: [EMAIL PROTECTED] |Owner: Type: bug | Status: new Priority: normal |Milestone:

[GHC] #898: GHC compiles against Apple's readline, giving error

2006-09-14 Thread GHC
#898: GHC compiles against Apple's readline, giving error -+-- Reporter: doaitse |Owner: Type: bug | Status: new Priority: normal|Milestone:

No child processes in 6.6-candidate

2006-09-14 Thread Serge D. Mechveliani
Dear GHC developers, Sometimes ghc-6.6-candidate reports -- runhaskell Setup.hs install --user ... *** Exception: waitForProcess: does not exist (No child processes) -- under Linux. This happens

Re: Build failures in packages built with GHC 6.6

2006-09-14 Thread shelarcy
Hi Duncan, On Mon, 11 Sep 2006 17:34:26 +0900, Duncan Coutts [EMAIL PROTECTED] wrote: Over the weekend Lennart Kolmodin tested all of Gentoo's Haskell packages with the latest GHC 6.6 RC snapshot. Here is his report of what failed, and how:

Re: [Haskell] ANN: SmallCheck 0.1

2006-09-14 Thread Colin Runciman
Don, Let's run QuickCheck (check) head to head with SmallCheck (scheck): ... lambdabot scheck \s - not (null s) == minimum (s :: [Int]) == (last . sort) s Failed test no. 10. Test values follow.: [-1,-1,-1,-1,-1,-1,-1,0] lambdabot check \s - not (null s) == minimum (s :: [Int])

[Haskell] building shared objects

2006-09-14 Thread Jeremy Wazny
Hi all, I'm wondering if anybody has had any success building shared objects from Haskell code on x86 Linux and/or Sparc Solaris. I have some Haskell source which I am trying to integrate into a C/C++ library which I am maintaining at the same time. The performance of the Haskell code is not

Re: [Haskell] building shared objects

2006-09-14 Thread Tomasz Zielonka
On Fri, Sep 15, 2006 at 01:45:46AM +1000, Jeremy Wazny wrote: The performance of the Haskell code is not an issue. [...] The alternative is to admit defeat and rewrite all the Haskell code as C++, which is pretty depressing. If performance is not an issue, then maybe another alternative -

[Haskell] On computable types. I. Typed lambda and type closures

2006-09-14 Thread oleg
This is the first message in a series on arbitrary type/kind-level computations in the present-day Haskell, and on using of so computed types to give signatures to terms and to drive the selection of overloaded functions. We can define the type TD N to be the type of a tree fib(N)-level deep, and

[Haskell] On computable types. II. Flipping the arrow

2006-09-14 Thread oleg
Part I of the series introduced the type-level functional language with the notation that resembles lambda-calculus with case distinction, fixpoint recursion, etc. Modulo a bit of syntactic tart, the language of the type functions even looks almost like the pure Haskell. In this message, we show

Re[2]: [Haskell-cafe] foreach

2006-09-14 Thread Bulat Ziganshin
Hello Michael, Thursday, September 14, 2006, 12:44:37 AM, you wrote: Or, what about using ListT to combine it with IO, eliminating the need for two separate `do' blocks? according to my experience, in most cases we need two do blocks just because outer one contains more code after inner one

Re: [Haskell-cafe] program execution and laziness

2006-09-14 Thread Bulat Ziganshin
Hello Tim, Thursday, September 14, 2006, 5:32:24 AM, you wrote: out - hGetContents o -- print out How can I force hGetContents to be strict (or at least to completely process the stream prior to the waitForProcess command)? return $! last out -- Best regards, Bulat

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread ajb
G'day all. Quoting Henning Thielemann [EMAIL PROTECTED]: A monoid operation is associative, isn't it? Duh. Yes. Sorry. Need caffeine. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Optimization problem

2006-09-14 Thread Rohan Drape
splitStreams [(3,x),(1,y),(3,z),(2,w)] [(3,[x,z]),(1,[y]),(2,[w])] [snip] Furthermore it should work on infinite lists. It can't eat the whole list before producing any output. This doesn't seem to make sense? Only at the end of the list can you know that you've collected all the events

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Ross Paterson
On Thu, Sep 14, 2006 at 01:11:56AM -0400, David Menendez wrote: Ross Paterson writes: I've collected some notes on these issues at http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/StandardClasses Coincidentally, I spent some time last week thinking about a replacement for

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Henning Thielemann
On Wed, 13 Sep 2006, Magnus Jonsson wrote: When programming the other day I ran into this problem. What I want to do is a function that would work like this: splitStreams::Ord a=[(a,b)]-[(a,[b])] splitStreams [(3,x),(1,y),(3,z),(2,w)] [(3,[x,z]),(1,[y]),(2,[w])] Interestingly we use

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Matthias Fischmann
Magnus Jonsson [EMAIL PROTECTED] writes: splitStreams::Ord a=[(a,b)]-[(a,[b])] splitStreams [(3,x),(1,y),(3,z),(2,w)] [(3,[x,z]),(1,[y]),(2,[w])] [...] But is there any way to write it such that each element is touched only once? Or at least an O(n*log(m)) algorithm? I guess

[Haskell-cafe] ambiguous partially defined type problem

2006-09-14 Thread Maarten
Dear all, For a project involving I use some partially defined node (in this case a simple record, in my project state transformers) in which the defined part is common to all nodes, and the custom part is different for each node. They have to become anonymous so I can put them in a list of

Re[2]: [Haskell-cafe] foreach

2006-09-14 Thread Bulat Ziganshin
Hello Tim, Wednesday, September 13, 2006, 10:48:37 PM, you wrote: I would like to add to this. The previous loop runs the code once independantly for each item in the list. Sometimes you want to carry state through the loop: all this can be easily implemented by programmer himself.

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Bertram Felgenhauer
Magnus Jonsson wrote: splitStreams::Ord a=[(a,b)]-[(a,[b])] splitStreams [(3,x),(1,y),(3,z),(2,w)] [(3,[x,z]),(1,[y]),(2,[w])] I'm afraid this algorithm is O(n*m) time in the worst case, where n is the length of the input list, and m is the number of unique channels. But is there any

Re: [Haskell-cafe] ambiguous partially defined type problem

2006-09-14 Thread Brian Hulley
Maarten wrote: For a project involving I use some partially defined node (in this case a simple record, in my project state transformers) in which the defined part is common to all nodes, and the custom part is different for each node. They have to become anonymous so I can put them in a list of

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Ross Paterson
Here's my attempt, also using the quicksort idea, but using two passes instead of tying the knot: import Data.Set hiding (map) First a binary search tree, with a lookup function: data Tree k v = Node (Tree k v) k v (Tree k v) get :: Ord a = a - Tree a b - b get a (Node l k v r) = case

Re[2]: [Haskell-cafe] ambiguous partially defined type problem

2006-09-14 Thread Bulat Ziganshin
Hello Brian, Thursday, September 14, 2006, 7:43:55 PM, you wrote: Even if the compiler did know, by some other means, that a Node had been wrapped, Haskell doesn't support true existentials whereas you'd really need an existential: getCommon :: (forall gc. Node gc) - Common they are

[Haskell-cafe] Re: Optimization problem

2006-09-14 Thread Bertram Felgenhauer
I wrote: [1] Balancing can be done with the information in the blueprint, and mapping back is easily done by doing the transformation on the tree in reverse. I should add that this possibility was the main reason for dealing with blueprints at all. As Ross Paterson's solution shows, it's

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Bruno Oliveira
Hello, I think it is possible to do it in O(n) (if you change the representation of the output stream). Note that the solution is quite similar toTwan van Laarhoven, and it should be trivial use Map instead of Rel. Here is my take on it: The type of the output stream: type Rel a b = a -

Re: [Haskell-cafe] Re: Optimization problem

2006-09-14 Thread Magnus Jonsson
Thanks Bertran for your solution. I have difficulty understanding it so I can't comment on it right now but I'll try to have a look at it. Do you know of any article that explains this technique, starting from very simple examples? /Magnus On Thu, 14 Sep 2006, Bertram Felgenhauer wrote: I

[Haskell-cafe] Haskore microtonal support

2006-09-14 Thread Magnus Jonsson
On Thu, 14 Sep 2006, Henning Thielemann wrote: On Thu, 14 Sep 2006, Magnus Jonsson wrote: Now even more interestingly, my program also deals with music! :) I'm generating microtonal midi files. I use it for very much the same purpose as you do (although my program is not yet finished). Is

Re: [Haskell-cafe] Re: Optimization problem

2006-09-14 Thread Bertram Felgenhauer
Magnus Jonsson wrote: Thanks Bertran for your solution. I have difficulty understanding it so I can't comment on it right now but I'll try to have a look at it. Do you know of any article that explains this technique, starting from very simple examples? Not really. It's a result of

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Bruno Oliveira
Hello Magnus, You are right. Silly me. I was thinking of Rel as a kind of Hashtable. In this case, I think it should be possible to have O(n), since "cons" would only need constant time. Cheers, Bruno On Thu, 14 Sep 2006 13:11:05 -0400 (EDT), Magnus Jonsson wrote: Thanks

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread David Menendez
Ross Paterson writes: On Thu, Sep 14, 2006 at 01:11:56AM -0400, David Menendez wrote: Coincidentally, I spent some time last week thinking about a replacement for the Num class. I think I managed to come up with something that's more flexible than Num, but still mostly comprehensible.

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Jacques Carette
David Menendez wrote: * Having (+) work on lists, tuples and all the other monoids would make error messages more complicated. It gets worse than that. Imagine trying to explain to someone why 1 + sin is actually \a - const 1 a + sin a. It isn't that hard - it is done routinely in

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Jacques Carette
[EMAIL PROTECTED] wrote: That is what polymorphism is all about! Not in this context, sorry. This is a convention. Another one may give you an abomination, e.g., 1+sin means 1 plus the addres of the sin routine. (Of course not in a 'decent' language, but I know a few undecent. No, it is

[Haskell-cafe] Re: Optimization problem

2006-09-14 Thread apfelmus
Bertram Felgenhauer wrote: splitSeq' :: Ord a = Map a () - [(a,b)] - ([(a,[b])], Map a [b]) splitSeq' bp [] = ([], map (const []) bp) splitSeq' bp ((a,b):xs) = case lookup a bp bp of Just _ - let (l, m) = splitSeq' bp xs in (l, update a (b:) bp m) _ - let (bp', m) =

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Ross Paterson
On Thu, Sep 14, 2006 at 05:22:05PM +0200, Bertram Felgenhauer wrote: [much subtle code] We can now build the splitStream function, using the following helper function: splitSeq' :: Ord a = Map a () - [(a,b)] - ([(a,[b])], Map a [b]) This works for infinite lists if there is no balancing,

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Lennart Augustsson
On Sep 14, 2006, at 03:05 , Rohan Drape wrote: splitStreams [(3,x),(1,y),(3,z),(2,w)] [(3,[x,z]),(1,[y]),(2,[w])] [snip] Furthermore it should work on infinite lists. It can't eat the whole list before producing any output. This doesn't seem to make sense? Only at the end of the list

Re: [Haskell-cafe] Re: evaluate vs seq

2006-09-14 Thread Lennart Augustsson
On Sep 14, 2006, at 16:20 , [EMAIL PROTECTED] wrote: Michael Shulman wrote: On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So `seq` forces its first argument. When we define f x = x `seq` (Return x) we thereby get f _|_== _|_ f [] == Return [] f (x:xs) == Return

[Haskell-cafe] Bit string

2006-09-14 Thread Thomas Conway
Hi all, I'm doing some work with ASN.1, and I'm thinking about how to represent the type BIT STRING. The obvious, and inefficient representation would be type BitString = [Bool] A reasonable sparse representation might be type BitString = [Integer] where the integers represent the

Re: [Haskell-cafe] Bit string

2006-09-14 Thread Lennart Augustsson
It's hard to tell what the best representation is if you don't know what the operations that you are going to perform are. If all you are going to do is I/O of bitstrings, then [Bool] could be great. If you need to do bitwise boolean ops then Integer is a wise choice. -- Lennart

Re: [Haskell-cafe] Bit string

2006-09-14 Thread Thomas Conway
On 9/15/06, Lennart Augustsson [EMAIL PROTECTED] wrote: It's hard to tell what the best representation is if you don't know what the operations that you are going to perform are. If all you are going to do is I/O of bitstrings, then [Bool] could be great. If you need to do bitwise boolean ops

Re: [Haskell-cafe] Re: evaluate vs seq

2006-09-14 Thread Michael Shulman
On 9/14/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: With this in mind the equations 1) return _|_ == Return _|_ 2) _|_ `seq` (return _|_) == _|_ can be interpreted: 1) when reducing a return-redex (i.e. evaluating it), we get weak-head normal form without evaluating the argument

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Bertram Felgenhauer
Ross Paterson wrote: On Thu, Sep 14, 2006 at 05:22:05PM +0200, Bertram Felgenhauer wrote: [much subtle code] We can now build the splitStream function, using the following helper function: splitSeq' :: Ord a = Map a () - [(a,b)] - ([(a,[b])], Map a [b]) This works for infinite

[Haskell-cafe] Anonymous types

2006-09-14 Thread Thomas Conway
Hi all, Is there any deep and meaningful reason why Haskell doesn't have anonymous discriminated union types? I'm thinking of an example like: data Amount = Amount Integer (Mg|G|Kg|T) Now this particular case is perhaps unconvincing - a seperate Units type would be quite sensible, however I'm

[Haskell-cafe] Why is type 'b' forced to be type 'm a' and not possibly 'm a - m a'

2006-09-14 Thread Vivian McPhail
Dear Haskell Cafe, I have a problem I can't get my head around. The code below sets the problem out. What I need to be able to do is commented out. This code works, the only problem is that what I need is that an argument will be evaluated before it is passed, so ((and fries eats)

Re: [Haskell-cafe] Bit string

2006-09-14 Thread Tomasz Zielonka
On Fri, Sep 15, 2006 at 11:35:45AM +1000, Thomas Conway wrote: My question for all present is: Have I missed either a problem with using Integer, or have I overlooked a better representation? Consider also (UArray Int Bool). In GHC it has an efficient implementation. Best regards Tomasz