packages feed

red-black-record 2.1.3.0 → 2.1.4.0

raw patch · 5 files changed

+29/−16 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.RBR.Internal: instance Data.RBR.Internal.FromRecord (Data.RBR.Internal.Record Data.SOP.BasicFunctors.I t)
+ Data.RBR.Internal: instance Data.RBR.Internal.ToRecord (Data.RBR.Internal.Record Data.SOP.BasicFunctors.I t)

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Revision history for red-black-record +## 2.1.4.0+- Added trivial FromRecord and ToRecord instances to Record.+ ## 2.1.3.0 - Added injections_Record.  
README.md view
@@ -194,3 +194,5 @@ * [higgledy](http://hackage.haskell.org/package/higgledy). Provides you with HKD   versions of normal records. +* [Flay](https://hackage.haskell.org/package/flay-0.4) Work generically on your datatype without knowing its shape nor its contents.+
lib/Data/RBR/Examples.hs view
@@ -183,9 +183,9 @@  >>> :{     let parseSpecial-              :: forall r c flat. (IsRecordType r c, -                                   Maplike c,-                                   KeysValuesAll (KeyValueConstraints KnownSymbol FromJSON) c) +              :: forall r c. (IsRecordType r c, +                              Maplike c,+                              KeysValuesAll (KeyValueConstraints KnownSymbol FromJSON) c)                => (Record ((,) String :.: Star Parser Data.Aeson.Value) c -> Record ((,) String :.: Star Parser Data.Aeson.Value) c)               -> Data.Aeson.Value                -> Parser r@@ -219,9 +219,9 @@  >>> :{     let parseWithAliases-              :: forall r c flat. (IsRecordType r c, -                                   Maplike c,-                                   KeysValuesAll (ValueConstraint FromJSON) c) +              :: forall r c. (IsRecordType r c, +                              Maplike c,+                              KeysValuesAll (ValueConstraint FromJSON) c)                => Record (K String) c               -> Data.Aeson.Value                -> Parser r@@ -313,9 +313,9 @@  >>> :{     let parseAll-              :: forall r c flat. (IsVariantType r c, -                                   Maplike c,-                                   KeysValuesAll (KeyValueConstraints KnownSymbol FromJSON) c) +              :: forall r c. (IsVariantType r c, +                              Maplike c,+                              KeysValuesAll (KeyValueConstraints KnownSymbol FromJSON) c)                => Data.Aeson.Value                -> Parser r         parseAll = @@ -346,6 +346,7 @@     * [Adventures assembling records of capabilities. (Discourse)](https://discourse.haskell.org/t/adventures-assembling-records-of-capabilities/623)     * [Creating a result piecewise from stateful computation. (SO)](https://stackoverflow.com/a/60067270/1364288)     * [Extracting sections of function pipelines. (GitHub)](https://gist.github.com/danidiaz/2157e68f5d4967e468a9d062d4476adf#file-pipelines3-hs)+    * [A function that builds record values by asking the user for the fields' values. (Twitter)](https://twitter.com/DiazCarrete/status/1250770045749342210)     * [Resources on sop-core and generics-sop. (GitHub)](https://github.com/well-typed/generics-sop/issues/47)  -}
lib/Data/RBR/Internal.hs view
@@ -98,7 +98,7 @@     -> r t  {- | This typeclass provides generalizations of 'Applicative'-like functions- - which work over 'Record's and 'Variant's.+     which work over 'Record's and 'Variant's. -} class Maplike (t :: Map Symbol Type) where     {- | @@ -116,7 +116,8 @@     sequence_Record :: Applicative f => Record f t -> f (Record I t)     {- |           Like 'sequence_Record', but only pulls out the outer 'Applicative'-         from an 'Applicative' composition that wraps each field. See '(:.:)'.+         from an 'Applicative' composition that wraps each field. See+         'Data.SOP.:.:'.           This can be useful for staged computations, where each stage is          represented by an 'Applicative' layer.@@ -253,7 +254,7 @@     the values satisfy some constraint. The constraint is passed as a     'Data.Proxy.Proxy'. -    The fuction that constructs each field receives the name of the field as an+    The function that constructs each field receives the name of the field as an     argument.      The naming scheme follows that of 'Data.SOP.NP.cpure_NP'.@@ -356,7 +357,13 @@ instance (Productlike '[] t result, Show (NP f result)) => Show (Record f t) where     show x = "fromNP (" ++ show (toNP x) ++ ")" +instance ToRecord (Record I (t :: Map Symbol Type)) where+    type RecordCode (Record I t)  = t+    toRecord = id +instance FromRecord (Record I (t :: Map Symbol Type)) where+    fromRecord = id+ {-# DEPRECATED collapse_Record "Use collapse'_Record" #-} collapse_Record :: forall t result a. (Productlike '[] t result) => Record (K a) t -> [a] collapse_Record = collapse_NP . toNP@@ -992,9 +999,9 @@ newtype SetField f a b = SetField { getSetField :: f b -> a -> a }   {- | For a given 'Map', produces a two-place constraint confirming the presence- - of a entry.- --  Defined using the "class synonym" <https://www.reddit.com/r/haskell/comments/ab8ypl/monthly_hask_anything_january_2019/edk1ot3/ trick>.+     of a entry.+     +     Defined using the "class synonym" <https://www.reddit.com/r/haskell/comments/ab8ypl/monthly_hask_anything_january_2019/edk1ot3/ trick>. -} class (Key k t, Value k t ~ v) => PresentIn (t :: Map Symbol q) (k :: Symbol) (v :: q)  instance (Key k t, Value k t ~ v) => PresentIn (t :: Map Symbol q) (k :: Symbol) (v :: q)
red-black-record.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.0 name:                red-black-record-version:             2.1.3.0+version:             2.1.4.0 synopsis:            Extensible records and variants indexed by a type-level Red-Black tree.  description:         A library that provides extensible records and variants,