packages feed

vinyl-utils 0.2.0.2 → 0.2.0.3

raw patch · 10 files changed

+355/−355 lines, 10 filesdep ~contravariantsetup-changed

Dependency ranges changed: contravariant

Files

LICENSE view
@@ -1,30 +1,30 @@-Copyright (c) 2014, Marcin Mrotek--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:--    * Redistributions of source code must retain the above copyright-      notice, this list of conditions and the following disclaimer.--    * Redistributions in binary form must reproduce the above-      copyright notice, this list of conditions and the following-      disclaimer in the documentation and/or other materials provided-      with the distribution.--    * Neither the name of Marcin Mrotek nor the names of other-      contributors may be used to endorse or promote products derived-      from this software without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+Copyright (c) 2014, Marcin Mrotek
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Marcin Mrotek nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
README.md view
@@ -1,2 +1,2 @@-# vinyl-utils-Utilities for Vinyl+# vinyl-utils
+Utilities for Vinyl
Setup.hs view
@@ -1,2 +1,2 @@-import Distribution.Simple-main = defaultMain+import Distribution.Simple
+main = defaultMain
changelog.md view
@@ -1,24 +1,24 @@-0.2.0.1----------* Record type class is now polykinded.--0.2.0.0----------* Updated for base-4.8-* Added operations on field constraints.-* Added proxy record generation.-* Removed ConstApplicative type class, replaced by generation from proxy record.--0.1.0.0----------* Updated for Vinyl 0.5.*-* Removed slicing lens and overwriting (already in Vinyl proper).--0.0.0.0---------* Initial commit.-+0.2.0.1
+-------
+
+* Record type class is now polykinded.
+
+0.2.0.0
+-------
+
+* Updated for base-4.8
+* Added operations on field constraints.
+* Added proxy record generation.
+* Removed ConstApplicative type class, replaced by generation from proxy record.
+
+0.1.0.0
+-------
+
+* Updated for Vinyl 0.5.*
+* Removed slicing lens and overwriting (already in Vinyl proper).
+
+0.0.0.0
+------
+
+* Initial commit.
+
src/Data/Vinyl/Utils/Compose.hs view
@@ -1,25 +1,25 @@-{-|-Module      : Data.Vinyl.Utils.Compose-Copyright   : (c) Marcin Mrotek, 2014-License     : BSD3-Maintainer  : marcin.jan.mrotek@gmail.com--Operations on composed functor records.--}--{-# LANGUAGE-      DataKinds-    , PolyKinds-    #-}--{-# OPTIONS_HADDOCK show-extensions #-}--module Data.Vinyl.Utils.Compose -  ( rtraverse1 ) where--import Data.Vinyl.Functor-import Data.Vinyl--rtraverse1 :: Applicative f => Rec (Compose f g) rs -> f (Rec g rs)--- ^Traverse a record parametrized with a composition of functors, leaving the inner functor.-rtraverse1 = rtraverse getCompose+{-|
+Module      : Data.Vinyl.Utils.Compose
+Copyright   : (c) Marcin Mrotek, 2014
+License     : BSD3
+Maintainer  : marcin.jan.mrotek@gmail.com
+
+Operations on composed functor records.
+-}
+
+{-# LANGUAGE
+      DataKinds
+    , PolyKinds
+    #-}
+
+{-# OPTIONS_HADDOCK show-extensions #-}
+
+module Data.Vinyl.Utils.Compose 
+  ( rtraverse1 ) where
+
+import Data.Vinyl.Functor
+import Data.Vinyl
+
+rtraverse1 :: Applicative f => Rec (Compose f g) rs -> f (Rec g rs)
+-- ^Traverse a record parametrized with a composition of functors, leaving the inner functor.
+rtraverse1 = rtraverse getCompose
src/Data/Vinyl/Utils/Const.hs view
@@ -1,67 +1,67 @@-{-|-Module      : Data.Vinyl.Utils.Const-Copyright   : (c) Marcin Mrotek, 2014-License     : BSD3-Maintainer  : marcin.jan.mrotek@gmail.com--Operations on constant type records.--}---{-# LANGUAGE-      DataKinds-    , PolyKinds-    , TypeFamilies-    , TypeOperators-    #-}--{-# OPTIONS_HADDOCK show-extensions #-}--module Data.Vinyl.Utils.Const-  ( cfmap-  , cpure-  , capp-  , rconst-  , constCommute-  , rtraverseconst-  , Record (..)-  ) where--import Data.Vinyl.Utils.Compose-import Data.Vinyl.Utils.Proxy--import Data.Vinyl.Functor-import Data.Vinyl--cfmap :: (a -> b) -> Rec (Const a) rs -> Rec (Const b) rs--- ^Map a function over a constant type record.-cfmap _ RNil = RNil-cfmap f (Const r :& rs) = Const (f r) :& cfmap f rs--cpure :: Record rs => a -> Rec (Const a) rs--- ^Extension of 'pure' to constant type records.-cpure = cpure' proxyRecord--cpure' :: Rec Proxy rs -> a -> Rec (Const a) rs-cpure' RNil _ = RNil-cpure' (Proxy :& ps) a = Const a :& cpure' ps a--capp  :: (Rec (Const (a -> b)) rs) -> Rec (Const a) rs -> Rec (Const b) rs--- ^Extension of (<*>) to constant type records.-capp RNil RNil = RNil-capp (Const f :& fs) (Const x :& xs) = Const (f x) :& capp fs xs-capp RNil _ = error "impossible"-capp _ RNil = error "impossible"--rconst :: (Applicative f, RecApplicative rs) => f a -> f (Rec (Const a) rs)-rconst = rtraverse1 . rcpure-    where rcpure a = rpure (Compose $ Const <$> a)--constCommute :: Functor f => Const (f a) b -> Compose f (Const a) b--- ^Commute a constant functor with another functor.-constCommute (Const a) = Compose $ Const <$> a--rtraverseconst :: Applicative f => Rec (Const (f a)) rs -> f (Rec (Const a) rs)--- ^Distribute a functor over a constant type record.-rtraverseconst rec = rtraverse1 $ constCommute <<$>> rec-+{-|
+Module      : Data.Vinyl.Utils.Const
+Copyright   : (c) Marcin Mrotek, 2014
+License     : BSD3
+Maintainer  : marcin.jan.mrotek@gmail.com
+
+Operations on constant type records.
+-}
+
+
+{-# LANGUAGE
+      DataKinds
+    , PolyKinds
+    , TypeFamilies
+    , TypeOperators
+    #-}
+
+{-# OPTIONS_HADDOCK show-extensions #-}
+
+module Data.Vinyl.Utils.Const
+  ( cfmap
+  , cpure
+  , capp
+  , rconst
+  , constCommute
+  , rtraverseconst
+  , Record (..)
+  ) where
+
+import Data.Vinyl.Utils.Compose
+import Data.Vinyl.Utils.Proxy
+
+import Data.Vinyl.Functor
+import Data.Vinyl
+
+cfmap :: (a -> b) -> Rec (Const a) rs -> Rec (Const b) rs
+-- ^Map a function over a constant type record.
+cfmap _ RNil = RNil
+cfmap f (Const r :& rs) = Const (f r) :& cfmap f rs
+
+cpure :: Record rs => a -> Rec (Const a) rs
+-- ^Extension of 'pure' to constant type records.
+cpure = cpure' proxyRecord
+
+cpure' :: Rec Proxy rs -> a -> Rec (Const a) rs
+cpure' RNil _ = RNil
+cpure' (Proxy :& ps) a = Const a :& cpure' ps a
+
+capp  :: (Rec (Const (a -> b)) rs) -> Rec (Const a) rs -> Rec (Const b) rs
+-- ^Extension of (<*>) to constant type records.
+capp RNil RNil = RNil
+capp (Const f :& fs) (Const x :& xs) = Const (f x) :& capp fs xs
+capp RNil _ = error "impossible"
+capp _ RNil = error "impossible"
+
+rconst :: (Applicative f, RecApplicative rs) => f a -> f (Rec (Const a) rs)
+rconst = rtraverse1 . rcpure
+    where rcpure a = rpure (Compose $ Const <$> a)
+
+constCommute :: Functor f => Const (f a) b -> Compose f (Const a) b
+-- ^Commute a constant functor with another functor.
+constCommute (Const a) = Compose $ Const <$> a
+
+rtraverseconst :: Applicative f => Rec (Const (f a)) rs -> f (Rec (Const a) rs)
+-- ^Distribute a functor over a constant type record.
+rtraverseconst rec = rtraverse1 $ constCommute <<$>> rec
+
src/Data/Vinyl/Utils/Field.hs view
@@ -1,44 +1,44 @@-{-|-Module      : Data.Vinyl.Utils.Field-Copyright   : (c) Marcin Mrotek, 2014-License     : BSD3-Maintainer  : marcin.jan.mrotek@gmail.com--Manipulation of constraints that apply to field labels (as opposed to actual types stored in the record).--}--{-# LANGUAGE -    ConstraintKinds-  , DataKinds-  , GADTs-  , PolyKinds-  , TypeFamilies-  , TypeOperators-  #-}--{-# OPTIONS_HADDOCK show-extensions #-}--module Data.Vinyl.Utils.Field where--import Data.Proxy-import Data.Vinyl-import GHC.Exts---- |Assert that all field labels in a given type list satisfy a given constraint.-type family FieldAll (rs :: [k]) (c :: k -> Constraint) :: Constraint where-  FieldAll '[] c = ()-  FieldAll (r ': rs) c = (c r, FieldAll rs c)---- |A data type that reifies a constraint. Pattern match on the 'DictProxy' constructor to bring the constraint into scope.-data DictProxy c a where-  DictProxy :: c a => DictProxy c a--getProxy :: DictProxy c a -> Proxy a--- ^Obtain a 'Proxy' from a 'DictProxy', forgetting its constraint.-getProxy DictProxy = Proxy--reifyFieldConstraint :: FieldAll rs c => proxy c -> Rec Proxy rs -> Rec (DictProxy c) rs--- ^Given a dummy record and a constraint that applies to all field labels, reify the constraint for each field label.-reifyFieldConstraint _ RNil = RNil-reifyFieldConstraint c (Proxy :& ps) = DictProxy :& reifyFieldConstraint c ps-+{-|
+Module      : Data.Vinyl.Utils.Field
+Copyright   : (c) Marcin Mrotek, 2014
+License     : BSD3
+Maintainer  : marcin.jan.mrotek@gmail.com
+
+Manipulation of constraints that apply to field labels (as opposed to actual types stored in the record).
+-}
+
+{-# LANGUAGE 
+    ConstraintKinds
+  , DataKinds
+  , GADTs
+  , PolyKinds
+  , TypeFamilies
+  , TypeOperators
+  #-}
+
+{-# OPTIONS_HADDOCK show-extensions #-}
+
+module Data.Vinyl.Utils.Field where
+
+import Data.Proxy
+import Data.Vinyl
+import GHC.Exts
+
+-- |Assert that all field labels in a given type list satisfy a given constraint.
+type family FieldAll (rs :: [k]) (c :: k -> Constraint) :: Constraint where
+  FieldAll '[] c = ()
+  FieldAll (r ': rs) c = (c r, FieldAll rs c)
+
+-- |A data type that reifies a constraint. Pattern match on the 'DictProxy' constructor to bring the constraint into scope.
+data DictProxy c a where
+  DictProxy :: c a => DictProxy c a
+
+getProxy :: DictProxy c a -> Proxy a
+-- ^Obtain a 'Proxy' from a 'DictProxy', forgetting its constraint.
+getProxy DictProxy = Proxy
+
+reifyFieldConstraint :: FieldAll rs c => proxy c -> Rec Proxy rs -> Rec (DictProxy c) rs
+-- ^Given a dummy record and a constraint that applies to all field labels, reify the constraint for each field label.
+reifyFieldConstraint _ RNil = RNil
+reifyFieldConstraint c (Proxy :& ps) = DictProxy :& reifyFieldConstraint c ps
+
src/Data/Vinyl/Utils/Operator.hs view
@@ -1,79 +1,79 @@-{-|-Module      : Data.Vinyl.Utils.Operator-Copyright   : (c) Marcin Mrotek, 2014-License     : BSD3-Maintainer  : marcin.jan.mrotek@gmail.com--Operations on records parametrized with various kinds of functions.--}--{-# LANGUAGE -      ConstraintKinds-    , DataKinds-    , FlexibleContexts-    , FlexibleInstances-    , MultiParamTypeClasses-    , PolyKinds -    , RankNTypes-    , ScopedTypeVariables-    , TypeFamilies-    , TypeOperators-    #-}--{-# OPTIONS_HADDOCK show-extensions #-}--module Data.Vinyl.Utils.Operator (-      operator-    , (/$/), (/$$/), (\$\), (\$$\), (\&&\), (\||\)-) where--import Data.Functor.Contravariant-import Data.Vinyl-import Data.Vinyl.Functor--operator :: (forall t. f t -> g t -> h t) -> Rec f rs -> Rec g rs -> Rec h rs--- ^Create an operator between records sharing their fields but differing in functors.-operator _ RNil RNil = RNil-operator f (a :& as) (b :& bs) = (f a b) :& operator f as bs-operator _ RNil _ = error "impossible"-operator _ _ RNil = error "impossible"--(/$/) :: Functor f => Rec ((->) a) rs -> Rec (Const (f a)) rs -> Rec f rs--- ^Apply a record of (a -> x) functions to a constant type record to obtain a plain f-record.-(/$/) = operator (\f (Const x) -> f <$> x)--(/$$/) :: Rec (Compose ((->) a) f) rs -> Rec (Const a) rs -> Rec f rs--- ^Apply a record of (a -> f x) functions to a constant type record to obtain a plain f-record.-(/$$/) = operator (\(Compose f) (Const x) -> f x)--(\$\) :: Functor f => Rec (Op a) rs -> Rec f rs -> Rec (Const (f a)) rs--- ^Apply a record of (x -> a) functions to a plain f-record to obtain a constant type record.-(\$\) = operator (\(Op f) x -> Const $ f <$> x)--(\$$\) :: Rec (Compose (Op a) f) rs -> Rec f rs -> Rec (Const a) rs--- ^Apply a record of (f x -> a) functions to a plain f-record to obtain a constant type record.-(\$$\) = operator (\(Compose (Op f)) x -> Const $ f x)--predicate :: Functor f => Predicate t -> f t -> Const (f Bool) a-predicate (Predicate p) x = Const $ p <$> x--(\&&\) :: forall f rs. Applicative f => Rec Predicate rs -> Rec f rs -> f Bool--- ^Apply a predicate record to a plain f-record to obtain a boolean product inside the f functor.-(\&&\) p r = go result $ pure True-    where-        go :: Rec (Const (f Bool)) xs -> f Bool -> f Bool-        go RNil b = b-        go (Const a :& as) b = go as $ (&&) <$> a <*> b-        result :: Rec (Const (f Bool)) rs-        result = operator predicate p r-    -(\||\) :: forall f rs. Applicative f => Rec Predicate rs -> Rec f rs -> f Bool--- ^Apply a predicate record to a plain f-record to obtain a boolean sum inside the f functor.-(\||\) p r = go result $ pure False-    where -        go :: Rec (Const (f Bool)) xs -> f Bool -> f Bool-        go RNil b = b-        go (Const a :& as) b = go as $ (||) <$> a <*> b-        result :: Rec (Const (f Bool)) rs-        result = operator predicate p r-+{-|
+Module      : Data.Vinyl.Utils.Operator
+Copyright   : (c) Marcin Mrotek, 2014
+License     : BSD3
+Maintainer  : marcin.jan.mrotek@gmail.com
+
+Operations on records parametrized with various kinds of functions.
+-}
+
+{-# LANGUAGE 
+      ConstraintKinds
+    , DataKinds
+    , FlexibleContexts
+    , FlexibleInstances
+    , MultiParamTypeClasses
+    , PolyKinds 
+    , RankNTypes
+    , ScopedTypeVariables
+    , TypeFamilies
+    , TypeOperators
+    #-}
+
+{-# OPTIONS_HADDOCK show-extensions #-}
+
+module Data.Vinyl.Utils.Operator (
+      operator
+    , (/$/), (/$$/), (\$\), (\$$\), (\&&\), (\||\)
+) where
+
+import Data.Functor.Contravariant
+import Data.Vinyl
+import Data.Vinyl.Functor
+
+operator :: (forall t. f t -> g t -> h t) -> Rec f rs -> Rec g rs -> Rec h rs
+-- ^Create an operator between records sharing their fields but differing in functors.
+operator _ RNil RNil = RNil
+operator f (a :& as) (b :& bs) = (f a b) :& operator f as bs
+operator _ RNil _ = error "impossible"
+operator _ _ RNil = error "impossible"
+
+(/$/) :: Functor f => Rec ((->) a) rs -> Rec (Const (f a)) rs -> Rec f rs
+-- ^Apply a record of (a -> x) functions to a constant type record to obtain a plain f-record.
+(/$/) = operator (\f (Const x) -> f <$> x)
+
+(/$$/) :: Rec (Compose ((->) a) f) rs -> Rec (Const a) rs -> Rec f rs
+-- ^Apply a record of (a -> f x) functions to a constant type record to obtain a plain f-record.
+(/$$/) = operator (\(Compose f) (Const x) -> f x)
+
+(\$\) :: Functor f => Rec (Op a) rs -> Rec f rs -> Rec (Const (f a)) rs
+-- ^Apply a record of (x -> a) functions to a plain f-record to obtain a constant type record.
+(\$\) = operator (\(Op f) x -> Const $ f <$> x)
+
+(\$$\) :: Rec (Compose (Op a) f) rs -> Rec f rs -> Rec (Const a) rs
+-- ^Apply a record of (f x -> a) functions to a plain f-record to obtain a constant type record.
+(\$$\) = operator (\(Compose (Op f)) x -> Const $ f x)
+
+predicate :: Functor f => Predicate t -> f t -> Const (f Bool) a
+predicate (Predicate p) x = Const $ p <$> x
+
+(\&&\) :: forall f rs. Applicative f => Rec Predicate rs -> Rec f rs -> f Bool
+-- ^Apply a predicate record to a plain f-record to obtain a boolean product inside the f functor.
+(\&&\) p r = go result $ pure True
+    where
+        go :: Rec (Const (f Bool)) xs -> f Bool -> f Bool
+        go RNil b = b
+        go (Const a :& as) b = go as $ (&&) <$> a <*> b
+        result :: Rec (Const (f Bool)) rs
+        result = operator predicate p r
+    
+(\||\) :: forall f rs. Applicative f => Rec Predicate rs -> Rec f rs -> f Bool
+-- ^Apply a predicate record to a plain f-record to obtain a boolean sum inside the f functor.
+(\||\) p r = go result $ pure False
+    where 
+        go :: Rec (Const (f Bool)) xs -> f Bool -> f Bool
+        go RNil b = b
+        go (Const a :& as) b = go as $ (||) <$> a <*> b
+        result :: Rec (Const (f Bool)) rs
+        result = operator predicate p r
+
src/Data/Vinyl/Utils/Proxy.hs view
@@ -1,42 +1,42 @@-{-|-Module      : Data.Vinyl.Utils.Proxy-Copyright   : (c) Marcin Mrotek, 2014-License     : BSD3-Maintainer  : marcin.jan.mrotek@gmail.com--Create a dummy record parametrized by 'Proxy', for the purpose of guiding code generation through pattern matching.--}--{-# LANGUAGE-    DataKinds-  , GADTs-  , PolyKinds-  , RankNTypes-  , TypeOperators-  #-}--module Data.Vinyl.Utils.Proxy -  ( module Data.Vinyl.Utils.Proxy-  , Proxy (..)-  ) where--import Data.Proxy-import Data.Vinyl---- |Create a dummy record parametrized by 'Proxy'. The class is named 'Record' to signify that every possible type list is its instance.-class Record (rs :: [k]) where-  proxyRecord :: Rec Proxy rs--instance Record '[] where-  proxyRecord = RNil--instance Record rs => Record (r ': rs) where-  proxyRecord = Proxy :& proxyRecord--recPure :: forall (f :: k -> *) (rs :: [k]). Record rs => (forall (a :: k). f a) -> Rec f rs-recPure = recPure' proxyRecord--recPure' :: forall (f :: k -> *) (rs :: [k]). Rec Proxy rs -> (forall (a :: k). f a) -> Rec f rs-recPure' RNil _ = RNil-recPure' (Proxy :& ps) a = a :& recPure' ps a-+{-|
+Module      : Data.Vinyl.Utils.Proxy
+Copyright   : (c) Marcin Mrotek, 2014
+License     : BSD3
+Maintainer  : marcin.jan.mrotek@gmail.com
+
+Create a dummy record parametrized by 'Proxy', for the purpose of guiding code generation through pattern matching.
+-}
+
+{-# LANGUAGE
+    DataKinds
+  , GADTs
+  , PolyKinds
+  , RankNTypes
+  , TypeOperators
+  #-}
+
+module Data.Vinyl.Utils.Proxy 
+  ( module Data.Vinyl.Utils.Proxy
+  , Proxy (..)
+  ) where
+
+import Data.Proxy
+import Data.Vinyl
+
+-- |Create a dummy record parametrized by 'Proxy'. The class is named 'Record' to signify that every possible type list is its instance.
+class Record (rs :: [k]) where
+  proxyRecord :: Rec Proxy rs
+
+instance Record '[] where
+  proxyRecord = RNil
+
+instance Record rs => Record (r ': rs) where
+  proxyRecord = Proxy :& proxyRecord
+
+recPure :: forall (f :: k -> *) (rs :: [k]). Record rs => (forall (a :: k). f a) -> Rec f rs
+recPure = recPure' proxyRecord
+
+recPure' :: forall (f :: k -> *) (rs :: [k]). Rec Proxy rs -> (forall (a :: k). f a) -> Rec f rs
+recPure' RNil _ = RNil
+recPure' (Proxy :& ps) a = a :& recPure' ps a
+
vinyl-utils.cabal view
@@ -1,40 +1,40 @@-name:                vinyl-utils-version:             0.2.0.2-synopsis:            Utilities for vinyl-description:         Operations on records parametrized with various kinds of functors.-license:             BSD3-license-file:        LICENSE-author:              Marcin Mrotek-maintainer:          marcin.jan.mrotek@gmail.com-copyright:           (c) Marcin Mrotek 2015-category:            Control-build-type:          Simple-extra-source-files:  README.md-cabal-version:       >=1.10-homepage:            https://github.com/marcinmrotek/vinyl-utils       -extra-source-files:  changelog.md-source-repository    head-    type:     git-    location: https://github.com/marcinmrotek/vinyl-utils --Flag devel-    description: Development mode (-Werror).-    default: False-    manual:  True--library-  exposed-modules:     Data.Vinyl.Utils.Const-                      ,Data.Vinyl.Utils.Compose-                      ,Data.Vinyl.Utils.Field-                      ,Data.Vinyl.Utils.Operator-                      ,Data.Vinyl.Utils.Proxy-  build-depends:       base          >= 4.8 && < 4.9-                      ,contravariant >= 1.3 && < 1.4-                      ,transformers  >= 0.4 && < 0.5-                      ,vinyl         >= 0.5 && < 0.6-  hs-source-dirs:      src-  default-language:    Haskell2010-  ghc-options: -Wall -  if flag(devel)-     ghc-options: -Werror-+name:                vinyl-utils
+version:             0.2.0.3
+synopsis:            Utilities for vinyl
+description:         Operations on records parametrized with various kinds of functors.
+license:             BSD3
+license-file:        LICENSE
+author:              Marcin Mrotek
+maintainer:          marcin.jan.mrotek@gmail.com
+copyright:           (c) Marcin Mrotek 2015
+category:            Control
+build-type:          Simple
+extra-source-files:  README.md
+cabal-version:       >=1.10
+homepage:            https://github.com/marcinmrotek/vinyl-utils       
+extra-source-files:  changelog.md
+source-repository    head
+    type:     git
+    location: https://github.com/marcinmrotek/vinyl-utils 
+
+Flag devel
+    description: Development mode (-Werror).
+    default: False
+    manual:  True
+
+library
+  exposed-modules:     Data.Vinyl.Utils.Const
+                      ,Data.Vinyl.Utils.Compose
+                      ,Data.Vinyl.Utils.Field
+                      ,Data.Vinyl.Utils.Operator
+                      ,Data.Vinyl.Utils.Proxy
+  build-depends:       base          >= 4.8 && < 4.9
+                      ,contravariant >= 1.3 && < 1.5
+                      ,transformers  >= 0.4 && < 0.5
+                      ,vinyl         >= 0.5 && < 0.6
+  hs-source-dirs:      src
+  default-language:    Haskell2010
+  ghc-options: -Wall 
+  if flag(devel)
+     ghc-options: -Werror
+