From f08f6ef411247d138b98f4f753ee272a00260ebb Mon Sep 17 00:00:00 2001 From: Justin Le Date: Mon, 12 Aug 2019 22:46:27 -0700 Subject: [PATCH] ready for 0.2 --- CHANGELOG.md | 9 +++++---- package.yaml | 2 +- src/Data/Type/Predicate/Auto.hs | 19 +++++++++++++++++++ src/Data/Type/Universe.hs | 8 ++++---- stack.yaml | 5 +++-- stack.yaml.lock | 15 ++++----------- 6 files changed, 36 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f19d4c1..2c9bc55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,15 @@ Changelog ========= -Version 0.1.5.1 +Version 0.2.0.0 --------------- -*Unreleased* +*August 12, 2019* - + -* Add `sameIndexVal`, `sameNEIndexVal`. +* Full restructuring of the Universe system, pulling it all out into a new + package, *functor-products*. Version 0.1.5.0 --------------- diff --git a/package.yaml b/package.yaml index 6c74f2b..df64027 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: decidable -version: 0.1.5.0 +version: 0.2.0.0 github: "mstksg/decidable" license: BSD3 author: "Justin Le" diff --git a/src/Data/Type/Predicate/Auto.hs b/src/Data/Type/Predicate/Auto.hs index 630cf12..4fc069d 100644 --- a/src/Data/Type/Predicate/Auto.hs +++ b/src/Data/Type/Predicate/Auto.hs @@ -312,3 +312,22 @@ autoNotAll = anyNotNotAll sing . autoAny instance (SingI as, AutoAll f (Not (Found p)) as) => Auto (Not (Found (AnyMatch f p))) as where auto = mapRefuted (\(s :&: WitAny i p) -> WitAny i (s :&: p)) $ auto @_ @(Not (Any f (Found p))) @as + +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (Rec Sing)) as where + auto = singProd sing +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (PMaybe Sing)) as where + auto = singProd sing +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (NERec Sing)) as where + auto = singProd sing +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (PEither Sing)) as where + auto = singProd sing +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (PTup Sing)) as where + auto = singProd sing +-- | @since 2.0.0 +instance SingI as => Auto (TyPred (PIdentity Sing)) as where + auto = singProd sing diff --git a/src/Data/Type/Universe.hs b/src/Data/Type/Universe.hs index fd8138a..ed1bdf7 100644 --- a/src/Data/Type/Universe.hs +++ b/src/Data/Type/Universe.hs @@ -332,10 +332,10 @@ instance Universe (Either j) where Proved p -> Proved $ WitAll $ \case IRight -> p Disproved v -> Disproved $ \a -> v $ runWitAll a IRight allProd f = \case - SLeft _ -> \_ -> PLeft + SLeft w -> \_ -> PLeft w SRight x -> \a -> PRight (f x (runWitAll a IRight)) prodAll f = \case - PLeft -> WitAll $ \case {} + PLeft _ -> WitAll $ \case {} PRight x -> WitAll $ \case IRight -> f x instance Universe NonEmpty where @@ -389,8 +389,8 @@ instance Universe ((,) j) where idecideAll f (STuple2 _ x) = case f ISnd x of Proved p -> Proved $ WitAll $ \case ISnd -> p Disproved v -> Disproved $ \a -> v $ runWitAll a ISnd - allProd f (STuple2 _ x) a = PSnd $ f x (runWitAll a ISnd) - prodAll f (PSnd x) = WitAll $ \case ISnd -> f x + allProd f (STuple2 w x) a = PTup w $ f x (runWitAll a ISnd) + prodAll f (PTup _ x) = WitAll $ \case ISnd -> f x -- | The single-pointed universe. instance Universe Identity where diff --git a/stack.yaml b/stack.yaml index da6ec76..7327fda 100644 --- a/stack.yaml +++ b/stack.yaml @@ -48,8 +48,9 @@ packages: # using the same syntax as the packages field. # (e.g., acme-missiles-0.3) extra-deps: -- github: mstksg/functor-products - commit: 476b961bb007d7ee9aa0e60500c1473bc4a34e73 +- functor-products-0.1.0.0 +# - github: mstksg/functor-products +# commit: 476b961bb007d7ee9aa0e60500c1473bc4a34e73 # Override default flag values for local packages and extra-deps # flags: {} diff --git a/stack.yaml.lock b/stack.yaml.lock index e08aca3..3c7f39d 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -5,19 +5,12 @@ packages: - completed: - size: 8366 - url: https://github.com/mstksg/functor-products/archive/476b961bb007d7ee9aa0e60500c1473bc4a34e73.tar.gz - cabal-file: - size: 1140 - sha256: de5ef87f6154dfdb5e8ca9d609e12959e93b28c2467a0e655dea1e9f67b33818 - name: functor-products - version: 0.1.0.0 - sha256: 6d271ac81804a3cca1eb4f92acbb93092bce292809d62061340268fe4d09976e + hackage: functor-products-0.1.0.0@sha256:cc5e526b5f3694d33a89044578e4fe74e4e05dd01d5d96bc57be06d6d98a1883,1455 pantry-tree: - size: 477 - sha256: 479ea6650a95cb50e909ef1df9534228a255a1b49b1b167193eac1b3fcbaedc8 + size: 408 + sha256: 33712b9ee5c4491bcf320dc53618dba0f765a1ece19e26336fa9ed2aa3809365 original: - url: https://github.com/mstksg/functor-products/archive/476b961bb007d7ee9aa0e60500c1473bc4a34e73.tar.gz + hackage: functor-products-0.1.0.0 snapshots: - completed: size: 523441