1 line simple cat in Haskell

2002-11-12 Thread Ahn Ki-yung
If you are steaming with compicated codes, then how about taking a break. Let's play with a simple cat. \begin{code} main = mapM (>>=putChar) getCharS where getCharS = getChar:getCharS \end{code} Tested with ghc. Works good except that you get some messages on stderror because eof is not handle

Re: Record of STRefs better than STRef to a Record?

2002-11-12 Thread Andrew J Bromage
G'day all. On Wed, Nov 13, 2002 at 04:05:42AM +, Jorge Adriano wrote: > If I use an STRef to a record, will a new record be created each time I want > to update a single field? Basically, yes. > Right now I'm using a record of STRefs, like: > data E s = E{ > refi :: STRef s Int, >

Record of STRefs better than STRef to a Record?

2002-11-12 Thread Jorge Adriano
Hi all, If I use an STRef to a record, will a new record be created each time I want to update a single field? Or can I expect GHC to optimize it and have the field of the record updated in place? Right now I'm using a record of STRefs, like: data E s = E{ refi :: STRef s Int, refc

Haskell98 Report copyright

2002-11-12 Thread Christopher Milton
I hope we don't have a repeat of the MathWorld website shutdown.* I also can't find a webpage with the definition of Standard ML... only avaible in print from MIT Press? Chris * http://mathworld.wolfram.com/erics_commentary.html = Christopher Milton [EMAIL PROTECTED] ___

Calling Haskell from Python / C++

2002-11-12 Thread Jonathan Holt
Hi, I've just recently learned about Haskell, and I'm impressed by the abstractions and expressiveness that it affords. I'm particularly interested in it for a small parser project that I'm planning. However, my main programming languages are Python and C++, and for various reasons switching enti

Re: showsPrec: cui bono?

2002-11-12 Thread C.Reinke
> has anybody here used in a non-trivial way the showsPrec anti-parser? Isn't the idea to make things trivial while avoiding performance penalties? Perhaps: simple pretty-printing of abstract syntax trees? I often use it to get simple debugging output for complex internal data structures (first,

showsPrec: cui bono?

2002-11-12 Thread Jerzy Karczmarczuk
A simple, primitive question: has anybody here used in a non-trivial way the showsPrec anti-parser? My students asked me what is it for, it is never used in the Hugs Prelude, OK, once: possible parentheses around fractions n%d. I explained that it is a good contraption to make one own pretty- pri