vinyl 0.2 → 0.2.1
raw patch · 2 files changed
+14/−4 lines, 2 files
Files
- Data/Vinyl/Rec.hs +12/−2
- vinyl.cabal +2/−2
Data/Vinyl/Rec.hs view
@@ -20,6 +20,7 @@ , PlainRec , (=:) , (<+>)+ , (<-:) , type (++) , fixRecord ) where@@ -51,12 +52,21 @@ (<+>) :: Rec as f -> Rec bs f -> Rec (as ++ bs) f RNil <+> xs = xs (x :& xs) <+> ys = x :& (xs <+> ys)-infixl 8 <+>+infixr 5 <+> -- | Shorthand for a record with a single field. Lifts the field's -- value into the chosen functor automatically. (=:) :: Applicative f => sy ::: t -> t -> Rec '[sy ::: t] f-a =: b = pure b :& RNil+_ =: b = pure b :& RNil++-- | Shorthand for a record with a single field of an 'Applicative'+-- type. This is useful for @Applicative@ or @Monad@ic intialization+-- of records as in the idiom:+--+-- > dist $ myField <-: someIO <+> yourField <-: otherIO+(<-:) :: Applicative f => sy ::: t -> f t -> Rec '[sy ::: t] f+_ <-: b = b :& RNil+infixr 6 <-: -- | Append for type-level lists. type family (as :: [*]) ++ (bs :: [*]) :: [*]
vinyl.cabal view
@@ -1,5 +1,5 @@ name: vinyl-version: 0.2+version: 0.2.1 synopsis: Extensible Records -- description: license: MIT@@ -16,7 +16,7 @@ source-repository head type: git- location: https://github.com/jonsterling/Vinyl/+ location: https://github.com/VinylRecords/Vinyl/ library exposed-modules: Data.Vinyl, Data.Vinyl.Field, Data.Vinyl.Lens,