Guides¶
This section provides in-depth guides for working with Haiway's core concepts and patterns.
Core Concepts¶
State Management¶
Learn how to work with Haiway's immutable state system, including:
- Defining state classes with type validation
- Working with immutability and updates
- Using generic state types
- Path-based updates for nested structures
- Performance considerations
Functionalities¶
Understand Haiway's functional programming approach:
- Protocol-based function interfaces
- Dependency injection through context
- Factory patterns for implementations
- Organizing business logic functionally
- Complete example: Notes management system
Packages¶
Structure larger applications effectively:
- Module organization patterns
- Package boundaries and interfaces
- Composing functionalities
- Managing dependencies between packages
Configuration Management¶
Simple type-safe configuration with automatic defaults:
- Define configuration classes with State
- Load configurations from various backends
- Automatic fallback to class defaults
Concurrent Processing¶
Master concurrent and parallel processing patterns:
- Structured concurrency with task spawning
- Context preservation across tasks
- Concurrent processing helpers
- Streaming multiple sources
- Performance optimization strategies
Learning Path¶
- Start with State - Understanding immutable state is fundamental to using Haiway effectively
- Learn Functionalities - See how to organize business logic using functional patterns
- Manage Configuration - Handle application configuration with type safety and automatic defaults
- Master Concurrency - Build high-performance applications with concurrent processing
- Scale with Packages - Apply these concepts to structure larger applications