[Haskell-cafe] Type level logic programming terminology

2006-07-20 Thread oleg
Most systems of (first-order) logic differentiate between function letters (aka, symbols) and predicate letters (symbols). The former are used to build terms; the latter build atomic formulas (which can later be combined in more complex formulas using negation, conjunction, disjunction, and

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

2006-07-20 Thread Neil Mitchell
Hi I want to make sure a filename is valid. For example, prn and con This is another rat's nest, so I suggest that it be dealt with separately from the basic filepath module. The notion of valid is squishy: It depends entirely on what you intend to do with the path. Its a rats nest to do

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

2006-07-20 Thread Bulat Ziganshin
Hello Jared, Tuesday, July 18, 2006, 11:12:09 PM, 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 trying

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

2006-07-20 Thread Tom Schrijvers
On Tue, 18 Jul 2006, Jared Warren 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 trying to figure out is: what is

[Haskell-cafe] irc channel stats

2006-07-20 Thread Donald Bruce Stewart
While we're in a period of reflection, pondering the history of haskell, I've prepared some graphs of activity on the IRC channel. Summary: its growing much as the mailing lists are, with more than 5000 users over the past 5 years. Full details here, http://www.cse.unsw.edu.au/~dons/irc/

[Haskell-cafe] Re: Compiling ghc for using STM

2006-07-20 Thread Simon Marlow
Duncan Coutts wrote: I believe that the smp flavour of the RTS is now built by default and so all you need to do is use it when linking a program: ghc-6.5 -smp Foo.hs -o foo Yes, although -smp is now the same as -threaded, so for simplicity we'll stop referring to -smp and just use

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

2006-07-20 Thread Neil Mitchell
Hi, In this library proposal, there are a bunch of xxxDrive functions .. [remove them] I strongly agree about this. I have decided you are right, on Windows getDrive x can be written simply as: getDrive x | isRelative x = | otherwise = head (getDirectories x) And given that

[Haskell-cafe] trace function

2006-07-20 Thread Alexander Vodomerov
Hello! The function trace is supposed to write debug messages to console. However, when I trying to run the following program import Debug.Trace main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. Why trace is not working? PS.

[Haskell-cafe] Opening a file that another process is writing

2006-07-20 Thread Maurício
Hi, I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says permission denied. Thanks, Maurício

[Haskell-cafe] trace function

2006-07-20 Thread tpledger
Alexander Vodomerov wrote: import Debug.Trace main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. Why trace is not working? Nothing uses the value of (trace yyy ()), so it is never evaluated. Try this instead, which uses the

[Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
I've looked around at the various STRef examples out there, but still nothing I write myself using this will work. I'm trying to figure out how the s is escaping in really simple examples like x = runST $ return 1 y = runST $ do {r - newSTRef 1; readSTRef r} Neither of these works in ghci -

[Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread tpledger
Chad Scherrer wrote: x = runST $ return 1 y = runST $ do {r - newSTRef 1; readSTRef r} Neither of these works in ghci x = runST (return 1) y = runST (do {r - newSTRef 1; readSTRef r}) The escaping s is something to do with rank 2 polymorphism. (Search for rank in the ghc user guide, for

[Haskell-cafe] problems with receiving mail lists

2006-07-20 Thread Bulat Ziganshin
Hello Simon, Simon, you are administrator of many haskell mail lists, so i wrote to you. last day i don't receive messages in these mail lists. investigating the problem, i found on haskell-cafe subscription page that there are some problems in mail delivery to my address. i'm not 100% sure but i

Re: [Haskell-cafe] The History of Haskell

2006-07-20 Thread Maarten Hazewinkel
Simon and partners, Thank you for this paper. As a relative newcomer to Haskell, quite few topics on the mailing lists went right past me. Now that I've read this paper a can at least understand generally what most topics are about. I'd definitely recommend this as reading material to anyone

[Haskell-cafe] test message

2006-07-20 Thread Simon Marlow
Trying to diagnose problems with mailing lists... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] RE: problems with receiving mail lists

2006-07-20 Thread Simon Marlow
Apparently Mailman was stuck, I've restarted it and it seems to be working again. Noone's account has been disabled, as far as I can tell. Cheers, Simon On 20 July 2006 06:18, Bulat Ziganshin wrote: Hello Simon, Simon, you are administrator of many haskell mail lists, so i wrote to

Re: [Haskell-cafe] Opening a file that another process is writing

2006-07-20 Thread Bulat Ziganshin
Hello Maurício, Thursday, July 20, 2006, 1:22:01 AM, you wrote: I want to open for reading a log file that another process is locking for write. I know it's possible, since 'cat' and 'vim' can read that file (but not edit it, of course). How can I do that in Haskell? 'openFile' says

Re: [Haskell-cafe] trace function

2006-07-20 Thread Neil Mitchell
Hi, Either one of these will work: main = do putStrLn xxx x - return (trace yyy ()) x `seq` putStrLn zzz main = do putStrLn xxx trace yyy (return ()) putStrLn zzz This works fine, the problem is that trace is defined to output the first parameter before returning the second. In the case of

Re: [Haskell-cafe] trace function

2006-07-20 Thread Malcolm Wallace
Alexander Vodomerov [EMAIL PROTECTED] wrote: main = do putStrLn xxx return (trace yyy ()) putStrLn zzz only xxx and zzz is displayed. yyy is missing. This is because you never demanded the value of (trace yyy ()), so it was never computed. The joys of laziness! To force its

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
Whoa. That changes everything I thought I knew about ($). Come to think of it, one of the examples that does work it written main = print $ runST f where f is defined separtely. So that's consistent. I'll take a look at the references. Thanks! Indeed. The short answer: use runST (long

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

2006-07-20 Thread Jon Fairbairn
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 not polished code, and I'm not at all wedded to the

Re: [Haskell-cafe] REALLY simple STRef examples

2006-07-20 Thread Chad Scherrer
Hi, The short answer: use runST (long expression) rather than runST $ long expression when it comes to higher-ranked functions such as runST. I suppose the same holds for runSTUArray, right? But this still gives me that same error, about being less polymorphic than expected.

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

2006-07-20 Thread Bulat Ziganshin
Hello Chad, Thursday, July 20, 2006, 9:38:43 PM, you wrote: I suppose the same holds for runSTUArray, right? But this still gives me that same error, about being less polymorphic than expected. there is well-known problem with that _unboxed_ arrays aren't polymorphic. Oleg Kiselyov proposed

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

2006-07-20 Thread Chad Scherrer
Ok, I see now why the return is necessary. For now I'll switch to boxed arrays until I get the rest of this down better. But why should this... sumArrays [] = error Can't apply sumArrays to an empty list sumArrays (x:xs) = runSTArray (result x) where result x = do x0 - thaw x

Re: [Haskell-cafe] doubt on gui

2006-07-20 Thread Duncan Coutts
On Thu, 2006-07-20 at 18:09 +0300, Alvaro Galan wrote: Hi, im almost new in haskell world, but im trying to do a simple graphical interface for a small program, i developed the program under winhugs, and now i want to develop the gui also with it, but all the libraries and kits that i download

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

2006-07-20 Thread Udo Stenzel
Chad Scherrer wrote: But why should this... sumArrays [] = error Can't apply sumArrays to an empty list sumArrays (x:xs) = runSTArray (result x) where result x = do x0 - thaw x mapM_ (x0 +=) xs return x0 work differently than this...

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

2006-07-20 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

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

2006-07-20 Thread Bulat Ziganshin
Hello Simon, Friday, July 21, 2006, 7:46:15 AM, you wrote: | 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