packages feed

lawful-conversions 0.1.2.1 → 0.1.2.2

raw patch · 3 files changed

+9/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

lawful-conversions.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: lawful-conversions-version: 0.1.2.1+version: 0.1.2.2 synopsis: Lawful typeclasses for bidirectional conversion between types category: Conversion homepage: https://github.com/nikita-volkov/lawful-conversions@@ -27,10 +27,10 @@   = The conversion problem    Have you ever looked for a @toString@ function? How often do you-  import @Data.Text.Lazy@ only to call its 'Data.Text.Lazy.fromStrict'? How+  import @Data.Text.Lazy@ only to call its @fromStrict@? How   about importing @Data.ByteString.Builder@ only to call its-  'Data.ByteString.Builder.toLazyByteString' and then importing-  @Data.ByteString.Lazy@ only to call its 'Data.ByteString.Lazy.toStrict'?+  @toLazyByteString@ and then importing+  @Data.ByteString.Lazy@ only to call its @toStrict@?    Those all are instances of one pattern. They are conversions between different   representations of the same information. Codebases that don't attempt to@@ -52,7 +52,7 @@    = Prior work and acknowledgements -  This library is a direct successor of the ["isomorphism-class"](https://hackage.haskell.org/package/isomorphism-class) library, expanding upon the patterns discovered there. It also shares some ideas with ["control-iso"](https://hackage.haskell.org/package/control-iso) and ["type-iso"](https://hackage.haskell.org/package/type-iso).+  This library is a direct successor of the "[isomorphism-class](https://hackage.haskell.org/package/isomorphism-class)" library, expanding upon the patterns discovered there. It also shares some ideas with "[control-iso](https://hackage.haskell.org/package/control-iso)" and "[type-iso](https://hackage.haskell.org/package/type-iso)".  source-repository head   type: git
src/library/LawfulConversions.hs view
@@ -78,6 +78,9 @@ -- >       else if double > 1 -- >         then Percent 1 -- >         else Percent double+--+-- However declaring an instance of 'Is' would be incorrect, because this conversion is partial.+-- Namely, while every @Percent@ value can be losslessly transformed into 'Double', not every 'Double' can be losslessly transformed into @Percent@. module LawfulConversions   ( -- * Typeclasses     IsSome (..),
src/library/LawfulConversions/Classes/Is.hs view
@@ -25,7 +25,7 @@ -- -- For all values of /a/ converting from /a/ to /b/ and then converting from /b/ to /a/ produces the original value: ----- > \a -> a == from (to @b a)+-- > \a -> a == to (from @a @b a) -- -- === Testing --