Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-19 Thread Don Stewart
dave: On Tue, Nov 18, 2008 at 3:52 PM, Don Stewart [EMAIL PROTECTED] wrote: dave: 2008/11/18 kenny lu [EMAIL PROTECTED]: The above number shows that my implementations of python style dictionary are space/time in-efficient as compared to python. Can some one point out what's wrong

Re: [Haskell-cafe] GHC 6.10.1 and cabal[-install]

2008-11-19 Thread Duncan Coutts
On Tue, 2008-11-18 at 13:56 -0800, Jason Dagit wrote: Will Hackage one day provide a way to discover that one package has been superceeded by another? Currently you can see when a newer version of the exact same package exists, but (for

[Haskell-cafe] UArray Word16 Word32 uses twice as much memory as it should?

2008-11-19 Thread Arne Dehli Halvorsen
Hello, I am having an issue with these unboxed arrays. I have some code that creates this structure:: (Array Word16 (UArray Int Word32), Array Word16 (UArray Int Word8)), and I am finding that it uses about twice as much memory as I had anticipated. This tuple is returned strict, and I think I

Re: [Haskell-cafe] Cabal and more than one version

2008-11-19 Thread Duncan Coutts
On Tue, 2008-11-18 at 16:53 -0800, Jason Dusek wrote: In the ticket, someone says: True though I suspect it looks a bit weird to the uninitiated. We know to read the conditional syntax as an implication constraint which can be applied in either direction but I suspect many

Re: [Haskell-cafe] Monadic bind with associated types + PHOAS?

2008-11-19 Thread Wouter Swierstra
Hi Ryan, On 19 Nov 2008, at 04:39, Ryan Ingram wrote: In HOAS, a lambda expression in the target language is represented by a function in the source language: data ExpE t where ApE :: ExpE (a - b) - ExpE a - ExpE b LamE :: (ExpE a - ExpE b) - ExpE (a - b) But without a way to inspect

Re: [Haskell-cafe] FFI and returning structs

2008-11-19 Thread Donn Cave
Quoth Maurcio [EMAIL PROTECTED]: | I have not found examples of this in documentation | or hackage packages: how can I deal with funcions | returning not pointers to structs but structs | thenselves? | | struct example {... | | example function_name (... | | My intuition said I could try a data

Re: [Haskell-cafe] GHC 6.10.1 and cabal[-install]

2008-11-19 Thread Wolfgang Jeltsch
Am Dienstag, 18. November 2008 22:24 schrieben Sie: How do I install and configure it so that it is integrated best with GHC 6.10.1? For example, should cabal use some directory in the GHC tree to place compiled packages in? The defaults for user or global should be fine. There is no

RE: [Haskell-cafe] Pattern matching on numbers?

2008-11-19 Thread Tobias Bexelius
Yes, fromInteger and == is used for pattern matching on numbers. However, on GHC you can use -XNoImplicitPrelude to make it use whatever fromInteger and == that's in scope (without any Num or Eq). Eg. if == is a method of MyEq class and fromInteger is a method of MyNum, and MyNum doesn't inherit

Re: [Haskell-cafe] Monadic bind with associated types + PHOAS?

2008-11-19 Thread Ryan Ingram
On Wed, Nov 19, 2008 at 1:04 AM, Wouter Swierstra [EMAIL PROTECTED] wrote: I'm not convinced yet. The problem is that there's no best way to handle binding. HOAS is great for some things (you don't have to write substitution), but annoying for others (optimisations or showing code). PHOAS

strict collections via types (was: [Haskell-cafe] implementing python-style dictionary in Haskell)

2008-11-19 Thread Claus Reinke
One problem is that Haskell collections are lazy by default. I'm aware of a few use cases where laziness lets you formulate a very elegant recursive population of a collection, but I think that in general, strictness is what you want, While I strongly agree with the gist of your post, I

[Haskell-cafe] Re: FFI and returning structs

2008-11-19 Thread Maurí­cio
I have not found examples of this in documentation or hackage packages: how can I deal with funcions returning not pointers to structs but structs thenselves? struct example {... example function_name (... (...) (...) If it were my problem, I would try a wrapper function

[Haskell-cafe] Re: Can't figure out source of race condition when using System.Process

2008-11-19 Thread Simon Marlow
Rafal Kolanski wrote: Bryan O'Sullivan wrote: What is the it that segfaults? The Haskell program shouldn't, at least. The Haskell program. It does so rarely, however, and I'm unable to reproduce it with any consistency, only enough to notice something is wrong with what I've written. Upon

[Haskell-cafe] Re: Automatic parallelism in Haskell, similar to make -j4?

2008-11-19 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Chad, Wednesday, November 5, 2008, 6:34:01 AM, you wrote: ghc --make -j4 Foo.hs afair, it was implemented and not shown speed improvements. ask Simon We did get speed improvements, it was the main case study for the initial implementation of shared-memory

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-19 Thread Ketil Malde
Tillmann Rendel [EMAIL PROTECTED] writes: Why should a Haskell hash table need more memory then a Python hash table? I've heard that Data.HashTable is bad, so maybe writing a good one could be an option. One problem is that Haskell collections are lazy by default. I'm aware of a few use

Re: [Haskell-cafe] Cabal and more than one version

2008-11-19 Thread Jason Dusek
Duncan Coutts [EMAIL PROTECTED] wrote: Jason Dusek wrote: In the ticket, someone says: True though I suspect it looks a bit weird to the uninitiated. We know to read the conditional syntax as an implication constraint which can be applied in either direction but I suspect many

[Haskell-cafe] The Monad.Reader - Issue 12: SoC Special

2008-11-19 Thread Wouter Swierstra
I am pleased to announce that a new issue of The Monad.Reader is now available: http://www.haskell.org/haskellwiki/The_Monad.Reader Issue 12 is another Summer of Code special and consists of the following three articles: * Max Bolingbroke Compiler Development Made Easy * Roman

Re: [Haskell-cafe] UArray Word16 Word32 uses twice as much memory as it should?

2008-11-19 Thread Bulat Ziganshin
Hello Arne, Wednesday, November 19, 2008, 11:57:01 AM, you wrote: finding that it uses about twice as much memory as I had anticipated. it may be 1) GC problem (due to GC haskell programs occupies 2-3x more memory than actually used) 2) additional data (you not said how long each small array.

Re: [Haskell-cafe] streaming translation using monads

2008-11-19 Thread Justin Bailey
On Tue, Nov 18, 2008 at 6:23 PM, Warren Harris [EMAIL PROTECTED] wrote: I am working on a query language translator, and although I feel that a monadic formulation would work well for this application, I've stumbled on a number of questions and difficulties that I thought the knowledgeable

Re: [Haskell-cafe] Re: FFI and returning structs

2008-11-19 Thread Donn Cave
Quoth Maurcio [EMAIL PROTECTED]: | (...) Ironically, that's actually just what the original | function is doing - cf. struct return convention, where the | caller allocates space and passes a pointer as a hidden | parameter. (...) | | Can I be sure things always goes like

Re: [Haskell-cafe] streaming translation using monads

2008-11-19 Thread Warren Harris
On Nov 18, 2008, at 6:53 PM, Brandon S. Allbery KF8NH wrote: On 2008 Nov 18, at 21:23, Warren Harris wrote: However, each of the clauses is actually an output routine to send the expression that it denotes to a remote server, and a parser for receiving the results. Since a clause is really

[Haskell-cafe] Re: Begginer question about alignment in Storable

2008-11-19 Thread Mauricio
If you are using hsc2hs (if you are using Cabal this is easy; just rename the file to *.hsc and Cabal will take care of the rest), then there is a macro for making this easier and so you don't have to think about it. (...) Well, after reading FFI addendum, I'm using my loyal text editor. Am I

[Haskell-cafe] Re: Monadic bind with associated types + PHOAS?

2008-11-19 Thread Chung-chieh Shan
Ryan Ingram [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: I really like the syntax for do-notation. And I really like how great Haskell is as writing embedded languages, a lot of which comes from the programmable semicolon that monadic bind gives you.

Re: [Haskell-cafe] UArray Word16 Word32 uses twice as much memory as it should?

2008-11-19 Thread Arne Dehli Halvorsen
Bulat Ziganshin wrote: Hello Arne, Wednesday, November 19, 2008, 11:57:01 AM, you wrote: finding that it uses about twice as much memory as I had anticipated. Hello, and thank you for your reply. it may be 1) GC problem (due to GC haskell programs occupies 2-3x more memory than

Re: [Haskell-cafe] streaming translation using monads

2008-11-19 Thread Warren Harris
On Nov 19, 2008, at 9:11 AM, Justin Bailey wrote: On Tue, Nov 18, 2008 at 6:23 PM, Warren Harris [EMAIL PROTECTED] wrote: I am working on a query language translator, and although I feel that a monadic formulation would work well for this application, I've stumbled on a number of

Re: [Haskell-cafe] streaming translation using monads

2008-11-19 Thread Justin Bailey
On Wed, Nov 19, 2008 at 11:50 AM, Warren Harris [EMAIL PROTECTED] wrote: Now perhaps the in-memory list part was a bad conclusion since the queries can be decorated with translation functions capable of streaming the results out to another channel. However, the use of a universal type for the

[Haskell-cafe] Re: streaming translation using monads

2008-11-19 Thread Chung-chieh Shan
Warren Harris [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: However, the use of a universal type for the values would still seem to be required since there is no way to implement type-indexed values when the queries themselves are expressed as an

[Haskell-cafe] Deprecated packages

2008-11-19 Thread Andrew Coppin
Jason Dagit wrote: On Tue, Nov 18, 2008 at 2:03 PM, Jason Dagit [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: On Tue, Nov 18, 2008 at 2:00 PM, Andrew Coppin [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Jason Dagit wrote: Will Hackage one day

Re: [Haskell-cafe] GHC 6.10.1 and cabal[-install]

2008-11-19 Thread Daniel McAllansmith
On Wed, 19 Nov 2008 21:27:36 Duncan Coutts wrote: It's even easier than that! Someone has done it already :-) http://hackage.haskell.org/trac/hackage/ticket/261 Thu Aug 28 16:55:16 CEST 2008 Chry Cheng [EMAIL PROTECTED] * Marking packages deprecated Fixes ticket no. 261 as discussed in

Re: Fwd: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-19 Thread Duncan Coutts
On Tue, 2008-11-18 at 22:42 +0100, Alberto G. Corona wrote: sorry, Dons, -- Forwarded message -- From: Alberto G. Corona [EMAIL PROTECTED] Date: 2008/11/18 Subject: Re: [Haskell-cafe] implementing python-style dictionary in Haskell To: Don Stewart [EMAIL PROTECTED] By

Re: [Haskell-cafe] streaming translation using monads

2008-11-19 Thread Warren Harris
On Nov 19, 2008, at 12:19 PM, Justin Bailey wrote: On Wed, Nov 19, 2008 at 11:50 AM, Warren Harris [EMAIL PROTECTED] wrote: Now perhaps the in-memory list part was a bad conclusion since the queries can be decorated with translation functions capable of streaming the results out to another

Re: [Haskell-cafe] portable arrow instances

2008-11-19 Thread Conal Elliott
Hi Wolfgang, I use CPP to manage such differences between 6.8, 6.9, and 6.10. As an example, see http://hackage.haskell.org/packages/archive/TypeCompose/latest/doc/html/src/Control-Compose.html. Regards, - Conal On Tue, Nov 18, 2008 at 6:01 AM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Hackage policy question

2008-11-19 Thread John Meacham
The usual solution to this is the 'release version', which is used in most (all?) other packaging systems. namely, you have foo-1.2-4, where 4 is the release version which documents what version the meta-info is. For instance, when bugs are fixed in the rpm spec file or deb package that number is