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

Build docs on 2.13 #4238

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Build docs on 2.13 #4238

merged 3 commits into from
Jul 20, 2022

Conversation

armanbilge
Copy link
Member

@armanbilge armanbilge commented Jun 16, 2022

Closes #4229.

Edit: Apparently also fixes #4041

val writer1: Writer[String, Double] = Writer.value(5.0).tell("Initial value ")
val writer1: Writer[String, Double] = Writer.value[String, Double](5.0).tell("Initial value ")
Copy link
Member Author

Choose a reason for hiding this comment

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

This feels like a type inference regression from 2.12 -> 2.13.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, seems so... I think it might be nice (in the future) to create a better version of Writer.value (and WriterT.value) with some sort of PartialApply involved which would allow to write something line this:

val writer1 = Writer.value[String](5.0).tell("Initial value ")

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, we can do it bincompatibly probably but it would be source-breaking...

Comment on lines -117 to 119
```scala mdoc
try {
allFalse.foldRight(true)(_ && _)
} catch {
case e:StackOverflowError => println(e)
}
```scala
// beware! throws OutOfMemoryError, which is irrecoverable
allFalse.foldRight(true)(_ && _)
```
Copy link
Member Author

Choose a reason for hiding this comment

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

This seemed to throw OutOfMemoryError instead of StackOverflowError on my machine. Maybe in 2.13 they made it stack-safe?

Problem is, unlike StackOverflowError, I believe an OutOfMemoryError is irrecoverable, so a try/catch here only leads to problems arising elsewhere in the JVM. At least that's what I was observing locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to save time for other curious readers :)

Specialized implementation of reverse in LazyList in Scala 2.13 is now @tailrec
https://github.com/scala/scala/blob/bfe46ae4da6401a62c83b728561d6bc7d1b3467b/src/library/scala/collection/immutable/LazyList.scala#L735

@armanbilge armanbilge added this to the 2.9.0 milestone Jun 19, 2022
Co-authored-by: Arthur S. <36887373+arixmkii@users.noreply.github.com>
@armanbilge
Copy link
Member Author

@arixmkii thank you!!

@armanbilge
Copy link
Member Author

Politely requesting review from Sergey since we discussed this in #4160 (comment). No rush, whenever you have a chance, thanks!

@armanbilge armanbilge changed the title Builds docs on 2.13 Build docs on 2.13 Jun 22, 2022
@armanbilge armanbilge closed this Jul 13, 2022
@armanbilge armanbilge reopened this Jul 13, 2022
@armanbilge
Copy link
Member Author

@satorg polite ping on this? :)

@satorg
Copy link
Contributor

satorg commented Jul 19, 2022

@armanbilge oops, sorry, missed this one

Copy link
Contributor

@satorg satorg left a comment

Choose a reason for hiding this comment

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

lgtm, thank you!

@armanbilge armanbilge merged commit 771c6c8 into typelevel:main Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade default scalaVersion to 2.13 Reducible examples are broken
3 participants