[ ghc-Bugs-1291820 ] Strictness problem

2005-09-15 Thread SourceForge.net
Bugs item #1291820, was opened at 2005-09-15 12:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=108032aid=1291820group_id=8032 Please note that this message will contain a full copy of

Set.lookup?

2005-09-15 Thread Serge D. Mechveliani
Dear GHC developers, How do you think, maybe, Data.Set also needs to provide `lookup' ? For example, I have data D = D Int String, with the instances Eq and Ord defined by the first coordinate. I do use Map Int String, and for a certain reason, also use Set D. Then, for example, the

Re: Set.lookup?

2005-09-15 Thread Christian Maeder
Serge D. Mechveliani wrote: How do you think, maybe, Data.Set also needs to provide `lookup' ? Admittingly, using 'Set.filter (==e) s' to find the matching element may be a bit slower. When trying to use 'Set.intersection s $ singleton e' I just noticed that intersection is not

Set.intersection

2005-09-15 Thread Christian Maeder
Christian Maeder wrote: When trying to use 'Set.intersection s $ singleton e' I just noticed that intersection is not left-biased (see below)! Set.intersection is neither left- nor right-biased but biased towards the smaller set. I think that needs to be changed (and that may require a

Re: Set.intersection

2005-09-15 Thread Christian Maeder
Christian Maeder wrote: Set.intersection is neither left- nor right-biased but biased towards the smaller set. I think that needs to be changed (and that may require a function splitLookup). Below is my code proposal. I'm not sure if splitLookup should be exported. And I'm not sure if

Re: [Haskell] how to cite the (revised) Haskell Report

2005-09-15 Thread Ben Horsfall
On 15/09/05, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Page 0? What is that? OK, I admit there is no page zero (although the JFP contents page gives pages 0--255, which is where the information in my bibtex file must have come from); you've forced me to look at the journal version again - I

RE: [Haskell] Realistic max size of GHC heap

2005-09-15 Thread Simon Marlow
On 15 September 2005 01:04, Karl Grapone wrote: I'm considering using haskell for a system that could, potentially, need 5GB-10GB of live data. My intention is to use GHC on Opteron boxes which will give me a max of 16GB-32GB of real ram. I gather that GHC is close to being ported to amd64.

Re: [Haskell] how to cite the (revised) Haskell Report

2005-09-15 Thread Wolfgang Jeltsch
Am Donnerstag, 15. September 2005 08:33 schrieb Ben Horsfall: On 15/09/05, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Page 0? What is that? OK, I admit there is no page zero (although the JFP contents page gives pages 0--255, which is where the information in my bibtex file must have come

RE: [Haskell] Realistic max size of GHC heap

2005-09-15 Thread S. Alexander Jacobson
Should one interpret this as GHC now targets 64-bit systems or does one need to employ some sort of clevernesss to use this much memory? (I posted this question a while ago and was told that GHC did not at that time support 64-bit so could not use that much memory) On a related note, does GHC

RE: [Haskell] Realistic max size of GHC heap

2005-09-15 Thread Simon Marlow
On 15 September 2005 14:48, S. Alexander Jacobson wrote: Should one interpret this as GHC now targets 64-bit systems or does one need to employ some sort of clevernesss to use this much memory? (I posted this question a while ago and was told that GHC did not at that time support 64-bit so

Re[2]: [Haskell] Realistic max size of GHC heap

2005-09-15 Thread Bulat Ziganshin
Hello Simon, Thursday, September 15, 2005, 2:42:44 PM, you wrote: of 16GB-32GB of real ram. I gather that GHC is close to being ported SM It'll be a good stress test for the GC, at least. There are no reasons SM in principle why you can't have a heap this big, but major collections SM are

Re[2]: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread Bulat Ziganshin
Hello Ben, Wednesday, September 14, 2005, 6:32:27 PM, you wrote: BRG do { ... ; ... borrow E ... ; ... } BRG is transformed into BRG do { ... ; x - E ; ... x ... ; ... } i strongly support this suggestion. actually, i suggest the same for dealing with references (IORef/MVar/...),

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread Lyle Kopnicky
Bulat Ziganshin wrote: Hello Ben, Wednesday, September 14, 2005, 6:32:27 PM, you wrote: BRG do { ... ; ... borrow E ... ; ... } BRG is transformed into BRG do { ... ; x - E ; ... x ... ; ... } i strongly support this suggestion. actually, i suggest the same for dealing with

Re[2]: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread Bulat Ziganshin
Hello Lyle, Thursday, September 15, 2005, 10:50:30 PM, you wrote: z := *x + *y -- translated to { x' - readIORef x; y' - readIORef y; writeIORef z (x'+y') } LK Right, I realize my suggestion is the same as Ben's. I just prefer a LK more succinct notation, like special brackets instead

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread robert dockins
I raise you: class (Monad m) = Ref m c | c - m where new :: a - m (c a) get :: c a - m a peek :: c a - m a set :: c a - a - m () modify :: c a - (a - a) - m a modify_ :: c a - (a - a) - m () modifyM :: c a - (a - m a) - m a

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread Einar Karttunen
On 15.09 23:40, Bulat Ziganshin wrote: of course class Ref c a where new :: a - IO (c a) get :: c a - IO a set :: c a - a - IO () Maybe even: class Ref m t where new :: a - m (t a) get :: t a - m a set :: t a - a - m () Or if you want to support things like FastMutInts class

Re: [Haskell] Mixing monadic and non-monadic functions

2005-09-15 Thread Frederik Eaton
I have another proposal, though. Introduce a new keyword, which I'll call borrow (the opposite of return), that behaves like a function of type (Monad m) = m a - a inside of do statements. More precisely, a do expression of the form do { ... ; ... borrow E ... ; ... } is transformed

Re: [Haskell] Realistic max size of GHC heap

2005-09-15 Thread Karl Grapone
On 9/15/05, Simon Marlow [EMAIL PROTECTED] wrote: On 15 September 2005 01:04, Karl Grapone wrote: I'm considering using haskell for a system that could, potentially, need 5GB-10GB of live data. My intention is to use GHC on Opteron boxes which will give me a max of 16GB-32GB of real ram.I gather

Re: [Haskell-cafe] Binary parser combinators and pretty printing

2005-09-15 Thread Einar Karttunen
On 13.09 23:31, Tomasz Zielonka wrote: How about all these points together?: a) Simple monadic interface I think I already have this - minus packaging and documentation. b) Using better combinators This is lacking. c) Using TH to generate code for the simple cases I have TH for

Re: [Haskell-cafe] How to call ICS from Haskell

2005-09-15 Thread Malcolm Wallace
Huong Nguyen [EMAIL PROTECTED] writes: Do you know how to call ICS (Integrated Canonizer and Solver: www.icansolve.com http://www.icansolve.com) or PVS (Prototype Verification System) from Haskell ? Normally, it is easy to call external libraries via Haskell's FFI (Foreign Function

[Haskell-cafe] Autrijus Tang interviewed by Perl.com

2005-09-15 Thread John Goerzen
metaperl posted about this on the Haskell Sequence this morning and I thought all of you list readers might be interested as well. Autrijus Tang is well-known for developing the first working Perl 6 interpreter, Pugs. Pugs is written in Haskell. Perl.com has an interview with Autrijus, and page 2

Re[2]: [Haskell-cafe] Weak hashtable memoization code?

2005-09-15 Thread Bulat Ziganshin
Hello Simon, Tuesday, September 13, 2005, 7:42:52 PM, you wrote: SM There's the memo table implementation in the util package: SM hslibs/util/Memo.lhs. Note that this is scheduled for demolition in GHC SM 6.6. why? -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: [Haskell-cafe] Autrijus Tang interviewed by Perl.com

2005-09-15 Thread Joel Reymont
What is the meaning of xxs@(x:xs) in the code below? I understand that x:xs is a list /head:tail/ but a tuple of (x:xs) does not make sense. main = print (take 1000 hamming) hamming = 1 : map (2*) hamming ~~ map (3*) hamming ~~ map (5*) hamming where xxs@(x:xs) ~~

Re: [Haskell-cafe] Autrijus Tang interviewed by Perl.com

2005-09-15 Thread Philippa Cowderoy
On Thu, 15 Sep 2005, Joel Reymont wrote: What is the meaning of xxs@(x:xs) in the code below? I understand that x:xs is a list /head:tail/ but a tuple of (x:xs) does not make sense. It's not a tuple, it's just the usual meaning for parens. -- [EMAIL PROTECTED] The task of the academic

RE: Re[2]: [Haskell-cafe] Weak hashtable memoization code?

2005-09-15 Thread Simon Marlow
On 15 September 2005 13:44, Bulat Ziganshin wrote: Hello Simon, Tuesday, September 13, 2005, 7:42:52 PM, you wrote: There's the memo table implementation in the util package: hslibs/util/Memo.lhs. Note that this is scheduled for demolition in GHC 6.6. why? It doesn't perform very

[Haskell-cafe] Network parsing and parsec

2005-09-15 Thread John Goerzen
Hello, The recent thread on binary parsing got me to thinking about more general network protocol parsing with parsec. A lot of network protocols these days are text-oriented, so seem a good fit for parsec. However, the difficulty I come up time and again is: parsec normally expects to parse as

[Haskell-cafe] Re: Network parsing and parsec

2005-09-15 Thread Peter Simons
John Goerzen writes: With networking, you must be careful not to attempt to read more data than the server hands back, or else you'll block. [...] With a protocol such as IMAP, there is no way to know until a server response is being parsed, how many lines (or bytes) of data to read.

Re: [Haskell-cafe] Doing Windows Programming

2005-09-15 Thread Juan Carlos Arevalo Baeza
GHC 6.4's support for Win32 is definitely broken. However, I've been experimenting with implementing a wrapper using FFI, and that has proven to be reasonably easy. The only gotchas: 1- You have to run ghc --make with the extra -lGdi32, -lUser32, etc... switches. 2- You can't use something

Re: [Haskell-cafe] Doing Windows Programming

2005-09-15 Thread Brian McQueen
Thanks for this! That is helpful and eye-opening. I do want to use ghc, though I don't really have a good reason for that choice. It seems that if I were to go with hugs, it would be easier going. On 9/15/05, Juan Carlos Arevalo Baeza [EMAIL PROTECTED] wrote: GHC 6.4's support for Win32

[Haskell-cafe] Re: Network parsing and parsec

2005-09-15 Thread John Goerzen
On 2005-09-15, Peter Simons [EMAIL PROTECTED] wrote: The approach I recommend is to run a scanner (tokenizer) before the actual parser. IMAP, like most other RFC protocols, is line-based; so you can use a very simple scanner to read a CRLF-terminated line efficiently (using non-blocking I/O,

Re: [Haskell-cafe] Re: Network parsing and parsec

2005-09-15 Thread Adam Turoff
On 9/15/05, John Goerzen [EMAIL PROTECTED] wrote: Not only that, but IMAP has a way where you can embed, say {305} instead of a string. That means, after you finish reading this line, read exactly 305 bytes, and consider that to be used here. But if you see {305} (the double quotes

Re: [Haskell-cafe] RE: [Haskell] ANNOUNCE: ghc-src version 0.2.0

2005-09-15 Thread Bulat Ziganshin
Hello Simon, Tuesday, September 13, 2005, 5:00:17 PM, you wrote: But I did finish the combinator based parser for GHC. I tested it by having GHC( with combinator parser) compile itself and all the libraries. This took about 10% longer than with the original GHC, so in practice its speed is

Re: [Haskell-cafe] Functional vs Imperative

2005-09-15 Thread Bulat Ziganshin
Hello Dhaemon, Tuesday, September 13, 2005, 5:45:52 PM, you wrote: D everywhere... Why use a function language if you use it as an imperative D one?(i.e. most of the apps in http://haskell.org/practice.html) because most complex parts of code are really functional and Haskell give ability to

Re: [Haskell-cafe] Binary parser combinators and pretty printing

2005-09-15 Thread Bulat Ziganshin
Hello Einar, Tuesday, September 13, 2005, 7:03:00 PM, you wrote: EK data Packet = Packet Word32 Word32 Word32 [FastString] well. you can see my own BinaryStream package at http://freearc.narod.ru class BinaryData a where read :: ... write :: ... instance BinaryData Word32 where read =

Re: [Haskell-cafe] Binary parser combinators and pretty printing

2005-09-15 Thread Einar Karttunen
On 15.09 21:53, Bulat Ziganshin wrote: EK data Packet = Packet Word32 Word32 Word32 [FastString] well. you can see my own BinaryStream package at http://freearc.narod.ru class BinaryData a where read :: ... write :: ... I don't think this is a very good solution. Keeping the on-wire

Re: [Haskell-cafe] wxHaskell: getting a checkbox state

2005-09-15 Thread Sebastian Sylvan
On 9/14/05, Mark Carter [EMAIL PROTECTED] wrote: Arthur Baars wrote: Hi, A Checkbox is instance of the class Checkable: http://wxhaskell.sourceforge.net/doc/ Graphics.UI.WX.Classes.html#t%3ACheckable This means you can get and set the checked property for checkboxes. for

Re: [Haskell-cafe] Functional vs Imperative

2005-09-15 Thread John Meacham
On Thu, Sep 15, 2005 at 09:38:35PM +0400, Bulat Ziganshin wrote: Hello Dhaemon, Tuesday, September 13, 2005, 5:45:52 PM, you wrote: D everywhere... Why use a function language if you use it as an imperative D one?(i.e. most of the apps in http://haskell.org/practice.html) because most

Re: [Haskell-cafe] Functional vs Imperative

2005-09-15 Thread John Meacham
On Fri, Sep 16, 2005 at 12:44:02AM +0200, Sebastian Sylvan wrote: On 9/16/05, John Meacham [EMAIL PROTECTED] wrote: On Thu, Sep 15, 2005 at 09:38:35PM +0400, Bulat Ziganshin wrote: Hello Dhaemon, Tuesday, September 13, 2005, 5:45:52 PM, you wrote: D everywhere... Why use a

Re: [Haskell-cafe] Network parsing and parsec

2005-09-15 Thread Andrew Pimlott
On Thu, Sep 15, 2005 at 11:09:25AM -0500, John Goerzen wrote: The recent thread on binary parsing got me to thinking about more general network protocol parsing with parsec. A lot of network protocols these days are text-oriented, so seem a good fit for parsec. However, the difficulty I

Re: [Haskell-cafe] Network parsing and parsec

2005-09-15 Thread Andrew Pimlott
On Thu, Sep 15, 2005 at 06:11:58PM -0700, Andrew Pimlott wrote: I don't see why this would be more error-prone than any other approach. Hmm... I take that back. I don't know anything about the IMAP protocol, but after imagining for a few moments what it might be like, I can see how it could be