GithubHelp home page GithubHelp logo

b-studios / scala-effekt Goto Github PK

View Code? Open in Web Editor NEW
144.0 9.0 15.0 1.8 MB

Extensible algebraic effects with handlers

Home Page: http://b-studios.de/scala-effekt

License: MIT License

Scala 100.00%
scala effects continuations

scala-effekt's Issues

Not able to pull for scala 2.13

I modified my build.sbt according to the instruction and it looks like there is no library distribution for scala 2.13 in the repository.

sbt output
[error] (core / ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading de.b-studios:effekt_2.13:0.4-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: /Users/sitiritis/.ivy2/localde.b-studios/effekt_2.13/0.4-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/de/b-studios/effekt_2.13/0.4-SNAPSHOT/effekt_2.13-0.4-SNAPSHOT.pom
[error]   not found: https://oss.sonatype.org/content/repositories/snapshots/de/b-studios/effekt_2.13/0.4-SNAPSHOT/effekt_2.13-0.4-SNAPSHOT.pom

Is there a way to fix this? I would be happy to get some help ๐Ÿ™

Lazy handler for Amb

Is there a way to implement a handler similar to ambList that returns a stream, lazily returning the results?
My naive attempt did not work, but will result in an infinite loop:

def ambStream[R](prog: Amb => Control[R]): Control[Stream[R]] =
  new Handler[Stream[R]] with Amb {
    def flip() = use { resume =>
      for {
        x <- resume(true)
        y <- resume(false)
      } yield x ++ y
    }
  } handle { amb => prog(amb).map(Stream(_)) }

def flip(implicit amb: Amb): Control[Boolean] = amb.flip()

def from(n: Int)(implicit amb: Amb): Control[Int] = for {
  x <- flip
  y <- if (x) pure(n) else from(n + 1)
} yield y

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.