Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Cardano-Fans/acca
Aiken's utility library
https://github.com/Cardano-Fans/acca
aiken cardano smart-contracts
Last synced: about 1 month ago
JSON representation
Aiken's utility library
- Host: GitHub
- URL: https://github.com/Cardano-Fans/acca
- Owner: Cardano-Fans
- License: mit
- Created: 2023-02-08T20:09:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-17T22:09:32.000Z (about 1 year ago)
- Last Synced: 2024-08-04T01:14:26.780Z (5 months ago)
- Topics: aiken, cardano, smart-contracts
- Language: Gleam
- Homepage: https://cardano-fans.github.io/acca/
- Size: 710 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-aiken - Cardano-Fans/acca - Extensions to the standard library (Libraries)
README
[![Build](https://github.com/Cardano-Fans/acca/actions/workflows/tests.yml/badge.svg)](https://github.com/Cardano-Fans/acca/actions/workflows/tests.yml)
[![License](https://img.shields.io:/github/license/Cardano-Fans/acca?label=license)](https://github.com/Cardano-Fans/acca/blob/master/LICENSE)
Aiken's utility library.
## Introduction
Acca is Aiken's utility library (https://github.com/aiken-lang/aiken).
Creators of Aiken standard library are quite opinionated what should be in Aiken's standard library (stdlib) and what should not be. They want to keep it quite minimal. This library is simply an extension / utility library that is adding many useful / repetitive functions, which somehow didn't make to std lib.
## Usage
aiken.toml
```
licences = ["Apache-2.0"]
description = "Example project"dependencies = [
{ name = "Cardano-Fans/acca", version = "a3a886b1e3557d00ed491a73001020a533cf34cd", source = "github" }
]
```## Limitations
Since Aiken doesn't support libraries which both include the same std library (or any other library), this project simply clones std library. In other words Aiken's std lib is inlined in this project and there is no plan to make any changes to it.Current std lib SHA1 version: 746c7a9cf29729c3978235703de9e2e30848088d
## Requirements
- Aiken (https://github.com/aiken-lang/aiken)## Examples
```gleam
use acca/list as alist
use acca/math as amathlet items: List> = [Some(1), None, Some(2)]
// resolve only Some and ignore None elements
let resolved: List> = alist.resolve(items)// resolved = [Some(1), Some(2)]
let min: Option = amath.min([1, 2, 3])
expect Some(x) = min// x = 1
let max: Option = amath.max([1, 2, 3])
expect Some(x) = max// x = 3
let indexOf: Option = alist.index_of([1, 2, 3], 3)
expect Some(x) = indexOf// x = 2
let sum: Option = amath.sum([1, 2, 3])
expect Some(x) = sum// x = 6
let product: Option = amath.product([1, 2, 3, 4])
expect Some(x) = product// x = 24
// and many more functions...
```## Why acca?
Acca (Acca sellowiana) is brazilian guava fruit. The name is not accidental, this library is a tribute to well known Google's java library called guava.## Status
Project under development, API subject to change.