RE: [Haskell-cafe] First steps in Haskell

| Actually, I have sometimes wished that the various interactive Haskell | interfaces had the possibility to enter also declarations interactively GHCi does. ghci> let f x = "hello" ghci> f True True But there's no editor -- it's strictly a one-line definition Simon | -----Original Message----- | From: Bjorn Lisper [mailto:lisper@it.kth.se] | Sent: 19 December 2005 13:06 | To: Simon Peyton-Jones | Cc: wolfgang@jeltsch.net; haskell-cafe@haskell.org | Subject: Re: [Haskell-cafe] First steps in Haskell | | Simon P-J: | >Daniel is right, by definition. He is a new user. He had difficulty. | >That much is incontrovertible. | > | >While he may seem unusual, perhaps he is only unusual in that he's told | >us about his experience rather than trying Perl instead. For which, | >much thanks, Daniel! | | Actually, I have sometimes wished that the various interactive Haskell | interfaces had the possibility to enter also declarations interactively, as | Daniel originally asked for. Lisp interpreters often support this to some | extent, so it is not out of line for a newcomer to expect it also for | Haskell. I often use hugs as a calculator, and sometimes it would be very | convenient to be able to make one or a few short declarations while making | some interactive calculations. It can be quite tedious to create and edit a | source code file on the side and then load it, when all you want is a short | declaration or two. Would it be that complex to have an interactive | interface enter a "declarations mode" when it sees a declaration coming, and | then let it create, compile and load a temporary module when the declaration | is finished? | | Björn Lisper

Simon:
Me: | Actually, I have sometimes wished that the various interactive Haskell | interfaces had the possibility to enter also declarations interactively
GHCi does.
Ah, I see! Does it open a let-environment with a local definition?
ghci> let f x = "hello" ghci> f True True
Hmm, an interesting semantics for f given the declaration :-)
But there's no editor -- it's strictly a one-line definition
Which is useful enough in many situations. I'll try it out... Björn

On Mon, Dec 19, 2005 at 01:17:35PM -0000, Simon Peyton-Jones wrote:
| Actually, I have sometimes wished that the various interactive Haskell | interfaces had the possibility to enter also declarations interactively
GHCi does.
ghci> let f x = "hello" ghci> f True True
But there's no editor -- it's strictly a one-line definition
Consider this: Prelude> :def read readFile Prelude> :!cat input let f x = "hello" Prelude> :read input Prelude> f () "hello" If we had a program that would: - move top-level definitions to a "let" - convert layout to explicit { ; } then it would be quite simple to define (with :def) a command that would allow to enter some code in the editor and load it into ghci, even without clearing the older definitions (as :load does). However, no datatype/class/... declarations, etc. Unless we could allow them in "let"? These should be possible to do with haskell-src-ext, programmatica or GHC itself. Best regards Tomasz -- I am searching for a programmer who is good at least in some of [Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
participants (3)
-
Bjorn Lisper
-
Simon Peyton-Jones
-
Tomasz Zielonka