[Haskell-cafe] extreme newbie: hugs prompt vs load module

Robert Dockins robdockins at fastmail.fm
Wed Aug 23 12:09:53 EDT 2006


On Aug 23, 2006, at 10:16 AM, George Young wrote:

> [linux, ghci 6.4.3.20060820, hugs May 2006]
>
> I have just started learning Haskell.  I have hugs and ghci under
> linux, and I'm going through the Gentle Introduction to
> Haskell<http://www.haskell.org/tutorial>, so far through section 4,
> "case expressions and pattern matching".  I'm a python programmer,  
> with
> background in maclisp, scheme, T, C, C++, and a little J.
>
> I'm confused about what sort of things I can type at the interpreter
> prompt, and what things have to be loaded as a module.  I keep trying
> to treat the prompt like a lisp or python REPL, which is obviously
> wrong.  Can someone set me straight?

For the most part, the things you can enter at the GHCi or Hugs  
prompt are _expressions_.  This mostly* excludes _declarations_,  
which are things like function definitions, datatype declarations,  
class and instance declarations, etc.  Those things need to go into a  
source file.

(*) 'let' expressions will allow you to define local functions as  
part of an expression, however.  GHCi also has a slight variation of  
'let' that allows you to define functions for the session.


> Is there another tutorial that might be more appropriate for me?

The following tutorial is generally recognized as one of the better  
ones:

http://www.cs.utah.edu/~hal/htut/


> I am finding haskell quite appealing.  I hope to start writing real  
> (if
> small) applications to do some data analysis from our Postgres DB.   
> Any
> hints?

There are several haskell database layers.  I've had some luck with  
HDBC, which has a PostgreSQL driver.

http://quux.org:70/devel/hdbc


> --George Young
> -- 
> "Are the gods not just?"  "Oh no, child.
> What would become of us if they were?" (C.S. Lewis)



Rob Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
           -- TMBG





More information about the Haskell-Cafe mailing list