sayable 1.2.3.1 → 1.2.4.0
raw patch · 3 files changed
+26/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−0
- Text/Sayable.hs +16/−3
- sayable.cabal +1/−1
CHANGELOG.md view
@@ -1,5 +1,14 @@ # Revision history for sayable +## 1.2.4.0 -- 2023-11-25++* Fix sayableSubConstraints filtering to only apply to outer constructor and+ still consider inner elements.+* Add Set, Seq, and NonEmpty to List in avoiding outer constructor dependencies+ for sayableSubConstraints.+* Fix sayableSubConstraints to consider all elements and not just top-level.++ ## 1.2.3.1 -- 2023-11-12 * Reduce maximum constraint tuple arity generated by `sayableSubConstraints` to
Text/Sayable.hs view
@@ -1225,19 +1225,32 @@ let collectTC :: TH.Type -> Q [TH.Type] collectTC = \case+ -- String as a [Char] is a special case because String is the fundamental -- Pretty printable type, so restore it after resolveTypeSynonyms. AppT ListT (ConT a) | a == ''Char -> return [ConT ''String]- AppT ListT b -> collectTC b -- assumes lists are handled via &*++ -- Assumes that lists or list-like sequences are handled via &* and so+ -- only a dependency on the element type and not the sequence type itself+ -- is needed.+ AppT ListT b -> collectTC b+ AppT (ConT a) b | TH.nameBase a `elem` [ "NonEmpty"+ , "Seq"+ , "Set"+ ] -> collectTC b++ -- Assumes Maybe is handled via &? so only a dependency on the element+ -- type and not on the Maybe itself. x@(AppT (ConT a) b) -> if a == ''Maybe- then collectTC b -- assumes Maybe is handled via &?+ then collectTC b else return $ if fltr a then [x] else []+ (AppT a b) -> do y <- collectTC a z <- collectTC b return $ concat ((\x -> AppT x <$> z) <$> y) x@(ConT a) -> return $ if fltr a then [x] else [] x@(VarT a) -> return $ if fltr a then [x] else []- _ -> return []+ x -> return [x] tc <- fmap (applySubstitution tsubmap) . concat <$> (mapM collectTC cf)
sayable.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: sayable-version: 1.2.3.1+version: 1.2.4.0 synopsis: Construction of context-adjusted pretty output description: .