Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 09:18
    GusevTimofey starred mpilquist/simulacrum
  • Jan 29 2019 12:01
    mriceron starred mpilquist/simulacrum
  • Jan 25 2019 15:35
    shuttj starred mpilquist/simulacrum
  • Jan 19 2019 20:51
    driuzz commented #124
  • Jan 19 2019 17:54

    mpilquist on master

    Updated README for 0.15 release (compare)

  • Jan 19 2019 16:03

    mpilquist on v0.15.0

    (compare)

  • Jan 19 2019 16:03

    mpilquist on master

    Setting version to 0.15.0 Setting version to 0.15.1-SNAPS… (compare)

  • Jan 19 2019 15:16

    mpilquist on master

    Update scalatest to 3.0.6-SNAP6 Merge pull request #125 from sc… (compare)

  • Jan 19 2019 15:16
    mpilquist closed #125
  • Jan 19 2019 15:15

    mpilquist on master

    Update sbt-release to 1.0.11 Merge pull request #123 from sc… (compare)

  • Jan 19 2019 15:15
    mpilquist closed #123
  • Jan 19 2019 15:15

    mpilquist on master

    Add support for DocDef Add support for DocDef - test Disabled ScalaDoc generation on… and 2 more (compare)

  • Jan 19 2019 15:15
    mpilquist closed #124
  • Jan 19 2019 15:10
    mpilquist commented #124
  • Jan 19 2019 15:10
    mpilquist synchronize #124
  • Jan 19 2019 15:09
    mpilquist synchronize #124
  • Jan 19 2019 04:34
    wangpengwen starred mpilquist/simulacrum
  • Jan 18 2019 13:57
    scala-steward synchronize #125
  • Jan 18 2019 13:57
    scala-steward synchronize #123
  • Jan 18 2019 12:44

    mpilquist on master

    Future proof subtype evidence … Merge pull request #126 from jo… (compare)

Yilin Wei
@yilinwei
@siddhant3s Simulacrum has nothing to do with IntelliJ?
Macros are nested expansions and I'm guessing IntelliJ might be able to see it in target, but you won't be able to see it in the file I guess?
Siddhant Sanyam
@siddhant3s
I mean, IntelliJ's official Scala plugin has support for Simulacrum's injected methods using @ops
Yilin Wei
@yilinwei
Oh, no idea.
Yilin Wei
@yilinwei
In which case, I suspect it would be unlikely that it would find the op inside a macro expansion since they wouldn't need special support for it otherwise.
Siddhant Sanyam
@siddhant3s
Hmm... I think you're right.
But that would depend on if the macro's are really executed within IJ or not. WhiteBox macros allow you to return a more specific type than what is there on the macro definition. And if so they are really being executed by IJ, then I can imagine the plugin be able to read the annotation and dynamically inject methods.
Seems like there is no way in Scala/Macro to really create a dynamically named method on fly and have it work with IJ.
Marcin Kossakowski
@markosski
Hi guys, I'm trying out simulacrum and running into an issue with running first example from readme - typeclass annotation should have been removed by simulacrum but was not. I'm on Scala 2.12.8. I ensured simulacrum dependency and compiler plugin was added as per readme instructions.
Maxim Davydov
@Twizty
Hi people, I'm working on the issue at cats (typelevel/cats#3141), and have found strange behavior of simulacrum. I've implemented a method def foldA[G[_], A](fga: F[G[A]])(implicit G: Applicative[G], A: Monoid[A]): G[A] for Foldable and it's compiled to def foldA[G[_], A](implicit ev$macro$49: <:<[D, G[A]], G: Applicative[G], A: Monoid[D]) = typeClassInstance.foldA(self.asInstanceOf[F[G[A]]])(G, A); which fails. Is it a bug or am I doing something wrong?
Travis Brown
@travisbrown
I've been experimenting with a reworking of Simulacrum that's built on scala.meta + scalafmt and based on codegen instead of macro annotations…
The idea is that in Cats 3 the type class machinery would go in managed source, but I'm pretty close to having a Cats 2 proof-of-concept that just expands the checked-in source (while still passing all tests + bincompat checks).
I think you've mentioned ideas like this, @mpilquist—do you happen to know if anyone else has worked on it?
Yilin Wei
@yilinwei
@travisbrown Apologies for the late reply. I swear that a long time ago Eugene or Oleg had a branch with it.
Jasper Moeys
@Jasper-M
I thought I saw a scalameta implementation of simulacrum somewhere once, but it was probably not complete and now also outdated. Can't find it anymore though.
Brian P. Holt
@bpholt
If a typeclass has methods with by-name parameters, afaict ops methods aren't generated for those methods. Is that because they aren't possible, no one has implemented it, or it's a bad idea?
Georgi Krastev
@joroKr21
It should be possible (#: is one example)
Fabrizio Colonna
@ColOfAbRiX
Hi! I wanted to learn adn add Simulacrum to one of my project but I keep getting typeclass annotation should have been removed by simulacrum but was not. I can't understand why, I'm using scala 2.13, sbt 1.3.8, simulacrum 1.0.0 and I'm copy-pasting the example in the github readme
forgot to say I have "-Ymacro-annotations" in my compiler options
Fabrizio Colonna
@ColOfAbRiX
Solved. If anyone is interested the sbt plugin Splain was messing up with Simulacrum
Pablo Cavallo
@pacdaemon

Hi I have an error but I can't figure out what is happening

@typeclass trait Monad[F[_]] { self =>
  def flatten[A](ffa: F[F[A]]): F[A] =
    ???

  def notNested[A](fa: F[A]): F[A] =
    ???
}

The flatten with the nested context throws a compilation error

Error:(19, 2) exception during macro expansion: 
scala.ScalaReflectionException: object scala.reflect.macros.blackbox.Context in compiler mirror not found.
    at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:145)
    at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:29)
    at simulacrum.TypeClassMacros$$typecreator1$2.apply(typeclass.scala:218)
    at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:237)

The method notNested not. Btw I'm using simulacrum 1.0.0, Scala 2.13.3

I got the same error switching to the mpilquist 0.19 version. @mquilquist, as you can guess I'm following your series on youtube about Functional Structures on Scala, but with newer versions of the libraries.
Pablo Cavallo
@pacdaemon
Update creating an aliast to the nested context allows compilation type NF[A] = F[F[A]]
Michael Pilquist
@mpilquist
Hm, that definitely seems like a bug, though it’s been a while since I’ve looked at simulacrum source. With Dotty’s support for extension methods (and lack of support for macro annotations), Simulacrum has been effectively EOLed. Hope the YouTube series is helpful :)
Pablo Cavallo
@pacdaemon
Got it, I understand, no worries I can use the trick of the type alias. Yes, the YouTube series is great! thanks