Size: a a a

ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)

2020 June 05

Oℕ

Oleg ℕizhnik in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
rafael saraiva
👏👏👏👏👏👏👏👏👏👏👏👏
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
I will take a look. And I will try tofu as soon as I can
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
I have been using ZIO for some time. It's nice. I contributed a bit to it. I have looked at Izumi. Did not really convince me. Tofu did. It looks nice, principled and so far the community also does not disappoint, nothing against typepevel personally but hm
источник

w

welcometotheclubbudd... in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
rafael saraiva
I have been using ZIO for some time. It's nice. I contributed a bit to it. I have looked at Izumi. Did not really convince me. Tofu did. It looks nice, principled and so far the community also does not disappoint, nothing against typepevel personally but hm
источник

λ

λoλcat in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
rafael saraiva
I have been using ZIO for some time. It's nice. I contributed a bit to it. I have looked at Izumi. Did not really convince me. Tofu did. It looks nice, principled and so far the community also does not disappoint, nothing against typepevel personally but hm
So true
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Hum, first question, why does bimonad have two higher kinded types each with two type parameters
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
This is very new to me
источник

ΛВ

Λнтон Войцишевский... in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Oleg ℕizhnik
no, only for bifunctors
я пропустил, что в тофу появился био?
где?
источник

ИО

Илья Оськин... in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
@odomontois, @saraiva132, guys, I see you’re discussing tofu design topics, wouldn’t it be better to move to discord where this conversation would remain accessible for future contributors?
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
True. I am in discord, I will move questions there,
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
You can also answer there oleg, I am Saraiva there
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Thank you 🙏
источник

Oℕ

Oleg ℕizhnik in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
rafael saraiva
Is it possible to partially provide the context? Let's say, I have A now, at some point later someone will give you B and C
Tofu has its own machinery for tasks like that.
I don't like ZIO-way contextual records, so we have different approach here.

First, TF offers it's own way to compose things.
If you need only part of the context in some place you require only F HasContext ThingsYouNeedHere
Or F WithContext Thing and F WithContext AnotherThing if you need several parts.
Tofu has implicit lenses via @ClassyOptics annotation that helps to extract only needed part of your context.
Even more cool, if your thing is trait Service[F[_]] you can derive Embed[Service] and have
implicit Service[F] automatically whenever you have F HasContext Service[F]
Final type is most probably ZIO[R,..] , Env[R, ...] , ReaderT[F, R, ...], ContextT[F, R ,...]  where R - is a large case class with lot of nested case classes with all the components.

Second thing - if you really need to transform several final types with more and less complete environments, you can use the Unlift[F, G] machinery.
This simple yet powerful typeclass offer transformations between reader-like types, or reader and its base.

For example when you have F[A] = ZIO[Foo with Bar, E, A] and G[A] = ZIO[Foo with Bar with Baz, E, A],
you can get Unlift[F, G] which automatically gives you F ~> G and G[G ~> F]
First one is just widening, second one can help to memoize portion of context, to reuse it in places, when you are not allowed to read it.
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
I think I need to write a sample microservice trying all of this out,
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
To get used to this machinery that is somewhat new to me. I understand the concepts but I don't have the baggage you do :)))
источник

ИО

Илья Оськин... in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Oleg ℕizhnik
Tofu has its own machinery for tasks like that.
I don't like ZIO-way contextual records, so we have different approach here.

First, TF offers it's own way to compose things.
If you need only part of the context in some place you require only F HasContext ThingsYouNeedHere
Or F WithContext Thing and F WithContext AnotherThing if you need several parts.
Tofu has implicit lenses via @ClassyOptics annotation that helps to extract only needed part of your context.
Even more cool, if your thing is trait Service[F[_]] you can derive Embed[Service] and have
implicit Service[F] automatically whenever you have F HasContext Service[F]
Final type is most probably ZIO[R,..] , Env[R, ...] , ReaderT[F, R, ...], ContextT[F, R ,...]  where R - is a large case class with lot of nested case classes with all the components.

Second thing - if you really need to transform several final types with more and less complete environments, you can use the Unlift[F, G] machinery.
This simple yet powerful typeclass offer transformations between reader-like types, or reader and its base.

For example when you have F[A] = ZIO[Foo with Bar, E, A] and G[A] = ZIO[Foo with Bar with Baz, E, A],
you can get Unlift[F, G] which automatically gives you F ~> G and G[G ~> F]
First one is just widening, second one can help to memoize portion of context, to reuse it in places, when you are not allowed to read it.
Эх, это бы да в доку
источник

Oℕ

Oleg ℕizhnik in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Илья Оськин
Эх, это бы да в доку
All those comments are free to use, if you wish.
I'm just not very confident in my English skill to display conversations like that for the public as official guide
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Last time I saw your talk in functional Scala London
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
Your English was just fine :)
источник

rs

rafael saraiva in ПОКА ОДЕРСКИ НЕ ВИДИТ (спидран Олега по тофу)
I also met you shortly 😉
источник