Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prncss-xyz/beam
https://github.com/prncss-xyz/beam
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/prncss-xyz/beam
- Owner: prncss-xyz
- License: mit
- Created: 2024-01-20T18:16:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-08T21:00:31.000Z (6 months ago)
- Last Synced: 2024-05-08T22:23:00.680Z (6 months ago)
- Language: HTML
- Size: 450 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Beam
[![codecov](https://codecov.io/gh/prncss-xyz/beam/graph/badge.svg?token=goDnJXXmy9)](https://codecov.io/gh/prncss-xyz/beam)
Functional optics and transducers sharing a destiny. This is mostly exploratory work for now. Although I do care about code quality, don't use this in production.
## Transducers
Transducers were first introduced to closure in [2014](https://clojure.org/news/2014/08/06/transducers-are-coming) by Rich Hickey. They adress the following problems:
- having a common representation for `map`, `filter` and the like on different data structures (and making such operations extensible);
- processing data without creating unnecessary intermediate structures.As such, they solve problems typically adressed with monads in traditional functional programming languages. But as they offer an explicit way to terminate evaluation, they are a better fit for eagerly evaluated languages.
Transducers have blossomed in JavaScript around 2015 but seem to have been abandoned. One possible explanation is that they are, in the word of their creator, ["an interesting type problem"](https://www.youtube.com/watch?v=6mTbuzafcII&t=1677s). Typescript implementations I have found all relied on type declarations or `any`. I here propose a well typed implementation. The API is also designed to offer proper type inference.