Re: [Haskell-cafe] Re: Why is there no splitBy in the list module?

2006-07-21 Thread Jon Fairbairn
On 2006-07-20 at 18:31BST I wrote: > On 2006-07-13 at 10:16BST I wrote: > > Hooray! I've been waiting to ask "Why aren't we asking what > > laws hold for these operations?" > > Having thought about this for a bit, I've come up with the > below. This is intended to give the general idea -- it's no

RE: Re[4]: [Haskell-cafe] REALLY simple STRef examples

2006-07-21 Thread Simon Peyton-Jones
| > | ps: you successfully going through all the standard Haskell troubles | > in | > | this area :) seems that making FAQ about using ST monad will be a | > | good idea :) | | > Indeed. If someone would like to start one, a good place for it would be | > GHC's collaborative-documentation Wiki |

[Haskell-cafe] seq - RTFM?

2006-07-21 Thread Dusan Kolar
Hello all, my question is probably dull. So answers to better investigate manual are welcome. Why is this correct? ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/

Re: [Haskell-cafe] seq - RTFM?

2006-07-21 Thread Piotr Kalinowski
On 21/07/06, Dusan Kolar <[EMAIL PROTECTED]> wrote: Prelude> putStr "Ahoj\n" Ahoj Prelude> putStr "Ahoj\n" `seq` 3+3 6 Prelude> :q Leaving GHCi. And not Prelude> putStr "Ahoj\n" Ahoj Prelude> putStr "Ahoj\n" `seq` 3+3 Ahoj 6 Well, I understand that seq evaluates the first argument. But the re

Re: [Haskell-cafe] seq - RTFM?

2006-07-21 Thread Jens Fisseler
Hi Dusan, > my question is probably dull. So answers to better investigate manual > are welcome. Why is this correct? the Haskell Report is probably better in explaining the behaviour of 'seq' than me: http://haskell.org/onlinereport/basic.html#sect6.2 Regards, Jens

Re: [Haskell-cafe] seq - RTFM?

2006-07-21 Thread Christophe Poucet
Hello Dusan, The reason why that does not work as you expect it to is because the type of the whole expression is not monadic. Therefore it will basically evaluate the action until it's an action ready to be executed, but not execute it, cause it's not in the IO monad. It's the same as having a

[Haskell-cafe] Still not dead

2006-07-21 Thread Einar Karttunen
Hello As many of you may have noticed I have been away for some months. This has been due to health problems which have unfortunately kept me unable to work on Haskell projects. I am not dead and will be working on resolving the backlog of messages (will probably take a week). I will be slowly ba

[Haskell-cafe] HXT - problems with runIOSLA or xread

2006-07-21 Thread Niklas
Hi everybody, and especially Uwe Schmidt et al. I ran into some problems trying to process some xml from a string source, illustrated in the code below. From file, using readDocument, everything works great though. I've probably missed a finer detail or two in the arrow handling, or it could be

Re: Re[4]: [Haskell-cafe] REALLY simple STRef examples

2006-07-21 Thread Chad Scherrer
The IO monad hasn't given me too much trouble, but I want to be sure to structure things the way "they should be". If I get everything running using IO first and then have type-checking problems with ST, it will be tempting to just slap on an unsafePerformIO and call it good. Sure, it's really doi

[Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-21 Thread Simon Marlow
Neil Mitchell wrote: I have also added a canonicalPath function, support for spotting file\con as invalid and fixing it, support for \\?\ paths (if you don't know what they are, don't look it up, they are quite painful!) and a few very obscure corner cases which broke some of the properties. I

[Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-21 Thread Neil Mitchell
Hi, I haven't been following this discussion very closely, but this caught my eye. Has anyone pointed out yet that eliminating ".." in a FilePath isn't valid in the presence of symbolic links? I vaguely recall that this is why Krasimir's System.FilePath library doesn't include normalisation. N

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-21 Thread S C Kuo
Not totally relevant to what the discussion has evolved to, but I wrote a factorial function using STRefs (in the spirit of the Evolution of a Haskell programmer) and I think it qualifies as a really simple example. Code follows: import Data.STRef import Control.Monad.ST foreach :: (M

Re: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-21 Thread David Menendez
Neil Mitchell writes: > > We should avoid referring to $PATH as the "path", since we > > already have FilePath. > Agreed, but I couldn't come up with a better name, if anyone has any > suggestions. searchPath? -- David Menendez <[EMAIL PROTECTED]> _

[Haskell-cafe] incoherent instance selection when it should be still coherent

2006-07-21 Thread Ralf Lammel
The following pain is sort of ghc (6.4.2) specific. (The same behavior is achievable with hugs -98 +O which is Ok in so far that +O (as opposed to +o) is not strongly supposed to be coherent.) Note the following GHC options preceding the code. They do not contain -fallow-incoherent-instances. {-#

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-21 Thread Bryan Burgers
On 7/21/06, S C Kuo <[EMAIL PROTECTED]> wrote: Not totally relevant to what the discussion has evolved to, but I wrote a factorial function using STRefs (in the spirit of the Evolution of a Haskell programmer) and I think it qualifies as a really simple example. Code follows: import Data.STRef i