[Haskell] simple declarations proposal, was: offside rule question

2005-07-14 Thread Christian Maeder
Frederik Eaton wrote: > main = do > let a = (map (\x-> > x+1) --* > [0..9]) --* > print a seeing this, I wonder if do-statements (and qualifiers in list comprehensions) could be easily extended by an alternative for simple declarations (without mutual recursion and type sig

[Haskell] writeFile for a looong string

2005-07-14 Thread Johannes Waldmann
Dear all, I am writing a long string (several MByte) to a file, with writeFile fname ( render d ) where d :: Text.PrettyPrint.HughesPJ.Doc I wonder what happens internally (when compiled with ghc -O, if that matters) Will the string be in memory completely before it is actually written? My d

Re: [Haskell] writeFile for a looong string

2005-07-14 Thread Christian Maeder
Hi, maybe try using fullRender with defaults (mode=PageMode, lineLength=100, ribbonsPerLine=1.5) and "a" instantiated to "IO()" so that TextDetails can be appended to a file (handle). HTH Christian Johannes Waldmann wrote: > Dear all, > > I am writing a long string (several MByte) to a file, >

Re: [Haskell] line-based interactive program

2005-07-14 Thread Peter Achten
At 12:02 PM 7/12/2005, Wolfgang Jeltsch wrote: Am Montag, 11. Juli 2005 15:51 schrieben Sie: > [...] > I am always interested in functional I/O solutions that adopt the > "world-as-value" paradigm (or the more verbose "explicit multiple > environment passing" paradigm) that has been exploited in

Re: [Haskell] line-based interactive program

2005-07-14 Thread Wolfgang Jeltsch
Am Donnerstag, 14. Juli 2005 13:17 schrieben Sie: > [...] > > > where readEntireFile reads the entire file and returns it as a string. > > > I can imagine several results: [a,a], [a,b], [a,_|_], [_|_,_|_], _|_. > > > >I decided to distinguish between read-only I/O and write-permitted I/O. > > If

RE: [Haskell] writeFile for a looong string

2005-07-14 Thread Simon Marlow
On 14 July 2005 10:08, Johannes Waldmann wrote: > I am writing a long string (several MByte) to a file, > with writeFile fname ( render d ) > where d :: Text.PrettyPrint.HughesPJ.Doc > > I wonder what happens internally > (when compiled with ghc -O, if that matters) > Will the string be in memo

Re: [Haskell] offside rule question

2005-07-14 Thread Frederik Eaton
On Thu, Jul 14, 2005 at 03:15:32AM +0200, Lennart Augustsson wrote: > The offside rule is patronizing. :) > It tries to force you to lay out your program in a certain way. > If you like that way, good. I disagree. The offside rule in general makes a more concise syntax available to the programmer

Re: [Haskell] offside rule question

2005-07-14 Thread Brian Smith
On 7/14/05, Frederik Eaton <[EMAIL PROTECTED]> wrote: > On Thu, Jul 14, 2005 at 03:15:32AM +0200, Lennart Augustsson wrote: > > The offside rule is patronizing. :) > > It tries to force you to lay out your program in a certain way. > > If you like that way, good. > > I disagree. The offside rule i