Giter Site home page Giter Site logo

teseo's Introduction

TESEO

TESEO is a library for the construction of workflows and pipelines through an ergonomic API.

  • Easy to create and composable algorithms
  • Automatic configuration though implicits
  • Detailed compiler help when troubleshooting

TESEO provides the Algm data structure, representing an algorithm that can automatically construct a complex set of configuration through the usage of implicits and determine its actual execution through this. They are easy to create and highly composable. This allows safer construction and design of pipelines.

Installation

To use TESEO, add the following to your build.sbt file:

libraryDependencies += "io.github.pablf" %% "teseo" % "0.1.0"

Example

A simple example wrapping a function

import teseo.*
import teseo.given

// transform an `Int` into a `String`
val alg1 = Algm.const[Int, String](x => x.toString)

alg1 ex 7

An example wrapping a function and reading a given.

// transform an `Int` into a `String` using an implicit `Double``
val alg2 = Algm[Int, String, Double](implic => (x => x.toString ++ implic.toString))

// doesn't compile because there are no `Double` given in scope
//alg ex 7

{
    given Double = 7.7
    alg2 ex 7
}

An example wrapping an algorithm and searching an instance in scope.

import teseo.*

trait Transformer[A <: Conf] extends Algm[Int, String] { type CC = A }

// executes a transformer in scope
val alg3 = Algm.wrap[Int, String, Transformer]()

// doesn't compile because there are no Transformer in scope
//alg.ex(7) 

{
    given Transformer[Conf.Simple[Double]] with
        val alg = AlgmImpl[Int, String, Double](double => x => x.toString ++ double.toString)

    given Double = 7.7

    alg3 ex 7
}

An example creating a pipeline of three algorithms.

import teseo.*

trait Alg1[A <: Conf] extends Algm[Int, String] { type CC = A }
trait Alg2[A <: Conf] extends Algm[String, Double] { type CC = A }
trait Alg3[A <: Conf] extends Algm[Double, Boolean] { type CC = A }

trait Pipeline[A <: Conf] extends Algm[Int, Boolean] { type CC = A }

object Pipeline {
    
    val container = AlgmGen.pipeline[Alg1, Alg2, Alg3]
    export container.alg
}

// in another file
import Pipeline.given

// it will chain automatically given implementations of `Alg1`, `Alg2` and `Alg3`.
summon[Pipeline[_]] ex 3

Documentation

Learn more on Teseo!

Contributing

Contributions are welcomed. Feedback is also very important, so any comment is highly appreciated. Thanks!

License

License

teseo's People

Contributors

pablf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.