-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Implement a comprehensive Lens/Optics system inspired by Haskell's lens library and F#'s Aether. This would provide composable getter/setter abstractions for deep nested immutable data structures without boilerplate.
Technical Details:
- Implement Lens, Prism, Iso, and Traversal types
- Support composition through pipe operators
- Type-safe with full Pylance/Pyright support
- Integration with existing Option/Result types for safe access
- Support for focusing, updating, and transforming nested data
- Provide van Laarhoven encoding compatible with Python's type system
Use Cases:
- Complex nested dataclass/frozen class updates
- Deep JSON/config manipulation without mutation
- State management in functional applications
- Type-safe path access with composition
Implementation Challenges:
- Python's limited higher-kinded types support
- Complex generic type inference
- Performance optimization for deep nesting
- Integration with Pattern Matching (PEP 634)
pchabros
Metadata
Metadata
Assignees
Labels
No labels