21 Matching Annotations
  1. Dec 2017
    1. module SumOfList where sumOfList :: Int -> [Int] -> Int sumOfList total lst = if (x == []) then total else sumOfList (total + (head x)) (tail x)

      I was really trying to wrap my head around where the variable x is coming from?

      I even get a compile error that the variable is not in scope.

    2. ->

      I read till the end of this section to understand what the -> pointy arrow in the function signature meant. It would have been great if a note was added about this.

      I understood that the first two types are for the variables and the last for the return. This is in the recap, however, I would like to know if there is any other use of the pointy arrow.

    3. /=,

      EDIT: It is described below the table.

      <del>Small text describing the operators would help beginners never exposed to code.</del>

      Those of you trying to understand this /= is the not equals operator.

    1. Ensure that the hie binary (command-line tool) has installed successfully by going through the following steps. Ensure that you see output similar to what is shown above after you run the hie command. You can exit it by pressing Ctr+c

      I ran into an issue here - The first time after installation that I ran hie, it worked. However, after exiting the root user, I tried hie, command not found. I tried getting back into the root user, command not found again.

      I copied the hie file from root ~/.local/bin/hie to my home directory.

      I probably should have installed as a regular user instead of root. I got another error in VScode as soon as I opened the Main.hs file.

      You are not the owner of '/home/kaycee/github/octo-goggles/haskell/first-project/.stack-work/'. Aborting to protect file permissions.
      Retry with '--allow-different-user' to disable this precaution.
      

      I added allow-different-user: true to ~/.stack/config.yaml file.

      Suggestion: Please add an instruction to not use a root shell for the installation. Saves a lot of time in fixing it later. GHC was downloaded yet another time for me.

    2. lts-9.14

      Some more explanation on this would help.

      How to change the resolver? For example, I have a nightly build, I'd like to switch to an LTS version.

    3. follow the instructions

      It's not clear if we are expected to just follow the install instructions and the steps 2, 3 and 4 from the Get started page are covered in the chapters in this book.

    1. Some tips on what kind of comments to add:

      You should probably also add some predefined tags here to be used in annotations. It would make it easier for you to sift through the annotations.