Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veewee/reflecta
🪞 Reflecta 🪞 - Unleash the Power of Optics in your code!
https://github.com/veewee/reflecta
array-access isomorphisms lenses optics reflection
Last synced: about 1 month ago
JSON representation
🪞 Reflecta 🪞 - Unleash the Power of Optics in your code!
- Host: GitHub
- URL: https://github.com/veewee/reflecta
- Owner: veewee
- License: mit
- Created: 2023-11-13T06:15:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-25T06:31:09.000Z (about 2 months ago)
- Last Synced: 2024-10-26T18:12:52.091Z (about 2 months ago)
- Topics: array-access, isomorphisms, lenses, optics, reflection
- Language: PHP
- Homepage:
- Size: 298 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## 🪞 REFLECTA 🪞
### Unleash the Power of Optics in your codeWelcome to Reflecta!
Transform your data like never before with this optics implementation – a set of sleek, intuitive tools designed to empower your code with the finesse of reflection, the precision of lenses, and the magic of Isomorphisms.
Say goodbye to the complexities, and hello to a world where building, accessing and manipulating your data structures becomes as effortless as a brushstroke on a canvas.Dive into this Optics Toolkit, where coding meets artistry, and simplicity meets power.
It's not just about data – it's about orchestrating a symphony of possibilities.
Your data has never looked so good!## Installation
Reflecta is installed via Composer.
```
composer require veewee/reflecta
```
> Requires PHP 8.1+**Warning.** This package is primarily published to receive early feedback and for contributors, during this development phase we cannot guarantee the stability of the APIs, consider each release to contain breaking changes.
### Psalm support
This package is created with type-safety and error awareness in mind.
In order to have better type inference, this package comes shipped with a psalm plugin.
You can enable it by:```
./vendor/bin/psalm-plugin enable 'VeeWee\Reflecta\Psalm\Plugin'
```
> Requires vimeo/psalm 5+## Components
This package provides following components:
* [ArrayAccess](/docs/array-access.md): Helps you read from and write to arrays.
* [Iso](/docs/isomorphisms.md): Provides bidirectional transformations on your data.
* [Lens](/docs/lens.md): Separate your data from it's structure
* [Reflect](/docs/reflect.md): Helps you read from and write to objects in a runtime-safe context.## Inspiration
This library was inspired by the following projects:
* [marcosh/lamphpda-optics](https://github.com/marcosh/lamphpda-optics)
* [fp-ts/optic](https://github.com/fp-ts/optic)
* [haskell lens](https://hackage.haskell.org/package/lens)