describe 0.2.0.2 → 0.2.0.3
raw patch · 3 files changed
+6/−2 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Serialize.Describe.Combinators: newtype Optional p t
+ Data.Serialize.Describe.Combinators: newtype Predicate t p => Optional p t
Files
- CHANGELOG.md +4/−0
- describe.cabal +1/−1
- src/Data/Serialize/Describe/Combinators.hs +1/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for describe +## 0.2.0.3 -- 2019-10-06++* Added constraint on `Optional` to prevent overlapping instances on the supplied predicate.+ ## 0.2.0.2 -- 2019-10-06 * Exposed `Equals`.
describe.cabal view
@@ -3,7 +3,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/ name: describe-version: 0.2.0.2+version: 0.2.0.3 synopsis: Combinators for describing binary data structures description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. homepage: https://github.com/riugabachi/describe
src/Data/Serialize/Describe/Combinators.hs view
@@ -15,7 +15,7 @@ import qualified Data.Serialize.Get as G -- | An 'Optional' represents a field which is optionally-serializable. The field will be parsed via a lookAhead and, if the value matches the 'Predicate' p, then the field exists. If not, it is assumed as though the field was never serialized in the first place and the value will be set to 'Nothing'; parsing will then continue on as usual.-newtype Optional p t = Optional { unwrapOptional :: Maybe t }+newtype Predicate t p => Optional p t = Optional { unwrapOptional :: Maybe t } class Predicate t a where check :: t -> Bool