records 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+27/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Record.Combinators: (///) :: (TypeFun style, Record (Domain style) rec, Record (Domain style) replRec, Convertible rec replRec) => rec style -> replRec style -> rec style
Files
- records.cabal +1/−1
- src/Data/Record/Combinators.hs +26/−2
records.cabal view
@@ -1,5 +1,5 @@ Name: records-Version: 0.1.0.0+Version: 0.1.1.0 Cabal-Version: >= 1.2.3 Build-Type: Simple License: BSD3
src/Data/Record/Combinators.hs view
@@ -18,8 +18,13 @@ map, zipWith, - -- * Modification+ -- * Modification of fields+ {-FIXME:+ Actually, all applicative functor operations except repeat are also about modification of+ fields.+ -} modify,+ (///), -- * Conversion -- FIXME: maybe don’t use the term “conversion” because of “record conversion”@@ -251,7 +256,9 @@ -- ^ zipWith fun argRec1 argRec2 = repeat fun <<*>> argRec1 <<*>> argRec2 - -- * Modification+ -- * Modification of multiple fields+ infixl 1 ///+ {-| Modifies a record by changing some of its field values. The first argument of @modify@ is called the modification record, and the second argument is called the data record. The@@ -307,6 +314,23 @@ onInit :: (rec style -> rec style) -> ((rec :& name ::: sort) style -> (rec :& name ::: sort) style) onInit fun (rec :& field) = fun rec :& field++ {-|+ Overwrites the values of multiple record fields. The first argument is the source record,+ and the second argument lists the names of the fields to be modified together with their new+ values.+ -}+ (///) :: (TypeFun style,+ Record (Domain style) rec,+ Record (Domain style) replRec,+ Convertible rec replRec)+ => rec style+ -- ^+ -> replRec style+ -- ^+ -> rec style+ -- ^+ rec /// replRec = modify (map (WrapApp const) replRec) rec -- * Conversion -- |Converts a record whose style is a constant function into the list of its field values.