Code Monkey home page Code Monkey logo

freestyle's People

Contributors

47degdev avatar 47degfreestyle avatar adrianrafo avatar anamariamv avatar andyscott avatar calvellido avatar diesalbla avatar dominv avatar eperinan avatar fedefernandez avatar fommil avatar franciscodr avatar israelperezglez avatar jesusmtnez avatar jorgegalindocruces avatar jrgonzalezg avatar juanpedromoreno avatar justjoheinz avatar loostro avatar maureenelsberry avatar noelmarkham avatar pepegar avatar peterneyens avatar pvillega avatar raulraja avatar shokohara avatar suhasgaddam avatar tinybarks avatar witi83 avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freestyle's Issues

Add note on performance and intended use

Free monads though practical in many use cases are not a silver bullet. We should include notes on performance and intended use cases in the docs with examples about overcoming some of the common antipatterns when apps rely heavily on Free for everything and the concerns around GC, etc.

Can't include freestyle as a dependency

When I add freestyle as a dependency

libraryDependencies += "io.freestyle" %% "freestyle" % "0.1.0"

I get:

[error] (freestyle-example/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: io.freestyle#freestyle_2.12;0.1.0: not found

Reorganize package structure

The entire codebase is going to be reorganized to support top level imports such as import freestyle._ and import freestyle.implicits._. All nested submodules and integrations will be under import freestyle.#name#

Research autocake style injection alternative

An implementation of the following potentially based on shapeless or with macros may allow us to have an auto cake style pattern based on trait composition and implicits. This can serve as an alternative to create @module where they are just being created for dependencies. The grouping of Coproduct and synthetic members for result.T would have to be taking into consideration as programs resulting from such combination would need an aligned Coproduct for interpretation.

implicit def autoInject[A, B](implicit a: A, b: B): A with B = ???

Use:

def program[F[_]](implicit C: AlgebraA with AlgebraB with ...)

Add docs for fetch integration

Add documentation for using fetch in freestyle programs, including tips on how to best use fetch together with freestyle.

ValidationM Effect Algebra

In the same way the ErrorM effect implements a fail fast strategy that immediately stops computation upon an error and relies on the presence of a MonadError instance for M[_] in the interpreter it should possible to have an algebra for Validation which places similar constrains.

In contrast to ErrorM, ValidationM should be able to accumulate errors and rely in something like MonadState in the final interpreter to accumulate errors over the computation and make them available at any point in the program.

The ValidationM algebra may tentatively look something like this:

trait ValidationProvider[E, A] {
  @free trait ValidationM[F[_]] {
       def valid(a: A): FreeS.Par[F, A] //lifts a valid value in the validation context
       def invalid(a: A): FreeS.Par[F, Unit] //accumulates an error in the validation context
       def validation: FreeS.Par[F, ValidatedNel[E, A]] // return the current state of the validation context
       def errors: FreeS.Par[F, List[E]] // returns a list of errors from the validation context
  }
}

RPC Endpoint POC

Related to findings in #39 provide a POC that lifts smart constructors as RPC endpoints and allows some degree of composition.

Integrate FS2 Streams into freestyle's monadic flow

Research the possibility to include FS2 streams into freestyle's monadic flow. Similarly to the integration with Fetch, we can reify fs2 stream operations into an algebra an defer execution to the free monad interpretation.

Cache Algebras

We should provide a simple algebra with the most common operations for caching. This may be able to reutilize StateM generic in the target type of the cache storage so we can build storages for common integrations such as Redis and other related libs in the caching space.

Beginner Vs Advanced use cases doc split

As part of the initiative to support newcommers that are not fully acquainted with FP in Scala we are gonna provide in each page a beginner / advance friendly split of each explained concept and areas covered by Freestyle

Scala JS Settings

once the sbt-catalyst-extras integration is in place we need to publish also as a JS library since Github4S and others also require this target.

ensime/scala-ide support: i.e. tests with pcplod

You don't need to do anything special for it to "just work" in ensime and scala-ide, but you might find that you have bugs that break position information when the compiler enables them. I can try to help you fix it if the tests don't pass.

To ensure that you cover this use-case, please make sure to add a pcplod unit test https://github.com/ensime/pcplod

btw, I'm really looking forward to when this is ready for release, so I can use it in
https://github.com/fommil/drone-dynamic-agents/blob/master/src/main/scala/algebra.scala !

Documentation offline

It seems that the link on the doc in the readme in not working. What is the URL of the doc?

Cheers,
Romain

Home page layout

The home page layout will contain three main outlined features and needs a special jekyll style layout that integrates with sbt-microsite.

Uber implicits import for effects module

Currently each separate effects module includes its own object implicits containing the implicit interpreters and syntax for each effect. We should have also a import freestyle.effects.implicits._ which brings into scope all implicits of all the effects. This also apply to other modules that may declare more than one algebra

Extend Cache Operations

This Issue continues Issue#37, which is under Code Review in PR #70. The goal is to extend the algebra of CacheM, with the operations that appear in the original comment.

For the Interpreter backed on a ConcurrentHashMap, the implementation should be based on the API for that class. For the Redis-backed interpreter, the implementation should be based on the commands of redis, and the client library rediscala. Specially relevant would be the command scan for efficiently iterating on the set of keys.

Provide common stack target example

We need to provide an example of interpreting to a common stack such as Kleisli[Task, Config, A] that supports most of the most common effects.

fs2 integrations

Including interpreting streams to FreeS[F, ?] and support for fs2.Task with the same semantics we are planning on supporting monix.Task and scalaz.concurrent.Task

Inject Journal's Logger instance

I'm not using freestyle yet, but it's indeed very appealing.

I have a similar logging algebra in a project of mine, and found it really useful to not instantiate Logger directly in the body of the interpreter (https://github.com/47deg/freestyle/blob/master/freestyle-logging/jvm/src/main/scala/io/freestyle/loggingJVM.scala#L14), first compiling to Kleisli[F, Logger, A]. It has several benefits, for example, that using your approach it'll take the first Manifest[C] from the environment.

I propose something like follows:

  def LogInterp[F[_] : MonadError[?[_], Throwable]](log: Logger): LogF ~> F = LogInterpK andThen KleisliInterp(log)

  def KleisliInterp[F[_] : MonadError[?[_], Throwable]](log: Logger): Kleisli[F, Logger, ?] ~> F = λ[Kleisli[F, Logger, ?] ~> F](_.run(log))

  def LogInterpK[F[_]](implicit ME: MonadError[F, Throwable]): LogF ~> Kleisli[F, Logger, ?] = new (LogF ~> Kleisli[F, Logger, ?]) {
    def apply[A](logF: LogF[A]): Kleisli[F, Logger, A] = logF match {
      case Debug(message) => Kleisli { log =>
        ME.catchNonFatal(log.debug(message))
      }
      case Info(message) => Kleisli { log =>
        ME.catchNonFatal(log.info(message))
      }
      case Warn(message) => Kleisli { log =>
        ME.catchNonFatal(log.warn(message))
      }
      case Error(message) => Kleisli { log =>
        ME.catchNonFatal(log.error(message))
      }
    }
  }

Are you guys open for a PR?

Update to latest scalafmt

Additionally we may have to write our own SBT task bound to compile since the new version no longer has the format on compile setting.

Integrate case classy in config algebras

Case class supports now derivation of codecs for product types so config can be mapped directly to things like classes. On top of that it supports also access to the most common combinators provided by libs like Typesafe Config and a module for shocon wich would allow us to remain compatible with ScalaJS //cc @andyscott

Enable Kazari in freestyle

It's time to test the Kazari integration in the freestyle docs as we approach a first release in January.
Can I get some help integrating Kazari and seeing what it looks like or what potential issues may arise when a project such as Freestyle uses macros? thanks!

Add docs for fs2 integration

Add documentation showing how to integrate fs2 streams in freestyle programs. Also on how to use it together with fs2 streaming IO library.

Research callback based APIs integrations

Many other libs provide callback based APIs that we may be able to integrate in freestyle's monadic flow in some way. This is to track the need to research how that could be best integrated.

Add docs about using generated ADTs

We need to add docs that explain how generated ADTs can be used to write natural transformations from 'Alg.T' to any target type and the compiler will show the missing cases. This should be explained in the context of writing custom interpreters when subclassing and implementing individual methods is less convenient.

Multiple provider style effects conflict

It seems that when you want to use two provider style effects the implicits are not resolved.

For example effect.reader and effect.writer (with respectively EnvironmentProvider and AccumulatorProvider) :

val rd = reader[Config]
val wr = writer[Vector[String]]

@module trait App[F[_]] {
  val persistence: Persistence[F]

  val errorM: ErrorM[F]
  val readerM: rd.ReaderM[F]
  val writerM: wr.WriterM[F]
}

Results in something like :

diverging implicit expansion for type FunctionK[rd.ReaderM.T, Stack]

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.