An open API service indexing awesome lists of open source software.

https://github.com/aygp-dr/lazy-weekends

A chill, 8-week Haskell learning journey designed for busy people who want to explore functional programming without the pressure.
https://github.com/aygp-dr/lazy-weekends

beginner-friendly education functional-programming haskell tutorial

Last synced: about 7 hours ago
JSON representation

A chill, 8-week Haskell learning journey designed for busy people who want to explore functional programming without the pressure.

Awesome Lists containing this project

README

          

#+TITLE: Lazy Weekends: Learn Haskell at Your Own Pace
#+AUTHOR: Aidan Pace
#+DATE: 2025-06-02

A chill, 8-week Haskell learning journey designed for busy people who want to explore functional programming without the pressure.

* Philosophy

"If you miss a weekend, no big deal. If you solve it in a weird way, that's fine too. The goal is to get comfortable with functional thinking, not to optimize everything."

* What This Is

- *8 weekend exercises* that build on each other naturally
- *2-3 hours per weekend* (but take as long as you need)
- *AOC-style structured problems* with real parsing challenges
- *No bootcamp pressure* - learn at your own pace

* Structure

Each week has its own folder (=week1/=, =week2/=, etc.) containing:

- =README.md= - Problem description and learning goals
- =input.txt= - Structured data to parse (no trivial inputs!)
- =template.hs= - Starter code with type signatures
- =spoilers/solution.hs= - Reference solution (peek if you're stuck)

* Learning Path

** Weeks 1-2: Foundation
- Lists, basic functions, simple parsing
- Getting comfortable with Haskell syntax

** Weeks 3-4: Core Concepts
- Pattern matching, recursion, custom types
- Building your functional thinking muscles

** Weeks 5-6: Real Tools
- Monads, parsing libraries, file I/O
- Writing actual useful programs

** Weeks 7-8: Polish
- Real-world problems, performance, style
- Becoming a confident Haskeller

* Getting Started

** Prerequisites
- Basic programming experience in any language
- Curiosity about functional programming
- A weekend or two to spare

** Setup

1. *Install Haskell* (choose one):
#+begin_src bash
# GHCup (recommended)
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

# Or via package manager
# macOS: brew install ghc cabal-install
# Ubuntu: apt install ghc cabal-install
# FreeBSD: pkg install ghc hs-cabal-install
#+end_src

2. *Clone and start*:
#+begin_src bash
git clone https://github.com/aygp-dr/lazy-weekends.git
cd lazy-weekends/week1
ghci template.hs
#+end_src

3. *Test your setup*:
#+begin_src haskell
-- In GHCi
:load template.hs
main
#+end_src

** How to Use Each Week

1. *Read the README* - understand the problem and goals
2. *Look at input.txt* - see what data you're working with
3. *Start with template.hs* - fill in the type signatures
4. *Run and test* - =ghci template.hs= then call functions
5. *Check spoilers/* when stuck (no shame!)

* Tips for Success

- *Don't rush* - each concept builds on the last
- *Experiment in GHCi* - the REPL is your friend
- *Read error messages* - Haskell's compiler is surprisingly helpful
- *Embrace weird solutions* - there's usually 5 ways to solve anything
- *Ask questions* - the Haskell community is friendly

* When You Get Stuck

1. *Read the error message twice* - Haskell errors are better than you think
2. *Check the spoilers* - they're there for a reason
3. *Try ~:type~ in GHCi* - understand what you're working with
4. *Google "haskell how to X"* - someone has asked before
5. *Take a break* - sometimes the solution comes in the shower

* Resources

** Documentation
- [[https://www.haskell.org/documentation/][Official Haskell Documentation]]
- [[https://hoogle.haskell.org/][Hoogle]] - Search for functions by name or type signature
- [[https://hackage.haskell.org/][Hackage]] - Haskell package repository

** Community
- [[https://www.reddit.com/r/haskell/][r/haskell]] - Reddit community
- [[https://discord.gg/haskell][Haskell Discord]]
- [[https://discourse.haskell.org/][Haskell Discourse]]
- ~#haskell~ channel on Libera.Chat IRC

** Useful GHCi Commands
#+begin_src haskell
:t expr -- Show the type of 'expr'
:i name -- Show info about 'name'
:set +t -- Show types of evaluated expressions
:r -- Reload the current module
:sprint name -- Show the current value of 'name'
:doc function -- Show documentation for 'function'
#+end_src

** Debugging Tips
- Use ~trace~ from ~Debug.Trace~ for print debugging:
#+begin_src haskell
import Debug.Trace

factorial n = trace ("Computing factorial of " ++ show n) $
if n <= 1 then 1 else n * factorial (n-1)
#+end_src
- Break complex expressions into smaller named components
- Test functions with simple inputs in GHCi

* What You'll Build

By the end, you'll have written programs that:
- Parse real data formats
- Handle errors gracefully
- Use monads naturally
- Solve interesting problems
- Look like idiomatic Haskell

* Contributing

Found a bug? Have a better explanation? Want to add a week?
Pull requests welcome! This is meant to be a living resource.

-----

*Ready to start?* Head to =week1/= and dive in!

/Remember: The goal isn't perfection, it's progress. Happy lazy coding! 🏖️/