violin

A human-sized Kotlin utility library.

Лицензия

Лицензия

Группа

Группа

com.norswap
Идентификатор

Идентификатор

violin
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

violin
A human-sized Kotlin utility library.
Ссылка на сайт

Ссылка на сайт

https://github.com/norswap/violin
Система контроля версий

Система контроля версий

https://github.com/norswap/violin/tree/master

Скачать violin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.norswap/violin/ -->
<dependency>
    <groupId>com.norswap</groupId>
    <artifactId>violin</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.norswap/violin/
implementation 'com.norswap:violin:0.1.0'
// https://jarcasting.com/artifacts/com.norswap/violin/
implementation ("com.norswap:violin:0.1.0")
'com.norswap:violin:jar:0.1.0'
<dependency org="com.norswap" name="violin" rev="0.1.0">
  <artifact name="violin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.norswap', module='violin', version='0.1.0')
)
libraryDependencies += "com.norswap" % "violin" % "0.1.0"
[com.norswap/violin "0.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.0.3

test (1)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.9.12

Модули Проекта

Данный проект не имеет модулей.

V I O L I N

Violin is a utility library for Kotlin.

It tries to be human-sized, i.e., small enough that its code can be quickly understood without significant time investment. Hence, it focuses on a few orthogonal features and good documentation.

Presentation

Streams

Violin's main attraction is its stream capabilities.

Streams are best described as iterators, but on which transformations (map, filter, ...) can be applied lazily. Usually the same transformations are applied eagerly on the stream's source (e.g. kotlin.List) or lazily on the source (e.g. kotlin.Sequence). Violin streams are close to Java streams, but (1) allow incremental (not all-at-once) consumption from the stream, and (2) do not complect parallelization with stream processing.

Here is a completely bogus example (you're encouraged to submit a better one!):

1.transitive { it + 1 }
    .dropWhile { it < 10 }
    .upTo { it > 20 }
    .filter { it % 2 == 0 }
    .map { it / 2 }
    .indexed()
    .joinToString(transform = { "${it.index}: ${it.value}" })
    .let { println(it) } // prints "0: 5, 1: 6, 2: 7, 3: 8, 4: 9, 5: 10"

The stream interface is dead simple:

interface Stream <out T: Any> {
    fun stream(): T?
}

Other

Installation

Manual

Download the latest release and be include it in your classpath.

curl -T https://github.com/norswap/violin/releases/download/0.0.1/violin-0.0.1.jar

Maven

<dependency>
  <groupId>com.norswap</groupId>
  <artifactId>violin</artifactId>
  <version>0.0.1</version>
</dependency>

Gradle

compile 'com.norswap:violin:0.0.1'

Build from Source

You need make, curl and a JDK (8+).

You also need the CLI Kotlin compiler (1.0.3 - superior should be compatible). If you don't have it, run make kotlin to install the 1.0.3 compiler locally before continuing.

make deps
make build
make buildTests
make test
make jar

More targets (docs, clean, ...) available in the makefile.

Documentation

  • KDoc (to use violin from Kotlin)
  • Javadoc (to use violin from Java)

Roadmap

Версии библиотеки

Версия
0.1.0