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 2 months ago
JSON representation

Aiken's utility library

Lists

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)


Acca
Acca

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 amath

let 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.