Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tut in Travis builds (fix #362) #363

Merged
merged 8 commits into from
Oct 19, 2016

Conversation

guersam
Copy link
Contributor

@guersam guersam commented Oct 9, 2016

It seems that the first exec replaces the shell and swallows the following ones. [1] This PR just merges all sbt commands into a single run.

[1] http://stackoverflow.com/a/7194536

@guersam
Copy link
Contributor Author

guersam commented Oct 9, 2016

Confirmed that tut is running again, sorry for missing it from the first place. Will fix the doc itself within a few days.

@tpolecat
Copy link
Member

Cool thanks for looking into this.

@@ -22,7 +24,7 @@ object catchablespec extends Specification {
}

"work on unaliased IConnection" in {
42.pure[ConnectionIO].map(_ + 1).attempt
(42.pure[ConnectionIO].map(_ + 1): ConnectionIO[Int]).attempt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional indirection confuses type inference here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this test as-is and yax it out for cats, then open a separate issue to sort this out. I know Adelbert is pretty focused on it so maybe he'll have some ideas.

@@ -120,7 +120,7 @@ program3a.replicateM(5).transact(xa).unsafePerformIO.foreach(println)
#-scalaz
#+cats
```tut
program3a.replicateA(5).transact(xa).unsafePerformIO.foreach(println)
ApplicativeError[ConnectionIO, Throwable].replicateA(5, program3a).transact(xa).unsafePerformIO.foreach(println)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

@guersam
Copy link
Contributor Author

guersam commented Oct 11, 2016

Tried removing cats-only attempt syntax in favor of cats.ApplicativeError due to an ambiguous implicit error when import cats.implicits._ and fs2.interop.cats._ is used.

The problem is that the type cannot be inferred in some situation due to the additional implicit search step(s) as ApplicativeError is derived via the conversion from fs2.util.Catchable to cats.MonadError provided by fs2-cats. For example, even the simple test case 42.pure[ConnectionIO].map(_ + 1).attempt doesn't work whereas 42.pure[ConnectionIO].attempt works.

UPDATE: Not only ApplicativeError but other type classes such as Applicative suffer from it. Do you have any idea?

@tpolecat
Copy link
Member

Yeah I ran into this and didn't try to track it down. I won't have time to look at this until the weekend but I'll have a couple weeks with a lot of free time because I'll be in Chile by myself with nothing better to do.

In any case thanks for your help with this.

@guersam
Copy link
Contributor Author

guersam commented Oct 13, 2016

Seems related to typelevel/cats#1210

@guersam
Copy link
Contributor Author

guersam commented Oct 13, 2016

And this scala/scala#5106

@@ -120,7 +120,7 @@ program3a.replicateM(5).transact(xa).unsafePerformIO.foreach(println)
#-scalaz
#+cats
```tut
program3a.replicateA(5).transact(xa).unsafePerformIO.foreach(println)
Applicative[ConnectionIO].replicateA(5, program3a).transact(xa).unsafePerformIO.foreach(println)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh.

@tpolecat
Copy link
Member

If you don't mind making that one change in the tests I think this is ok to merge. Opened #369 to track the underlying issue.

@guersam
Copy link
Contributor Author

guersam commented Oct 16, 2016

Old postgis driver (1.3.3) is compiled against postgres driver 8.3 and pulls it as a transitive dependency. Bumped it to the latest version.

#+cats
// TODO Remove yax (https://github.com/tpolecat/doobie/issues/369)
(42.pure[ConnectionIO].map(_ + 1): ConnectionIO[Int]).attempt
#-cats
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to ping @tpolecat, is this what you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, perfect. Thanks!

@tpolecat tpolecat merged commit 1ebdb6b into typelevel:series/0.3.x Oct 19, 2016
@guersam guersam deleted the tmp/fix-tut branch October 19, 2016 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants