records 0.1.1.0 → 0.1.1.1
raw patch · 3 files changed
+8/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- records.cabal +1/−1
- src/Data/Record.hs +4/−6
- src/Data/Record/Combinators.hs +3/−3
records.cabal view
@@ -1,5 +1,5 @@ Name: records-Version: 0.1.1.0+Version: 0.1.1.1 Cabal-Version: >= 1.2.3 Build-Type: Simple License: BSD3
src/Data/Record.hs view
@@ -51,12 +51,10 @@ (X :& Surname ::: String :& Age ::: Int :& Room ::: String) ('Id' 'KindStar') @ - If we replace the type @Id KindStar@ by @Id KindStar -> Id KindStar@, we get a type that covers- all records with a @Surname@, an @Age@, and a @Room@ field that contain values of type- @String -> String@, @Int -> Int@, and @String -> String@, respectively. (Note that the type @Id- KindStar -> Id KindStar@ represents the type-level function @\\t -> (t -> t)@ according to the- @(->)@ instance of 'TypeFun'.) So by varying the style, we can generate a family of related- record types from a single record scheme.+ If we replace the type @Id KindStar@ by @Id KindStar :-> Id KindStar@, we get a type that+ covers all records with a @Surname@, an @Age@, and a @Room@ field that contain values of+ type @String -> String@, @Int -> Int@, and @String -> String@, respectively. So by varying+ the style, we can generate a family of related record types from a single record scheme. -} -- |The empty record scheme.
src/Data/Record/Combinators.hs view
@@ -60,20 +60,20 @@ @ ('App' style sortSurname ~ String, Num ('App' style sortAge), 'App' style sortRoom ~ String) =>- (X :& Surname ::: /sortSurname/ :& Age ::: /sortAge/ :& Room ::: /sortRoom/) style+ (X :& Surname ::: sortSurname :& Age ::: sortAge :& Room ::: sortRoom) style @ We can fix the style of that record using the expression @- X :& Surname := \"Jeltsch\" :& Age := 33 :& Room := \"HG/2.39\" \`withStyle\` Id KindStar+ X :& Surname := \"Jeltsch\" :& Age := 33 :& Room := \"HG/2.39\" \`withStyle\` 'Id' 'KindStar' @ which has the most general type @ (Num age) =>- (X :& Surname ::: String :& Age ::: age :& Room ::: String) (Id KindStar)+ (X :& Surname ::: String :& Age ::: age :& Room ::: String) ('Id' 'KindStar') @ The @withStyle@ combinator is similar to 'asTypeOf'.