packages feed

lens 3.7.0.1 → 3.7.0.2

raw patch · 16 files changed

+68/−12 lines, 16 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,9 @@+3.7.0.2+-------+* Fixed flagging for Safe Haskell.+* Fixed examples.+* Cleaned up the statement of the Prism laws.+ 3.7.0.1 ------- * Corrected bounds for hashable.@@ -22,7 +28,7 @@ * Removed `Data.Monoid.Lens` now that its newtypes are instances of `Wrapped`, exporting the (`<>=`)-variants from `Control.Lens.*`. * Renamed `via` to `cloneIso` for consistency. * Moved `Indexed(..)` to `Control.Lens.Classes`.-* Renamed `index` to `indexing` to reduce conflicts with third-party libraries.+* Renamed `index` to `indexed` to reduce conflicts with third-party libraries. * Added `curried` and `uncurried` to `Control.Lens.Iso`. * Added `Strict(strict)` for ad hoc overloading of conversions between strict and lazy variants of `ByteString` and `Text`. * Bug fixes for `tugTo` and `jerkTo`.
examples/Brainfuck.hs view
@@ -113,8 +113,8 @@  -- | Zipper helpers wrapRight, wrapLeft :: (a :> b) -> (a :> b)-wrapRight = liftM2 fromMaybe leftmost  right-wrapLeft  = liftM2 fromMaybe rightmost left+wrapRight = liftM2 fromMaybe leftmost rightward+wrapLeft  = liftM2 fromMaybe rightmost leftward  -- Main program action to actually run this stuff 
examples/lens-examples.cabal view
@@ -32,7 +32,7 @@    build-depends:     base,-    containers >= 0.4.2 && < 0.6,+    containers >= 0.4 && < 0.6,     gloss      == 1.7.*,     lens,     mtl        >= 2.0.1 && < 2.2,@@ -40,12 +40,12 @@   main-is: Pong.hs  executable brainfuck-  if !flag(pong)+  if !flag(brainfuck)     buildable: False    build-depends:     base,-    lens       == 3.2.*,+    lens,     free       >= 3.0 && < 3.3,     bytestring,     mtl        >= 2.0.1 && < 2.2,
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses-version:       3.7.0.1+version:       3.7.0.2 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Control/Exception/Lens.hs view
@@ -1,6 +1,11 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Exception.Lens
src/Control/Lens/Fold.hs view
@@ -1,9 +1,13 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LiberalTypeSynonyms #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif ---------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Fold
src/Control/Lens/IndexedSetter.hs view
@@ -1,9 +1,13 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.IndexedSetter
src/Control/Lens/Internal.hs view
@@ -488,7 +488,7 @@ type instance CoB (a -> f_b) = ArgOf f_b  -- | This data type is used to capture all of the information provided by the--- 'Prismatic' -- class, so you can turn a 'Prism' around into a 'Getter' or+-- 'Prismatic' class, so you can turn a 'Prism' around into a 'Getter' or -- otherwise muck around with its internals. -- -- If you see a function that expects a 'Prismoid' or 'APrism', it is probably
src/Control/Lens/Internal/Zipper.hs view
@@ -6,6 +6,10 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Zipper
src/Control/Lens/Loupe.hs view
@@ -1,4 +1,7 @@ {-# LANGUAGE CPP #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif  #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1
src/Control/Lens/Prism.hs view
@@ -69,11 +69,20 @@ ------------------------------------------------------------------------------  -- | A 'Prism' @l@ is a 0-or-1 target 'Traversal' that can also be turned around with 'remit' to--- obtain a 'Getter' in the opposite direction, such that in addition to the 'Traversal' laws, we also--- have+-- obtain a 'Getter' in the opposite direction. ----- @x '^.' 'remit' l '^?' l ≡ 'Just' x@+-- There are two laws that a 'Prism' should satisfy: --+-- First, if I 'remit' or 'review' a value with a 'Prism' and then 'preview' or use ('^?'), I will get it back:+--+-- * @'preview' l ('review' l b) ≡ 'Just' b@+--+-- Second, if you can extract a value @a@ using a Prism @l@ from a value @s@, then the value @s@ is completely described my @l@ and @a@:+--+-- * If @'preview' l s ≡ 'Just' a@ then @'review' l a ≡ s@+--+-- These two laws imply that the 'Traversal' laws hold for every 'Prism' and that we 'traverse' at most 1 element:+-- -- @'Control.Lens.Fold.lengthOf' l x '<=' 1@ -- -- It may help to think of this as a 'Control.Lens.Iso.Iso' that can be partial in one direction.@@ -129,7 +138,7 @@ -- Just 5 -- -- Another interesting way to think of a 'Prism' is as the categorical dual of a 'Lens'--- a /co/-'Lens', so to speak. This is what permits the construction of 'outside'.+-- -- a /co/-'Lens', so to speak. This is what permits the construction of 'outside'. type Prism s t a b = forall k f. (Prismatic k, Applicative f) => k (a -> f b) (s -> f t)  -- | If you see this in a signature for a function, the function is expecting a 'Prism',
src/Control/Lens/Representable.hs view
@@ -1,6 +1,10 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Representable
src/Control/Lens/Traversal.hs view
@@ -5,6 +5,10 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LiberalTypeSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+ #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1 #endif
src/Control/Lens/Tuple.hs view
@@ -4,6 +4,10 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Tuple
src/Control/Lens/Type.hs view
@@ -5,6 +5,10 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeOperators #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+  #ifndef MIN_VERSION_mtl #define MIN_VERSION_mtl(x,y,z) 1
src/Control/Lens/Wrapped.hs view
@@ -1,9 +1,14 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}+#ifdef TRUSTWORTHY+{-# LANGUAGE Trustworthy #-}+#endif+ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Wrapped