- Dec 2017
-
www.vacationlabs.com www.vacationlabs.com
-
this exercises:
Typo
-
geneerating
Typo
-
Can you explain why the following doesn’t work?
Is the only way to add type
[Char]
to the beginning of a[Char]
, concatenation++
? -
if (x == []) then total else sumOfList (total + (head x)) (tail x)
Replace x with lst.
-
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.
-
->
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.
-
mod x 2
Use variable as y to avoid confusion with multiplication operator.
-
/=,
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.
-
simply
Typo
-
that
Typo
-
Get used to GHCi before you start
This is a duplication of what is already a part of the previous section.
-
-
www.vacationlabs.com www.vacationlabs.com
-
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.
-
covfefe
typo
-
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.
-
wth with
typo
-
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.
-
Quick primer on Stack
This section was super easy to understand than reading - https://docs.haskellstack.org/en/stable/README/
This should probably be referenced in the previous chapter.
Tags
Annotators
URL
-
-
www.vacationlabs.com www.vacationlabs.com
-
stack & cabal
By this point I am not aware of what stack and cabal are. I'm hoping that this is covered in the next chapter as there is no indication. My immediate action was to do a search on these terms.
https://docs.haskellstack.org/en/stable/README/ https://www.haskell.org/cabal/
-
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.
-
and your
typo
-
your the
typo
Tags
Annotators
URL
-