Subject prefixes (was: RE: suggestion)

2001-10-27 Thread Simon Marlow
What do you all think about activating the mechanism that automatically includes the name of the list before the subject of a mailing list email? For example: [hugs-users] Installation problems or [haskell] newbie question. I don't like the extra prefixes, but if most folk would

RE: Asynchronous Exceptions

2001-11-23 Thread Simon Marlow
Can someone help me understand how this works? I've been reading the paper Asynchronous Exceptions in Haskell. This gives a combinator finally :: IO a - IO b - IO s finally a b = block (do { r - catch (unblock a) (\e - do { b; throw e }); b; return r; })

RE: GUI Library Task Force

2001-09-27 Thread Simon Marlow
I don't think this is compatible with things like adding support for the library hierarchy with multiple dots to Haskell 98 as you will then be able to write a program that is valid Haskell 98 by todays definition but not yesterdays. OTOH if what you mean is adding support incrementally to

RE: Cash Prizes Win!

2001-09-27 Thread Simon Marlow
[ Ketil Malde asks about recent spam on Haskell mailing lists... ] How about disallowing non-subscribers from posting? This list is my main source of spam these days. (Effective filtering is your friend) My apologies for this spam that got through. Mailman's automatic filtering catches

RE: Possible bug/omission in Numeric library?

2001-11-28 Thread Simon Marlow
There is something strange about the Haskell'98 Numeric library, which I think could be considered a bug of sorts. There are functions readDec, readOct, readHex :: (Integral a) = ReadS a which read an integer from a string in base 10, 8, or 16, but there are no corresponding show

RE: IO errors

2001-11-29 Thread Simon Marlow
A quick look at the source looks like both GHC and NHC will simply pass on errors from the OS, so for example with module Main where import IO import Directory main :: IO() main = do catch (createDirectory this/does/not/exist/foo) (\e -

RE: Harmful spammers

2001-10-15 Thread Simon Marlow
There are a couple things to do that can at least cut down on spam. 1) Make sure that your mail gateway, or (in this case) the mailing list host is not an open relay site. It isn't. 2) Every time you get spam, locate all the hosts it came through in the header. Or alternatively

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
I'm curious, how does GHC determine that the CAF is no longer required if it is referenced by code (somehow)? If code was also some kind of heap allocated data structure I guess this would be possible, but I thought this wasn't so with GHC. GHC actually tracks references to top-level

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
Well, how about the following little circular program? paths :: () - [Path] paths () = let r = T : branch r in r As far as I can understand what you are looking for, I think this meets the bill. Every use of the expression `paths ()' will re-evaluate the infinite

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
You can't rely on adding dummy arguments to cause re-evaluation: full-laziness (enabled when optimisation is on in GHC) will do the opposite transformation. Well in this case, you may find it harder to claim that the full laziness transformation constitutes an `optimisation'. Maybe the

RE: unsafePerformIO to give warnings

2001-12-21 Thread Simon Marlow
Ian Lynagh writes: Sorry, I meant hugs and ghci only seem to print the warning the first time I run the program, e.g. with module Main where import IOExts main :: IO() main = trace foo (putStrLn bar) in hugs: [...] Type :? for help Main main

RE: #s causing errors when -cpp not given

2002-01-28 Thread Simon Marlow
I've just been looking at using cpp in Haskell scripts and I am rather confused. I can't see anything in the report which gives special meaning to # in the surrounding text of literate scripts, yet if I put such things in (both cpp directives and random things) both nhc98 and ghc give me

RE: H98 Report: expression syntax glitch

2002-02-25 Thread Simon Marlow
In the table of precedence in the original Report (now deleted in the revised Report), it makes it clear that a rightward-extending let, if, or lambda has a lower precedence than an infix operator, so for instance the parse h = (let op x y = y in (3 `op`)) is correct and

RE: H98 Report: expression syntax glitch

2002-02-26 Thread Simon Marlow
On Mon, Feb 25, 2002 at 05:07:35PM -, Simon Marlow wrote: On the other hand, one way to fix this problem *is* to specify the relative precedence of 'let' co. as compared to infix operators (namely that 'let' should have a lower precedence). That would be a reasonable fix

RE: Why is this function type-correct

2002-03-04 Thread Simon Marlow
Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a - b x = x 42 is equally well accepted, though I can't see why this type would

RE: Isn't this tail recursive?

2002-03-11 Thread Simon Marlow
On 10 Mar 2002, Jyrinx wrote: In the case expression at the end of countAll, each of the values looks to me like a recursive tail call - I should think (hope?) that it would be optimized by GHC into a goto statement (a la Scheme). Instead, my program eats up memory (I've got 256

RE: HGL ang GHC on Win32

2002-03-13 Thread Simon Marlow
I'm hoping that a GHC honcho will say Well of course that happens with 5.02.2 - you should upgrade to 5.03 right away. or some such. I'm afraid not :-) But there *is* a bug in the native code generator in 5.02.2, namly in the FFI support for passing floating point arguments to

RE: un-layout program

2002-03-14 Thread Simon Marlow
does there exist a program that'll take a layed out haskell program and output one that uses braces and semis to delimit? You can use GHC's hssource package to parse then pretty-print the source code - the pretty printer can generate output with explicit layout tokens if you ask for it.

RE: HGL ang GHC on Win32

2002-03-14 Thread Simon Marlow
That is a shame. I tried both suggestions (specifying position explicitly and recompiling with fvia-c -- i had been using O all along) and neither worked :(. I also tried using 5.03, and got the following warnings: [ message deleted ] It looks like there are some prototypes missing:

RE: question about concurrency implementation

2002-03-18 Thread Simon Marlow
I'm curious about the implementation of Concurrent Haskell in GHC and Hugs. Does access to values possibly shared among threads cost the same in Concurrent Haskell as in regular Haskell? I'm guessing the answer is yes, because Concurrent Haskell is provided by default in GHC. yes

RE: handling errors in Happy

2002-04-03 Thread Simon Marlow
Is it possible to get the result of function happyError, in the main module of my program (which imports the module generated by Happy)? Sure. You need to use Happy's %monad feature, the documentation describes how to turn parse errors into something you can handle in the program:

ANNOUNCE: GHC 5.02.3 released

2002-04-08 Thread Simon Marlow
The (Interactive) Glasgow Haskell Compiler -- version 5.02.3 == We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC), version 5.02.3. The source distribution is freely available via the

RE: semi-private exports

2002-04-23 Thread Simon Marlow
In my NLP.Prelude file, I define: newtype Token = Token [Word8] and I export only the type, not the constructor because I don't users of my package to be able to inspect/modify the list directly. However, in my NLP.IO module, in which I define IO for some of my data types, I need

RE: do notation and

2002-04-24 Thread Simon Marlow
I don't believe that it will break many programs. How many programs produce large *input independent* output, that is not already literally in the source, in a caf with a long life-time? That sounds like a description of all the animation programs in Paul Hudak's School of Expression

RE: Syntax of functional dependencies

2002-04-26 Thread Simon Marlow
I errorneously specified categories as class (Eq object, Eq morphism) = Category id object morphism | id -, id - morphism where o :: id - morphism - morphism - Maybe morphism dom, cod :: id - morphism - object it should have been class (Eq object, Eq morphism) =

ANNOUNCE: Haddock version 0.1, a Haskell documentation tool

2002-05-01 Thread Simon Marlow
to me: Simon Marlow [EMAIL PROTECTED] [1] IDoc - A No Frills Haskell Interface Documentation System http://www.cse.unsw.edu.au/~chak/haskell/idoc/ [2] HDoc http://www.fmi.uni-passau.de/~groessli/hdoc/ ___ Haskell mailing list [EMAIL PROTECTED] http

RE: Haddock

2002-05-02 Thread Simon Marlow
I just tried haddock-0.1. Good thing! Two quibbles, though: * the parser chokes on CVS headers like -- $Id ...$ ( but -- -- $Id ..$ is OK) Yes, because '-- $' has a special meaning in Haddock (it's a named documentation comment). * is there support for hierarchical namespaces? ( with

ANNOUNCE: Haddock version 0.2, a Haskell documentation tool

2002-05-09 Thread Simon Marlow
I'm pleased to announce version 0.2 of Haddock, a documentation generation tool for Haskell source code. It's available from http://www.haskell.org/haddock/ The changes relative to version 0.1 are listed here: http://www.haskell.org/haddock/CHANGES.txt Cheers, Simon

RE: Dependent Types

2002-05-13 Thread Simon Marlow
However, if I now comment out the functional dependency class Encode a b {- | a - b -} where encode :: a - b and include the expressions x = encode TimeExceeded ExcTTL main = putStrLn x then Hugs complains ERROR codes.hs (line 37): Unresolved top-level overloading ***

RE: Dependent Types

2002-05-13 Thread Simon Marlow
I think you're running into a well-known(*) problem with Hugs's implementation of the monomorphism restriction. (*) actually I thought this was a well-known problem, but it doesn't seem to be mentioned in the Hugs documentation as far as I can see. Here's a bit of background I managed to

State monads don't respect the monad laws in Haskell

2002-05-14 Thread Simon Marlow
An interesting revelation just occurred to Simon P.J. and myself while wondering about issues to do with exceptions in the IO monad (see discussion on [EMAIL PROTECTED] if you're interested). The question we were considering was whether the following should hold in the IO monad: (return

RE: Negative literals and the meaning of case -2 of -2 - True

2002-05-17 Thread Simon Marlow
To find out how Haskell implementations treat negated literals, I tested the following program: main = print (minusTwo,trueOrFalse) minusTwo = -2::N trueOrFalse = case minusTwo of -2 - True _ - False data N =

ANNOUNCE: Haddock version 0.3

2002-06-03 Thread Simon Marlow
I'm pleased to announce version 0.3 of Haddock, a documentation generation tool for Haskell source code. It's available from http://www.haskell.org/haddock/ The changes relative to version 0.2 are listed here: http://www.haskell.org/haddock/CHANGES.txt Cheers, Simon

RE: [ADMINISTRIVIA]: Change list submission policy please?

2002-06-28 Thread Simon Marlow
Ralf Hinze [EMAIL PROTECTED] writes: The haskell mailing list is getting an increasing amount of spam, viruses, and virus warnings. Would it be possible to change the list policy to only allow submissions from subscribed members? Please? I'd like to second this. The amount of

ANNOUNCE: GHC version 5.04 released

2002-07-11 Thread Simon Marlow
The (Interactive) Glasgow Haskell Compiler -- version 5.04 We are pleased to announce a new major release of the Glasgow Haskell Compiler (GHC), version 5.04.

ANNOUNCE: Haddock version 0.4

2002-07-23 Thread Simon Marlow
I'm pleased to announce version 0.4 of Haddock, a documentation generation tool for Haskell source code. It's available from http://www.haskell.org/haddock/ The changes relative to version 0.3 are listed here: http://www.haskell.org/haddock/CHANGES.txt Cheers, Simon

RE: unsafePerformIO around FFI calls

2002-07-23 Thread Simon Marlow
If this is true, then is it equivalently safe to wrap the following Haskell action in unsafePerformIO: myFunc i = do arr - newArray (0,255) 0 mapM_ (\j - writeArray arr j (i+j)) [0..255] foo - newIORef 0 mapM_ (\j - readArray arr j = modifyIORef foo (+j))

RE: Text in Haskell: a second proposal

2002-08-09 Thread Simon Marlow
Here's my take on the Unicode issue. Summary: unless there's a very good reason, I don't think we should decouple encoding/decoding from I/O, at least for the standard I/O library. Firstly, types. We already have all the necessary types: - Char, a Unicode code point - Word8, an octet -

RE: Yet more text pedantry

2002-08-13 Thread Simon Marlow
Can't we make a mailing list for these issues? [EMAIL PROTECTED] is my proposal, who can create such a list? I'll set up the list. Anyone wish to volunteer to moderate it? Simon ___ Haskell mailing list [EMAIL PROTECTED]

RE: Yet more text pedantry

2002-08-13 Thread Simon Marlow
tis 2002-08-13 klockan 11.57 skrev Simon Marlow: Can't we make a mailing list for these issues? [EMAIL PROTECTED] is my proposal, who can create such a list? I'll set up the list. Anyone wish to volunteer to moderate it? Does it have to be moderated? This will make things

RE: difference between (evaluate . runST) and stToIO

2002-08-13 Thread Simon Marlow
I can't seem to figure out what the difference is between using evaluate (runST action) and stToIO action when in the IO monad and running something in ST...they seem to behave identically...are they? If they are, why do they have different type signatures (one is ST

New mailing list: haskell-i18n (was: RE: Yet more text pedantry)

2002-08-14 Thread Simon Marlow
tis 2002-08-13 klockan 11.57 skrev Simon Marlow: Can't we make a mailing list for these issues? [EMAIL PROTECTED] is my proposal, who can create such a list? I'll set up the list. Anyone wish to volunteer to moderate it? Does it have to be moderated? This will make

RE: listen/bind socket problem in GHC 5.04

2002-08-20 Thread Simon Marlow
I understand that GHC 5.04 has reoganized the network modules, but somehow my code broke over GHC 5.04... prepareSocket addr port = do s - socket AF_INET Stream 6 setSocketOption s ReuseAddr 1 let port' = PortNum port addr' - case addr of Just str - inet_addr

RE: Spam

2002-08-30 Thread Simon Marlow
Sorry to bother you with a message about spam. I have noticed two things about this mailing list: * Every once in a while, we get messages like your e-mail is under consideration for sending to the list. This suggests that the mailing list is moderated, and that there is some

ANNOUNCE: GHC version 5.04.1 released

2002-09-13 Thread Simon Marlow
== The (Interactive) Glasgow Haskell Compiler -- version 5.04.1 == We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC), version

RE: Q: Forcing repeated evaluation

2002-09-18 Thread Simon Marlow
From: D. Tweed [mailto:[EMAIL PROTECTED]] Note that (assuming that I'm not missing something) you can prevent the moving of expressions involving l in a very ugly way by noting that these `dummy argument functions' are polymorphic so that you could write x1 = f1 (l 1) x2 = f2 x1 (l

RE: Behaviour of div mod with negative arguments?

2002-09-25 Thread Simon Marlow
Does Haskell specify how div and mod should behave when given one or both arguments negative? Eg, in hugs we get: div 13 = 0 div (-1) 3 = -1 div 1 (-3) = -1 div (-1) (-3) = 0 and so on. We usually describe div as the version of division that truncates towards negative

RE: Bug? 'Storable' and 'with'

2002-10-14 Thread Simon Marlow
I am using ghc-5.04 and a code like: with c ( \c' - hPutBuf h c' (sizeOf c)) fails with Fail: Prelude.undefined when c is a user defined type, such as a pair: instance (Storable at,Storable bt) = Storable (at,bt) where sizeOf (a,b) = sizeOf a + sizeOf b

RE: Using Bison as Haskell parser generator

2002-10-17 Thread Simon Marlow
(I am currently not on this list, so replies, please cc me.) The later versions of the GNU parser generator Bison, like ftp://ftp.gnu.org/gnu/bison/bison-1.75.tar.gz (959 KB) ftp://ftp.gnu.org/gnu/bison/bison-1.75.tar.bz2 (759 KB) use the macro processing program M4 to

RE: Best recursion choice for penultimax

2002-11-25 Thread Simon Marlow
Some quick tests with Hugs +s on a example list that I constructed with 576 elements give food for thought: reductions cells my one liner 403511483 tournament705312288 your penultimax 1671520180 your

ANNOUNCE: GHC version 5.04.2 released

2002-12-04 Thread Simon Marlow
== The (Interactive) Glasgow Haskell Compiler -- version 5.04.2 == We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC), version

RE: ANNOUNCE: GHC version 5.04.2 released

2002-12-04 Thread Simon Marlow
== The (Interactive) Glasgow Haskell Compiler -- version 5.04.2 == We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC),

RE: stupid strictness question

2002-12-05 Thread Simon Marlow
Now, we define: data SMaybe a = SNothing | SJust !a deriving Show Now, we run: *Strict Just (undefined::Int) Just *** Exception: Prelude.undefined *Strict Just $! (undefined::Int) *** Exception: Prelude.undefined *Strict SJust $! (undefined::Int) *** Exception: Prelude.undefined

RE: Running out of memory in a simple monad

2002-12-17 Thread Simon Marlow
Alastair Reid writes: The workaround is simple enough: add a dummy argument to the CAF (so that it is not a CAF any more): main _ = loop 5 and then specify the extra argument when invoking it: main () (This is a pretty standard optimisation technique: we're trading time

RE: Running out of memory in a simple monad

2002-12-18 Thread Simon Marlow
Simon Marlow [EMAIL PROTECTED] writes: Also, GHCi retains CAFs in the same way as Hugs, the difference is that GHCi can be configured to throw away the results after evaluation (:set +r). If I set this flag, does GHCi discard CAFs during evaluation or at the end of evaluation

RE: IO confusion

2002-12-18 Thread Simon Marlow
With Foo in the file c.out and the module \begin{code} module Main (main) where import IO (openFile, hGetContents, hClose, IOMode(ReadMode)) import System (getArgs) import Monad (when) main :: IO () main = do [x] - getArgs let you_want_it_to_work = read x cout -

RE: Urgent Help: URI parser

2002-12-19 Thread Simon Marlow
I wonder what happens to the port when URI parses http URL string. Is it possible to check for : and use the stated port instead of port 80? Anyone has experience doing it before? Thanks in advance. Cheers, Gek The Network.URI library will extract the host:port: authority (fromJust

RE: Interpret haskell within haskell.

2002-12-20 Thread Simon Marlow
I was wondering if there is any project that aims to interpret haskell within haskell. Is it feasable that a program can import a user's .hs file that has something like: greeting :: String greeting = Something port :: Int port = 32 + 33 And the program can parse and execute the

RE: Evaluation Question

2003-01-13 Thread Simon Marlow
For each call, I believe. An exception might be if the call to nco is inlined into the calling function, but this is unlikely as nco is recursive. So, you're probably better off with: nco wn = nco' where wn' = cis wn nco' = 1 : map (wn'*) nco' In which case it will

RE: time since the epoch

2003-02-11 Thread Simon Marlow
[snip] It is always a problem to lump things with different semantics into the same type :-) What I'm arguing is that there should be only one fixed-duration offset datatype and it should be in terms of (seconds, picoseconds). Other fixed durations can be easily defined in terms of this

RE: Yet another weakly defined bug report

2003-02-13 Thread Simon Marlow
The following code runs out of file handles, so I am seeking enlightenment as to why. -- | add data from a file to the histogram addFile :: FiniteMap String Int - String - IO (FiniteMap String Int) addFile fm name = do x - readFile name return (addHist

RE: Yet another weakly defined bug report

2003-02-14 Thread Simon Marlow
What is the limit on open files, and why? I think it'd be nice to just schedule a huge amount of IO operations, and have them all be performed when required (i.e. when the FM is first accessed). Apparently, my addDir took the trouble to open the files, but not generate the FMs -- any idea

RE: Yet another weakly defined bug report

2003-02-17 Thread Simon Marlow
You should do the counting strictly: Just n - case n+1 of n1 - addToFM f w n1 Careful - that case expression doesn't actually force n to be evaluated. It's exactly equivalent to let n1 = n+1 in addToFM f w n1 You need to use seq to force evaluation. Cheers,

RE: Happy Alex

2003-02-28 Thread Simon Marlow
I have successfully used the the excellent haskell tools Happy and Alex in a couple of parsing projects, but I have failed when trying to combine a monadic Happy grammar (using the %monad and %lexer directives) together with an Alex generated okenizer, nor are there any such

RE: HTTP protocol libraries

2003-03-05 Thread Simon Marlow
From: Bayley, Alistair [mailto:[EMAIL PROTECTED] On a related note, what happened to the source code for the Haskell Web Server? http://research.microsoft.com/~simonmar/hws.tar.gz Is it no longer suitable for public consumption? (I have a copy at home somewhere, though). It's in

RE: URI handling code in Haskell available

2003-03-06 Thread Simon Marlow
Oops. I didn't find that. Thanks for the pointer. (Thinks: does it work with HUGS?) It works with the latest hugs, November 2002 (use hugs +N to get the hierarchical libraries). A significant amount of my work went into the test cases and matching the parsing code against the

RE: Persistant (as in on disk) data

2003-03-06 Thread Simon Marlow
a recent post reminded me of a feature i'd like. for all i know it is already implemenetd in GHC so pointers are welcome. i'd like to be able to dump data structures to disk, and later load them. A Binary library was discussed recently on the libraries list. The thread starts here:

ANNOUNCE: GHC vesrion 5.04.3 released

2003-03-11 Thread Simon Marlow
== The (Interactive) Glasgow Haskell Compiler -- version 5.04.3 == We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC), version

RE: Problem with hierarchical libraries.

2003-03-12 Thread Simon Marlow
IIRC, something very similar was suggested a while back on the libraries list, except that the form beginning with a dot was the relative module name (actually I think I prefer it that way). this seems exactly the opposite of what all file systems do. i know lateral thinking is

RE: flock and sockets

2003-03-19 Thread Simon Marlow
I am planning a Haskell project and I need to access files. Since the program will be automatically started whenever a mail comes in I will need to be able to lock the access to files. Is there any support for this in some library? Yes, the Posix library distributed with GHC has support

RE: Web server code in Haskell by Simon Marlow?

2003-03-20 Thread Simon Marlow
I am very interested in writing server programs in haskell. There is a link to a paper and code of haskell web server in the following page. http://www.haskell.org/practice.html I can see the case study paper, but there is no code at the link location. I think inspecting through code

RE: Performance Timing

2003-03-27 Thread Simon Marlow
timer f a = do t1 - get current time evaluate (f a) t2 - get current time return (different in t2 and t1) where evaluate is from Control.Exception. could someone tell me how evaluate compares to seq and deepSeq? The documentation explains the difference, but it's a bit cryptic.

RE: Two minor reports concerning GHC

2003-05-30 Thread Simon Marlow
(1) unhelpful error message from GHCi: [[ Compiling ParsecPrim ( F:\Haskell\Lib/ParsecPrim.hs, interpreted ) WARNING: ignoring polymorphic case in interpreted mode. Possibly due to strict polymorphic/functional constructor args. Your program may leak space unexpectedly.

RE: ANNOUNCE: GHC version 6.0

2003-05-30 Thread Simon Marlow
Congratulations on the new release. But out of curiosity, I've got to ask... Why is the test suite now driven by a python script? Is this a niche where a 'scripting' language was deemed more suitable than haskell? The test driver makes use of 'eval'-style scripting,

RE: Typesafe MRef with a regular monad

2003-06-09 Thread Simon Marlow
Simon P.J. writes: ... So it's reasonable that there should be some language extension. I'm just looking for the minimal such extension. unsafeCoerce# is quite a minimal extension :-) Cheers, Simon ___ Haskell mailing list [EMAIL

RE: Problems with working with Handles (PS)

2003-06-13 Thread Simon Marlow
(moderator, can you please include this mail at the bottom of my previous mail?) PS: I think the next example shows pretty well what goes wrong when you're not closing the read-handle: --- test = do writeFile' 123.txt blaat appendFile' 123.txt 1 z - readFile'

ANNOUNCE: GHC version 6.0

2003-05-30 Thread Simon Marlow
The (Interactive) Glasgow Haskell Compiler -- version 6.0 We are pleased to announce a new major release of the Glasgow Haskell Compiler (GHC), version 6.0. As

RE: Proposal for a new I/O library design

2003-07-28 Thread Simon Marlow
[ replies to [EMAIL PROTECTED] ] On the whole, I think this is a good direction to explore. I like the separation of Files from Streams: indeed it would remove much of the complication in the existing system caused by having Handles which can be both read and written. Also, it gives a nice way

ANNOUNCE: Haddock version 0.5

2003-07-28 Thread Simon Marlow
Haddock version 0.5 is released. Get it from here: http://www.haskell.org/haddock Not a great deal has changed from version 0.4, but you need the new version if you want to build it using recent versions of GHC. Also, several bugs have been fixed. This is the version of Haddock that we are

RE: exceptions

2003-07-30 Thread Simon Marlow
just out of curiosity, which is the proper idiom? trace a = r - catch a (\e - putStr exceptional\n throw e) trace a = r - catch a (\e - putStr exceptional\n ioError e) I am worried that one might subtly change the semantics of an execption depending on how it was originally

ANNOUNCE: GHC version 6.0.1

2003-07-30 Thread Simon Marlow
= The (Interactive) Glasgow Haskell Compiler -- version 6.0.1 = We are pleased to announce a new patchlevel release of the Glasgow Haskell Compiler (GHC), version

RE: literate scripts.

2003-08-14 Thread Simon Marlow
Ghc should not accept this code, because, no matter how the unliterating is achieved, it is illegal for a literal string to contain a literal newline character. Known bug in GHC. In the testsuite, but unfortunately not documented. Cheers, Simon

ANNOUNCE: Alex version 2.0

2003-08-14 Thread Simon Marlow
, Simon Marlow: [EMAIL PROTECTED] Chris Dornan: [EMAIL PROTECTED] Isaac Jones: [EMAIL PROTECTED] ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
I'm finishing up my Haskell interface to WordNet (http://www.cogsci.princeton.edu/~wn/) and have a standard unsafePerformIO question :). Basically, the interface functions by first calling an initialization function, 'initializeWordNet :: IO WordNetEnv'. WordNetEnv is essentially just a

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
If the databases *do* change over time, then there are two possibilities: 1. the contents change due to external factors only 2. the contents change because this program doing the writing in (1), you can still pretend the interface is pure, by imagining that all the changes

RE: more unsafePerformIO questions (is it safe to use with ReadMode Handles)?

2003-08-19 Thread Simon Marlow
Isn't there the possibility of inlining causing a read to happen twice even if it only appears to happen once? In theory that would be a valid transformation, but in practice no compiler would duplicate arbitrary computations. GHC certainly doesn't. I was thinking of a situation

RE: more unsafePerformIO questions ([...])

2003-08-19 Thread Simon Marlow
On Tuesday, 2003-08-19, 13:18, Simon Marlow wrote: [...] Yes, I agree that one shouldn't rely on the no duplication of work property. However, folloing this argument we arrive at the conclusion that hGetContents is an invalid use of unsafePerformIO. (which is something I've

RE: Exhaustive Pattern-Matching

2003-08-27 Thread Simon Marlow
I have a question about pattern-matching. In the Haskell-report it is not postulated, that pattern matching has to be exhaustive. Would it be possible at all to implement an algorithm, which checks Haskell-style patterns for exhaustiveness? What kinds of complication can be expected?

RE: Haskell-report, chapter 3 - Expressions

2003-08-28 Thread Simon Marlow
I do not completely understand the first part of chapter 3 of the Haskell-report. Concretely I am stumbling about the notation of nonterminals indexed by their precedence level. This should be a number ranging from 0 to 9. But what about this exp^{10} production rule? The grammar is

RE: Haskell for non-Haskell's sake

2003-09-05 Thread Simon Marlow
I implemented a trivial database, stored in ordinary files, and had to ensure mutual exclusion of database access between simultaneously running CGI scripts. Since each CGI run is short, I simply locked the entire database for the entire run. Claiming a lock on a file is easy in C

RE: Syntax extensions (was: RE: The Future of Haskell discussion at the Haskell Workshop)

2003-09-11 Thread Simon Marlow
Mark Jones writes: As a solution to that problem, the many-command-line-options scheme described seems quite poor! It's far too tool specific, not particularly scalable, and somewhat troublesome from a software engineering perspective. We're not talking about a choice between two points

RE: lexer puzzle

2003-09-15 Thread Simon Marlow
Iavor Diatchki writes: what do people think should be the tokens produced by a haskell lexer when applied to the following input: A... This has been discussed before (a while back, admittedly). See: http://www.mail-archive.com/[EMAIL PROTECTED]/msg04054.html GHC (still) gets this

RE: lexer puzzle

2003-09-15 Thread Simon Marlow
I agree with Marcin, A... should be split into A.. and . As I read the (on-line) report the maximal munch rule says that you should read the longest lexeme. It does not say that two operators have to be separated by whitespace. Because A... is not a lexeme, the longest lexeme you

RE: Syntax extensions (was: RE: The Future of Haskell discussionat the Haskell Workshop)

2003-09-17 Thread Simon Marlow
{-# LANGUAGE specification #-} where specification is one or more (if compatible) of keywords like Haskell98 Pure Haskell 98, no extensions. SharedExtenisons (Haskell02???) A set of agreed-upon extensions

RE: echoing of getChar, getLine, getContents

2003-09-22 Thread Simon Marlow
The report states about getChar, getLine, and getContents: By default, these input functions echo to standard output. In version 1.3 of the report, it used to continue Functions in the I/O library provide full control over echoing. Apparently, this has been removed and the I/O

RE: Library Infrastructure Proposal Home Page

2003-09-26 Thread Simon Marlow
I think the proposal is great. Here's some random comments: It might be worth saying earlier on that the library infrastructure is expected to be a layer underneath the platform's native package support (if such support exists). For example, I've never used Python's Distutils, but I have a

RE: interact behaves oddly if used interactively

2003-10-01 Thread Simon Marlow
Malcolm Wallace writes: But the whole purpose of 'interact' is to use its argument as the demanding function which drives lazy consumption of the input. It is *designed* to reveal the evaluation behaviour, by hoisting it into the I/O monad. This is why interact is bad, IMO: it forces you to

RE: interact behaves oddly if used interactively

2003-10-01 Thread Simon Marlow
Pardon? Haskell is a non-strict language. Using 'interact' is one of numerous situations where one takes advantage of non-strict semantics. (Keith just gave a different example.) Non-strict semantics does not prescribe the evaluation order, although usually lazy evaluation is used. I

RE: IO behaves oddly if used nested

2003-10-03 Thread Simon Marlow
Alastair Reid writes: ... Thus, we have Show instances for - and IO ... Actually, you have to explicitly import Text.Show.Functions to get the Show instance for (-). Cheers, Simon ___ Haskell mailing list [EMAIL PROTECTED]

RE: About Haskell Thread Model

2003-10-21 Thread Simon Marlow
On Mon, Oct 13, 2003 at 11:13:56AM +0200, Wolfgang Thaller wrote: The reason why we currently do not take advantage of SMP is that the Haskell Heap is a shared data structure which is modified whenever a thunk (an unevaluated expression) is evaluated. Using synchronisation

<    1   2   3   4   5   6   7   8   9   10   >