@@ -68,10 +68,8 @@ import Nix.Utils
6868import Text.Megaparsec.Pos
6969import Text.Read.Deriving
7070import Text.Show.Deriving
71- #if MIN_VERSION_base(4, 10, 0)
7271import Type.Reflection ( eqTypeRep )
7372import qualified Type.Reflection as Reflection
74- #endif
7573
7674type VarName = Text
7775
@@ -83,14 +81,6 @@ hashAt = flip alterF
8381instance Hashable1 NonEmpty
8482#endif
8583
86- #if !MIN_VERSION_base(4, 10, 0)
87- instance Eq1 NonEmpty where
88- liftEq eq (a NE. :| as) (b NE. :| bs) = eq a b && liftEq eq as bs
89- instance Show1 NonEmpty where
90- liftShowsPrec shwP shwL p (a NE. :| as) = showParen (p > 5 ) $
91- shwP 6 a . showString " :| " . shwL as
92- #endif
93-
9484#if !MIN_VERSION_binary(0, 8, 4)
9585instance Binary a => Binary (NE. NonEmpty a ) where
9686 get = fmap NE. fromList Bin. get
@@ -162,18 +152,11 @@ instance Serialise r => Serialise (NExprF r)
162152instance IsString NExpr where
163153 fromString = Fix . NSym . fromString
164154
165- #if MIN_VERSION_base(4, 10, 0)
166155instance Lift (Fix NExprF ) where
167156 lift = dataToExpQ $ \ b ->
168157 case Reflection. typeOf b `eqTypeRep` Reflection. typeRep @ Text of
169158 Just HRefl -> Just [| pack $ (liftString $ unpack b) | ]
170159 Nothing -> Nothing
171- #else
172- instance Lift (Fix NExprF ) where
173- lift = dataToExpQ $ \ b -> case cast b of
174- Just t -> Just [| pack $ (liftString $ unpack t) | ]
175- Nothing -> Nothing
176- #endif
177160
178161-- | The monomorphic expression type is a fixed point of the polymorphic one.
179162type NExpr = Fix NExprF
0 commit comments