with LOG & s3 being abstract vals in the inter...
# arrow
b
with LOG & s3 being abstract vals in the interfaces
r
yes that is common
or you can instead use classes and delegation
b
mm, can I delegate to more than one instance? I figured that only one instance could be supplied to
by
r
only one instance can be supplied to by
but you can have multiple delegations
that is a DI example
it’s one of the multiple techniques
that uses
R
type arguments that you constrain by powers and the edge you materialize a module with all the concrete instances
The module uses delegation to conform the type param R
Here is another style without type arguments that uses delegation at different layers to activate syntax
the code may be old but the DI concept is illustrated in the delegation
b
thanks
Ahh in the second file in the gist, I see now
r
The approach with abstract properties in interfaces is another approach
the one you mention is the one Arrow uses for its own type classes
if you define your algebras as type classes then you can export the syntax everywhere with @extension
in the same way we do in Arrow
b
I'm not certain how much business logic warrants being a typeclass
That is an example of that but really the technique can be used regardless of your algebra having laws or just being a bunch of IO operations
b
thanks, I will take a look. Logger syntax may be useful to export everywhere
👍 2