so there will be fewer `fix()` and `sequence(Eithe...
# arrow
p
so there will be fewer
fix()
and
sequence(Either.applicative())
needed all around. Ideally not at all 🙂
❤️ 2
d
I did not see the talk (yet), there will be automatic resolution of instances ?
p
ye, OptionOf will be considered the same as Option by the typechecker if I understood correctly
d
so if i write a method accepting Kind<F,Int>, Kind<F,Int>, Applicative<F> I can avoid passing for example Option.applicative as last parameter? And just pass two instances of Option<Int>
?
and invoke as
?
p
applicative: Applicative<F> = with)
ye
d
Thank you paco
Sometime I miss when Kategory was using default parameters such as: (…., Functor<F> = functor() )
with reified and a global map for lookup
p
oh yes
the good old days
so broken
hahaha
p
so, let me understand this better… how does the
with
default provides the actual instance?
I expect to be imports needed, for proper extensions?
@pakoito @dcampogiani
p
I believe it’s called
given
now
😂 1
the instances are unique per type, enforced at compile time
so there’s no imports, and there’re no possible suprises of malicious instances
the instances HAVE TO be defined either where the datatype is defined, or where the interface is defined
(I may need to check the latest version but AFAIK imports were not needed)
p
is
given
a polymorphic instance, then?? how comes?
p
object given: Nothing
the compiler plugin uses it as a marker
typechecks the other side of the assignment
and finds the right instance
it was either that or an @annotation
p
ohh, that’s what Raul was talking about yesterday… is it macro based?
sorry to bugger you
please ignore me if you want
p
you’re not bugging
if by macro you mean compiler extension then yes
p
I meant arrow-meta
p
it’s a plugin
meta has a bit of everything you need for metaprogramming, including a templating engine
p
actually I made a brain-short-circuit with scala, where scala-meta == macros… 😛
p
which I guess is like macros
p
this is getting so streamlined, really like magic
thanks for the details
p
I hope it doesn’t get as magic as AOP xD
it’s as simple as typecheck the left side of the assignment and see if it’s on the global injection module
classic @Inject pattern
dagger can do this because behind the scenes it’s doing all the parsing and typechecking
we’re just moving it to the compiler
so you don’t have to double the work, and also get IDE features, incrementality, compiler errors…the good stuff
p
So the inference is global, and you have to make instances globally coherent, right?
p
yep
no orphan instances
and overrides have to be explicit
sequence(MyUnlawfulInstance)
p
where do I find some blog article/series or presentations on the approach, to have a better idea than reverse engineering the docs?
p
look for the keep87 talks
and the design doc
it's just an implementation of that
p
👍