Macros is Scalaz

204 views
Skip to first unread message

Jean-Rémi Desjardins

unread,
Jan 10, 2015, 12:17:59 AM1/10/15
to sca...@googlegroups.com
Hi,

I noticed that there are no macros within scalaz right now (or am I wrong?).

Is there any chance whatsoever, that a contribution involving macros would be accepted within scalaz?

Cheers,

Alois Cochard

unread,
Jan 11, 2015, 12:58:22 PM1/11/15
to sca...@googlegroups.com
Hi Jean-Rémi,

You might have more feedback if you explain what you actually have in mind, I mean which problem do you want to solve using macros?

I'm of the one who prefer to avoid them as much as possible, but maybe you have a strong case for it?

Cheers



--
You received this message because you are subscribed to the Google Groups "scalaz" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaz+un...@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
Visit this group at http://groups.google.com/group/scalaz.
For more options, visit https://groups.google.com/d/optout.



--

Jean-Rémi Desjardins

unread,
Jan 11, 2015, 4:43:41 PM1/11/15
to sca...@googlegroups.com
Of course! I was trying to keep the question as simple as possible, but I would be delighted to talk about what I have been working on.

Over the holidays, I started prototyping the idea of an Idiom Bracket notation in Scala using macros. It turns out it is possible and I am hoping it will be useful.

Up until now, I took the path of least resistance and have been doing my work in a branch on my fork of Scalaz since Idiom Brackets are based on the notion of an Applicative Functor (which happens to be nicely defined in Scalaz).

I have thought about whether it could be included in Scalaz as syntactic sugar for Applicative. I think it's probably best if it lives in a separate repo but wanted to get some feedback on that.

Brian McKenna

unread,
Jan 11, 2015, 6:52:42 PM1/11/15
to sca...@googlegroups.com
There's been some prior art in this area:

https://github.com/aztek/scala-workflow

I would love for this to work in a similar way - as a separate artifact.

Part of the problem is that scalaz 7.1 supports Scala 2.9. I think the
plan is to kill that off in 7.2 and just support 2.10 and 2.11 but
macros changed a bit between those versions and are a pain to make
work across versions.

On 11 January 2015 at 14:43, Jean-Rémi Desjardins

Tony Morris

unread,
Jan 11, 2015, 7:56:08 PM1/11/15
to sca...@googlegroups.com
Slightly pedantic, but consider idiom brackets based on Apply (not Applicative). No need for pure.

Jean-Rémi Desjardins

unread,
Jan 11, 2015, 8:56:01 PM1/11/15
to sca...@googlegroups.com
@Brian McKenna Thanks for pointing me towards scala-workflow! That's awesome.

Alois Cochard

unread,
Jan 12, 2015, 2:44:57 AM1/12/15
to sca...@googlegroups.com
Great stuff!

This is -for me- a very good case for using macro/compiler-plugin, as this great tool by Erik: https://github.com/non/kind-projector it probably deserve to be in is own repo.

Once stabilized I can see it as being part of a scalaz module though.

Looking forward playing with your syntax!

 
Reply all
Reply to author
Forward
0 new messages