@@ -23,6 +23,10 @@ import Refined
2323import Refined.Unsafe
2424import Unsafe.Coerce
2525
26+#if MIN_VERSION_containers(0, 6, 3)
27+import Data.Bifoldable
28+#endif
29+
2630#if MIN_VERSION_containers(0, 6, 2)
2731#elif MIN_VERSION_containers(0, 5, 8)
2832import Data.Functor.Const (Const(..))
@@ -33,6 +37,10 @@ import qualified Data.List as List
3337import qualified Data.Map.Strict as MapStrict
3438#endif
3539
40+#if MIN_VERSION_containers(0, 5, 9) || MIN_VERSION_hashable(1, 4, 0)
41+import Data.Functor.Classes
42+#endif
43+
3644
3745-- | A wrapper around a regular 'Data.Map.Map' with a type parameter @s@
3846-- identifying the set of keys present in the map.
@@ -49,6 +57,12 @@ newtype Map s k a = Map (Map.Map k a)
4957 deriving newtype (Eq, Ord, Show, Functor, Foldable, NFData)
5058#if MIN_VERSION_hashable(1, 3, 4)
5159 deriving newtype (Hashable.Hashable)
60+#endif
61+#if MIN_VERSION_containers(0, 6, 3)
62+ deriving newtype (Bifoldable)
63+#endif
64+#if MIN_VERSION_containers(0, 5, 9) || MIN_VERSION_hashable(1, 4, 0)
65+ deriving newtype (Eq1, Eq2, Ord1, Ord2, Show1, Show2)
5266#endif
5367 deriving stock (Traversable)
5468type role Map nominal nominal representational