Comments (11)
I added the import to the example. Thanks.
from eff.
Thank you for that, it doesn't seem to compile though.
from eff.
What is your compilation error? My example is compiling because the doc is generated from valid Scala code here.
from eff.
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:5: not found: object all
[error] import org.atnos.eff., all.
[error] ^
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:6: object interpret is not a member of package org.atnos.eff
[error] import org.atnos.eff.interpret._
[error] ^
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:18: not found: type <=
[error] def future[R, A](a: => A)(implicit m: Fut <= R): Eff[R, A] =
[error] ^
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:19: not found: value send
[error] send[Fut, R, A](Future%28%28%29 => a%29)
[error] ^
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:24: not found: type Recurse
[error] val recurse = new Recurse[Fut, U, A] {
[error] ^
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects/Effects.scala:28: not found: value interpret1
[error] interpret1((a: A) => a)(recurse)(effects)(m)
[error] ^
[error] 6 errors found
error Compilation failed
[error] Total time: 0 s, completed 19-Apr-2016 20:04:38
4. Waiting for source changes... (press enter to interrupt)
[info] Compiling 2 Scala sources to /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/target/scala-2.11/classes...
[error] /Users/pavlos/Workspace/habito-deployment/slib/habito-effects/src/main/scala/habito/effects.scala:3: not found: type Effects
[error] package object effects extends Effects
[error] ^
[error] one error found
error Compilation failed
[error] Total time: 0 s, completed 19-Apr-2016 20:05:10
5. Waiting for source changes... (press enter to interrupt)
from eff.
These are the errors if I copy and paste the snippet as it is
from eff.
Now my code is like this
import scala.concurrent.{Await, ExecutionContext, Future}
import cats.data.Xor
import org.atnos.eff._
import Eff._
import Member._
import Interpret._
import scala.concurrent.duration.Duration
trait Effects {
object FutureEffect {
type Fut[A] = Future[() => A]
def future[R, A](a: => A)(implicit m: Fut <= R, ec: ExecutionContext): Eff[R, A] =
send[Fut, R, A](Future(() => a))
def runFuture[R <: Effects, U <: Effects, A]
(
atMost: Duration
)
(
effects: Eff[R, A]
)(
implicit m: Member.Aux[Fut, R, U],
ec: ExecutionContext
): Eff[U, A] = {
val recurse = new Recurse[Fut, U, A] {
override def apply[X](m: Fut[X]): Xor[X, Eff[U, A]] =
Xor.left(Await.result(m.map(_ ()), atMost))
}
interpret1[R, U, Fut, A, A]((a: A) => a)(recurse: Recurse[Fut, U, A])(effects)(m)
}
}
}
from eff.
The error here is
type arguments [R,U,habito.effects.Effects.FutureEffect.Fut,A,A] do not conform to method interpret1's type parameter bounds [R <: org.atnos.eff.Effects,U <: org.atnos.eff.Effects,M[_],A,B]
[error] interpret1[R, U, Fut, A, A](%28a: A%29 => a)(recurse: Recurse[Fut, U, A])(effects)(m)
[error] ^
[error] one error found
from eff.
Is this a public project I could have a look at?
from eff.
Sorry it's not, but the snippet I pasted should be enough, is it not?
Thank you
On 19 Apr 2016 21:20, "Eric Torreborre" [email protected] wrote:
Is this a public project I could have a look at?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#4 (comment)
from eff.
Those errors seem to correspond to the latest code which was not yet published. Please try version 1.4 which I just published now.
from eff.
Thank you
from eff.
Related Issues (20)
- sbt launch script in repo is outdated
- upgrade to cats-effect 1.0.0-RC3? HOT 5
- Any plans on releasing latest version of Eff ? HOT 4
- How to use fs2.Stream compile for Eff[R, ?] ? HOT 3
- 2.13 support ? HOT 12
- Future maintenance of Eff AddOns (Twitter, Scalaz, Monix, Doobie) HOT 7
- Use scala-steward? HOT 2
- missing 5.7.0 tag on GitHub HOT 1
- Broaden maintainer set HOT 1
- Scalajs 1.x support HOT 1
- Use Mergify for automatically merge scala-steward's PRs? HOT 2
- release new version HOT 5
- migrate to GitHub Actions?
- Cats Effect 3 migration HOT 2
- "Composing ADTs" tutorial code does not work as expected HOT 2
- Widening the effects a computation HOT 9
- ConcurrentWeakIdentityHashMap issue
- update specs2 HOT 1
- old removed branch memo
- remove `-source:3.0-migration` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eff.