These are exercises for the Alpha study group (if you want to participate, first get into the Haskell Learning Group and then ask @neongreen). A new set is published every week, but you're encouraged to solve old sets too. If you can't solve a task, ask in the Slack channel and you'll be given hints.
The exercises are beginner-to-intermediate level. Expect to learn how to write algorithms, solve simple problems with Haskell, use common libraries, write sites, talk to databases, create interfaces, parse things, do weird type-level stuff, and more.
- Setup your namespace
For instance, if your Github handle is john and you are solving task table from week 3, create a branch called table/john
and put your solution into week3/table/john
:
$ git checkout -b table/john
$ mkdir -p week3/table/john
Recap:
-
Branch
<exercise-code>/<your-gh-handle>
-
Folder
week<n>/<exercise-code>/<your-gh-handle>
-
Author your solution, get feedback
Work in your namespace. It doesn't matter what you call your
.hs
file, butMain.hs
is a good default.Create a pull request once you want feedback on your code and/or are ready to submit it.
-
Suggestion If you are not done then consider writing a task list in the description. This convention transparently communicates your progress.
-
Suggestion Feedback will probably result in additional tasks to do so updating the list may be desirable, but then again certain tasks may not be worth such detail. Use judgement, whatever helps.
-
-
Iterate
Discuss feedback with the reviewer. Integrate changes into your solution. Repeat as needed.
-
Finish
Once you and your reviewer are satisfied with your solution, merge! From then on you can make changes to your solution's code in the
master
branch (refactors, etc.).
At the end of each week each exercise is explained by someone who has solved it.
-
Don't forget to use hlint on your code – it often gives good suggestions on how to improve it. (They aren't always good, however! If you're unsure, ask.)
-
You can see yours (and others') progress in this table.
-
-
- Write QuickCheck
{quickcheck}
- Write QuickCheck
-
- Choosing a serialization method
{serialize}
- Choosing a serialization method
-
-
-
- Write a quine
{quine}
- Write a quine
-
- Write a database engine
{db}
- Write a database engine
-
-
Week 4 (September 19 – October 2)
-
- Draw a spiral
{spiral}
- Draw a spiral
-
- Justify text
{justify}
- Justify text
-
- Trie
{trie}
- Trie
-
- Path finding
{path}
- Path finding
-
- JSON printing
{json-print}
- JSON printing
-
-
-
- Binary conversion
{binary}
- Binary conversion
-
- Working with expressions
{expr}
- Working with expressions
-
- Compute a moving average
{average}
- Compute a moving average
-
- XOR encryption
{xor}
- XOR encryption
-
- Table formatting
{table}
- Table formatting
-
-
-
- Merge sort
{mergesort}
- Merge sort
-
- Silly compression
{compress}
- Silly compression
-
- Big integers
{bigint}
- Big integers
-
- Biased shuffle
{shuffle}
- Biased shuffle
-
- JSON extractor
{jpath}
- JSON extractor
-
-
Week 1 (August 26 – September 4)
-
- Find scary words
{scary}
- Find scary words
-
- Calculate probability of winning using simulation
{reposts}
- Calculate probability of winning using simulation
-
- Write a tic-tac-toe game
{tictactoe}
- Write a tic-tac-toe game
-
- Generate a maze using Wilson's algorithm
{wilson}
- Generate a maze using Wilson's algorithm
-
- Solve a logic problem using brute-force
{logic-brute}
- Solve a logic problem using brute-force
-