Nick
Nick
Note that the code in the snippet is executed automatically by `tut` when the site is built. Therefore the snippet needs to generate the image in a predictable location, so...
Could you elaborate what is the difference between this and a normal `List` diagram? Also how does it crash?
> To make your solution work, we would need to have implicit view for every instance of monad/functor separately, e.g. `Option[A] => A` (with the way things currently are) and...
By the way, I just realized that the new [macro annotations](http://docs.scala-lang.org/overviews/macros/annotations.html) expand before type-checking! So conceptually a ported version could look like so: ``` scala @workflow[Option[_]] val x = Some(3)...
@xeno-by ``` scala class Workflow[A] extends StaticAnnotation { def macroTransform(annottees: Any*) = macro WorkflowMacros.macroTransform[A] } object WorkflowMacros { def macroTransform[A: c.WeakTypeTag](c: MacroContext)(annottees: c.Expr[Any]*): c.Expr[Any] = { import c.universe._ println(weakTypeOf[A]) c.Expr[Any](Block(DefDef(Modifiers(),...
> That's how rewriting works I understand that, but what happens in this example? ``` scala workflow[Option] { Some(Success(42)) getOrElse "foobar" } ``` is it `option.map(x$1 ⇒ x$1.getOrElse("foobar"))(Some(Success(42))` or `option.point(Some(Success(42)).getOrElse("foobar"))`...
@aztek It makes sense! Thanks for the explanation. @xeno-by re 2) Lol now I remember that you suggested the same when we submitted https://issues.scala-lang.org/browse/SI-7736 :) So I’ll also try to...
Check this out! https://github.com/stanch/scala-workflow/commit/506fcc75196406ce59ea5781630ea673768f8b50#L0R49 https://github.com/stanch/scala-workflow/blob/e0325cc641fd4ed952337a0aec797d2777a0247a/project/Build.scala ``` scala scala> @workflow(option) val x = Some("f") + Some("o")*2 + Some("bar") x: Option[String] = Some(foobar) ``` However: ``` scala scala> @workflow(option) val x =...
I think the first error happens somewhere in `rewrite`. The second one is just due to the failed annotation expansion. I will look into this today. We can also try...
@xeno-by, after some investigation this looks very suspicious. ``` scala println(util.Try(c.typeCheck(q"4+"))) ... error: ambiguous reference to overloaded definition, both method + in class Int of type (x: Char)Int and method...