How can I find Haskell commands and keywords?

I teach myself Haskell, but one problem I have with haskell is that it is very difficult to find the definitions of keywords, syntax, and Haskell commands. I went through some Haskell tutorials, and this dispelled many of them for me, and in general, using the ": t" command in ghci is useful for viewing function types.

But in general, how should I know what they are doing: (.), (→ =), (= <<) ,! or \\

I know what they are doing now, but in the future, if I come across some symbol that I have never seen before, how should I know what it is doing or how to use it? It seems that these things do not work!

Right now, I'm trying to figure out what the 'it' command should do in ghci. Again, I cannot find this on Google, and all I know how to do is get type information via ": t it" in ghci. This is very unpleasant for someone new to the language ...

+4
source share
2 answers

You can get mileage using Google:

or by searching for the source code for Prelude:

These resources will help with function names and operators, but not necessarily with training syntax. To find out the syntax, you will need other resources or a book. Fortunately, most “syntaxes” at face value are actually a function defined in Prelude.

+8
source

For GHCi commands, type :help in GHCi. This will give you a list of all available commands. Some of them are likely to be useful, such as debugging.

I do not know where it documented. In GHCi, it is just a variable associated with the result of the last expression you evaluate. For instance:.

 λ>1 + 2 * 3 7 λ>it 7 λ>:t it it :: Integer λ>"foo" "foo" λ>it "foo" 
+5
source

All Articles