Uncomment temporarily commented instances

This commit is contained in:
Doug Beardsley 2018-04-05 16:30:53 -06:00
parent a074ede2f1
commit 99e4d86eff
2 changed files with 28 additions and 32 deletions

View file

@ -104,12 +104,8 @@ data Params r
deriving (Ord, Eq, Generic, Typeable, Data, Functor, Show,
Foldable, Traversable)
--instance Show1 Params where
-- liftShowsPrec sp sl p = undefined
-- liftShowsPrec sp sl p = \case
-- Param n -> show n
-- ParamSet s b mn -> showsUnaryWith showsPrec "StaticKey" p t
-- This uses InsOrdHashMap because nix XML serialization preserves the order of
-- the param set.
type ParamSet r = InsOrdHashMap VarName (Maybe r)
instance IsString (Params r) where
@ -165,17 +161,17 @@ data NKeyName r
instance IsString (NKeyName r) where
fromString = StaticKey . fromString
-- instance Eq1 NKeyName where
-- liftEq eq (DynamicKey a) (DynamicKey b) = liftEq2 (liftEq eq) eq a b
-- liftEq _ (StaticKey a) (StaticKey b) = a == b
-- liftEq _ _ _ = False
--
-- -- Deriving this instance automatically is not possible because @r@
-- -- occurs not only as last argument in @Antiquoted (NString r) r@
-- instance Show1 NKeyName where
-- liftShowsPrec sp sl p = \case
-- DynamicKey a -> showsUnaryWith (liftShowsPrec2 (liftShowsPrec sp sl) (liftShowList sp sl) sp sl) "DynamicKey" p a
-- StaticKey t -> showsUnaryWith showsPrec "StaticKey" p t
instance Eq1 NKeyName where
liftEq eq (DynamicKey a) (DynamicKey b) = liftEq2 (liftEq eq) eq a b
liftEq _ (StaticKey a) (StaticKey b) = a == b
liftEq _ _ _ = False
-- Deriving this instance automatically is not possible because @r@
-- occurs not only as last argument in @Antiquoted (NString r) r@
instance Show1 NKeyName where
liftShowsPrec sp sl p = \case
DynamicKey a -> showsUnaryWith (liftShowsPrec2 (liftShowsPrec sp sl) (liftShowList sp sl) sp sl) "DynamicKey" p a
StaticKey t -> showsUnaryWith showsPrec "StaticKey" p t
-- Deriving this instance automatically is not possible because @r@
-- occurs not only as last argument in @Antiquoted (NString r) r@
@ -227,16 +223,16 @@ paramName :: Params r -> Maybe VarName
paramName (Param n) = Just n
paramName (ParamSet _ _ n) = n
-- $(deriveEq1 ''NExprF)
-- $(deriveEq1 ''NString)
-- $(deriveEq1 ''Binding)
-- $(deriveEq1 ''Params)
-- $(deriveEq1 ''Antiquoted)
-- $(deriveEq2 ''Antiquoted)
--
-- $(deriveShow1 ''NExprF)
-- $(deriveShow1 ''NString)
-- $(deriveShow1 ''Params)
-- $(deriveShow1 ''Binding)
-- $(deriveShow1 ''Antiquoted)
-- $(deriveShow2 ''Antiquoted)
$(deriveEq1 ''NExprF)
$(deriveEq1 ''NString)
$(deriveEq1 ''Binding)
$(deriveEq1 ''Params)
$(deriveEq1 ''Antiquoted)
$(deriveEq2 ''Antiquoted)
$(deriveShow1 ''NExprF)
$(deriveShow1 ''NString)
$(deriveShow1 ''Params)
$(deriveShow1 ''Binding)
$(deriveShow1 ''Antiquoted)
$(deriveShow2 ''Antiquoted)

View file

@ -31,8 +31,8 @@ let
insert-ordered-containers = pkgs.fetchFromGitHub {
owner = "mightybyte";
repo = "insert-ordered-containers";
rev = "2a15aea6a9733259ee494eb379dd4df206d215c5";
sha256 = "1pjg9lwahm767mf88r6cb0dcaga84l8p08zd7mxjz322ll07q1ja";
rev = "87054c519b969b62131bcf7a183470d422cbb535";
sha256 = "0l0g6ns5bcrcaij0wbdgc04qyl9h0vk1kx9lkzdkwj9v51l26azm";
};
};
};