I'm more interested in the content, though. I was just trying here and there over the last week or so to learn some Haskell - people always seem to be raving about how cool it is. I found my way to the CIS 194 class link, the first one on the page, and I find that it really isn't very good for learning.
I went through the first page, trying to run some of the stuff. I find that the syntax of the ghci REPL seems to have almost nothing to do with the syntax shown so far. Apparently, I have to use let for every variable, which was never mentioned, and there are lots of funny tricks for how to use multi-line stuff. I still have no clue how to actually write something, compile it, and have some sort of output in the main ghc compiler. Is there a tutorial anywhere that actually helps you learn the language through doing useful things, instead of throwing a bunch of syntax that you can't do anything with at you?
Speaking of tutorials, the old page links to like 500 of them or so. I have no clue how to figure out which one to start with. If you're re-doing it, please link no more than 3 learning pages, no matter what. Have the rest in some buried page somewhere if you must, but keep the front page manageable. How is anybody supposed to make sense of however many tutorials and courses you guys have linked on the old one? I gotta figure I'm the prime audience for this stuff, but I have no idea where to start on your current page.
While I'm at it, can anybody recommend something like a step-by-step thing for people who are proficient in several other languages, but have never seen any Haskell before? Like where every little step has something you can actually type in, run somewhere, and get some sort of output?
You could try IHaskell[0] for playing around with Haskell. It is like GHCi, but provides a notebook interface where you can enter multiline expressions and do declarations, so it is a lot closer to real Haskell. (It can be a bit of a paint o install though.)
It sounds like you're looking for Learn You A Haskell. Great book, free too read online, tells you how to start with Haskell step by step. http://learnyouahaskell.com/chapters
I've been reading "Learn You a Haskell for Great Good" and it has been going much more smoothly than it has apparently been going for you. It addresses pretty much all of your complaints.
I suggest you enable the `+m` flag for multiline input
This way, you don't have to use the weird curly braces trick (which I always forget), at the cost of having to type one more enter when entering a oneliner
I've found that, when it comes to learning a new language from scratch, google and stackoverflow just aren't very helpful. Once you have the basics down, they're good for picking up extra bits and pieces, but at the beginning, when you have no idea where to even start, I find I need something a little more organized.
I too dislike tutorials focused around the REPL, because it's rarely how you write code in practice. The REPL is more of a debugging tool for quickly testing and manipulating code you've already written.
I'd jump directly into creating code files/modules - begin by creating simple programs using `main` as you would in other languages. Create a file with ".hs" extension, (Haskell filenames start with capital letters by convention, since they share the name of the module)
main :: IO ()
main = putStrLn "Hello World!"
Make sure the GHC bianries are in your PATH, and use the program "runhaskell File.hs" to quickly compile and execute them. Also, from ghci you can use the command (:load File.hs), if you want to debug stuff.
The preferred tool for writing Haskell though is emacs. If you're not familiar with emacs, its also a great opportunity to learn. Grab emacs 24, and open the file ~/.emacs, paste in this snippet:
Then hit M-x (M for Meta, which is typically Alt), and type eval-buffer into the minibuffer at the bottom.
If no errors, hit M-x and type into the mini-buffer:
package-install haskell-mode
You can add the following to the .emacs file and use `eval-buffer` again. Also save with C-x C-s.
Next step is to just open an empty haskell file. Create a new directory for your project with `M-x make-directory`, and create a new haskell file using C-x C-f. Add some code, and hit C-c C-l (load in ghci), and emacs will pop open a new window, launch ghci and load your code into it.
You can switch over to the ghci window with C-x o (cycle windows), and type some code into it for testing. (Note it can be quite buggy if the cursor is not in the right place - there needs to be a space after the prompt > ¦). Useful keyboard shortcuts to remember here are M-p (previous) and M-n to cycle through previously used commands. (You can rebind any keys to how you wish.)
You can also add typicall IDE features like "run without debugging" and such with simple snippets of elisp. Say if we want to bind F6 to this command, we can add this hack to .emacs, save and eval the expression.
Now with an active haskell file, F6 will launch like an application, bypassing GHCI - and emacs will typically open a new window (or replace an existing one) with the stdout/stderror for the application.
That'll get you started anyway. From there, using LYAH is a good beginner resource, although it won't get you much further than past the syntax and semantics of the core language. It doesn't cover the plethora of language extensions, building projects, using cabal, haddock, quickcheck and more. I'm not aware of a single resource which covers these though - I just learned what was needed as and when by searching - the best information typically comes from one-off blogs focused on a specific problem.
> I too dislike tutorials focused around the REPL, because it's rarely how you write code in practice....
> The preferred tool for writing Haskell though is emacs...
I understand, but if your goal is to pull in new Haskell programmers you want to grab them as quickly as possible. You want them to try something immediately, not force them to invest in a toolset from the get-go.
I wasn't interested in Haskell until I used the REPL. It allowed me to get immediate feedback on how Haskell works. The tutorial got me engaged quickly.
> The preferred tool for writing Haskell though is emacs.
That's news to me. Emacs is a popular editor for Haskell and in general, but I don't see any reason to say it's "preferred". Unlike, say, as it is with Agda or Coq. I use Sublime Text and Atom mostly (although occasionally emacs), and it's perfectly happy. Then again, all I really ask for from an editor is syntax highlighting, basic tab completion and sensible automatic indentation. But for those who want more, there's the SublimeHaskell plugin, although I've had mixed results with it.
Thanks for the help, though Vim is already my choice for insanely-powerful text editor with 2k+ page user manual :) I tried emacs, but the dependence on the control key for everything makes it kinda painful on every keyboard I have. I suppose I could probably remap a bunch of keys or something, but Vim seems to work much better in the default configuration. I know this tends to be a big flamewar subject, so it is what it is.
Anyways, your Hello World and runhaskell are much more along the lines of what I'm looking for. Also checking out the other people's suggested Learn you a Haskell.
> Also checking out the other people's suggested Learn you a Haskell.
Just to get the minority opinion out there, I found the style of Learn You a Haskell to be insufferable. Real World Haskell is available free online[1] and has a straightforward tone of voice.
This http://dev.stephendiehl.com/hask/ overview is a little bit more advanced. It gives a good overview over the tools, some of the ecosystem and important libraries.
I'm more interested in the content, though. I was just trying here and there over the last week or so to learn some Haskell - people always seem to be raving about how cool it is. I found my way to the CIS 194 class link, the first one on the page, and I find that it really isn't very good for learning.
I went through the first page, trying to run some of the stuff. I find that the syntax of the ghci REPL seems to have almost nothing to do with the syntax shown so far. Apparently, I have to use let for every variable, which was never mentioned, and there are lots of funny tricks for how to use multi-line stuff. I still have no clue how to actually write something, compile it, and have some sort of output in the main ghc compiler. Is there a tutorial anywhere that actually helps you learn the language through doing useful things, instead of throwing a bunch of syntax that you can't do anything with at you?
Speaking of tutorials, the old page links to like 500 of them or so. I have no clue how to figure out which one to start with. If you're re-doing it, please link no more than 3 learning pages, no matter what. Have the rest in some buried page somewhere if you must, but keep the front page manageable. How is anybody supposed to make sense of however many tutorials and courses you guys have linked on the old one? I gotta figure I'm the prime audience for this stuff, but I have no idea where to start on your current page.
While I'm at it, can anybody recommend something like a step-by-step thing for people who are proficient in several other languages, but have never seen any Haskell before? Like where every little step has something you can actually type in, run somewhere, and get some sort of output?