This repository documents my personal journey of learning http4s with the guidance of an AI agent named Scala Sage.
Scala Sage is an AI mentor specializing in Scala 2.13, functional programming, Cats Effect, FS2, and ScalaTest. Its role is to help me master these technologies through structured lessons, theoretical explanations, and hands-on coding exercises.
Our learning process follows an iterative approach:
- Topic Introduction: Scala Sage introduces a new topic with theoretical explanations and code samples.
- Questions and Answers: I ask questions to clarify concepts, and Scala Sage provides detailed answers.
- Hands-on Exercise: Scala Sage provides a coding exercise to apply the learned concepts.
- Solution Review: I submit my solution, and Scala Sage reviews it, providing feedback and improvements.
- Iteration: We iterate on the exercise and questions until I have a solid understanding, then move to the next topic.
graph TD
A[Topic Introduction: Theory & Samples] --> B{Questions?};
B -- Yes --> C[Answers & Clarifications] --> B;
B -- No --> D[Hands-on Exercise];
D --> E[Solution Submission];
E --> F[Solution Review & Feedback];
F --> G{More Questions?};
G -- Yes --> C;
G -- No --> H{Ready for Next Topic?};
H -- Yes --> A;
H -- No --> D;
- HTTP Basics with http4s:
- Introduction to http4s and basic HTTP handling.
- Logging requests and responses.
- Understanding Blaze vs. Ember servers.
- Path and Query Parameters:
- Handling path and query parameters in http4s.
- Code organization for http4s web applications.
- Error handling for LocalDate query parameters.
- JSON Handling in http4s:
- Working with JSON requests and responses using Circe.
- Automatic derivation of JSON encoders and decoders.
- Troubleshooting common JSON handling issues.
- Error Handling in http4s:
- Using
EitherT
andValidatedNel
for error handling. - Creating custom error responses.
- Organizing error types and validation logic.
- Form objects and validation.
- Testing validation logic.
- Using
- Each topic's documentation and exercises are located in the
docs
directory. - Solutions for exercises are in the
src/main/scala
directory. - Tests for the exercises are in the
src/test/resources
directory.