Hi,
I currently have a newtype definition of a typed Data.Map.
newtype G = G Data.Map String Values
I have done this because for my specific use-case, I can define G as a monoid and get some nice benefits.
However, I find myself often just re-declaring functions of Data.Map and wrap/unwrap them in my Constructor G, such as
singleton :: String -> Value -> G
singleton s v = G $ (Data.Map.singleton s v)
I think I do not need to limit the scope of G's functionality, I basically want everything from Data.Map + Bonus , like my Monoid.
Also I want G to be a specific Data.Map, there is never any other case where it's not a Map String Values.
However, if I have
type G2 = Data.Map String Values
I cannot instance Monoid.
So, I am very sure that I'm not the first person ever doing this. Is there a language extension providing what I want? Or is what i want "bad"?
Am I just missing a higher-order base function which does what I want?
best regards & thanks
Leonhard