RE: Dynamic scopes in Haskell

1999-12-06 Thread Simon Marlow
> Is there any references to memoization techniques? I could not find > any reference to memoization facilities in the Haskell report and > library report. Neither in the Clean report. After looking at GHC, > Hugs98 and nhc98, I have found that GCH provides the memo function > used in the example.

Re: Dynamic scopes in Haskell

1999-12-03 Thread Koen Claessen
Michael Erik Florentin Nielsen wrote: | > let x :: N Int | > x = veryBigExpression | > | >in plus x x | > | > Then "veryBigExpression" depending on an "Env" gets computed twice if you | > finally provide the "Env". | | I do not see this as a problem. [...] | One could im

Re: Dynamic scopes in Haskell

1999-12-03 Thread Koen Claessen
José Romildo Malaquias <[EMAIL PROTECTED]> asked: | Is there any references to memoization techniques? : | So, is it straightforward to implement the memo function in | Haskell 98 or in Clean? In my case, the memo function was only needed for the type "Env": memo :: (Env -> a) -> (Env ->

Re: Dynamic scopes in Haskell

1999-12-03 Thread José Romildo Malaquias
Is there any references to memoization techniques? I could not find any reference to memoization facilities in the Haskell report and library report. Neither in the Clean report. After looking at GHC, Hugs98 and nhc98, I have found that GCH provides the memo function used in the example. Looking a

Re: Dynamic scopes in Haskell

1999-12-03 Thread Michael Erik Florentin Nielsen
Koen Claessen <[EMAIL PROTECTED]> wrote: > let x :: N Int > x = veryBigExpression > >in plus x x > > Then "veryBigExpression" depending on an "Env" gets computed twice if you > finally provide the "Env". I do not see this as a problem. In fact it forces you to think about the dif

Re: Dynamic scopes in Haskell

1999-12-02 Thread Koen Claessen
Michael Erik Florentin Nielsen <[EMAIL PROTECTED]> writes: | There are no problems in having infix operators with more than two | parameters, eg. the operators `plus` and `times` below both take a third | parameter: [...] The problem is that you lose sharing. If you define: newtype N a

Re: Dynamic scopes in Haskell

1999-12-02 Thread Peter Hancock
> "Jerzy" == Jerzy Karczmarczuk <[EMAIL PROTECTED]> writes: > PS. Caeterum censeo, categoria Num delendam esse puto!! It would add a very scholarly tone to things if suggestions for the Haskell wish list were accepted only in Latin. Or category theory. -- Peter

Re: Dynamic scopes in Haskell

1999-12-02 Thread Jerzy Karczmarczuk
José Romildo Malaquias: > M.E.F.N ==> > > In fact you would probably be better of by hiding the prelude > > and overloading + and friends on your own. > Is there any directions on how to hide the prelude and still use the > definitions it exports? > > Romildo. Selective import or selective hi

Re: Dynamic scopes in Haskell

1999-12-02 Thread José Romildo Malaquias
On Thu, Dec 02, 1999 at 11:11:12AM +0100, Michael Erik Florentin Nielsen wrote: > > > My problem: > > -- > > One of the algorithms I have to implement is the > > addition of symbolic expressions. It should have > > two symbolic expressions as arguments and should > > produce a symbolic ex

Re: Dynamic scopes in Haskell

1999-12-02 Thread Michael Erik Florentin Nielsen
> My problem: > -- > One of the algorithms I have to implement is the > addition of symbolic expressions. It should have > two symbolic expressions as arguments and should > produce a symbolic expression as the result. But > how the result is produced is depending on series > of flags tha

Re: Dynamic scopes in Haskell

1999-12-01 Thread José Romildo Malaquias
On Wed, Dec 01, 1999 at 01:33:01PM +0100, Ch. A. Herrmann wrote: > Hello, > > > operators with suitable associations defined). So > > my symbolic expression type should be an instance > > of the Num class so that the (+) operator can > > be overloaded for it. But, as the function has > > now thre

Re: Dynamic scopes in Haskell

1999-12-01 Thread José Romildo Malaquias
On Wed, Dec 01, 1999 at 08:59:09AM -0800, Jeffrey R. Lewis wrote: > "Ch. A. Herrmann" wrote: > > > I had just a fast look at the following I found at the > > page "http://www.cse.ogi.edu/PacSoft/projects/Hugs/hugsman/exts.html" > > for dynamic scoping: > > > >min :: [a] -> a > >min = lea

Re: Dynamic scopes in Haskell

1999-12-01 Thread Jeffrey R. Lewis
Simon Peyton-Jones wrote: > | - Does other Haskell implementations (ghc, nhc, hbc, ...) > | would provide this extension in next releases? (This way, > | even been an extension, my system would be portable) > > Jeff Lewis is well advanced with adding functional dependencies > into GHC; I beli

Re: Dynamic scopes in Haskell

1999-12-01 Thread José Romildo Malaquias
On Wed, Dec 01, 1999 at 02:05:04PM +, Jerzy Karczmarczuk wrote: > José Romildo Malaquias: > > > One of the algorithms I have to implement is the > > addition of symbolic expressions. It should have > > two symbolic expressions as arguments and should > > produce a symbolic expression as the r

Re: Dynamic scopes in Haskell

1999-12-01 Thread Jeffrey R. Lewis
"Ch. A. Herrmann" wrote: > I had just a fast look at the following I found at the > page "http://www.cse.ogi.edu/PacSoft/projects/Hugs/hugsman/exts.html" > for dynamic scoping: > >min :: [a] -> a >min = least with ?cmp = (<=) > > Actually, I'm not sure how referential transparency can be

Re: Dynamic scopes in Haskell

1999-12-01 Thread Ch. A. Herrmann
I had just a fast look at the following I found at the page "http://www.cse.ogi.edu/PacSoft/projects/Hugs/hugsman/exts.html" for dynamic scoping: min :: [a] -> a min = least with ?cmp = (<=) Actually, I'm not sure how referential transparency can be established with these implicit parame

Re: Dynamic scopes in Haskell

1999-12-01 Thread Ch. A. Herrmann
Hello, > operators with suitable associations defined). So > my symbolic expression type should be an instance > of the Num class so that the (+) operator can > be overloaded for it. But, as the function has > now three arguments, it cannot be a binary operator > anymore. maybe, an ad-hoc soluti

Re: Dynamic scopes in Haskell

1999-12-01 Thread Jerzy Karczmarczuk
José Romildo Malaquias: > One of the algorithms I have to implement is the > addition of symbolic expressions. It should have > two symbolic expressions as arguments and should > produce a symbolic expression as the result. But > how the result is produced is depending on series > of flags that c

RE: Dynamic scopes in Haskell

1999-12-01 Thread Simon Peyton-Jones
| - Does other Haskell implementations (ghc, nhc, hbc, ...) | would provide this extension in next releases? (This way, | even been an extension, my system would be portable) Jeff Lewis is well advanced with adding functional dependencies into GHC; I believe that he plans then to add dynamic