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

2006-07-18 Thread Andrew Pimlott
On Sun, Jul 16, 2006 at 08:43:31PM -0500, Brian Smith wrote: > I kind of expect that a Haskell library for file paths will use the > type system to ensure some useful properties about the paths. It's a nice idea, but I claim that it's a rat's nest. Path semantics, when you look hard at them, are

[Haskell-cafe] deepSeq vs. rnf?

2006-07-18 Thread Chad Scherrer
Now and again I see references to "deepSeq", and I've never understood how this could be any different than using rnf from Control.Parallel.Strategies. Is there really any difference? When is it better to use one or the other? Thanks, -- Chad Scherrer "Time flies like an arrow; fruit flies lik

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-18 Thread Jared Warren
>> % defining natural numbers >> natural(zero). >> natural(s(X)) :- natural(X). >> >> % translate to integers >> toInt(zero, 0). >> toInt(s(X), N) :- toInt(X, Y), N is Y + 1. > Thank you. I can now more precisely state that what I'm trying to > figure out is: what is 's', a predicate or a data st

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

2006-07-18 Thread Neil Mitchell
And if someone wants to define a "new" and "better" FilePath type, I would prefer something more abstract, such as a list of Path components, with functions to serialize it as a String and to parse it from a String. A list of path components is just not enough, I'm afraid. What about extensions?

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

2006-07-18 Thread Chris Kuklewicz
Stephane Bortzmeyer wrote: On Mon, Jul 17, 2006 at 03:07:51AM +0100, Neil Mitchell <[EMAIL PROTECTED]> wrote a message of 64 lines which said: How about adding something like "restrictFilePaths :: FilePath -> IO ()" which will restrict the area that can be played with to that beneath the gi

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

2006-07-18 Thread Piotr Kalinowski
On 18/07/06, Stephane Bortzmeyer <[EMAIL PROTECTED]> wrote: For instance, many lazy (not in the Haskell meaning) programmers believe that the path is safe if it does not include .. but it is false (hint: ."."/foo/bar is a legal path on Unix). I believe this does not cause trouble. If it is a sh

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

2006-07-18 Thread Stephane Bortzmeyer
On Mon, Jul 17, 2006 at 03:07:51AM +0100, Neil Mitchell <[EMAIL PROTECTED]> wrote a message of 64 lines which said: > I am specificially concentrating on type FilePath = String, because > that is how it is defined by Haskell 98. And if someone wants to define a "new" and "better" FilePath type

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

2006-07-18 Thread Stephane Bortzmeyer
On Mon, Jul 17, 2006 at 03:07:51AM +0100, Neil Mitchell <[EMAIL PROTECTED]> wrote a message of 64 lines which said: > How about adding something like "restrictFilePaths :: FilePath -> IO > ()" which will restrict the area that can be played with to that > beneath the given FilePath? If someone

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-18 Thread Bulat Ziganshin
Hello Jared, Tuesday, July 18, 2006, 9:05:09 AM, you wrote: >> % defining natural numbers >> natural(zero). >> natural(s(X)) :- natural(X). >> >> % translate to integers >> toInt(zero, 0). >> toInt(s(X), N) :- toInt(X, Y), N is Y + 1. > Thank you. I can now more precisely state that what I'm try