The `K` type parameter can not be anything. For instance the following code would compile:

```scala
def printProfile(user: Rep[User], profiles: Rep[Map[User, Profile]]) = {
  println(profiles(user))
}
```

But it would fail at runtime because the coercion of a User into a String would produce the key `"[object Object]"`.

So we need to constrain `K` to be compatible with JavaScript types that produce a valid key when coerced to Strings. I would use some type constraint as follows:

```scala
case class JSKey[A]()
object JSKey {
  implicit val stringKey = JSKey[String]()
  implicit val intKey = JSKey[Int]()
  // … same with Boolean, Double, etc.
}

def map_new[K : JSKey : Manifest, V : Manifest](): Rep[Map[K, V]]
```

The same applies to all other methods.

Maybe we can make `JSKey[A]` *depend on* `Manifest[A]` (in Haskell we would write: `class Manifest a => JSKey a`), so we could just write `map_new[K : JSKey, V : Manifest]` instead of `map_new[K : JSKey : Manifest, V : Manifest]`.