+-----------------------------------------------
+ Notes about type families
+-----------------------------------------------
+
+Type synonym families
+~~~~~~~~~~~~~~~~~~~~~~
+* Type synonym families, also known as "type functions", map directly
+ onto the type functions in FC:
+
+ type family F a :: *
+ type instance F Int = Bool
+ ..etc...
+
+* From the user's point of view (F Int) and Bool are simply equivalent
+ types.
+
+* A Haskell 98 type synonym is a degenerate form of a type synonym
+ family.
+
+* Type functions can't appear in the LHS of a type function:
+ type instance F (F Int) = ... -- BAD!
+
+* In the future we might want to support
+ * closed type families (esp when we have proper kinds)
+ * injective type families (allow decomposition)
+ but we don't at the moment [2010]
+
+Data type families
+~~~~~~~~~~~~~~~~~~
+* Data type families are declared thus
+ data family T a :: *
+ data instance T Int = T1 | T2 Bool
+ data instance T [a] where
+ X1 :: T [Int]
+ X2 :: a -> T [a]
+
+* The user does not see any "equivalent types" as he did with type
+ synonym families. He just sees constructors with types
+ T1 :: T Int
+ T2 :: Bool -> T Int
+ X1 :: T [Int]
+ X2 :: a -> T [a]
+ Note that X2 is a fully-fledged GADT constructor; that's fine
+
+* The conversion into FC is interesting, and is the point where I was
+ getting mixed up. Here's the FC version of the above declarations:
+
+ data T a
+ data TI = T1 | T2 Bool
+ axiom ax_ti : T Int ~ TI
+
+ data TL a where
+ X1 :: TL Int
+ X2 :: a -> TL a
+ axiom ax_tl :: T [a] ~ TL a
+
+* Notice that T is NOT translated to a FC type function; it just
+ becomes a "data type" with no constructors, into which TI, TL, TB
+ are cast using their respective axioms.
+
+* As a result
+ - T behaves just like a data type so far as decomposition is concerned
+ - It's fine to have T in the LHS of a type function:
+ type instance F (T a) = [a]
+
+It was this last point that confused me! The big thing is that you
+should not think of a data family T as a *type function* at all, not
+even an injective one! We can't allow even injective type functions
+on the LHS of a type function:
+ type family injective G a :: *
+ type instance F (G Int) = Bool
+is no good, even if G is injective, because consider
+ type instance G Int = Bool
+ type instance F Bool = Char
+
+So a data type family is not an injective type function. It's just a
+data type with some axioms that connect it to other data types. These
+axioms come into play when (and only when) you
+ - use a data constructor
+ - do pattern matching
+