packages feed

type-combinators 0.2.4.0 → 0.2.4.1

raw patch · 2 files changed

+23/−1 lines, 2 files

Files

src/Data/Type/Conjunction.hs view
@@ -180,3 +180,25 @@  -- }}} +-- (:&&:) {{{++data (f :: k -> *) :&&: (g :: k -> *) where+  (:&&:) :: !(f a) -> !(g a) -> f :&&: g+infixr 6 :&&:++instance (TestEquality f, TestEquality g, Eq1 f, Eq1 g) => Eq (f :&&: g) where+  p == q = case conjEq p q of+    Just (a :&&: b, c :&&: d) -> eq1 a b && eq1 c d+    _                         -> False++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)++-- }}}+
type-combinators.cabal view
@@ -1,5 +1,5 @@ name: type-combinators-version: 0.2.4.0+version: 0.2.4.1 category: Data synopsis: A collection of data types for type-level programming cabal-version: >=1.10