
# _Type

This is an **internal** module!

I wrote up `_Type` because I wanted to use `Type` to create `Type` and I wanted to use `Type` to create other types before `Type` is defined; catch my drift?

```CoffeeScript
Null = _Type {...} # use Type's constructor before Type exists
Type = _Type {...} # use Type's constructor to create Type
```

### _Type.init

This is where initialization of every new `Type` occurs.

Mixins are applied in this method!

The prototype's constructor (a.k.a. the supertype) is set here.

A `Factory` is created to be used within a function that's returned to be used as the `Type` constructor.

Other undocumented stuff happens here too...

### _Type.Validator

This method creates the `Validator` that validates the options passed to the `Type` constructor.

Before the new `Validator` is returned, it's used to validate the `options` object it was created with!

This method isn't useful for anything else.

### _Type.checkers

This is a [`WeakMap`](https://github.com/polymer/WeakMap) that holds the customized `isType` function for each new `Type`.

The functions stored here are used in `Type::isType` to ensure both types being compared agree that they are the same type.
