-
Notifications
You must be signed in to change notification settings - Fork 192
How to write the code for chapter 3? #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For the purposes of prototyping and playing around without the tests getting in your way you could edit {-
Welcome to a Spago project!
You can edit this file as you like.
-}
{ name = "my-project"
, dependencies = [ "console", "effect", "lists", "psci-support", "test-unit" ]
, packages = ./packages.dhall
-- , sources = [ "src/**/*.purs", "test/**/*.purs" ]
, sources = [ "src/**/*.purs" ]
} To be honest I don't remember how I went about it, I probably just focused on the exercises and used the provided source files as a recap mostly, without directly changing them. I generally would recreate some of the variables to play with the syntax and try things independent of the source files, just inside |
I completely agree that it's much easier to learn if you have some code to write as you go along. I think solving exercises is even better than transcribing code snippets. Most of the other chapters do a much better job at interleaving exercises, and so the starter-code (AddressBook.purs in this case) seems like less of a wasted opportunity. It's a shame that Ch3 is probably the worst example of interleaved exercises. It just squishes everything at the end. #252 is a proposal to fix that chapter. Perhaps the best way to learn material is by teaching it, and so I'd be grateful if you could help us improve Ch3 by suggesting some exercises that we could add after the earlier sections. I also believe that some of the best learning material for beginners is contributed by folks who are also currently in the beginner's mindset, so feel free to rewrite anything that lacks clarity. |
This should be addressed by #252 and other restructuring efforts |
The text of chapter 3 seems to be structured as if I'm meant to enter the AddressBook code into a file as I go through it. (e.g. it refers to "the code you wrote".) I think it would be helpful to work that way - I find it quite helpful to enter the code myself and experiment with it as I go along, much more so than just reading code that's already written.
However, the
AddressBook.purs
file already exists in the repo, and already contains the complete implementation. I tried commenting out the contents of that file so I can re-enter them myself, but thenspago build
andspago repl
fail, because stuff inTest.NoPeeking.Solutions
expects to find the already-existing implementation.So I guess my question is, what's the intended way for the code in chapter 3 to be used? Should I just start my own entirely new project for my own AddressBook implementation? Or a separate
MyAddressBook.purs
file within the same folder? At this point in the learning process it's not obvious what the right solution is, so it would be helpful if there would be some guidance about that in the book.The text was updated successfully, but these errors were encountered: