-
Notifications
You must be signed in to change notification settings - Fork 51
deriveFixedPoint macro annotation #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| import scala.annotation.compileTimeOnly | ||
|
|
||
| @compileTimeOnly("enable macro paradise to expand macro annotations") | ||
| class fixie extends StaticAnnotation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about renaming fixie to deriveFixedPoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing! Now that it'll be part of droste, the old name doesn't make sense
|
|
||
| val λ: TypeDef = q"type λ[α] = $NonRecursiveAdtName[..${clait.tparams.map(_.name)}, α]" | ||
|
|
||
| val functorInstance = q""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we provide a Traverse instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently kittens doesn't derive traverse. Only Functor and Foldable in that hierarchy
| "org.typelevel" %%% "cats-core" % "1.1.0", | ||
| "org.typelevel" %%% "cats-free" % "1.1.0")) | ||
| "org.typelevel" %%% "cats-free" % "1.1.0", | ||
| "org.typelevel" %%% "kittens" % "1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This brings in the kittens dependency. Long term we should see about removing this dependency and instead having macros to generate Functor/Traverse instances without Shapeless.
For now, can we split fixie into a separate module to better isolate the additional dependency? I need to keep the core module dependency free with the exception of the binary compat guaranteed cats modules.
For splitting, what do you think of droste-extras or another similar name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense. Maybe droste-macros makes more sense? We could put all our macros there and isolate the use of macro paradise.
|
Overall, looks good. My only blocking issue is dependency isolation-- see the note. This opens the door to adding a few other nice macro helpers too :). Very exciting! |
|
@andyscott shall we merge this now? |
andyscott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one final tweak! After that, LGTM.
Ideally we squash and merge, or rebase to clean up the commit history (squashing/fixuping the "feedback" commits).
| lazy val coreJVM = core.jvm | ||
| lazy val coreJS = core.js | ||
|
|
||
| lazy val macros = module("macros") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the macros project to the aggregate list at the top on the root project
39d302c to
edad885
Compare
andyscott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
🎉 |
@andyscott I'm not sure if I need to add something to the bazel build files, since I'm not an user of it