packages feed

lens 3.0.5 → 3.0.6

raw patch · 14 files changed

+50/−20 lines, 14 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+3.0.6+-----+* Restored lenses to `Trustworthy` status so they can be used with Safe Haskell once more.+ 3.0.5 ----- * Fixed a bug in `rights1` and `lefts1` in `Control.Lens.Zipper` which would cause them to loop forever when given a 0 offset.
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses-version:       3.0.5+version:       3.0.6 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Control/Lens/Fold.hs view
@@ -203,13 +203,12 @@ -- [4,5,6] -- -- >>> toListOf (droppingWhile (<=3) folded) [1,6,1]-+-- [6,1] droppingWhile :: (Gettable f, Applicative f)               => (c -> Bool)-              -> Getting (Endo (f a)) a a c c+              -> Getting (Endo (f a, f a)) a a c c               -> LensLike f a a c c-droppingWhile p l f = foldrOf l (\a r -> if p a then r else f a *> r) noEffect--- droppingWhile p l f = fst . foldrOf l (\a r -> let s = f a *> snd r in if p a then (snd r, s) else (s, s)) (noEffect, noEffect)+droppingWhile p l f = fst . foldrOf l (\a r -> let s = f a *> snd r in if p a then (fst r, s) else (s, s)) (noEffect, noEffect) {-# INLINE droppingWhile #-}  --------------------------
src/Control/Lens/Getter.hs view
@@ -1,8 +1,12 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE UndecidableInstances #-}+-- {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Getter
src/Control/Lens/IndexedFold.hs view
@@ -426,9 +426,9 @@ -- | Obtain an 'IndexedFold' by dropping elements from another 'IndexedFold', 'Control.Lens.IndexedLens.IndexedLens', 'IndexedGetter' or 'Control.Lens.IndexedTraversal.IndexedTraversal' while a predicate holds. idroppingWhile :: (Gettable f, Applicative f, Indexed i k)               => (i -> c -> Bool)-              -> IndexedGetting i (Endo (f a)) a a c c+              -> IndexedGetting i (Endo (f a, f a)) a a c c               -> k (c -> f c) (a -> f a)-idroppingWhile p l = index $ \f -> ifoldrOf l (\i a r -> if p i a then r else f i a *> r) noEffect+idroppingWhile p l = index $ \f -> fst . ifoldrOf l (\i a r -> let s = f i a *> snd r in if p i a then (fst r, s) else (s, s)) (noEffect, noEffect) {-# INLINE idroppingWhile #-}  ------------------------------------------------------------------------------
src/Control/Lens/IndexedLens.hs view
@@ -5,6 +5,9 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif  #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1
src/Control/Lens/IndexedTraversal.hs view
@@ -6,6 +6,10 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif+ #ifndef MIN_VERSION_containers #define MIN_VERSION_containers(x,y,z) 1 #endif
src/Control/Lens/Internal.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-}@@ -5,6 +6,10 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal
src/Control/Lens/Setter.hs view
@@ -632,12 +632,12 @@ -- | Raise the target(s) of a numerically valued 'Control.Lens.Type.Lens', 'Setter' or 'Control.Lens.Traversal.Traversal' to a non-negative integral power. -- -- @--- ('^=') ::  ('MonadState' a m, 'Fractional' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Setter' a b -> c -> m ()--- ('^=') ::  ('MonadState' a m, 'Fractional' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a b -> c -> m ()--- ('^=') ::  ('MonadState' a m, 'Fractional' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a b -> c -> m ()--- ('^=') ::  ('MonadState' a m, 'Fractional' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a b -> c -> m ()+-- ('^=') ::  ('MonadState' a m, 'Num' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Setter' a b -> c -> m ()+-- ('^=') ::  ('MonadState' a m, 'Num' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a b -> c -> m ()+-- ('^=') ::  ('MonadState' a m, 'Num' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a b -> c -> m ()+-- ('^=') ::  ('MonadState' a m, 'Num' b, 'Integral' c) => 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a b -> c -> m () -- @-(^=) :: (MonadState a m, Fractional b, Integral c) => SimpleSetting a b -> c -> m ()+(^=) :: (MonadState a m, Num b, Integral c) => SimpleSetting a b -> c -> m () l ^= c = State.modify (l ^~ c) {-# INLINE (^=) #-} 
src/Control/Lens/Traversal.hs view
@@ -401,7 +401,7 @@  -- | A 'Traversal' is completely characterized by its behavior on a 'Bazaar'. ----- Cloning a 'Traversal' is one way to make sure you arent given+-- Cloning a 'Traversal' is one way to make sure you aren't given -- something weaker, such as a 'Control.Lens.Traversal.Fold' and can be -- used as a way to pass around traversals that have to be monomorphic in @f@. --
src/Control/Lens/Type.hs view
@@ -338,7 +338,7 @@ -------------------------------------------------------------------------------  -- |--- Cloning a 'Lens' is one way to make sure you arent given+-- Cloning a 'Lens' is one way to make sure you aren't given -- something weaker, such as a 'Control.Lens.Traversal.Traversal' and can be -- used as a way to pass around lenses that have to be monomorphic in @f@. --
src/Control/Lens/WithIndex.hs view
@@ -3,6 +3,9 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 704+{-# LANGUAGE Trustworthy #-}+#endif #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 706 {-# LANGUAGE DefaultSignatures #-} #define MPTC_DEFAULTS
src/Control/Lens/Zipper.hs view
@@ -1,12 +1,16 @@-{-# LANGUAGE EmptyDataDecls #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-}-{-# LANGUAGE KindSignatures #-}-{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Zipper
src/Control/Lens/Zoom.hs view
@@ -5,6 +5,10 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+{-# LANGUAGE Trustworthy #-}+#endif+  ------------------------------------------------------------------------------- -- |