ConstraintKinds 0.0.1.1 → 0.0.1.2
raw patch · 3 files changed
+4/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ConstraintKinds.cabal +1/−1
- src/Control/ConstraintKinds/Functor.hs +2/−1
- src/Control/ConstraintKinds/Traversable.hs +1/−0
ConstraintKinds.cabal view
@@ -1,5 +1,5 @@ Name: ConstraintKinds-Version: 0.0.1.1+Version: 0.0.1.2 Synopsis: Repackages standard type classes with the ConstraintKinds extension Description: This module provides more flexible versions of common type classes that use the ConstraintKinds extension. This allows us to make types that require constraints instances of the popular classes. For example, we reimplement Functor and Foldable using the ContraintKinds style. This allows us to manipulate lists and unboxed vectors using the same functions. .
src/Control/ConstraintKinds/Functor.hs view
@@ -20,7 +20,7 @@ class Functor f where type FunctorConstraint f x :: Constraint type FunctorConstraint f x = ()-+ fmap :: (FunctorConstraint f a, FunctorConstraint f b) => (a -> b) -> f a -> f b -- | An infix synonym for 'fmap'.@@ -31,6 +31,7 @@ -- Instances instance Functor [] where+ type FunctorConstraint [] x = () {-# INLINE fmap #-} fmap = P.map
src/Control/ConstraintKinds/Traversable.hs view
@@ -48,6 +48,7 @@ -- instances instance Traversable [] where+ type TraversableConstraint [] x = () {-# INLINE traverse #-} -- so that traverse can fuse traverse f = Prelude.foldr cons_f (pure []) where cons_f x ys = (:) <$> f x <*> ys