packages feed

composite-base 0.8.2.2 → 0.8.3.0

raw patch · 5 files changed

+41/−19 lines, 5 filesdep ~mtldep ~template-haskelldep ~textPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: mtl, template-haskell, text, transformers

API changes (from Hackage documentation)

- Composite.Record: instance (Control.DeepSeq.NFData x, Control.DeepSeq.NFData (Composite.Record.Record xs)) => Control.DeepSeq.NFData (Composite.Record.Record (x : xs))
- Composite.Record: instance Control.DeepSeq.NFData (Composite.Record.Record '[])
+ Composite.CoRecord: instance (Composite.Record.AllHave '[Control.DeepSeq.NFData] rs, Data.Vinyl.Core.RecApplicative rs) => Control.DeepSeq.NFData (Composite.CoRecord.CoRec Data.Functor.Identity.Identity rs)
- Composite.CoRecord: foldCoRec :: RecApplicative (r : rs) => Cases' f (r : rs) b -> CoRec f (r : rs) -> b
+ Composite.CoRecord: foldCoRec :: RecApplicative (r ': rs) => Cases' f (r ': rs) b -> CoRec f (r ': rs) -> b
- Composite.CoRecord: foldField :: (RMap rs, RecApplicative (r : rs)) => Cases (r : rs) b -> Field (r : rs) -> b
+ Composite.CoRecord: foldField :: (RMap rs, RecApplicative (r ': rs)) => Cases (r ': rs) b -> Field (r ': rs) -> b
- Composite.CoRecord: foldRec1 :: FoldRec (r : rs) rs => (CoRec f (r : rs) -> CoRec f (r : rs) -> CoRec f (r : rs)) -> Rec f (r : rs) -> CoRec f (r : rs)
+ Composite.CoRecord: foldRec1 :: FoldRec (r ': rs) rs => (CoRec f (r ': rs) -> CoRec f (r ': rs) -> CoRec f (r ': rs)) -> Rec f (r ': rs) -> CoRec f (r ': rs)
- Composite.CoRecord: matchCoRec :: RecApplicative (r : rs) => CoRec f (r : rs) -> Cases' f (r : rs) b -> b
+ Composite.CoRecord: matchCoRec :: RecApplicative (r ': rs) => CoRec f (r ': rs) -> Cases' f (r ': rs) b -> b
- Composite.CoRecord: matchField :: (RMap rs, RecApplicative (r : rs)) => Field (r : rs) -> Cases (r : rs) b -> b
+ Composite.CoRecord: matchField :: (RMap rs, RecApplicative (r ': rs)) => Field (r ': rs) -> Cases (r ': rs) b -> b
- Composite.Record: [:&] :: forall {u} (a :: u -> Type) (r :: u) (rs :: [u]). !a r -> !Rec a rs -> Rec a (r : rs)
+ Composite.Record: [:&] :: forall {u} (a :: u -> Type) (r :: u) (rs :: [u]). !a r -> !Rec a rs -> Rec a (r ': rs)
- Composite.Record: data Rec (a :: u -> Type) (b :: [u])
+ Composite.Record: data () => Rec (a :: u -> Type) (b :: [u])
- Composite.Record: pattern (:*:) :: () => () => a -> Rec Identity rs -> Rec Identity ((s :-> a) : rs)
+ Composite.Record: pattern (:*:) :: () => () => a -> Rec Identity rs -> Rec Identity ((s :-> a) ': rs)
- Composite.Record: pattern (:!:) :: Contravariant f => () => f a -> Rec f rs -> Rec f ((s :-> a) : rs)
+ Composite.Record: pattern (:!:) :: Contravariant f => () => f a -> Rec f rs -> Rec f ((s :-> a) ': rs)
- Composite.Record: recordToNonEmpty :: RecordToList rs => Rec (Const a) (r : rs) -> NonEmpty a
+ Composite.Record: recordToNonEmpty :: RecordToList rs => Rec (Const a) (r ': rs) -> NonEmpty a

Files

composite-base.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           composite-base-version:        0.8.2.2+version:        0.8.3.0 synopsis:       Shared utilities for composite-* packages. description:    Shared helpers for the various composite packages. category:       Records@@ -55,11 +55,11 @@     , exceptions >=0.8.3 && <0.11     , lens >=4.15.4 && <5.3     , monad-control >=1.0.2.2 && <1.1-    , mtl >=2.2.1 && <2.3+    , mtl >=2.2.1 && <2.4     , profunctors >=5.2.1 && <5.7-    , template-haskell >=2.11.1.0 && <2.19-    , text >=1.2.2.2 && <1.3-    , transformers >=0.5.2.0 && <0.6+    , template-haskell >=2.11.1.0 && <2.22+    , text >=1.2.2.2 && <2.1+    , transformers >=0.5.2.0 && <0.7     , transformers-base >=0.4.4 && <0.5     , unliftio-core >=0.1.0.0 && <0.3.0.0     , vinyl >=0.5.3 && <0.15@@ -108,11 +108,11 @@     , hspec     , lens >=4.15.4 && <5.3     , monad-control >=1.0.2.2 && <1.1-    , mtl >=2.2.1 && <2.3+    , mtl >=2.2.1 && <2.4     , profunctors >=5.2.1 && <5.7-    , template-haskell >=2.11.1.0 && <2.19-    , text >=1.2.2.2 && <1.3-    , transformers >=0.5.2.0 && <0.6+    , template-haskell >=2.11.1.0 && <2.21+    , text >=1.2.2.2 && <2.1+    , transformers >=0.5.2.0 && <0.7     , transformers-base >=0.4.4 && <0.5     , unliftio-core >=0.1.0.0 && <0.3.0.0     , vinyl >=0.5.3 && <0.15
src/Composite/CoRecord.hs view
@@ -5,6 +5,7 @@  import Prelude import Composite.Record (AllHave, HasInstances, (:->)(getVal, Val), reifyDicts, reifyVal, val, zipRecsWith)+import Control.DeepSeq (NFData, rnf) import Control.Lens (Prism', Wrapped, Unwrapped, prism', review, view, _Wrapped') import Control.Monad.Except (ExceptT, throwError, withExceptT) import Data.Functor.Contravariant (Contravariant(contramap))@@ -40,6 +41,13 @@       f :: forall a. (Dict Eq :. Maybe) a -> Maybe a -> Const Bool a       f (Compose (Dict a)) b = Const $ a == b       toRec = reifyConstraint . fieldToRec++instance forall rs. (AllHave '[NFData] rs, RecApplicative rs) => NFData (CoRec Identity rs) where+  rnf (CoVal (Identity x)) = rnf' x+    where+      rnfer :: Rec (Op ()) rs+      rnfer = reifyDicts (Proxy @'[NFData]) (\ _ -> Op rnf)+      rnf' = runOp (rget rnfer)  -- |The common case of a 'CoRec' with @f ~ 'Identity'@, i.e. a regular value. type Field = CoRec Identity
src/Composite/Record.hs view
@@ -88,12 +88,6 @@ instance NFData a => NFData (s :-> a) where   rnf (Val x) = rnf x -instance NFData (Record '[]) where-  rnf RNil = ()--instance (NFData x, NFData (Record xs)) => NFData (Record (x : xs)) where-  rnf (x :& xs) = rnf x `seq` rnf xs- instance forall (s :: Symbol) a. (KnownSymbol s, Show a) => Show (s :-> a) where   showsPrec p (Val a) = ((symbolVal (Proxy :: Proxy s) ++ " :-> ") ++) . showsPrec p a 
src/Composite/TH.hs view
@@ -22,6 +22,9 @@ #if MIN_VERSION_template_haskell(2,17,0)   , Specificity(SpecifiedSpec) #endif+#if MIN_VERSION_template_haskell(2,21,0)+  , BndrVis+#endif   ) import Language.Haskell.TH.Lens (_TySynD) @@ -146,11 +149,19 @@ withOpticsAndProxies = withBoilerplate True True  #if MIN_VERSION_template_haskell(2,17,0)+#if MIN_VERSION_template_haskell(2,21,0)+tyUnitToSpec :: Specificity -> TyVarBndr BndrVis -> TyVarBndr Specificity+#else tyUnitToSpec :: Specificity -> TyVarBndr () -> TyVarBndr Specificity-tyUnitToSpec x (PlainTV n ()) = PlainTV n x-tyUnitToSpec x (KindedTV n () k) = KindedTV n x k+#endif+tyUnitToSpec x (PlainTV n _) = PlainTV n x+tyUnitToSpec x (KindedTV n _ k) = KindedTV n x k +#if MIN_VERSION_template_haskell(2,21,0)+fieldDecUnitToSpec :: Specificity -> FieldDec BndrVis -> FieldDec Specificity+#else fieldDecUnitToSpec :: Specificity -> FieldDec () -> FieldDec Specificity+#endif fieldDecUnitToSpec x (FieldDec n b t v) = FieldDec n (map (tyUnitToSpec x) b) t v  data FieldDec a = FieldDec@@ -186,7 +197,9 @@ #endif   pure $ decs <> concat proxyDecs <> concat lensDecs <> concat prismDecs -#if MIN_VERSION_template_haskell(2,17,0)+#if MIN_VERSION_template_haskell(2,21,0)+fieldDecMay :: (Name, [TyVarBndr BndrVis], Type) -> Maybe (FieldDec BndrVis)+#elif MIN_VERSION_template_haskell(2,17,0) fieldDecMay :: (Name, [TyVarBndr ()], Type) -> Maybe (FieldDec ()) #else fieldDecMay :: (Name, [TyVarBndr], Type) -> Maybe FieldDec@@ -210,7 +223,9 @@ prismNameFor = mkName . ("_" ++) . nameBase proxyNameFor = mkName . (++ "_") . over _head toLower . nameBase -#if MIN_VERSION_template_haskell(2,17,0)+#if MIN_VERSION_template_haskell(2,21,0)+proxyDecFor :: FieldDec BndrVis -> Q [Dec]+#elif MIN_VERSION_template_haskell(2,17,0) proxyDecFor :: FieldDec () -> Q [Dec] #else proxyDecFor :: FieldDec -> Q [Dec]
test/RecordSpec.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >= 902+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}+#endif+ module RecordSpec where  import Composite.Record