records-th 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+7/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Record.TH: instance (Eq (a style), Eq (App style f), Name n) => Eq ((:&) a (n ::: f) style)
+ Data.Record.TH: instance Eq (X style)
Files
- Data/Record/TH.hs +6/−2
- records-th.cabal +1/−1
Data/Record/TH.hs view
@@ -27,7 +27,7 @@ -- | A field representing its TypeOf type Field a = (a ::: TypeOf a) --- | A record of kind *+-- | A record using the Id type function as its sort type Rec a = a (Id KindStar) -- | Generate field declarations for the given strings. For example:@@ -50,7 +50,7 @@ (AppT (ConT a) _) -> if a == ''Maybe then '(.:?) else '(.:) _ -> '(.:) let main = [- DataD [] n [] [NormalC n []] [''Show],+ DataD [] n [] [NormalC n []] [''Show, ''Eq], InstanceD [] (AppT (ConT ''Name) (ConT n)) [ FunD 'name [Clause [] (NormalB (ConE n)) []]], TySynInstD ''TypeOf [ConT n] t']@@ -92,6 +92,10 @@ instance Default (X style) where def = X instance (Default (a style), Default (App style f), Name n) => Default ((a :& (n ::: f)) style) where def = def :& name := def++instance Eq (X style) where _ == _ = True+instance (Eq (a style), Eq (App style f), Name n) => Eq ((a :& (n ::: f)) style) where+ (as :& (_ := a)) == (bs :& (_ := b)) = as == bs && a == b {- instance ToJSON x => ToJSONField ((A ::: x) (Id KindStar)) where
records-th.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: records-th-version: 0.1.0.0+version: 0.1.1.0 synopsis: Template Haskell declarations for the records package description: Records-TH generates a variety of declarations for use with the records package, including datatypes, Name, FromJSON, ToJSON and Default instances, and a default field type.