-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Build docs on 2.13 #4238
Conversation
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 ") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ")
There was a problem hiding this comment.
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...
```scala mdoc | ||
try { | ||
allFalse.foldRight(true)(_ && _) | ||
} catch { | ||
case e:StackOverflowError => println(e) | ||
} | ||
```scala | ||
// beware! throws OutOfMemoryError, which is irrecoverable | ||
allFalse.foldRight(true)(_ && _) | ||
``` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Co-authored-by: Arthur S. <36887373+arixmkii@users.noreply.github.com>
@arixmkii thank you!! |
Politely requesting review from Sergey since we discussed this in #4160 (comment). No rush, whenever you have a chance, thanks! |
@satorg polite ping on this? :) |
@armanbilge oops, sorry, missed this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you!
Closes #4229.
Edit: Apparently also fixes #4041