corez

fast product/coproduct types

License

License

GroupId

GroupId

io.frees
ArtifactId

ArtifactId

iotaz-core_2.12
Last Version

Last Version

0.3.10
Release Date

Release Date

Type

Type

jar
Description

Description

corez
fast product/coproduct types
Project Organization

Project Organization

47 Degrees
Source Code Management

Source Code Management

https://github.com/frees-io/iota

Download iotaz-core_2.12

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.6
org.scalaz : scalaz-core_2.12 jar 7.2.25

provided (2)

Group / Artifact Type Version
org.scala-lang : scala-compiler jar 2.12.6
org.scala-lang : scala-reflect jar 2.12.6

Project Modules

There are no modules declared in this project.

Build Status Maven Central License Latest version Scala.js GitHub Issues

Iota

Introduction

Iota is a tiny library for fast coproduct types with a syntax that cleanly supports the disjunction of any number of types.

Traditional coproduct implementations are implemented as binary trees or linked lists at both the type and value level. The syntax for traditional coproducts frequently becomes unwieldy as the number of disjunct types grows.

// a coproduct of types using scala.util.Either
type EitherFoo = Either[Int, Either[String, Double]]

// a coproduct of type constructors using cats.data.EitherK
import cats.data.EitherK
type EitherKBar0[A] = EitherK[List, Seq, A]
type EitherKBar[A]  = EitherK[Option, EitherKBar0, A]

// a coproduct of type constructors using scalaz.Coproduct
import scalaz.Coproduct
type CoproductKBar0[A] = Coproduct[List, Seq, A]
type CoproductKBar[A]  = Coproduct[Option, CoproductKBar0, A]

Iota coproducts are linked lists at the type level. At the value level, Iota stores the index of the disjunct value's type for quick and constant time access of the values. This syntax scales cleanly to support any number of disjunct types.

// for cats
import iota._
import TList.::
import TListK.:::

// a coproduct of types
type Foo = Cop[Int :: String :: Double :: TNil]

// a coproduct of type constructors
type Bar[A] = CopK[Option ::: List ::: Seq ::: TNilK, A]
// for scalaz
import iotaz._
import TList.::
import TListK.:::

// a coproduct of types
type Foo = Cop[Int :: String :: Double :: TNil]

// a coproduct of type constructors
type Bar[A] = CopK[Option ::: List ::: Seq ::: TNilK, A]

Installation

To get started with SBT, simply add the following to your build.sbt file.

For Scala 2.11.x and 2.12.x:

libraryDependencies += "io.frees" %% "iota-core"  % "0.3.10" // for cats
libraryDependencies += "io.frees" %% "iotaz-core" % "0.3.10" // for scalaz

Or, if using Scala.js (0.6.x):

libraryDependencies += "io.frees" %%% "iota-core"  % "0.3.10" // for cats
libraryDependencies += "io.frees" %%% "iotaz-core" % "0.3.10" // for scalaz

Cats vs Scalaz

Iota requires either Cats or Scalaz. If you're using Scalaz, use the "iotaz" modules and import from the iotaz package (instead of iota).

Cats friendly terminology (such as "FunctionK") is used in the iota modules while Scalaz friendly terminology (such as "NaturalTransformation") is used in the iotaz modules. If you find an issue or inconsistency, please file a GitHub issue and it will be fixed.

The Cats examples will work against Scalaz, and vise versa, so long as the library specific terminology is adjusted. Expect more Scalaz examples as the Iota library evolves.

Documentation

See docs/cats.md for the Cats specific documentation and docs/scalaz.md for the Scalaz specific documentation.

Iota in the wild

If you wish to add your library here please consider a PR to include it in the list below.

Commercial Support

47 Degrees offers commercial support for the iota library and associated technologies. To find out more, visit 47 Degrees' Open Source Support.

Copyright

Iota is designed and developed by 47 Degrees

Copyright (C) 2016-2018 47 Degrees. http://47deg.com

io.frees

Freestyle

A cohesive & pragmatic framework of FP centric Scala libraries

Versions

Version
0.3.10
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1