stateless icon indicating copy to clipboard operation
stateless copied to clipboard

Functional dependency between `P[_]` and `A`

Open neutropolis opened this issue 7 years ago • 0 comments

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.

neutropolis avatar Dec 11 '17 10:12 neutropolis