Re: Inferring from context declarations

2001-02-22 Thread Lennart Augustsson
Thomas Johnsson wrote: Lennart Augustsson writes: Simon Peyton Jones' comments about dictionary passing are a red herring, since they assume a particular form of compiler. Various (MLj, MLton) ML compilers already inline out all polymorphism. ML is a language where you can do

Re: Inferring from context declarations

2001-02-22 Thread Andreas Rossberg
Lennart Augustsson wrote: Incidentally, this has nothing to do with allowing polymorphic recursion on functions in Haskell. It could be done earlier too, but then it had to be encoded using a class and instance declaration. I would argue that methods are in fact polymorphically recursive

Re: Inferring from context declarations

2001-02-21 Thread Lennart Augustsson
Simon Peyton Jones' comments about dictionary passing are a red herring, since they assume a particular form of compiler. Various (MLj, MLton) ML compilers already inline out all polymorphism. ML is a language where you can do this. In Haskell it is not always possible to eliminate all

RE: Inferring from context declarations

2001-02-21 Thread Mark P Jones
| [One way to compile polymorphic code is to inline all uses of | polymorphic values...] | | It would require to keep bodies of all polymorphic functions in | a form allowing instantiation in different modules. For example | ghc already requires too much memory (even a hundred MB for large |

Re: Inferring from context declarations

2001-02-21 Thread George Russell
Andreas Rossberg wrote: George Russell wrote: I'm sorry if this is a FAQ, but I'm curious to know why Haskell (or at least, GHC and Hugs) doesn't seem able to use contexts on variables at the front of data declarations. There has been some discussion on contexts on data declarations

Re: Inferring from context declarations

2001-02-21 Thread George Russell
Andreas Rossberg wrote: [snip] Such monomorphisation is not possible for Haskell in general, because it allows polymorphic recursion. As a consequence, the number of dictionaries constructed for a given program also is potentially infinite. [snip] Yes OK, that's another case, like

Re: Inferring from context declarations

2001-02-21 Thread D. Tweed
George Russell wrote: (3) Simon Peyton Jones' comments about dictionary passing are a red herring, since they assume a particular form of compiler. Various (MLj, MLton) ML compilers already inline out all polymorphism. Some C++ compilers/linkers do it in a rather crude way as