type-combinators 0.2.4.1 → 0.2.4.2
raw patch · 2 files changed
+10/−4 lines, 2 files
Files
src/Data/Type/Conjunction.hs view
@@ -187,18 +187,24 @@ infixr 6 :&&: instance (TestEquality f, TestEquality g, Eq1 f, Eq1 g) => Eq (f :&&: g) where- p == q = case conjEq p q of+ p == q = case exConjEq p q of Just (a :&&: b, c :&&: d) -> eq1 a b && eq1 c d _ -> False +-- Defaulting to LT when terms are incomparable is dubious+instance (TestEquality f, TestEquality g, Ord1 f, Ord1 g) => Ord (f :&&: g) where+ compare p q = case exConjEq p q of+ Just (a :&&: b, c :&&: d) -> compare1 a b `mappend` compare1 c d+ _ -> LT+ instance (Show1 f, Show1 g) => Show (f :&&: g) where showsPrec d (a :&&: b) = showParen (d > 6) $ showsPrec1 7 a . showString " :&&: " . showsPrec1 6 b -conjEq :: (TestEquality f, TestEquality g) => f :&&: g -> f :&&: g -> Maybe (f :&&: f, g :&&: g)-conjEq (a :&&: c) (b :&&: d) = a =?= b //? c =?= d //? return (a :&&: b,c :&&: d)+exConjEq :: (TestEquality f, TestEquality g) => f :&&: g -> f :&&: g -> Maybe (f :&&: f, g :&&: g)+exConjEq (a :&&: c) (b :&&: d) = a =?= b //? c =?= d //? return (a :&&: b,c :&&: d) -- }}}
type-combinators.cabal view
@@ -1,5 +1,5 @@ name: type-combinators-version: 0.2.4.1+version: 0.2.4.2 category: Data synopsis: A collection of data types for type-level programming cabal-version: >=1.10