Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Andrew Coppin
Jonathan Cast wrote: On Fri, 2008-08-29 at 20:56 +0100, Andrew Coppin wrote: I've been playing with this today, and no matter what rules I come up with, it seems to be ridiculously easy to put the interpretter into an infinite loop from which it will never escape. Is there any way to know

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Ryan Ingram
On Sun, Aug 31, 2008 at 12:46 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Right. So if I have, say, the factorial function defined using the Y combinator, there's no way to stop the interpretter expanding an infinite number of copies of Y, even though in theory the factorial function should

Re: [Haskell-cafe] Calling Lockheed, Indra, Thales, Raytheon

2008-08-31 Thread Jason Dusek
You could dump the archives, grep out the names and then Google... -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Adrian Hey
Dan Doel wrote: Here's a first pass: -- snip -- {-# LANGUAGE Rank2Types, GeneralizedNewtypeDeriving #-} module Unique where import Control.Monad.Reader import Control.Monad.Trans import Control.Concurrent.MVar -- Give Uniques a phantom region parameter, so that you can't accidentally --

[Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sat, 30 Aug 2008, Ashley Yakeley wrote: OK. Let's call it top-level scope. Haskell naturally defines such a thing, regardless of processes and processors. Each top-level - would run at most once in top-level scope. If you had two Haskell runtimes call by C code, each would have its own

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sat, 30 Aug 2008, Adrian Hey wrote: Ganesh Sittampalam wrote: Well, yes, but if I implemented a library in standard Haskell it would always be safely serialisable/deserialisable (I think). So the global variables hack somehow destroys that property - how do I work out why it does in some

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: On Sat, 30 Aug 2008, Adrian Hey wrote: But then again, I'm sure that some that will be adamant that any way of making global variables is a hack. But they'll still be happy to go on using file IO, sockets etc regardless, blissfully unaware of

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what you mean here, but stdin, stdout and stderr are things provided by the OS to a process. That's what defines them as having process scope, not something the

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:29, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what you mean here, but stdin, stdout and stderr are things provided by the OS to a process. That's what

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:29, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what you mean here, but stdin, stdout and stderr are

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:34, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:29, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:20, Ganesh Sittampalam wrote: I'm not sure of precisely what

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Adrian Hey wrote: Thanks for taking the time to do this Dan. I think the safety requirement has been met, but I think it fails on the improved API. The main complaint would be what I see as loss of modularity, in that somehow what should be a small irrelevant detail of

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:34, Ganesh Sittampalam wrote: I don't follow what you mean. stdin, stdout and stderr are just file descriptors 0, 1 and 2, aren't they? You can create them as many times as you want with using that information

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 10:44, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:34, Ganesh Sittampalam wrote: I don't follow what you mean. stdin, stdout and stderr are just file descriptors 0, 1 and 2, aren't they? You can create them as many

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Adrian Hey
Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Adrian Hey wrote: Thanks for taking the time to do this Dan. I think the safety requirement has been met, but I think it fails on the improved API. The main complaint would be what I see as loss of modularity, in that somehow what should be a

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 10:44, Ganesh Sittampalam wrote: In that case it seems that any library that might be used from a runtime that isn't the top-level of a process should avoid doing IO

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle structures live in the latter case? The place you clearly think so little of that you need to ask: process-global (or process-local depending on how you think

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Adrian Hey wrote: Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Adrian Hey wrote: Thanks for taking the time to do this Dan. I think the safety requirement has been met, but I think it fails on the improved API. The main complaint would be what I see as loss of

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 12:01, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle structures live in the latter case? The place you clearly think so little of that you need to ask:

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Andrew Coppin
Ryan Ingram wrote: On Sun, Aug 31, 2008 at 12:46 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Right. So if I have, say, the factorial function defined using the Y combinator, there's no way to stop the interpretter expanding an infinite number of copies of Y, even though in theory the

Re: [Haskell-cafe] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 12:01, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle structures live in the latter case? The place you

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 17:29 +0100, Andrew Coppin wrote: Ryan Ingram wrote: On Sun, Aug 31, 2008 at 12:46 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Right. So if I have, say, the factorial function defined using the Y combinator, there's no way to stop the interpretter expanding an

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Ryan Ingram
On Sun, Aug 31, 2008 at 9:29 AM, Andrew Coppin [EMAIL PROTECTED] wrote: All of this strongly suggests that if you execute things in the correct order, you can arrange it so that expressions that have a normal form will be evaluated to it. But how to decide the correct evaluation order? For the

[Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Ryan Ingram
The point of having a strongly typed language is so the compiler can do more work for you. But right now I do a lot of typing (pun not intended) to appease the compiler. Let me give you an example: module Prob where import qualified Data.Map as M ... newtype Prob p a = Prob { runProb ::

Re: [Haskell-cafe] Re: [Haskell] Compiler Construction course using Haskell?

2008-08-31 Thread Johan Jeuring
Dear Johannes, Besides the IPT course, we also teach a course hat used to be called grammars and parsing. This course is taken before the compiler construction course. In this course we deal with parser combinators, datatypes, folds, first and follow, LL(1), and some more stuff, all in Haskell.

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Daniel Fischer
Am Sonntag, 31. August 2008 20:21 schrieb Ryan Ingram: The point of having a strongly typed language is so the compiler can do more work for you. But right now I do a lot of typing (pun not intended) to appease the compiler. Let me give you an example: module Prob where import qualified

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Johannes Waldmann
My proposal is to allow ad-hoc overloading of names; +1, although ... this could interact badly with the (still common?) practice of leaving out type declarations. (of course having allowed this in the first place is another language design error :-) when considering language changes

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Bulat Ziganshin
Hello Ryan, Sunday, August 31, 2008, 10:21:44 PM, you wrote: Cons: potentially exponential compile time? yes, and exponential programming complexity growth, going to brain explosion :) don't forget that OOP languages that supports ad-hoc overloading doesn't allow to infer types in both

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Andrew Coppin
Ryan Ingram wrote: What are you trying to get from the let binding? Sharing? Convinience. let x = foo in bar is so much easier to write than (\x - bar) foo when foo and/or bar is large. Trouble is, as soon as you allow let-bindings, some clever person is going to start writing

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 14:58, Daniel Fischer wrote: Am Sonntag, 31. August 2008 20:21 schrieb Ryan Ingram: Do you see it? All those M. just seem dirty to me, especially because the compiler should be able to deduce them from the types of the arguments. Another Con is that the compiler can catch

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Well, I was thinking that way when I was starting learning Haskell. But then I realized that this feature would make code much harder to read. Suppose you have different thing all named insertWith. You've got one somewhere in your program; how do YOU know when looking at the code after a

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Andrew Coppin
Ryan Ingram wrote: My proposal is to allow ad-hoc overloading of names; if a name is ambiguous in a scope, attempt to type-check the expression against each name. It is only an error if type-checking against all names fails. If type-checking succeeds for more than one then the expression is

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Gwern Branwen
On 2008.08.31 11:21:44 -0700, Ryan Ingram [EMAIL PROTECTED] scribbled 1.0K characters: The point of having a strongly typed language is so the compiler can do more work for you. But right now I do a lot of typing (pun not intended) to appease the compiler. Let me give you an example:

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Andrew Coppin
Gwern Branwen wrote: I think this would be very nice in GHCi, because there the situation is even *worse*. I think we've all experienced importing Data.Map or Data.ByteString and discovering we need to tediously write it out in *full*, because we can't even do qualified imports of it!

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-31 Thread Magnus Therning
On Wed, Aug 27, 2008 at 10:20 PM, David Bremner [EMAIL PROTECTED] wrote: Ketil Malde wrote: Another Debian question, once I've populated the debian/ directory one way or another, how should this be integrated with the rest of the project? Should it be part of the darcs archive, or a separate

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Erm... Why can't we? On 1 Sep 2008, at 00:43, Gwern Branwen wrote: I think we've all experienced importing Data.Map or Data.ByteString and discovering we need to tediously write it out in *full*, because we can't even do qualified imports of it! -- gwern BND fritz FKS 1071 Face

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Oh, sorry, haven't noticed you said ghcI. On 1 Sep 2008, at 00:59, Miguel Mitrofanov wrote: Erm... Why can't we? On 1 Sep 2008, at 00:43, Gwern Branwen wrote: I think we've all experienced importing Data.Map or Data.ByteString and discovering we need to tediously write it out in *full*,

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Gwern Branwen
On 2008.09.01 01:01:21 +0400, Miguel Mitrofanov [EMAIL PROTECTED] scribbled 0.5K characters: Oh, sorry, haven't noticed you said ghcI. On 1 Sep 2008, at 00:59, Miguel Mitrofanov wrote: Erm... Why can't we? The GHC API just doesn't support it. See the bug report filed on this issue:

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Stephan Friedrichs
Miguel Mitrofanov wrote: Suppose you have different thing all named insertWith. You've got one somewhere in your program; how do YOU know when looking at the code after a month or so, which one is this? We already have that situation when classes are involved. If you replace specialised

Re: [Haskell-cafe] Compiler's bane

2008-08-31 Thread Jeremy Apthorp
2008/9/1 Andrew Coppin [EMAIL PROTECTED]: Ryan Ingram wrote: What are you trying to get from the let binding? Sharing? Convinience. let x = foo in bar is so much easier to write than (\x - bar) foo when foo and/or bar is large. Trouble is, as soon as you allow let-bindings, some

[Haskell-cafe] Re: [Haskell] Top Level -

2008-08-31 Thread Ashley Yakeley
Ganesh Sittampalam wrote: On Sat, 30 Aug 2008, Ashley Yakeley wrote: OK. Let's call it top-level scope. Haskell naturally defines such a thing, regardless of processes and processors. Each top-level - would run at most once in top-level scope. If you had two Haskell runtimes call by C code,

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Claus Reinke
Well, I was thinking that way when I was starting learning Haskell. But then I realized that this feature would make code much harder to read. Suppose you have different thing all named insertWith. You've got one somewhere in your program; how do YOU know when looking at the code after a

Re: [Haskell-cafe] ANN: vxml (validating xml lib) - maybe usable now, quadratic compilation time ?

2008-08-31 Thread Marc Weber
Oleg has pointed me into the right direction: He has suggested to use kind of class AttrOk elTrype attr for attributes (result 35s - 30s) and do something similar with the state. (30s - 4,5s). After doing this I was quite happy: The 4,5s do include reading the dtd and generating about 1500

Re: [Haskell-cafe] Top Level -

2008-08-31 Thread Brandon S. Allbery KF8NH
On 2008 Aug 31, at 13:20, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 12:01, Ganesh Sittampalam wrote: On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 11:20, Ganesh Sittampalam wrote: Where do the filehandle

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Ryan Ingram
On Sun, Aug 31, 2008 at 2:10 PM, Claus Reinke [EMAIL PROTECTED] wrote: Indeed. Too much overloading can be a lot of trouble. You can do adhoc overloading already: {-# LANGUAGE FlexibleInstances #-} class Adhoc a where adhoc :: a instance Adhoc ((a-b)-([a]-[b])) where adhoc = map

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 16:08 -0700, Ryan Ingram wrote: In particular I do NOT want each function in its own typeclass; the previous post saying: foo x = map (bar x) should be rejected as ambiguous without a type signature somewhere What type signature do you propose? It seems as if you're

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Johannes Waldmann
As to the argument that a sufficiently smart IDE would insert the M. for me, I think that is flawed. First, there isn't a sufficiently smart IDE yet, I do believe there will be. What we do now is sort of putting down requirements ... and second, it'd be better for the type-aware IDE to

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread David House
2008/8/31 Ryan Ingram [EMAIL PROTECTED]: My proposal is to allow ad-hoc overloading of names; if a name is ambiguous in a scope, attempt to type-check the expression against each name. It is only an error if type-checking against all names fails. If type-checking succeeds for more than one

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Philippa Cowderoy
Oops, forgot to send to list. On Mon, 2008-09-01 at 01:27 +0100, Philippa Cowderoy wrote: On Mon, 2008-09-01 at 01:11 +0100, David House wrote: 2008/8/31 Ryan Ingram [EMAIL PROTECTED]: My proposal is to allow ad-hoc overloading of names; if a name is ambiguous in a scope, attempt to

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Ryan Ingram
On Sun, Aug 31, 2008 at 4:21 PM, Jonathan Cast [EMAIL PROTECTED] wrote: It seems as if you're proposing that doubleSet :: Set.Set Int - Set.Set Int doubleSet = map (*2) doubleList :: [Int] - [Int] doubleList :: map (*2) work, but that you not be allowed to notice that the definitions

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Ryan Ingram
On Sun, Aug 31, 2008 at 5:11 PM, David House [EMAIL PROTECTED] wrote: Here's an example of such a concern: you write the following: module Amb where import Data.Map foo = map What is the type of `foo'? Exactly the same as now: it has no type: amb.hs:4:6: Ambiguous occurrence `map'

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Marc Weber
On Sun, Aug 31, 2008 at 11:21:44AM -0700, Ryan Ingram wrote: [..] Any thoughts? -- ryan Nice problem, nice idea.. Maybe the time is better spend on IDEs than extending the (or all) compilers.. Right now I've something like this in my vim script files: function!

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Jonathan Cast
On Sun, 2008-08-31 at 19:06 -0700, Ryan Ingram wrote: On Sun, Aug 31, 2008 at 4:21 PM, Jonathan Cast [EMAIL PROTECTED] wrote: It seems as if you're proposing that doubleSet :: Set.Set Int - Set.Set Int doubleSet = map (*2) doubleList :: [Int] - [Int] doubleList :: map (*2)

Re: [Haskell-cafe] ANN: vxml (validating xml lib) - maybe usable now, quadratic compilation time ?

2008-08-31 Thread Marc Weber
There might still be some duplication.. in state transformation steps. I've removed duplicate state machine paths. Instead of approxmiately 1500 there are only 500 left. You can see the impact on speed here http://mawercer.de/~marc/vxml.svg data + (red): approx 1500 data3 * (blue): approx

Re: [Haskell-cafe] Top Level -

2008-08-31 Thread Ganesh Sittampalam
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote: On 2008 Aug 31, at 13:20, Ganesh Sittampalam wrote: I'm afraid I don't see how this generalises to sharing something across an entire process where the things that want to do the sharing are not in or controlled by the same shared