3 ms·
> I'm a Scala dev and I know monads, but what exactly is TMonad<User>? Like `[T: Monad](users: T[Users])`? Pretty much like it. There's a popular pattern calle
by namelosw 6y ago
> I'm a Scala dev and I know monads, but what exactly is TMonad<User>? Like `[T: Monad](users: T[Users])`?
Pretty much like it. There's a popular pattern called Tagless Final which lets you parametrize it and then swap the implementation in the last step.
In this way the model layer wouldn't know the underlying implementation is Future, Promise, or Flux. Sometimes it's useful because the developer finds it's painful to migrate from libraries to libraries.