@@ -60,6 +60,15 @@ deriveApiAndArbitraryInstances opts tname =
6060 deriveApiInstances opts tname
6161#endif
6262
63+#if MIN_VERSION_containers(0,6,6)
64+#elif MIN_VERSION_template_haskell(2,16,0)
65+instance (Lift k, Lift a) => Lift (Map k a) where
66+ liftTyped x = unsafeCodeCoerce (lift x)
67+ lift m = [|M.fromList (M.toList m)|]
68+#else
69+instance (Lift k, Lift a) => Lift (Map k a) where
70+ lift m = [|M.fromList (M.toList m)|]
71+#endif
6372-- We can't directly 'lift' Options into TH (there is no instance for function),
6473-- so we use this type.
6574data DerivingOptions = DerivingOptions