All Projects → frees-io → Iota

frees-io / Iota

Licence: apache-2.0
Fast [co]product types with a clean syntax. For Cats & Scalaz.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Iota

Derive4j
Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.
Stars: ✭ 511 (+192%)
Mutual labels:  algebra, functional-programming
Mu Scala
Mu is a purely functional library for building RPC endpoint based services with support for RPC and HTTP/2
Stars: ✭ 266 (+52%)
Mutual labels:  algebra, functional-programming
Static Land
Specification for common algebraic structures in JavaScript based on Fantasy Land
Stars: ✭ 699 (+299.43%)
Mutual labels:  algebra, functional-programming
Fp Resources
Functional programming great resources
Stars: ✭ 369 (+110.86%)
Mutual labels:  algebra, functional-programming
Functionaljava
Functional programming in Java
Stars: ✭ 1,472 (+741.14%)
Mutual labels:  algebra, functional-programming
Kotlin Retry
A higher-order function for retrying operations that may fail.
Stars: ✭ 159 (-9.14%)
Mutual labels:  functional-programming
Libf
C++ as a Pure Functional Programming Language
Stars: ✭ 167 (-4.57%)
Mutual labels:  functional-programming
Dslsofmath
Domain Specific Languages of Mathematics
Stars: ✭ 159 (-9.14%)
Mutual labels:  functional-programming
Kotlindiscretemathtoolkit
Set of extensions for Kotlin that provides Discrete math functionalities
Stars: ✭ 158 (-9.71%)
Mutual labels:  functional-programming
Symja android library
☕️ Symja - computer algebra language & symbolic math library. A collection of popular algorithms implemented in pure Java.
Stars: ✭ 170 (-2.86%)
Mutual labels:  algebra
Creative Scala
Quick, graphical, fun introduction to programming in Scala.
Stars: ✭ 171 (-2.29%)
Mutual labels:  functional-programming
Deal
Design by contract for Python with static checker and tests' generation.
Stars: ✭ 164 (-6.29%)
Mutual labels:  functional-programming
Algebraic Effects
Manage side-effects in your javascript application cleanly with algebraic effects
Stars: ✭ 162 (-7.43%)
Mutual labels:  functional-programming
Hornet
HORNET is a powerful IOTA fullnode software
Stars: ✭ 168 (-4%)
Mutual labels:  iota
Metalang99
A functional language for C99 preprocessor metaprogramming
Stars: ✭ 152 (-13.14%)
Mutual labels:  functional-programming
Curryable
An elegant and simple curry(f) implementation in PHP.
Stars: ✭ 172 (-1.71%)
Mutual labels:  functional-programming
Category Theory For Dotnet Programmers
This repo contains all c++ / haskell samples from Bartosz Milewski's book (Category Theory for Programmers) converted to csharp and fsharp
Stars: ✭ 159 (-9.14%)
Mutual labels:  functional-programming
Bow Arch
🏛 Functional Architecture in Swift using Bow
Stars: ✭ 166 (-5.14%)
Mutual labels:  functional-programming
Hm Def
Runtime type checking for JS with Hindley Milner signatures
Stars: ✭ 171 (-2.29%)
Mutual labels:  functional-programming
Nyaya
Random Data Generation and/or Property Testing in Scala & Scala.JS.
Stars: ✭ 165 (-5.71%)
Mutual labels:  functional-programming

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].