packages feed

vinyl-utils 0.2.0.0 → 0.2.0.1

raw patch · 4 files changed

+11/−5 lines, 4 files

Files

changelog.md view
@@ -1,3 +1,8 @@+0.2.0.1+-------++* Record type class is now polykinded.+ 0.2.0.0 ------- 
src/Data/Vinyl/Utils/Field.hs view
@@ -29,16 +29,16 @@   FieldAll '[] c = ()   FieldAll (r ': rs) c = (c r, FieldAll rs c) --- |An empty data type that reifies a constraint.+-- |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'+-- ^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 constraint that applies to all field labels and a dummy record, reify the constraint for all field labels.+-- ^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/Proxy.hs view
@@ -10,6 +10,7 @@ {-# LANGUAGE     DataKinds   , GADTs+  , PolyKinds   , RankNTypes   , TypeOperators   #-}@@ -23,7 +24,7 @@ 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 where+class Record (rs :: [k]) where   proxyRecord :: Rec Proxy rs  instance Record '[] where
vinyl-utils.cabal view
@@ -1,5 +1,5 @@ name:                vinyl-utils-version:             0.2.0.0+version:             0.2.0.1 synopsis:            Utilities for vinyl description:         Operations on records parametrized with various kinds of functors. license:             BSD3