Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Ketil Malde
Chris Kuklewicz <[EMAIL PROTECTED]> writes: > Prelude> let { fac :: Integer -> Integer; fac 0 = 1; fac n | n > 0 = n * fac > (n-1) } As somebody made me aware just the other day, the bracer are only necessary for nested expressions. So you can just use ; for line breaks: Prelude> let fac :: I

Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Tomasz Zielonka
On Mon, Dec 19, 2005 at 01:17:35PM -, 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 the

Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Chris Kuklewicz
Daniel Carrera wrote: > Hello all, > > I'm trying to write the simplest possible Haskell program, and I'm not > getting anywhere. > > I have installed Hugs, GHC and GHCI. I want to run the following program: > > fac :: Integer -> Integer > fac 0 = 1 > fac n | n > 0 = n * fac (n-1) > $ ghci Pr

Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Daniel Carrera
Benjamin Franksen wrote: What I meant was that a certain mindset (that I, in principle, share and value) leads to a culture where the primary values somewhat differ from the mainstream, thereby sometimes creating hurdles for newcomers, particularly newcomers without a strong academic background

Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Benjamin Franksen
On Tuesday 20 December 2005 09:45, Simon Peyton-Jones wrote: > | (mild) culture shock here. It is typical for people in the Haskell > | community to view things in a rather principled way. A language > | tutorial is supposed to introduce /the language/. If you want to > | know how to compile or exe

Re: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Daniel Carrera
Simon Peyton-Jones wrote: I'm certain there are hurdles, but I think on the whole they are there by accident rather than design. Why certainly. I have never seen any on-line community that had hurdles by design. Hurdles are usually due to the fact that the people who design the website/commun

RE: [Haskell-cafe] First steps in Haskell

2005-12-20 Thread Simon Peyton-Jones
| (mild) culture shock here. It is typical for people in the Haskell | community to view things in a rather principled way. A language | tutorial is supposed to introduce /the language/. If you want to know | how to compile or execute a Haskell program, well then, look at the | appropriate tutorial

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Benjamin Franksen
On Monday 19 December 2005 12:13, Daniel Carrera wrote: > Wolfgang Jeltsch wrote: > >>* There's no way for a new user to figure out how to successfully > >> run the simplest Haskell program. > > > > There is! "The Hugs 98 User's Guide" and "The GHC User's Guide". > > Okay, I stand corrected. I rep

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Bjorn 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 i

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Montag, 19. Dezember 2005 12:13 schrieb Daniel Carrera: > [...] > I guess that Haskell is unique among interpreted languages Haskell is not an "interpreted language". There are Haskell interpreters, there are Haskell compilers. > in that there are two compilers and they work different. The

RE: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Simon Peyton-Jones
| -Original Message- | From: Bjorn Lisper [mailto:[EMAIL PROTECTED] | Sent: 19 December 2005 13:06 | To: Simon Peyton-Jones | Cc: [EMAIL PROTECTED]; haskell-cafe@haskell.org | Subject: Re: [Haskell-cafe] First steps in Haskell | | Simon P-J: | >Daniel is right, by definition. He is a

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Bjorn Lisper
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

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Daniel Carrera
Tomasz Zielonka wrote: I think what Wolfgang meant was that different Haskell implementations may have: - different executable names, so you have to invoke them differently - different options - different style of work etc... Of course, all of them should accept all Haskell 98 programs. Ah. Th

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Daniel Carrera
Wolfgang Jeltsch wrote: The point is that the visitor should know that he/she might need a document about GHCi if he/she wants to use GHCi. A introductionary document about Haskell might not explain a specific Haskell system. If you read a book which is about C++ in general, it won't tell you

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Tomasz Zielonka
On Mon, Dec 19, 2005 at 10:14:07AM +, Daniel Carrera wrote: > Wolfgang Jeltsch wrote: > >If you want to know how to feed, for example, Hugs with your Haskell > >program, you might have to have a look at some Hugs documentation. > >Remember that different Haskell implementations like Hugs, GH

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 18:02 schrieb Daniel Carrera: > Chris Kuklewicz wrote: > > Almost everything is explained under > > > > http://www.haskell.org/ghc/docs/6.4.1/html/users_guide/ghci.html > > Ok. How would a visitor to the Haskell site find this document? The point is that the visitor s

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Daniel Carrera
Wolfgang Jeltsch wrote: The problem is that the content of that page, and its links, didn't show me how to write a Haskell program (like you did). If you want to know how to feed, for example, Hugs with your Haskell program, you might have to have a look at some Hugs documentation. Remember t

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Daniel Carrera
Wolfgang Jeltsch wrote: In addition, Haskells requirement of a main variable is nothing new. Certainly nothing new. I just wish that the documentation I read had told me about it. `ghci fac.hs` doesn't give any errors. I don't understand why loading the file like that is ok but typing the e

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 18:04 schrieb Daniel Carrera: > Joel Koerwer wrote: > > Then after you've played with you creation a bit, check out > > http://haskell.org/learning.html > > Thank you. I did find that page, and it was very easy to find. There's a lin

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Daniel Carrera
Wolfgang Jeltsch wrote: honestly, I have to say that during my years with Haskell, this seems to be the first time that I see somebody trying to enter a Haskell program via the command line of an interactive environment. Well, I tried all three (Hugs, GHCI, GHC). The problem is that the tutor

RE: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Simon Peyton-Jones
L PROTECTED] On Behalf Of | Wolfgang Jeltsch | Sent: 19 December 2005 09:50 | To: haskell-cafe@haskell.org | Subject: Re: [Haskell-cafe] First steps in Haskell | | Am Sonntag, 18. Dezember 2005 17:25 schrieb Daniel Carrera: | > [...] | | > This is a real problem for Haskell. I expect that a lo

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 17:42 schrieb Daniel Carrera: > Lemmih wrote: > > GHC is a compiler. If you want to compile to a binary then you must > > define a function called 'main'. Otherwise just load the file in ghci > > (`ghci fac.hs`). > > I would expect GHC to be able to compile a program w

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 17:25 schrieb Daniel Carrera: > [...] > This is a real problem for Haskell. I expect that a lot of people try > Haskell and give up because they can't even write the simplest function. Hello Daniel, honestly, I have to say that during my years with Haskell, this see

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Cale Gibbard
On 18/12/05, Daniel Carrera <[EMAIL PROTECTED]> wrote: > Chris Kuklewicz wrote: > > Almost everything is explained under > > > > http://www.haskell.org/ghc/docs/6.4.1/html/users_guide/ghci.html > > Ok. How would a visitor to the Haskell site find this document? If this > is the correct document for

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Cale Gibbard
The ordinary usage pattern, which I recall is actually described in a number of the tutorials, and on the wiki, probably in a number of places, is to write your program text into a file with an editor, and then load it at a terminal with either ghci fac.hs or hugs fac.hs. (See http://www.haskell.or

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Sebastian Sylvan
On 12/18/05, Daniel Carrera <[EMAIL PROTECTED]> wrote: > Lemmih wrote: > > GHC is a compiler. If you want to compile to a binary then you must > > define a function called 'main'. Otherwise just load the file in ghci > > (`ghci fac.hs`). > > I would expect GHC to be able to compile a program with a

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Daniel Carrera
Joel Koerwer wrote: Then after you've played with you creation a bit, check out http://haskell.org/learning.html Thank you. I did find that page, and it was very easy to find. The problem is that the content of that page, and its links, didn't show me how to

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Daniel Carrera
Chris Kuklewicz wrote: Almost everything is explained under http://www.haskell.org/ghc/docs/6.4.1/html/users_guide/ghci.html Ok. How would a visitor to the Haskell site find this document? If this is the correct document for a beginner to start with Haskell, perhaps the site should be update

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Daniel Carrera
Lemmih wrote: GHC is a compiler. If you want to compile to a binary then you must define a function called 'main'. Otherwise just load the file in ghci (`ghci fac.hs`). I would expect GHC to be able to compile a program with a function that is not called 'main'. I wouldn't expect it to print a

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Chris Kuklewicz
Daniel Carrera wrote: >> Hello all, >> >> I'm trying to write the simplest possible Haskell program, and I'm not >> getting anywhere. >> >> I have installed Hugs, GHC and GHCI. I want to run the following program: >> >> fac :: Integer -> Integer >> fac 0 = 1 >> fac n | n > 0 = n * fac (n-1) >> $

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Joel Koerwer
Try ghci fac.hs. You will then have an interactive session with access to the definitions in your file.Then after you've played with you creation a bit, check out http://haskell.org/learning.html Welcome and enjoy!Joel ___ Haskell-Cafe mailing list Haskel

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Lemmih
On 12/18/05, Daniel Carrera <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm trying to write the simplest possible Haskell program, and I'm not > getting anywhere. > > I have installed Hugs, GHC and GHCI. I want to run the following program: > > fac :: Integer -> Integer > fac 0 = 1 > fac n | n > 0

[Haskell-cafe] First steps in Haskell

2005-12-18 Thread Daniel Carrera
Hello all, I'm trying to write the simplest possible Haskell program, and I'm not getting anywhere. I have installed Hugs, GHC and GHCI. I want to run the following program: fac :: Integer -> Integer fac 0 = 1 fac n | n > 0 = n * fac (n-1) This is what I see: $ hugs Hugs.Base> fac :: Intege