             #     name: (ctx.definitionName() if ctx.isAtSimpleDefinition())
             #     params: paramNames
             #     body: (join compiledWheres, [(jsReturn compiledBody)]))])
+
+ms.type = ms_type = (ctx, call) ->
+  hasName = requireName ctx, 'Name required to declare new type alias'
+  alias = ctx.definitionName()
+  if not (isCapital symbol: alias)
+    malformed ctx.definitionPattern(), 'Type aliases must start with a capital letter'
+  [type] = _arguments call
+  ctx.addTypeAlias alias, typeCompile ctx, type
+  jsNoop()
 
   # data
   #   listing or

    toInject = collectRequiresFor moduleName
    ctx = injectedContext toInject
    {js, ast} = compileCtxAstToJs topLevel, ctx, (astFromSource "(#{source})", -1, -1)
    replaceOrAddToMap compiledModules, moduleName,
      declared: (subtractContexts ctx, (injectedContext toInject)) # must recompute because ctx is mutated
      js: js

    for scope in (reverse @scopes)
      if kind = lookupInMap scope.typeNames, name
        return kind

  addTypeAlias: (name, type) ->
    addToMap @_scope().typeAliases, name, type

  resolveTypeAliases: (name) ->
    if alias = lookupInMap @_scope().typeAliases, name
      alias
    else
      name

  bindTypeVariables: (vars) ->
    addAllToSet @_scope().boundTypeVariables, vars
