Skip to content

Commit

Permalink
update refined, always polykinded; release 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed Jul 4, 2022
1 parent c7c3dd4 commit dab7797
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 38 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.3.1 (2022-07-04)
* update refined (polykind predicate)

## 0.3.0 (2022-06-08)
* switch to associated type family for `Weak` inside `Weaken` - `Strengthen`
now has `Weaken` as a superclass
Expand Down
20 changes: 5 additions & 15 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: strongweak
version: 0.3.0
version: 0.3.1
synopsis: Convert between strong and weak representations of types
description: Please see README.md.
extra-source-files:
Expand Down Expand Up @@ -71,14 +71,15 @@ dependencies:
- base >= 4.14 && < 5
- either ^>= 5.0.1.1
- prettyprinter ^>= 1.7.1
- refined ^>= 0.6.3
- refined ^>= 0.7
- vector-sized ^>= 1.5.0
- vector ^>= 0.12.3.1

ghc-options:
- -Wall

library:
source-dirs: src
ghc-options:
- -Wall

tests:
spec:
Expand All @@ -92,14 +93,3 @@ tests:
- QuickCheck ^>= 2.14.2
- quickcheck-instances ^>= 0.3.26
- generic-random ^>= 1.5.0.1

flags:
refined-polykind:
description: assume predicate p in Refined p a is polykinded
default: false
manual: true

when:
- condition: flag(refined-polykind)
cpp-options:
- -DREFINED_POLYKIND
4 changes: 0 additions & 4 deletions src/Strongweak/Strengthen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ instance (KnownNat n, Typeable a, Show a) => Strengthen (Vector n a) where
Just s -> Success s

-- | Obtain a refined type by applying its associated refinement.
#ifdef REFINED_POLYKIND
instance (Predicate (p :: k) a, Typeable k, Typeable a, Show a) => Strengthen (Refined p a) where
#else
instance (Predicate p a, Typeable p, Typeable a, Show a) => Strengthen (Refined p a) where
#endif
strengthen a =
case refine a of
Left err -> strengthenFailBase a (show err)
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
resolver: nightly-2022-03-30
resolver: nightly-2022-07-04
packages: [.]
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
size: 539378
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/3/30.yaml
sha256: 745431a4c5b78cc93d81e99b2253a1e0eacd4f94e00cf17dab7cc14e665332e3
original: nightly-2022-03-30
size: 614841
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/7/4.yaml
sha256: 2d44a08a35e492f0d547eddf9007f4e4a71614101bb0f3dfca90a8b9eea0bc72
original: nightly-2022-07-04
16 changes: 4 additions & 12 deletions strongweak.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: strongweak
version: 0.3.0
version: 0.3.1
synopsis: Convert between strong and weak representations of types
description: Please see README.md.
category: Data
Expand All @@ -26,11 +26,6 @@ source-repository head
type: git
location: https://github.com/raehik/strongweak

flag refined-polykind
description: assume predicate p in Refined p a is polykinded
manual: True
default: False

library
exposed-modules:
Strongweak
Expand Down Expand Up @@ -81,11 +76,9 @@ library
base >=4.14 && <5
, either >=5.0.1.1 && <5.1
, prettyprinter >=1.7.1 && <1.8
, refined >=0.6.3 && <0.7
, refined ==0.7.*
, vector >=0.12.3.1 && <0.13
, vector-sized >=1.5.0 && <1.6
if flag(refined-polykind)
cpp-options: -DREFINED_POLYKIND
default-language: Haskell2010

test-suite spec
Expand Down Expand Up @@ -130,6 +123,7 @@ test-suite spec
StandaloneKindSignatures
ScopedTypeVariables
TypeOperators
ghc-options: -Wall
build-tool-depends:
hspec-discover:hspec-discover >=2.7 && <2.10
build-depends:
Expand All @@ -140,10 +134,8 @@ test-suite spec
, hspec >=2.7 && <2.10
, prettyprinter >=1.7.1 && <1.8
, quickcheck-instances >=0.3.26 && <0.4
, refined >=0.6.3 && <0.7
, refined ==0.7.*
, strongweak
, vector >=0.12.3.1 && <0.13
, vector-sized >=1.5.0 && <1.6
if flag(refined-polykind)
cpp-options: -DREFINED_POLYKIND
default-language: Haskell2010
4 changes: 2 additions & 2 deletions test/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ deriving stock instance Eq (DS 'Weak)
deriving stock instance Show (DS 'Weak)
deriving via (GenericArbitraryU `AndShrinking` (DS 'Weak)) instance Arbitrary (DS 'Weak)

instance Weaken (DS 'Strong) where
type Weak (DS 'Strong) = DS 'Weak
instance Weaken (DS 'Strong) where
type Weak (DS 'Strong) = DS 'Weak
weaken = weakenGeneric
instance Strengthen (DS 'Strong) where strengthen = strengthenGeneric

Expand Down

0 comments on commit dab7797

Please sign in to comment.