eq 4.0.2 → 4.0.3
raw patch · 3 files changed
+66/−13 lines, 3 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.Eq.Type: instance Category (:=)
- Data.Eq.Type: instance Groupoid (:=)
- Data.Eq.Type: instance Semigroupoid (:=)
+ Data.Eq.Type: instance Category ((:=) *)
+ Data.Eq.Type: instance Groupoid ((:=) *)
+ Data.Eq.Type: instance Semigroupoid ((:=) *)
- Data.Eq.Type: Refl :: (forall c. c a -> c b) -> (:=) a b
+ Data.Eq.Type: Refl :: (forall c. c a -> c b) -> := a b
- Data.Eq.Type: subst :: (:=) a b -> forall c. c a -> c b
+ Data.Eq.Type: subst :: := a b -> forall c. c a -> c b
Files
- .travis.yml +54/−1
- eq.cabal +1/−1
- src/Data/Eq/Type.hs +11/−11
.travis.yml view
@@ -1,4 +1,57 @@-language: haskell+# NB: don't set `language: haskell` here++# See also https://github.com/hvr/multi-ghc-travis for more information+env:+ # we have to use CABALVER=1.16 for GHC<7.6 as well, as there's+ # no package for earlier cabal versions in the PPA+ - GHCVER=7.4.2 CABALVER=1.16+ - GHCVER=7.6.3 CABALVER=1.16+ - GHCVER=7.8.2 CABALVER=1.18+ # NOTE: we can't use Cabal 1.20 yet due to+ # https://github.com/haskell/cabal/issues/1806+ - GHCVER=head CABALVER=1.20++matrix:+ allow_failures:+ - env: GHCVER=head CABALVER=1.20++# Note: the distinction between `before_install` and `install` is not+# important.+before_install:+ - travis_retry sudo add-apt-repository -y ppa:hvr/ghc+ - travis_retry sudo apt-get update+ - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH+ - cabal --version++install:+ - travis_retry cabal update+ - cabal install --only-dependencies++# Here starts the actual work to be performed for the package under+# test; any command which exits with a non-zero exit code causes the+# build to fail.+script:+ # -v2 provides useful information for debugging+ - cabal configure -v2++ # this builds all libraries and executables+ # (including tests/benchmarks)+ - cabal build++ # tests that a source-distribution can be generated+ - cabal sdist++ # check that the generated source-distribution can be built & installed+ - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;+ cd dist/;+ if [ -f "$SRC_TGZ" ]; then+ cabal install --force-reinstalls "$SRC_TGZ";+ else+ echo "expected '$SRC_TGZ' not found";+ exit 1;+ fi+ notifications: irc: channels:
eq.cabal view
@@ -1,6 +1,6 @@ name: eq category: Type System-version: 4.0.2+version: 4.0.3 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE
src/Data/Eq/Type.hs view
@@ -46,7 +46,7 @@ #endif ) where -import Prelude ()+import Prelude (flip) import Control.Category import Data.Semigroupoid import Data.Groupoid@@ -82,32 +82,32 @@ -- | Equality is transitive trans :: a := b -> b := c -> a := c-trans = (>>>)+trans = flip subst newtype Symm p a b = Symm { unsymm :: p b a } -- | Equality is symmetric symm :: (a := b) -> (b := a)-symm a = unsymm (subst a (Symm id))+symm a = unsymm (subst a (Symm refl)) newtype Lift f a b = Lift { unlift :: f a := f b } -- | You can lift equality into any type constructor lift :: a := b -> f a := f b-lift a = unlift (subst a (Lift id))+lift a = unlift (subst a (Lift refl)) newtype Lift2 f c a b = Lift2 { unlift2 :: f a c := f b c } -- | ... in any position lift2 :: a := b -> f a c := f b c-lift2 a = unlift2 (subst a (Lift2 id))+lift2 a = unlift2 (subst a (Lift2 refl)) lift2' :: a := b -> c := d -> f a c := f b d-lift2' ab cd = lift2 ab . lift cd+lift2' ab cd = subst (lift2 ab) (lift cd) newtype Lift3 f c d a b = Lift3 { unlift3 :: f a c d := f b c d } lift3 :: a := b -> f a c d := f b c d-lift3 a = unlift3 (subst a (Lift3 id))+lift3 a = unlift3 (subst a (Lift3 refl)) lift3' :: a := b -> c := d -> e := f -> g a c e := g b d f-lift3' ab cd ef = lift3 ab . lift2 cd . lift ef+lift3' ab cd ef = lift3 ab `subst` lift2 cd `subst` lift ef #ifdef LANGUAGE_TypeFamilies type family Inj f@@ -115,19 +115,19 @@ newtype Lower a b = Lower { unlower :: Inj a := Inj b } -- | Type constructors are injective, so you can lower equality through any type constructor lower :: f a := f b -> a := b-lower eq = unlower (subst eq (Lower id :: Lower (f a) (f a)))+lower eq = unlower (subst eq (Lower refl :: Lower (f a) (f a))) type family Inj2 f type instance Inj2 (f a b) = a newtype Lower2 a b = Lower2 { unlower2 :: Inj2 a := Inj2 b } -- | ... in any position lower2 :: f a c := f b c -> a := b-lower2 eq = unlower2 (subst eq (Lower2 id :: Lower2 (f a c) (f a c)))+lower2 eq = unlower2 (subst eq (Lower2 refl :: Lower2 (f a c) (f a c))) type family Inj3 f type instance Inj3 (f a b c) = a newtype Lower3 a b = Lower3 { unlower3 :: Inj3 a := Inj3 b } lower3 :: f a c d := f b c d -> a := b-lower3 eq = unlower3 (subst eq (Lower3 id :: Lower3 (f a c d) (f a c d)))+lower3 eq = unlower3 (subst eq (Lower3 refl :: Lower3 (f a c d) (f a c d))) #endif