diff --git a/package-lock.json b/package-lock.json index 69951c8a6a..7c5355ceb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,39 @@ { - "lockfileVersion": 1, + "name": "cats-effect", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "devDependencies": { + "source-map-support": "^0.5.19" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + }, "dependencies": { "buffer-from": { "version": "1.1.2", diff --git a/std/shared/src/main/scala/cats/effect/std/MapRef.scala b/std/shared/src/main/scala/cats/effect/std/MapRef.scala index 3e910ffe18..16675524db 100644 --- a/std/shared/src/main/scala/cats/effect/std/MapRef.scala +++ b/std/shared/src/main/scala/cats/effect/std/MapRef.scala @@ -49,14 +49,12 @@ object MapRef extends MapRefCompanionPlatform { * the default Constructor for MapRef. If Async is available, it will use a ConcurrentHashMap, * otherwise it will use a sharded immutable map. */ - def apply[F[_]: Concurrent, K, V](): F[MapRef[F, K, Option[V]]] = { - + def apply[F[_]: Concurrent, K, V]: F[MapRef[F, K, Option[V]]] = { Concurrent[F] match { - case a: Async[_] => - implicit val async: Async[F] = a - ofConcurrentHashMap() + case s: Sync[F] => + ofConcurrentHashMap()(s) case _ => - ofShardedImmutableMap[F, K, V](Runtime.getRuntime.availableProcessors()) + ofShardedImmutableMap[F, K, V](shardCount = Runtime.getRuntime.availableProcessors()) } }