         (list-first in)))
   """
   "(first {42 43 44})", 42
+
+  'functional deps on function'
+  """
+    Map (class [m k v]
+      put (fn [key value map]
+        (: (Fn k v m m))))
+
+    map-map (instance (Map (Map k v) k v)
+      put (macro [key value map]
+        (: (Fn k v (Map k v) (Map k v)))
+        (Js.call (Js.access map "set") {key value})))
+
+    count (macro [map]
+      (: (Fn (Map k v) Num))
+      (Js.access map "size"))
+
+    magic (fn [key map]
+      (put key 42 map))
+  """
+  "(count (magic \\C (Map)))", 1
 
   'nested pattern matching'
   """

  undefined

typeNamesOfNormalized = (constraint) ->
  map (({name}) -> name), constraint.types.types

accessList = (what, list) ->
  [first, rest...] = list

          (findFree currentType),
          (substituteList ctx.substitution, matched.tea.constraints)
        # log "assign type", name, (printType currentType), retainedConstraints
        # Finalizing type again after possibly added substitution when defer constraints
        currentType = substitute ctx.substitution, type
        ctx.assignType name,
          if polymorphic
            quantifyUnbound ctx, (addConstraints currentType, retainedConstraints)
