stateless
stateless copied to clipboard
Functional dependency between `P[_]` and `A`
We define our entities in the data layer this way:
trait Entity[A] {
type P[_]
}
We know that P[_] and A are related, since P is somehow hiding a value of type A. However this connection isn't reflected at all in the code. This notion seems like a functional dependency in Haskell, but we think that it should be enough if we define a MonadState[A, P] inside the trait. Consider this alternative and apply it, if useful.