School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,022 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,176 people online right now. Registration is fast and FREE... Join Now!




Learning Haskell

 

Learning Haskell

curioComp

28 Oct, 2009 - 05:19 AM
Post #1

New D.I.C Head
*

Joined: 25 Oct, 2009
Posts: 5

I'm programming in Haskell for the first time. I'm using Visual Haskell Studio, and I got this error: parse error on input 'name'
CODE
main =
    do putStrLn "What is your name?"
    [u]name [/u] <- getLine
    putStrLn ("Hello, " ++ name ++ ". I think you will really like Haskell!")

What does it mean? In Haskell you don't have to define types, isn't it?
Does anyone know any good site where I can learn how to read/write to/from a file in Haskell?
Thank you!


User is offlineProfile CardPM
+Quote Post


Raynes

RE: Learning Haskell

28 Oct, 2009 - 11:31 AM
Post #2

Resident Witch. No, really.
Group Icon

Joined: 5 Jan, 2009
Posts: 957



Thanked: 14 times
Dream Kudos: 250
My Contributions
The problem is the indentation and such, as far as I can tell. I just modified the code in Emacs to use proper formatting.

CODE

main = do
  putStrLn "What is your name?"
  name <- getLine
  putStrLn ("Hello, " ++ name ++ ". I think you will really like Haskell!")


The Haskell plugin for VS is old and outdated and virtually worthless. I seriously recommend running through a quick Emacs or Vim tutorial and just slowly learning how to use one of these editors. Either that, or you could try Leksah. I hear people have good experiences with Leksah, though I myself can't get it to compile.

As for a site, haskell.org is a good start. There is a tutorials section with links to tutorials, books, etc. I personally recommend reading Real World Haskell in order to learn Hasekll. It's a very good book, and it's free to read online at http://book.realworldhaskell.org/read/

Good luck.

This post has been edited by Raynes: 28 Oct, 2009 - 12:37 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 08:09AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month