Reading about family types in haskellwiki , I see an example
class Collects ce where type Elem ce empty :: ce insert :: Elem ce -> ce -> ce
This makes sense to me, because I use my (possibly counterproductive) OOP metaphors - an instance of Collects HAS A type (synonym) Elem ce. The collection is somehow more than elements.
I got confused in the example for related data families because it is not suitable for this model.
class GMapKey k where data GMap k :: * -> * empty :: Gmap kv insert :: k -> v -> GMap kv -> Gmap kv
The card collects vs and feels "bigger" than vs and ks. But it seems like GMapKey has an associated GMap when I expected relationships to go the other way.
When I choose between data families and types of synonymous families, should I follow the pattern (data families: container is a related type, types of synonyms: element is a related type)? Or is it IS A / HAS The difference does not matter, and two examples could be replaced?
source share