You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The big part of boilerplate code is when multiple algebras are combined with explicit implementation of algebra interface. For example state monad with either type.
The good news is that this complete class can be generated automatically with the help of any off-the-shelf dependency injection library. Just basic constructor injection can do the trick. Visual Studio already has support to generate this pattern, including with method body if implementing interface is supplied in the constructor.
The big part of boilerplate code is when multiple algebras are combined with explicit implementation of algebra interface. For example state monad with either type.
object-algebras/Algebras.Impl/StateEitherImpl.cs
Lines 14 to 25 in 37d9d2c
The good news is that this complete class can be generated automatically with the help of any off-the-shelf dependency injection library. Just basic constructor injection can do the trick. Visual Studio already has support to generate this pattern, including with method body if implementing interface is supplied in the constructor.
Very similar thing exists for Scala to generate composed instances.
https://github.com/b-studios/MixinComposition
The text was updated successfully, but these errors were encountered: