Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 11 22:54

    julien-truffaut on gh-pages

    Deploy website Deploy website … (compare)

  • Aug 11 22:48

    xuwei-k on master

    Update scalafmt-core to 3.5.9 (… (compare)

  • Aug 11 22:48
    xuwei-k closed #1294
  • Aug 11 22:00
    scala-steward-bot synchronize #1294
  • Aug 11 21:00
    scala-steward-bot synchronize #1294
  • Aug 11 20:03
    scala-steward-bot review_requested #1294
  • Aug 11 20:03
    scala-steward-bot review_requested #1294
  • Aug 11 20:03
    scala-steward-bot review_requested #1294
  • Aug 11 20:03
    scala-steward-bot opened #1294
  • Jul 29 16:59
    rpiaggio opened #1293
  • Jul 27 03:37

    julien-truffaut on gh-pages

    Deploy website Deploy website … (compare)

  • Jul 27 03:32

    xuwei-k on master

    Update sbt-mdoc to 2.3.3 (#1292) (compare)

  • Jul 27 03:32
    xuwei-k closed #1292
  • Jul 27 03:27
    xuwei-k auto_merge_enabled #1292
  • Jul 27 03:25
    scala-steward-bot synchronize #1292
  • Jul 27 00:00
    scala-steward-bot synchronize #1292
  • Jul 26 23:01
    scala-steward-bot synchronize #1292
  • Jul 26 22:03
    scala-steward-bot synchronize #1292
  • Jul 26 21:01
    scala-steward-bot synchronize #1292
  • Jul 26 20:01
    scala-steward-bot synchronize #1292
Matthew Pocock
@drdozer
thanks
wedens
@wedens
why does prisms in monocle are based on Option, and prisms in Control.Lens on Either?
Julien Truffaut
@julien-truffaut
@wedens PPrism are based on scalaz.\/
monomorphic Prism only needs an Option
wedens
@wedens
ahh, ok
Matthew Pocock
@drdozer
so I have something to ask because it is painful :D
I have a caseclass with, say 15 fields
they all have unique types
I'd like to generically infer an operation over each individual field
given a lens from the case class to a field, I can infer the operation
so the simplest way for me to automate this would be to make the lenses implicit
however, I don't think the @Lenses generated code makes the lenses implicit
Binh Nguyen
@ngbinh
@julien-truffaut how hard is it to support scala.js upstream?
hmm.. looks like there are two dependencies scalaz-core and discipline do not officially support scala.js yet.
Julien Truffaut
@julien-truffaut
@drdozer you're right @Lenses do not make the generated Lens implicit as there are no guarantee of uniqueness
@ngbinh I am not really familiar with scala.js build, I suppose there must be a build for scalaz since @japgolly manages a fork of monocle for scala.js
I am completely fine to integrate to scala.js directly, I just don't know how to configure it
Binh Nguyen
@ngbinh
yes, but he has to comment out some parts of scalaz-core
Julien Truffaut
@julien-truffaut
feel free to open an issue if it is something you want
Binh Nguyen
@ngbinh
k, I will open an issue on it. Hope that I can find some time for a PR too
I think just rely on @japgolly scalaz build for now
Julien Truffaut
@julien-truffaut
@drdozer I don't know if that can help you but GenLens supports generating Lens several level deep. e.g. GenLens[Person](_.address.streetNumber)
Binh Nguyen
@ngbinh
@julien-truffaut just curious, is there any future plan to replace Scalaz with Cats? (Not that I have any problem with Scalaz but Cats seems to be nicer :smile: )
Julien Truffaut
@julien-truffaut
It all depends on how the community adopt cats, I believe the biggest blocker at the moment is scalaz stream but there is a plan to remove scalaz dependency there
Matthew Pocock
@drdozer
@julien-truffaut exactly - lenses aren't generally unique, which is one of my anoyances with them as an abstraction
At some point i want someone to give me cash for 6 months so that I can sit down and do a path calculus, where each step in the path has a unique type, and paths are injective to lenses and zippers, and where you can manipulate the paths as first-class data structures to optimize lookup/update operations
wedens
@wedens
@drdozer in haskell lenses are just functions. in scala it's not convenient to represent them this way due to shitty inference (at least). If I understood correctly what you mean
Julien Truffaut
@julien-truffaut
This message was deleted
@wedens optics cannot be defined as function in scala because functions do not have type parameters, only method do
wedens
@wedens
right. and it's very sad. I wish there were no methods/function distinction :)
Gary Pamparà
@gpampara
stupid OO
wedens
@wedens
OO is always the party pooper
Miles Sabin
@milessabin
This is nothing to do with "OO" (however construed) per se. It's a limitation of the particular encoding of (a very limited range of) function types into class types that's used in the Scala std lib. Function types could have been encoded differently, without those restrictions ... shapeless's Polytypes are one way that might have been done.
Gary Pamparà
@gpampara
sure, but it wasn’t. the issue is moot regardless - we have them now
Matthew Pocock
@drdozer
Right, so in principle could optics not be encoded like shapeless poly?
Julien Truffaut
@julien-truffaut
I don't know shapeless enough to say
Miles Sabin
@milessabin
In principle, probably yes. In practice more work would have to be done on poly composition ... for technical reasons it's pretty clunky right now.
(the problem is that polys rely on stable values for case/instance lookup, but the result of an expression f compose g isn't stable).
Mark Eibes
@i-am-the-slime
What do I need to import to get the Lenses macro?
Ah I see, it's a different dependency for me on ScalaJS. Sorry.
Julien Truffaut
@julien-truffaut
Matthew Pocock
@drdozer
looks good to me
Markus Klink
@justjoheinz
@julien-truffaut It would be cool to provide the output of modifyF (because otherwise it is not clear what it does) and provide an example using Future as a Functor, as this is something which will very frequently occur.
Matthew Pocock
@drdozer
I opened an issue for implicit lenses
My general use case is when there is some TC [A] and an instance for X and from this we can drive an instance for Y given a Lens [Y, X].
Julien Truffaut
@julien-truffaut
@justjoheinz tut will actually run the command and display it in the web page
Julien Truffaut
@julien-truffaut
@drdozer I think I understand your use case but a Lens is not unique, so I don't think it should be defined as implicit
Matthew Pocock
@drdozer
@julien-truffaut it is the path that is unique, but there's not currently a type-level reflection of paths. In my data models, each of these lenses is guaranteed unique, but I realise that they are not unique in the general case.
is there an argument to be made against making this a user-configurable option to the Lens macro?