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 recursiv

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 yo

Re: Inferring from context declarations

2001-02-22 Thread Marcin 'Qrczak' Kowalczyk
Wed, 21 Feb 2001 16:46:48 +0100, George Russell <[EMAIL PROTECTED]> pisze: > Various (MLj, MLton) > ML compilers already inline out all polymorphism. Some C++ compilers/linkers > do it in a rather crude way as well, for templates. If you can do it, > you can forget about dictiona

Re: Inferring from context declarations

2001-02-21 Thread Thomas Johnsson
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 this. In Haskell it is

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 dec

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 dynamica

Re: Inferring from context declarations

2001-02-21 Thread Andreas Rossberg
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 during the Haskell 98 standa

Re: Inferring from context declarations

2001-02-21 Thread Andreas Rossberg
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

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 | modu

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 pol