Skip to content

Commit

Permalink
ready for 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Aug 13, 2019
1 parent 81e7469 commit f08f6ef
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 22 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Changelog
=========

Version 0.1.5.1
Version 0.2.0.0
---------------

*Unreleased*
*August 12, 2019*

<https://github.com/mstksg/decidable/releases/tag/v0.1.5.1>
<https://github.com/mstksg/decidable/releases/tag/v0.2.0.0>

* Add `sameIndexVal`, `sameNEIndexVal`.
* Full restructuring of the Universe system, pulling it all out into a new
package, *functor-products*.

Version 0.1.5.0
---------------
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: decidable
version: 0.1.5.0
version: 0.2.0.0
github: "mstksg/decidable"
license: BSD3
author: "Justin Le"
Expand Down
19 changes: 19 additions & 0 deletions src/Data/Type/Predicate/Auto.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions src/Data/Type/Universe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down
15 changes: 4 additions & 11 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f08f6ef

Please sign in to comment.