• Eric Myhre's avatar
    Refactor of type/schema code. · 122c5338
    Eric Myhre authored
    - `typed.Node` -> now lives in the `impl/typed` package, more like
    other nodes.
    
    - Most of the other essential parts of reasoning about types moved
    to `schema` package.  ("typed.Type" seemed like a nasty stutter.)
    
    - `typed.Universe` renamed to `schema.TypeSystem`.
    
    - Current `Validate` method moved to `schema` package, but see new
    comments about potential future homes of that code, and its
    aspirational relationship to `typed.Node`.
    
    Conspicuously *not* yet refactored or moved in this comment:
    
    - The `typed/declaration` package -- though it will shortly be scrapped
    and later reappear as `schema/ast`.  The dream is that it would be
    neatest of all if we could generate it by codegen; but we'll see.
    (This would seem to imply we'll have to make sufficient exported
    methods for creating the `schema.Type` values... while we also want
    to make those immutable.  We'll... see.)
    
    - The `typed/gen` package is also untouched in this commit, but
    should similarly move shortly.  The codegen really ought to be built
    against the `schema.Type` reified interfaces.
    
    Overall, this drops the sheer nesting depths of packages a fair bit,
    which seems likely to be a good smell.
    122c5338
typesystem.go 490 Bytes