diff --git a/src/Data/Map/Implicit.hs b/src/Data/Map/Implicit.hs index 83d5c4a..ac0d459 100644 --- a/src/Data/Map/Implicit.hs +++ b/src/Data/Map/Implicit.hs @@ -24,7 +24,7 @@ newtype ImplicitMap v = ImplicitMap { get :: Map (KeyType v) v } type ImplicitMapElems :: Type -> Type type role ImplicitMapElems representational -newtype ImplicitMapElems v = ImplicitMapElems { elems :: [v] } +newtype ImplicitMapElems v = ImplicitMapElems [v] deriving stock (Show, Read) instance (Show v) => Show (ImplicitMap v) where @@ -33,7 +33,7 @@ instance (Show v) => Show (ImplicitMap v) where instance (Read v, ImplicitKeyOf v, Ord (KeyType v)) => Read (ImplicitMap v) where readPrec :: ReadPrec (ImplicitMap v) - readPrec = ImplicitMap . Map.fromList . List.map (keyOf &&& id) . elems <$> readPrec + readPrec = ImplicitMap . Map.fromList . List.map (keyOf &&& id) . (\(ImplicitMapElems es) -> es) <$> readPrec type ImplicitKeyOf :: Type -> Constraint class ImplicitKeyOf v where