Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bwireman/gleither
A small data-structure for representing Left or Right. ↔️
https://github.com/bwireman/gleither
beam either elixir erlang gleam javascript monad
Last synced: 23 days ago
JSON representation
A small data-structure for representing Left or Right. ↔️
- Host: GitHub
- URL: https://github.com/bwireman/gleither
- Owner: bwireman
- License: mit
- Created: 2024-03-23T22:25:05.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-11-01T13:35:14.000Z (about 1 month ago)
- Last Synced: 2024-11-14T00:12:59.404Z (29 days ago)
- Topics: beam, either, elixir, erlang, gleam, javascript, monad
- Language: Gleam
- Homepage: https://hex.pm/packages/gleither
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gleam - gleither - [📚](https://hexdocs.pm/gleither/) - A small data-structure for representing an Either Monad (Packages / Data Structures)
README
# Gleither ↔️
A small data-structure for representing an Either Monad. Written in the excellent [gleam ✨](https://gleam.run/) language. Supporting both Erlang & Javascript targets
[![test](https://github.com/bwireman/gleither/actions/workflows/test.yml/badge.svg)](https://github.com/bwireman/gleither/actions/workflows/test.yml)
[![commits](https://img.shields.io/github/last-commit/bwireman/gleither)](https://github.com/bwireman/gleither/commit/main)
[![mit](https://img.shields.io/github/license/bwireman/gleither?color=brightgreen)](https://github.com/bwireman/gleither/blob/main/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com)Docs: https://hexdocs.pm/gleither/
```sh
gleam add gleither
```
```gleam
import gleither.{Left, Right, map, get}pub fn main() {
Right(1)
|> map(fn(x) { x + 1 })
|> get()
// Some(2)
}fn ex() {
Left(1)
|> map(fn(x) { x + 1 })
|> get()
// Some(1)
}
```