![foo bar baz boom zoom moom voom foo bar baz boom zoom moom voom](https://image.slidesharecdn.com/d3js-140705170121-phpapp02/95/stylish-visualisations-with-d3js-odessajs-19-638.jpg)
#Foo bar baz boom zoom moom voom how to#
Yikes! What GHCI is telling us here is that "llama" is not a number and so it doesn't know how to add it to 5. In the definition of `it': it = 5 + "llama" Possible fix: add an instance declaration for (Num ) What about doing 5 + "llama" or 5 = True? Well, if we try the first snippet, we get a big scary error message!
![foo bar baz boom zoom moom voom foo bar baz boom zoom moom voom](https://hallwines.s3-us-west-1.amazonaws.com/zoom-backgrounds/hall/T-T_Ranch_Final.jpg)
As you probably know, & means a boolean and, || means a boolean or. Doing 5 * -3 will make GHCI yell at you but doing 5 * (-3) will work just fine.īoolean algebra is also pretty straightforward. If we want to have a negative number, it's always best to surround it with parentheses. A little pitfall to watch out for here is negating numbers.
![foo bar baz boom zoom moom voom foo bar baz boom zoom moom voom](https://hallwines.s3-us-west-1.amazonaws.com/zoom-backgrounds/hall/Rutherford_Final.jpg)
Pretty cool, huh? Yeah, I know it's not but bear with me. We can use parentheses to make the precedence explicit or to change it. We can also use several operators on one line and all the usual precedence rules are obeyed. If you want to have the same prompt, just type in :set prompt "ghci> ". done.Ĭongratulations, you're in GHCI! The prompt here is Prelude> but because it can get longer when you load stuff into the session, we're going to use ghci>. You will be greeted with something like this. The first thing we're going to do is run ghc's interactive mode and call some function to get a very basic feel for haskell. Alright, let's get started! If you're the sort of horrible person who doesn't read introductions to things and you skipped it, you might want to read the last section in the introduction anyway because it explains what you need to follow this tutorial and how we're going to load functions.