Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:59
    lrytz commented #9451
  • 13:47
    dwijnand synchronize #9534
  • 13:40
    lrytz edited #9536
  • 13:40
    lrytz edited #9536
  • 13:35
    dwijnand labeled #9535
  • 13:30
    lrytz synchronize #8830
  • 13:29
    lrytz synchronize #8830
  • 13:28
    dwijnand commented #9536
  • 13:24
    lrytz review_requested #8830
  • 13:23
    lrytz synchronize #8830
  • 12:39
    dwijnand synchronize #9534
  • 11:25
    lrytz synchronize #8830
  • 11:22
    lrytz synchronize #8830
  • 11:21
    lrytz synchronize #8830
  • 10:44
    exoego commented #1221
  • 10:44
    exoego commented #1221
  • 10:43
    exoego commented #1221
  • 10:38
    exoego commented #1221
  • 10:37
    exoego commented #1221
  • 10:25

    darjutak on master

    Scala 3 developers preview surv… (compare)

Seth Tisue
@SethTisue
it’s rarely important to know. Gen stands for “general” — meaning it might or might not be a parallel collection. TraversableOnce means it might (or might not) be e.g. an Iterator which is consumed in a single pass.
soc
@soc
it basically says that it's a data strucutre which can be traversed at least once, and Gen means it has no idea whether it happens sequantially or in parallel
Seth Tisue
@SethTisue
Michiel Borkent
@borkdude
thanks
Li Haoyi
@lihaoyi
Traversable would be such a beautifully useful/general trait if it wasn't full of annoying concrete eager implementations :/
A traversable with lazy operations is the perfect dual of an iterator with lazy operations (which we have)
And would map perfectly onto Java 8 streams because that's basically what they are
Rob Norris
@tpolecat
@borkdude the collections hierarchy is legitimately baffling, so don't feel bad.
richfwebb
@richfwebb
Anyone have a recommendation for lightweight communication from scala to lua (for an API)? Tcp and cURL are the best options I've found so far.
Otto Chrons
@ochrons
HTTP is usually quite well supported
agilisticdev
@agilisticdev
Hi. I am a newly with Scala and actually reading Scala 2nd Edition and got a question on how to create an empty list. I read that Nil is a shorter way to create an empty... Why Nil? Just by its name, I would never know that Nil does that? What the explanation for Nil?
Thanks
Perry
@pfn
because Nil means empty list
Rob Norris
@tpolecat
Nil is the empty list. The one and only.
So it doesn't "create" anything; it's just a value.
agilisticdev
@agilisticdev
Thanks for you quick answer but I'll orient my question differently
Rob Norris
@tpolecat
Traditionally nil was the empty list in Lisp, so that's almost certainly where the name came from.
agilisticdev
@agilisticdev
Nil, in some languages like Objective-C means the same thing as null in Java
To me, there is no obvious relation between Nil and an empty list...
They could have used "Lon".. at it would be a acroymn for "List of Nothing"....
Martijn Hoekstra
@martijnhoekstra
I think the convention comes from Lisp, but I'm not 100% sure.
Rob Norris
@tpolecat
In FP the linked list constructors are almost always called cons and nil.
Krzysztof Pado
@povder
@agilisticdev there are a lot of new terms to learn when you start learning functional programming
agilisticdev
@agilisticdev
Oh, I do not know Lisp...
Rob Norris
@tpolecat
In Scala we write them as :: and Nil.
Krzysztof Pado
@povder
@agilisticdev If you're interested, check out https://en.wikipedia.org/wiki/Cons
agilisticdev
@agilisticdev
@povder Thanks, I'll certainly read it
Krzysztof Pado
@povder
I also recommend this course https://www.coursera.org/course/progfun
I think that this course is a very good starting point for learning functional programming and scala
agilisticdev
@agilisticdev
Thanks for your quick answer. I do not find :: and Nil very readable and easy to understand but as you guys said, these terms are used in FP, so I'll get used to it
Perry
@pfn
get used to it, and it's very readable vs alternatives
Justin du Coeur, AKA Mark Waks
@jducoeur
@agilisticdev This usage of nil is 50+ years old in the functional-programming community. It's a bit unfortunate that Objective-C used it to mean something else, but it has meant "empty list" since the early days of software -- it not only predates Objective-C, I believe it predates C...
Rob Norris
@tpolecat
correct. lisp was invented in the late 1950's
Srepfler Srdan
@schrepfler
what happened with Coursera’s progfun course this year, it was supposed to happen in September no?
nafg
@nafg
@schrepfler I think they're refactoring it ;)
@odersky can give a better answer
Seth Tisue
@SethTisue
re: progfun course, see Martin’s post at https://groups.google.com/d/msg/scala-user/mB_5PnAWRow/vt0Yv9mECwAJ
they’re actively working on it.
qifeng dai
@matrix2011
Dear all, i have a question. I know what "case class” means, but I found some single object modified by “case" yet, what does it means? as "case object Nil extends List[Nothing]” for example.
qifeng dai
@matrix2011
thanks
Sebastian Himberger
@shimberger
is Either idiomatic to use? I am looking for a good way of error handling in the standard library
Rob Norris
@tpolecat
Either is what's provided in stdlib but it is awkward to use because it is unbiased. scalaz.\/ and cats.Xor are better. Scalactic Or as well.
@shimberger here is a good overview of some possibilities and their trade-offs.
Sebastian Himberger
@shimberger
@tpolecat thanks
Krzysztof Pado
@povder
Is this ok to signal application exceptions through failed futures (methods returning Future[A]) or is this only for unexpected errors? Should my methods return Future[A] or Future[Try[A]] when I expect some errors?
It was pretty clear to me that Future[A] is enough but I think I read somewhere (can't find the source now) that it's wrong
Liara
@kiritsuku
exceptions always model unexpected failures, therefore if you want to throw an exception Future[A] is ok. If you want to explicitly let users handle the error case, then you should use Future[Try[A]].
Which one is better depends on the use case and needs to be decided wisely ;)
soc
@soc
added some SVGs to the tooling section: http://get-scala.org/#tooling opinions?