Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 20 00:39
    joroKr21 synchronize #1273
  • Sep 20 00:39
    joroKr21 synchronize #1275
  • Sep 19 22:08

    joroKr21 on main

    Update scala-compiler, scala-li… Merge branch 'main' into update… Merge pull request #1278 from s… (compare)

  • Sep 19 22:08
    joroKr21 closed #1278
  • Sep 19 22:00
    joroKr21 synchronize #1278
  • Sep 19 21:59

    joroKr21 on main

    Update sbt-scalajs, scalajs-com… Merge branch 'main' into update… Merge pull request #1277 from s… (compare)

  • Sep 19 21:59
    joroKr21 closed #1277
  • Sep 19 21:52
    joroKr21 synchronize #1277
  • Sep 19 21:51

    joroKr21 on main

    Update sbt-mima-plugin to 1.1.1 Merge pull request #1276 from s… (compare)

  • Sep 19 21:51
    joroKr21 closed #1276
  • Sep 19 19:18
    scala-steward opened #1278
  • Sep 19 19:17
    scala-steward opened #1277
  • Sep 19 19:17
    scala-steward opened #1276
  • Sep 17 20:23
    joroKr21 assigned #1275
  • Sep 17 20:23
    joroKr21 review_requested #1275
  • Sep 17 20:23
    joroKr21 labeled #1275
  • Sep 17 20:08
    joroKr21 opened #1275
  • Sep 17 19:03
    joroKr21 synchronize #1273
  • Sep 15 18:29

    joroKr21 on main

    Update slf4j-nop to 2.0.1 Merge pull request #1274 from s… (compare)

  • Sep 15 18:29
    joroKr21 closed #1274
Fabio Labella
@SystemFw
a very simple way to fix it is to remove the type sigs
however , that can hit some weird corner cases
so explicit types with Aux is the best practice
Tim Spence
@TimWSpence
Are implicits with no explicit type annotation eligible for this stuff? I thought they weren’t valid as implicit arguments
Fabio Labella
@SystemFw
they are eligible and valid
the inferred type will infer the refinement
the problem is that you hit some bugs sometimes (pretty weird ones)
probably dotty will require explicit signatures for implicits though
Tim Spence
@TimWSpence
Cool, thanks!
Miles Sabin
@milessabin
Aux is the way to go.
It's still needed in Dotty I'm afraid.
It would be good to come up with a way to avoid it.
Fabio Labella
@SystemFw
I'm actually worried about how obscure things will be with the new given syntax and so on
we don't need Aux as much though, right? if parameters can depend on each other within lists
Miles Sabin
@milessabin
There's that. But the other use of Aux to abbreviate duplicated type member declarations in result types doesn't go away.
Fabio Labella
@SystemFw
yeah that makes sense
however perhaps you can just write the full refinement in that case, it's not that big of a deal if only the return type is affected. I think what confuses people about Aux is the prolog style it forces when thinking about your type params, mostly
and that is fixed if you can do (implicit gen: Generic[A], foo: Foo[gen.Repr])
although again, I wonder how that works with the new syntax
Tim Spence
@TimWSpence
Thanks @SystemFw and @milessabin - it (finally) worked! :)
Miles Sabin
@milessabin

although again, I wonder how that works with the new syntax

I'd need to check, but I'm pretty sure it works in much the same way.

Fabio Labella
@SystemFw
:+1:
Ben Kyrlach
@bkyrlach

With the help of the kind folks on here, I finally got some code that works. If anyone was extremely bored and wanted to provide some feedback, I'm sure there's plenty of improvements that could be made.

https://gist.github.com/bkyrlach/cf8ea12ded3c6fb07c14d9c00b33a818
https://gist.github.com/bkyrlach/2ba7fcad87e780e9958c34f898beb468

PhillHenry
@PhillHenry

I suspect this is a silly question: it appears that the values given to create a shapeless.Sized need to be explicitly typed in by the programmer. Is there any way to make this more flexible - perhaps with values pulled from a more dynamic source...?

I'm guessing the answer is 'no' but since Shapeless does things I never thought would be possible, it's worth asking the question.

Fabio Labella
@SystemFw
the answer is no
well, maybe you can read from a file during a macro or something, but basically it needs to be known statically when you compile
this is a general point with what Scala can and cannot do: when you build a typed model, all you can do is then dynamically check if something adheres to that model, but not infer the model dynamically
example, let's say you build a typed schema with shapeless. Most of your code will have compile time guarantees about it
at the edge of your code you can say "I dynamically assert that this piece of data conforms to this schema, and will throw an error otherwise"
PhillHenry
@PhillHenry
I thought not. Thanks @SystemFw
Fabio Labella
@SystemFw

:point_up: March 6, 2019 4:26 PM

it's somewhat related to this point

Yosef Fertel
@frosforever
Hey folks, is it possible to prove some A is not a case class? I can do something like evNotCaseClass: A <:!< Product but that’s more broad than I would otherwise want it.
Yosef Fertel
@frosforever
you’ve got much better google fu than me @DmytroMitin!
guess there’s no way using shapeless constructs only?
Dmytro Mitin
@DmytroMitin
@frosforever myabe something will illTyped
Miles Sabin
@milessabin
Hmm ... I thought we did have something like that.
Dmytro Mitin
@DmytroMitin
@frosforever that link at SO shows how to check that T is a case class and negation can be done via standard trick DoesntHave https://stackoverflow.com/questions/24853615/how-in-shapeless-do-you-say-that-a-proof-is-the-empty-type-i-e-false
Yosef Fertel
@frosforever
Ohhh that looks useful too. Gotta play with that a bit. thanks!
Miles Sabin
@milessabin
Why is ruling out Products too broad? Do you want to allow tuples?
Yosef Fertel
@frosforever
In my particular case there’s a class that I want to include that’s not a case class but sadly extends Product otherwise it would be perfect
I think I might just get around it for that particular class with some Low prority implicits instead. That might be easier
Miles Sabin
@milessabin
I think that's probably the simplest approach.
Dirk T.
@DirkToewe
Why does Nat use Peano Arithmetics instead of a binary integer representation?
AndreasKostler
@AndreasKostler

Hi all, is there machinery in shapeless (or elsewhere) allowing you to prove that a particular implicit instance is NOT in scope? I.e.

trait Foo
implicit val foo = new Foo {}

implicitly[Not[Foo]] // Err: "Implicit instance for Foo in scope."

I have something that works but I'm wondering if someone thought about this in more depth before.

Jacob Wang
@jatcwang
@AndreasKostler I'm pretty sure there is. Let me take a look (good to see you again btw! :D)
AndreasKostler
@AndreasKostler
Ahhh thank you! :)
Ethan
@esuntag
I've got a code generator that produces a sealed trait with ~280 case classes extending it. I would like to use Shapeless to do some generic reasoning over this, and am currently working on a parser. However, trying to create a Generic[MyData] leads to a stack overflow. Is there any good way around this?
ritschwumm
@ritschwumm
@esuntag have you tried increasing the VMs stack size to at least -Xss2M ?