packages feed

lawful-conversions 0.1.6.1 → 0.1.7

raw patch · 3 files changed

+17/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ LawfulConversions: onto :: forall b a. IsMany a b => a -> b

Files

lawful-conversions.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: lawful-conversions-version: 0.1.6.1+version: 0.1.7 synopsis: Lawful typeclasses for bidirectional conversion between types category: Conversion homepage: https://github.com/nikita-volkov/lawful-conversions
src/library/LawfulConversions.hs view
@@ -87,6 +87,9 @@     IsMany (..),     Is, +    -- * Combinators+    onto,+     -- * Optics     isSomePrism,     isManyIso,
src/library/LawfulConversions/Classes.hs view
@@ -82,12 +82,25 @@   --   -- The first type application of the 'to' function on the other hand specifies   -- the output data type.+  --+  -- If you want to specify the output type instead, use 'onto'.   from :: a -> b    -- |   -- Requires the presence of 'IsSome' in reverse direction.   default from :: (IsSome b a) => a -> b   from = to++-- |+-- Alias to 'from', which lets you specify the target type of the conversion first using @TypeApplications@.+--+-- In mathematics @onto@ is another name for [Surjective function](https://en.wikipedia.org/wiki/Surjective_function).+--+-- E.g.,+--+-- > lenientDecodeUtf8 = onto @Text+onto :: forall b a. (IsMany a b) => a -> b+onto = from  instance IsMany a a