 for jsMethod in ['binary', 'ternary', 'unary']
   do (jsMethod) ->
     ms["Js.#{jsMethod}"] = (ctx, call) ->
-      call.tea = "JS"
+      call.tea = toConstrained typeConstant "JS"
       (jsCall "js#{jsMethod[0].toUpperCase()}#{jsMethod[1...]}", (termsCompile ctx, _arguments call))
 
 ms['=='] = ms_eq = (ctx, call) ->

  # Or we can just mangle the name like PureScript does it
]



testNamed = (givenName) ->
  for [name, source, expression, result] in tuplize 4, tests when name is givenName
    return source

    # TODO: support lookup of composite types, by traversing left depth-first
    if type.type.type.name is constraint.type.name
      return validIdentifier name
  throw new Error "no instance for #{safePrintType constraint}"

irFunction = ({name, params, body}) ->
  {ir: irFunctionTranslate, name, params, body}
