         (Person name id) name))"""
   """(name ((Person id: 3) "Mike"))""", "Mike"
 
+  'polymorphic records'
+  """Person (record [a] name: a id: Num)
+
+    name (fn [person]
+      (match person
+        (Person name id) name))"""
+  """(name ((Person id: 3) "Mike"))""", "Mike"
+
   'late bound function'
   """f (fn [x] (g x))
     g (fn [x] 2)"""

      if name and type
        syntaxType type
    if args.length is 0
      malformed call, 'Missing arguments'
    # TS: (data #{ctx.definitionName()} [#{_arguments form}])
    if not hasName
      return 'malformed'
    replicate call,
      (call_ (token_ 'data'), [(token_ ctx.definitionName()), (tuple_ args)])

  # # Type an expression
  # ':': (ctx, call) ->

ms.record = ms_record = (ctx, call) ->
    args = _arguments call
    hasName = requireName ctx, 'Name required to declare new record'
    if isTuple args[0]
      [typeParamTuple, args...] = args
    else
      typeParamTuple = (tuple_ [])
    for [name, type] in _labeled args
      if not name
        malformed type, 'Label is required'
