Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 00:25
    SethTisue converted_to_draft #9677
  • 00:25
    SethTisue commented #9679
  • 00:25
    SethTisue commented #9679
  • Jun 23 22:37
    joroKr21 commented #12422
  • Jun 23 22:37
    joroKr21 commented #12422
  • Jun 23 22:17
    SethTisue demilestoned #9678
  • Jun 23 22:17
    SethTisue closed #9678
  • Jun 23 22:17
    SethTisue commented #9678
  • Jun 23 21:42
    joroKr21 commented #12422
  • Jun 23 21:21
    joroKr21 commented #12422
  • Jun 23 21:21
    pjfanning commented #12422
  • Jun 23 21:15
    joroKr21 commented #12422
  • Jun 23 21:07
    joroKr21 commented #12422
  • Jun 23 21:01
    joroKr21 commented #12422
  • Jun 23 20:50
    SethTisue review_requested #2093
  • Jun 23 20:50
    SethTisue opened #2093
  • Jun 23 20:37
    SethTisue edited #9679
  • Jun 23 20:36
    SethTisue commented #9678
  • Jun 23 20:36
    SethTisue commented #9678
  • Jun 23 20:35
    SethTisue commented #9678
D Cameron Mauch
@DCameronMauch
So even if you only use a handful of the fields in the case class, Spark can’t load only those fields from whatever storage
Seth Tisue
@SethTisue
@ImGrayMouser_twitter seconded that learn-you-a-Scala coding challenges should most definitely not be directing you to use Array
D Cameron Mauch
@DCameronMauch
The only place I would except to see Array in a Scala application is in a main method, to satifying the signature.
Luis Miguel Mejía Suárez
@BalmungSan
Not even there if you use IOApp from cats-effect :grimacing:
Also, I believe Scala 3 will have some something similar to one of the Li' libraries to automatically parse the arguments into a case class, so your main method would not see the Array
Matt Hicks
@darkfrog26
Ugh...80% of my open-source projects now released for Scala 3.
Rob Norris
@tpolecat
:tada:
I'm waiting on a few things but I'm almost done.
Eric K Richardson
@ekrich
Nice job!
Life without macros is easier.
Matt Hicks
@darkfrog26
@ekrich sometimes yes, sometimes no
Eric K Richardson
@ekrich
At least for porting, not for what you are doing :smile:
Seth Tisue
@SethTisue
Luis Miguel Mejía Suárez
@BalmungSan
:tada:
gitleet
@gitleet
I'm confused, why does typesafe config return back java collections?
Luis Miguel Mejía Suárez
@BalmungSan
Well mostly because is a Java library.
gitleet
@gitleet
:) ok the typesafe namespace got me confused
Luis Miguel Mejía Suárez
@BalmungSan
The good news is that transforming a Java collection into a Scala one is pretty easy thanks to the CollectionConverters in the stdlib :)
Matt Hicks
@darkfrog26
@gitleet typesafe-config is pure evil. :-p
Luis Miguel Mejía Suárez
@BalmungSan
You may also want to give a look to pureconfing which is a Scala wrapper over typesafe config.
Matt Hicks
@darkfrog26
I'd recommend Profig or PureConfig (the former being better because I wrote it). :-p
Oh, and Profig doesn't rely on typesafe-config
I'm honestly surprised that typesafe-config is still so widely used
Rob Norris
@tpolecat
I have had pretty good luck with Ciris.
Matt Hicks
@darkfrog26
I've actually never used that one
at first glance it looks a bit complicated
seems a bit problematic that it has custom types
like their enum support
Rob Norris
@tpolecat
It works great.
Matt Hicks
@darkfrog26
@tpolecat thanks, I made a note to look into it further later. :)
econoraptor
@econoraptor
What's the proper way to get from a type to its corresponding class in a macro? I'm trying this, but the TypeDef invocation results in a MatchError on macro expansion TypeDef(TypeRepr.of[T].classSymbol.get)
Seth Tisue
@SethTisue
@econoraptor what if the type doesn't have a corresponding class?
@econoraptor is this Scala 2 or 3, by the way?
econoraptor
@econoraptor
I'm assuming that's why classSymbol is an option. In this specific case it does have a class
scala 3
Seth Tisue
@SethTisue
oh, I only know macros in 2. maybe someone else can help
gitleet
@gitleet

I'm honestly surprised that typesafe-config is still so widely used

probably b/c playframework ships with it

Rob Norris
@tpolecat
I think Akka also uses it.
Eric K Richardson
@ekrich
Scalafmt uses it or sconfig
Nathan Fischer
@nrktkt:matrix.org
[m]
what are the issues with typesafe/lightbend config?
I know a few things I'd like to improve, but nothing really bad comes to mind
gitleet
@gitleet
I don't like how it returns java collections by default....
Rob Norris
@tpolecat
I don’t like how it uses config files.
1 reply
Seth Tisue
@SethTisue
unless you take Rob's position, HOCON seems quite nice to me
Luis Miguel Mejía Suárez
@BalmungSan
I believe I understand Rob's point. All my HOCONS are just redirects to env vars or constants.
So the config file just becomes more work to maintain and extra source for bugs.
Like having runtime errors because I had a typo in the HOCON file.
I want to try ciris, but it is in the bottom of my TODO list.
Jim Newton
@jimka2001

I am using a library function which I didn't write which as an argument of type => Any. I'd like to prepend some action before and after the object passed to that function. How can I do that?
Here is what I've tried, but it doesn't work.

class MyFunSuite extends AnyFunSuite {
  import org.scalactic.source
  import org.scalatest.Tag
  override def test(testName: String, testTags: Tag*)(testFun: => Any /* Assertion */)(implicit pos: source.Position):Unit = {
    lazy val action = locally{
      println("[ starting " + testName)
      try{      testFun }
      finally{ println("] finished " + testName)}
    }
    super.test(testName,testTags : _*)(action)(pos)
  }
}

When I run my test case I see output like the following which (I believe) means the finally is executed before the testFun

[ starting subclass
] finished subclass
[ starting disjoint
] finished disjoint
[ starting disjoint and subtype
] finished disjoint and subtype
[ starting randomizer
] finished randomizer
[ starting test 1
] finished test 1
[ starting typep
] finished typep
[info] GenusBddTest:
[info] - subclass
[info] - disjoint
[info] - disjoint and subtype
[info] - randomizer
[info] - test 1
[info] - typep
Jim Newton
@jimka2001
The problem is that I have a test which gives an out-of-heap-space error. And if [info] is printed after the test finishes, then the [info] for the problematic test never gets printed.