Desugaring of top-level pattern bindings?

2000-06-29 Thread Tommy Thorn
I'm puzzled by the Haskell 98 report, as it doesn't seem to explain how to desugar top-level pattern declarations, such as (x,y) = e In Section 4.4.3 (Function and Pattern Bindings) under Pattern Bindings it essentially says ``A simple pattern binding has form p = e. The pattern p is matc

Pattern matching

2000-06-20 Thread Tommy Thorn
I've looked at the pattern matching semantics as defined in the Haskell 98 report and there is few things I don't understand. 1) In Figure 3 (Semantics of Case Expressions, Part 1) clause c reads: case v of { p | g1 -> e1 ; ... | gn -> en where { decls } _ -

Re: What happened to the GRIN project?

2000-06-19 Thread Tommy Thorn
Thanks John, that's what I want to hear. Now the obvious follow up questions: 1) are anyone pursuing this line of work, and 2) is the software available? Best wishes, Tommy John Hughes writes: > The results of the GRIN experiment are written up in Urban Boquist's > PhD thesis from l

What happened to the GRIN project?

2000-06-19 Thread Tommy Thorn
Long time ago I read The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages Urban Boquist Thomas Johnson I thought it sounded very promising, but nev

Desugarer for the happy Haskell parser?

2000-05-03 Thread Tommy Thorn
First let me thank the authors of the prototype Haskell parser (Simon Marlow, Sven.Panne, and Noel Winstanley). It's a beautiful piece of work. While writing a desugarer for this, it occurred to me that somebody might already have done the work and be willing to share it, if not I'll make it ava

Constrained instances?

2000-04-29 Thread Tommy Thorn
Isn't it possible to constrain instances? I tried the following where the idea is to implement a simple monad, but one which can only pass and return values that are showable. newtype Show a => TracingEv a = TE (Int -> IO (Int,a)) unTE :: Show a => TracingEv a -> Int -> IO (Int,a) unTE (T

Re: A hard core game programmers view

2000-01-27 Thread Tommy Thorn
"D. Tweed" wrote: > Another reason for the popularity of Perl is that it's _popular_ & > _ubiquitous_. Although I like Haskell and some other languages (e.g., > Mathematica, python, even C++) more than Perl, when I want to produce > something that I hope other people in my lab will use/contribute

Re: drop & take [was: fixing typos in Haskell-98]

2000-01-25 Thread Tommy Thorn
Chris Okasaki wrote: > For the people that share this sentiment, can you please > explain why ints that are too big should not similarly > give an error? I can see both being ok, or both being > errors. I just don't see why one should be ok and the > other an error. IMHO, both should be errors

drop & take [was: fixing typos in Haskell-98]

2000-01-24 Thread Tommy Thorn
S. Alexander Jacobson writes: > The correct definitions would be: > > take -2 -- drops the last 2 elements from the list > (takes everything except the last 2 elements) > drop -2 -- grabs the last 2 elements from the list > (drops everything except the last 2 eleme

Mixing fruits [Was: Clean and Haskell]

2000-01-13 Thread Tommy Thorn
I makes very little sense to compare GCC (C++) with GHC (Haskell) inspite of the sneaky names. 1) While no C++ expert, I'd conjecture that compiling C++ is roughly five times harder than C, due to C++ being a much larger language with _many many_ ugly corners. The difficulty in compiling Haskell

Re: Haskell HTTP lib?

1999-08-27 Thread Tommy Thorn
Sven Panne wrote/a ecrit/skrev: > William Lee Irwin III wrote: > > Personally, I'd like to see some equivalent of the C system call > > select(2) in GHC's socket library; [...] > > About a year ago this has been discussed, but the implementation has > somehow vanished from GHC's sources. Strange.

Stylistic question about Haskell optional arguments

1999-08-16 Thread Tommy Thorn
Andy Gill wrote/a ecrit/skrev: > I've got a stylistic question about Haskell. > What's the best way to add optional arguments to a > embedded DSL? > > For example, say I've got an library of HTML combinators. > To represent > > This is a Header > > you might write > > h1 (strin

A datatype for the text editor buffer?

1999-07-06 Thread Tommy Thorn
Peter Hancock wrote/a ecrit/skrev: > I don't think its crazy. I thought that one could start with > something simple, like a "before" list and an "after list". Indeed. When I was getting into Haskell, I hacked the ansi.hs example from the Hugs distribution to add editing. Parts of the function

Plea for Change #2: Tools

1999-03-29 Thread Tommy Thorn
I have another pet peeve: ease of use of tools. The Haskell standard (intentionally?) leaves the interface to tools an implementors question. Unfortunate, IMHO, every Haskell compiler I've tried (GHC, NHC, HBC) have just had plain horrible interfaces. Interpreters are inherently a different st

Plea for Change #1: Why, O why, `Main'?

1999-03-29 Thread Tommy Thorn
Jens' question gave my a perfect opportunity to open my a pet peeve of mine: the ditatorship of `Main'. In Haskell, the `main' function must reside in the `Main' module. Add to this that the `Main' module must reside in a `Main' file and you have an unfortunate consequence that you can only have

Main.main [Was: question to GHC 4.02]

1999-03-29 Thread Tommy Thorn
Dear Jens, the problem is quite simple, but alas, the error message leaves much to be disired: standalone Haskell program must contain a `main' function in the `Main' module (thus the missing Main_main_closure reference). Furthermore, this `main' function must have the type signature `IO ()' (or

GHC import chasing [Was: GHC/Hugs Status]

1998-07-20 Thread Tommy Thorn
Alastair Reid wrote/a ecrit/skrev: > > * import-chasing as part of the spec > > This is an environment feature not a language feature. > > What does it mean for GHC? > Are you wanting to do away with Makefiles? > Makefiles can do an awful lot more than import chasing can > and GNU makefiles are

Re: FW: Exceptions are too return values!

1998-06-10 Thread Tommy Thorn
Thats a wonderful idea. With that it will be so much easier to write robust code without bloating the code with error checks. I've always been annoyed that I couldn't trap arbitrary errors, say to close down the application cleanly. Now, we only need extendible data types, and then we have an (

Keep it up! [Re: Where is Haskore discussed?]

1998-05-06 Thread Tommy Thorn
Hi there, Just a my "deux centimes" to say that I'm happy with "application" oriented discussion on the Haskell list. In fact, I'd be happy to see more "applications" discussed, like CGI, Fran, Happy, ... /Tommy

Re: Phil's Pretty Printing Library

1998-03-28 Thread Tommy Thorn
> Incidentally, the above def of `sep' doesn't match Hughes' in an important > way. Consider: Aiee, I knew this was gonna backfire. No, my `sep' does not (and wasn't intended to) have exactly the same semantics as Hughes' `sep'. Also, please understand that Phil never proposed such a `sep'.

Phil's Pretty Printing Library

1998-03-27 Thread Tommy Thorn
nting Library Hacked somewhat to pieces by Tommy Thorn, 26/3-1998 Major changes: - <+> and $$ has nil (empty) as unit. - bline is a blind line that disappears when flattened > module WadlersPretty where > infixr 5 :<|> > infixr 6 :<> > infixr 6 <>, <+> &

FP Naming/Directory Service

1998-03-24 Thread Tommy Thorn
S. Alexander Jacobson wrote/a ecrit/skrev: > I just started playing with Haskell for CGI applications. > I would like to try writing a more serious CGI app, but > missing infrastructure makes it more difficult than conventional > approaches. On a general note, I too try employ Haskell for more an

the overloading of ==

1998-03-12 Thread Tommy Thorn
Victor M. Gulias wrote/a ecrit/skrev: > As a naive implementation of "all" and "any", one of my students coped with > these definitions: > > any' p xs = [x | x <- xs, p x] /= [] > all' p xs = [x | x <- xs, p x] == xs I used to be in favor of the monadic overloading of list operations, but

Re: Punning: Don't fix what ain't broken.

1998-02-12 Thread Tommy Thorn
Koen Claessen: > This brings us to another issue. Doesn't the following definition look > a bit awkward? > > R{ x = x } Definitely wierd. The left and right-hand side denotes two different things, which AFAIK is the only place where `=' behaves like this. Wouldn't `<-' have been a better cho

Punning: Don't fix what ain't broken.

1998-02-11 Thread Tommy Thorn
John Hughes wrote on the Std Haskell board: > `Punning' can be used in three places in Haskell. Suppose a record > type is defined by > > data R = R{x :: Int} > > Then > * R{x} constructs a record, and is equivalent to R{x=x} > * r{x} updates the x field of record r, and is equivalent

Evaluating Haskell

1997-08-27 Thread Tommy Thorn
David Wilczynski raises some very important and interesting questions about Haskell from a "Real World" point of view. I would very much like to see this kind of discussions, which I feel are essential if Haskell is ever to move out of the laboratories. Please do *not* move this discussion into

pattern guards and guarded patterns

1997-04-30 Thread Tommy Thorn
I can see the arguments for the pattern guard extension and the syntax seem reasonable. I also agree with Chris on the shortcomings of if-then-else. (I have disliked it in any language where I've seen it, and it "feels" un-Haskell-like to me.) On the other hand, the suggested case | ..

foldM vs. foldL and foldR

1997-02-02 Thread Tommy Thorn
Please, could anybody explain me what the rationale behind the current foldM in Monad? At least of the IO monad, it seems important to have a left associative fold instead of the right associative foldM. Adding to my confusion, it seems that earlier in time, there was indeed two monad fold's inst

Haskell 1.3?

1996-03-05 Thread Tommy Thorn
Quoting from "Introducing Haskell 1.3" (http://www.cs.yale.edu/ HTML/YALE/CS/haskell/haskell13.html): "The final version of the Haskell 1.3 is expected to be complete in January, 1996." Does anyone know what happens? Regards, Tommy -- "When privacy is outlawed, only outlaws will have priv