This is obviously not strongly typed + the "fields" dont know what type they are. To solve this, we create a type to describe what a field contains and how to map it to a column (which is "typed"):
```ts
typeFieldSchema<T>={T:T/* remember the type */,createColumn:CIFField=>Column<T>}
```
Category schema is just an object whose properties are all instances of "field schemas", its "shape" has the type:
Notice that the type of ``my_category`` is not specified. Assigning it explictly would hide the actual property names which we do not want. Moreover, the names of the properties must match the names of the fields in the actual category (optionally, a field ``alias`` can be added to the field schema).
Given a category schema, we need to construct a type that defines the typed category itself:
In other words, the type ``TypedCategory`` has a property of type ``Column<_>`` for each property of the schema. ``Schema[F]['T']`` just says: extract type of property called ``T`` from property ``F`` in ``Schema``. ``Schema extends CategorySchema`` says that all properties of ``Schema`` must be of type ``FieldSchema<any>``.
Finally, we just define a mapping, ``toTypedCategory``: