packages feed

lens 4.0 → 4.0.1

raw patch · 9 files changed

+118/−75 lines, 9 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,9 @@+4.0.1+-----+* Typo fixes+* Exporting `Rewrapping` from `Control.Lens.Wrapped`.+* Removed the dependency on `cpphs`.+ 4.0 ---- * Added `nearly` to `Control.Lens.Prism`.@@ -6,7 +12,7 @@ * Added `failing` and `ifailing` to `Control.Lens.Traversal`. * Changed the signature of `Data.List.Split.Lens.condensing` due to the addition of `DropBlankFields` to `Data.List.Split.CondensePolicy` in `split`. * Simplified `Each`, `Ixed`, and `Contains`. They are no longer indexed. The previous design was actively getting in the way of user-defined instances.-* Replaced more of our home-grown types with standard ones. They had previously been defined to help make more intelligible error messages, but when we switched to using `(Contravariant f, Functor f)` instead of `(Gettable f)`, these no ceased to really help. Now you can define even more `lens`-compatible types (e.g. `Getter` and `Fold`) without depending on `lens`.+* Replaced more of our home-grown types with standard ones. They had previously been defined to help make more intelligible error messages, but when we switched to using `(Contravariant f, Functor f)` instead of `(Gettable f)`, these ceased to really help. Now you can define even more `lens`-compatible types (e.g. `Getter` and `Fold`) without depending on `lens`.   * Replaced the use of `Accessor` with `Const`.   * Replaced the use of `Mutator` with `Identity`.   * Replaced the use of `Reviewed` with `Tagged`.
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses, Generics-version:       4.0+version:       4.0.1 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Control/Lens/Fold.hs view
@@ -66,6 +66,7 @@   , cycled   , takingWhile   , droppingWhile+  , worded, lined    -- ** Folding   , foldMapOf, foldOf@@ -153,6 +154,7 @@ import Data.Functor.Apply import Data.Functor.Compose import Data.Int (Int64)+import Data.List (intercalate) import Data.Maybe import Data.Monoid import Data.Profunctor@@ -401,6 +403,44 @@       b' = b && p a     in (if b' then pure a else corep f wa, b') {-# INLINE droppingWhile #-}++-- | A 'Fold' over the individual 'words' of a 'String'.+--+-- @+-- 'worded' :: 'Fold' 'String' 'String'+-- 'worded' :: 'Traversal'' 'String' 'String'+-- @+--+-- @+-- 'worded' :: 'IndexedFold' 'Int' 'String' 'String'+-- 'worded' :: 'IndexedTraversal'' 'Int' 'String' 'String'+-- @+--+-- Note: This function type-checks as a 'Traversal' but it doesn't satisfy the laws. It's only valid to use it+-- when you don't insert any whitespace characters while traversing, and if your original 'String' contains only+-- isolated space characters (and no other characters that count as space, such as non-breaking spaces).+worded :: Applicative f => IndexedLensLike' Int f String String+worded f = fmap unwords . conjoined traverse (indexing traverse) f . words+{-# INLINE worded #-}++-- | A 'Fold' over the individual 'lines' of a 'String'.+--+-- @+-- 'lined' :: 'Fold' 'String' 'String'+-- 'lined' :: 'Traversal'' 'String' 'String'+-- @+--+-- @+-- 'lined' :: 'IndexedFold' 'Int' 'String' 'String'+-- 'lined' :: 'IndexedTraversal'' 'Int' 'String' 'String'+-- @+--+-- Note: This function type-checks as a 'Traversal' but it doesn't satisfy the laws. It's only valid to use it+-- when you don't insert any newline characters while traversing, and if your original 'String' contains only+-- isolated newline characters.+lined :: Applicative f => IndexedLensLike' Int f String String+lined f = fmap (intercalate "\n") . conjoined traverse (indexing traverse) f . lines+{-# INLINE lined #-}  -------------------------- -- Fold/Getter combinators
src/Control/Lens/Internal/Reflection.hs view
@@ -10,7 +10,6 @@ {-# OPTIONS_GHC -fno-full-laziness #-} {-# OPTIONS_GHC -fno-float-in #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-}-{-# OPTIONS_GHC -pgmPcpphs -optP--cpp -optP-ansi #-} ---------------------------------------------------------------------------- -- | -- Module     : Control.Lens.Internal.Reflection@@ -70,40 +69,38 @@ class Typeable s => B s where   reflectByte :: proxy s -> IntPtr -#define CAT(a, b) a##b- #define BYTES(GO) \-  GO(0) GO(1) GO(2) GO(3) GO(4) GO(5) GO(6) GO(7) GO(8) GO(9) GO(10) GO(11) \-  GO(12) GO(13) GO(14) GO(15) GO(16) GO(17) GO(18) GO(19) GO(20) GO(21) GO(22) \-  GO(23) GO(24) GO(25) GO(26) GO(27) GO(28) GO(29) GO(30) GO(31) GO(32) GO(33) \-  GO(34) GO(35) GO(36) GO(37) GO(38) GO(39) GO(40) GO(41) GO(42) GO(43) GO(44) \-  GO(45) GO(46) GO(47) GO(48) GO(49) GO(50) GO(51) GO(52) GO(53) GO(54) GO(55) \-  GO(56) GO(57) GO(58) GO(59) GO(60) GO(61) GO(62) GO(63) GO(64) GO(65) GO(66) \-  GO(67) GO(68) GO(69) GO(70) GO(71) GO(72) GO(73) GO(74) GO(75) GO(76) GO(77) \-  GO(78) GO(79) GO(80) GO(81) GO(82) GO(83) GO(84) GO(85) GO(86) GO(87) GO(88) \-  GO(89) GO(90) GO(91) GO(92) GO(93) GO(94) GO(95) GO(96) GO(97) GO(98) GO(99) \-  GO(100) GO(101) GO(102) GO(103) GO(104) GO(105) GO(106) GO(107) GO(108) \-  GO(109) GO(110) GO(111) GO(112) GO(113) GO(114) GO(115) GO(116) GO(117) \-  GO(118) GO(119) GO(120) GO(121) GO(122) GO(123) GO(124) GO(125) GO(126) \-  GO(127) GO(128) GO(129) GO(130) GO(131) GO(132) GO(133) GO(134) GO(135) \-  GO(136) GO(137) GO(138) GO(139) GO(140) GO(141) GO(142) GO(143) GO(144) \-  GO(145) GO(146) GO(147) GO(148) GO(149) GO(150) GO(151) GO(152) GO(153) \-  GO(154) GO(155) GO(156) GO(157) GO(158) GO(159) GO(160) GO(161) GO(162) \-  GO(163) GO(164) GO(165) GO(166) GO(167) GO(168) GO(169) GO(170) GO(171) \-  GO(172) GO(173) GO(174) GO(175) GO(176) GO(177) GO(178) GO(179) GO(180) \-  GO(181) GO(182) GO(183) GO(184) GO(185) GO(186) GO(187) GO(188) GO(189) \-  GO(190) GO(191) GO(192) GO(193) GO(194) GO(195) GO(196) GO(197) GO(198) \-  GO(199) GO(200) GO(201) GO(202) GO(203) GO(204) GO(205) GO(206) GO(207) \-  GO(208) GO(209) GO(210) GO(211) GO(212) GO(213) GO(214) GO(215) GO(216) \-  GO(217) GO(218) GO(219) GO(220) GO(221) GO(222) GO(223) GO(224) GO(225) \-  GO(226) GO(227) GO(228) GO(229) GO(230) GO(231) GO(232) GO(233) GO(234) \-  GO(235) GO(236) GO(237) GO(238) GO(239) GO(240) GO(241) GO(242) GO(243) \-  GO(244) GO(245) GO(246) GO(247) GO(248) GO(249) GO(250) GO(251) GO(252) \-  GO(253) GO(254) GO(255)+  GO(T0,0) GO(T1,1) GO(T2,2) GO(T3,3) GO(T4,4) GO(T5,5) GO(T6,6) GO(T7,7) GO(T8,8) GO(T9,9) GO(T10,10) GO(T11,11) \+  GO(T12,12) GO(T13,13) GO(T14,14) GO(T15,15) GO(T16,16) GO(T17,17) GO(T18,18) GO(T19,19) GO(T20,20) GO(T21,21) GO(T22,22) \+  GO(T23,23) GO(T24,24) GO(T25,25) GO(T26,26) GO(T27,27) GO(T28,28) GO(T29,29) GO(T30,30) GO(T31,31) GO(T32,32) GO(T33,33) \+  GO(T34,34) GO(T35,35) GO(T36,36) GO(T37,37) GO(T38,38) GO(T39,39) GO(T40,40) GO(T41,41) GO(T42,42) GO(T43,43) GO(T44,44) \+  GO(T45,45) GO(T46,46) GO(T47,47) GO(T48,48) GO(T49,49) GO(T50,50) GO(T51,51) GO(T52,52) GO(T53,53) GO(T54,54) GO(T55,55) \+  GO(T56,56) GO(T57,57) GO(T58,58) GO(T59,59) GO(T60,60) GO(T61,61) GO(T62,62) GO(T63,63) GO(T64,64) GO(T65,65) GO(T66,66) \+  GO(T67,67) GO(T68,68) GO(T69,69) GO(T70,70) GO(T71,71) GO(T72,72) GO(T73,73) GO(T74,74) GO(T75,75) GO(T76,76) GO(T77,77) \+  GO(T78,78) GO(T79,79) GO(T80,80) GO(T81,81) GO(T82,82) GO(T83,83) GO(T84,84) GO(T85,85) GO(T86,86) GO(T87,87) GO(T88,88) \+  GO(T89,89) GO(T90,90) GO(T91,91) GO(T92,92) GO(T93,93) GO(T94,94) GO(T95,95) GO(T96,96) GO(T97,97) GO(T98,98) GO(T99,99) \+  GO(T100,100) GO(T101,101) GO(T102,102) GO(T103,103) GO(T104,104) GO(T105,105) GO(T106,106) GO(T107,107) GO(T108,108) \+  GO(T109,109) GO(T110,110) GO(T111,111) GO(T112,112) GO(T113,113) GO(T114,114) GO(T115,115) GO(T116,116) GO(T117,117) \+  GO(T118,118) GO(T119,119) GO(T120,120) GO(T121,121) GO(T122,122) GO(T123,123) GO(T124,124) GO(T125,125) GO(T126,126) \+  GO(T127,127) GO(T128,128) GO(T129,129) GO(T130,130) GO(T131,131) GO(T132,132) GO(T133,133) GO(T134,134) GO(T135,135) \+  GO(T136,136) GO(T137,137) GO(T138,138) GO(T139,139) GO(T140,140) GO(T141,141) GO(T142,142) GO(T143,143) GO(T144,144) \+  GO(T145,145) GO(T146,146) GO(T147,147) GO(T148,148) GO(T149,149) GO(T150,150) GO(T151,151) GO(T152,152) GO(T153,153) \+  GO(T154,154) GO(T155,155) GO(T156,156) GO(T157,157) GO(T158,158) GO(T159,159) GO(T160,160) GO(T161,161) GO(T162,162) \+  GO(T163,163) GO(T164,164) GO(T165,165) GO(T166,166) GO(T167,167) GO(T168,168) GO(T169,169) GO(T170,170) GO(T171,171) \+  GO(T172,172) GO(T173,173) GO(T174,174) GO(T175,175) GO(T176,176) GO(T177,177) GO(T178,178) GO(T179,179) GO(T180,180) \+  GO(T181,181) GO(T182,182) GO(T183,183) GO(T184,184) GO(T185,185) GO(T186,186) GO(T187,187) GO(T188,188) GO(T189,189) \+  GO(T190,190) GO(T191,191) GO(T192,192) GO(T193,193) GO(T194,194) GO(T195,195) GO(T196,196) GO(T197,197) GO(T198,198) \+  GO(T199,199) GO(T200,200) GO(T201,201) GO(T202,202) GO(T203,203) GO(T204,204) GO(T205,205) GO(T206,206) GO(T207,207) \+  GO(T208,208) GO(T209,209) GO(T210,210) GO(T211,211) GO(T212,212) GO(T213,213) GO(T214,214) GO(T215,215) GO(T216,216) \+  GO(T217,217) GO(T218,218) GO(T219,219) GO(T220,220) GO(T221,221) GO(T222,222) GO(T223,223) GO(T224,224) GO(T225,225) \+  GO(T226,226) GO(T227,227) GO(T228,228) GO(T229,229) GO(T230,230) GO(T231,231) GO(T232,232) GO(T233,233) GO(T234,234) \+  GO(T235,235) GO(T236,236) GO(T237,237) GO(T238,238) GO(T239,239) GO(T240,240) GO(T241,241) GO(T242,242) GO(T243,243) \+  GO(T244,244) GO(T245,245) GO(T246,246) GO(T247,247) GO(T248,248) GO(T249,249) GO(T250,250) GO(T251,251) GO(T252,252) \+  GO(T253,253) GO(T254,254) GO(T255,255) -#define GO(n) \-  newtype CAT(T,n) = CAT(T,n) CAT(T,n) deriving Typeable; \-  instance B CAT(T,n) where { \+#define GO(Tn,n) \+  newtype Tn = Tn Tn deriving Typeable; \+  instance B Tn where { \     reflectByte _ = n \   }; BYTES(GO)@@ -114,7 +111,7 @@  reifyByte :: Word8 -> (forall s. B s => Proxy s -> r) -> r reifyByte w k = case w of {-#define GO(n) n -> k (Proxy :: Proxy CAT(T,n));+#define GO(Tn,n) n -> k (Proxy :: Proxy Tn); BYTES(GO) #undef GO _ -> impossible
src/Control/Lens/Internal/Zoom.hs view
@@ -74,7 +74,7 @@ -- Focusing ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.State.StateT'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.State.StateT'. newtype Focusing m s a = Focusing { unfocusing :: m (s, a) }  instance Monad m => Functor (Focusing m s) where@@ -103,7 +103,7 @@ -- FocusingWith ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.RWS.RWST'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.RWS.RWST'. newtype FocusingWith w m s a = FocusingWith { unfocusingWith :: m (s, a, w) }  instance Monad m => Functor (FocusingWith w m s) where@@ -132,7 +132,7 @@ -- FocusingPlus ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.Writer.WriterT'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.Writer.WriterT'. newtype FocusingPlus w k s a = FocusingPlus { unfocusingPlus :: k (s, w) a }  instance Functor (k (s, w)) => Functor (FocusingPlus w k s) where@@ -153,7 +153,7 @@ -- FocusingOn ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.Trans.Maybe.MaybeT' or 'Control.Monad.Trans.List.ListT'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.Trans.Maybe.MaybeT' or 'Control.Monad.Trans.List.ListT'. newtype FocusingOn f k s a = FocusingOn { unfocusingOn :: k (f s) a }  instance Functor (k (f s)) => Functor (FocusingOn f k s) where@@ -195,7 +195,7 @@ -- FocusingMay ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.Error.ErrorT'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.Error.ErrorT'. newtype FocusingMay k s a = FocusingMay { unfocusingMay :: k (May s) a }  instance Functor (k (May s)) => Functor (FocusingMay k s) where@@ -237,7 +237,7 @@ -- FocusingErr ------------------------------------------------------------------------------ --- | Used by 'Control.Lens.Lens.Zoom' to 'Control.Lens.Lens.zoom' into 'Control.Monad.Error.ErrorT'.+-- | Used by 'Control.Lens.Zoom.Zoom' to 'Control.Lens.Zoom.zoom' into 'Control.Monad.Error.ErrorT'. newtype FocusingErr e k s a = FocusingErr { unfocusingErr :: k (Err e s) a }  instance Functor (k (Err e s)) => Functor (FocusingErr e k s) where
src/Control/Lens/Iso.hs view
@@ -229,7 +229,7 @@ -- @'Maybe' a'@ to @a@. -- -- @--- 'non' ≡ 'anon' '.' 'only'+-- 'non' ≡ 'non'' '.' 'only' -- @ -- -- Keep in mind this is only a real isomorphism if you treat the domain as being @'Maybe' (a sans v)@.@@ -264,7 +264,7 @@ non = non' . only {-# INLINE non #-} --- | @'non_' p@ generalizes @'non' (p # ())@ to take any unit 'Prism'+-- | @'non'' p@ generalizes @'non' (p # ())@ to take any unit 'Prism' -- -- This function generates an isomorphism between @'Maybe' (a | 'isn't' p a)@ and @a@. --
src/Control/Lens/Tuple.hs view
@@ -82,8 +82,8 @@ #ifndef HLINT   default _1 :: (Generic s, Generic t, GIxed N0 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _1 #-}   _1 = ix proxyN0+  {-# INLINE _1 #-} #endif  instance Field1 (Identity a) (Identity b) a b where@@ -147,8 +147,8 @@ #ifndef HLINT   default _2 :: (Generic s, Generic t, GIxed N1 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _2 #-}   _2 = ix proxyN1+  {-# INLINE _2 #-} #endif  -- | @@@ -193,8 +193,8 @@ #ifndef HLINT   default _3 :: (Generic s, Generic t, GIxed N2 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _3 #-}   _3 = ix proxyN2+  {-# INLINE _3 #-} #endif  instance Field3 (a,b,c) (a,b,c') c c' where@@ -232,8 +232,8 @@ #ifndef HLINT   default _4 :: (Generic s, Generic t, GIxed N3 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _4 #-}   _4 = ix proxyN3+  {-# INLINE _4 #-} #endif  instance Field4 (a,b,c,d) (a,b,c,d') d d' where@@ -267,8 +267,8 @@ #ifndef HLINT   default _5 :: (Generic s, Generic t, GIxed N4 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _5 #-}   _5 = ix proxyN4+  {-# INLINE _5 #-} #endif  instance Field5 (a,b,c,d,e) (a,b,c,d,e') e e' where@@ -298,8 +298,8 @@ #ifndef HLINT   default _6 :: (Generic s, Generic t, GIxed N5 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _6 #-}   _6 = ix proxyN5+  {-# INLINE _6 #-} #endif  instance Field6 (a,b,c,d,e,f) (a,b,c,d,e,f') f f' where@@ -325,8 +325,8 @@ #ifndef HLINT   default _7 :: (Generic s, Generic t, GIxed N6 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _7 #-}   _7 = ix proxyN6+  {-# INLINE _7 #-} #endif  instance Field7 (a,b,c,d,e,f,g) (a,b,c,d,e,f,g') g g' where@@ -348,8 +348,8 @@ #ifndef HLINT   default _8 :: (Generic s, Generic t, GIxed N7 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _8 #-}   _8 = ix proxyN7+  {-# INLINE _8 #-} #endif  instance Field8 (a,b,c,d,e,f,g,h) (a,b,c,d,e,f,g,h') h h' where@@ -367,8 +367,8 @@ #ifndef HLINT   default _9 :: (Generic s, Generic t, GIxed N8 (Rep s) (Rep t) a b)              => Lens s t a b-  {-# INLINE _9 #-}   _9 = ix proxyN8+  {-# INLINE _9 #-} #endif  instance Field9 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f,g,h,i') i i' where@@ -376,8 +376,8 @@   {-# INLINE _9 #-}  ix :: (Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) => f n -> Lens s t a b-{-# INLINE ix #-} ix n f = fmap to . gix n f . from+{-# INLINE ix #-}  type family GSize (f :: * -> *) type instance GSize U1 = Z@@ -389,19 +389,19 @@   gix :: f n -> Lens (s x) (t x) a b  instance GIxed N0 (K1 i a) (K1 i b) a b where-  {-# INLINE gix #-}   gix _ = dimap unK1 (fmap K1)+  {-# INLINE gix #-}  instance GIxed n s t a b => GIxed n (M1 i c s) (M1 i c t) a b where-  {-# INLINE gix #-}   gix n = dimap unM1 (fmap M1) . gix n+  {-# INLINE gix #-}  instance (p ~ GT (GSize s) n,           p ~ GT (GSize t) n,           GIxed' p n s s' t t' a b)       => GIxed n (s :*: s') (t :*: t') a b where-  {-# INLINE gix #-}   gix = gix' (Proxy :: Proxy p)+  {-# INLINE gix #-}  #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706 -- $gixed-fundeps@@ -424,15 +424,15 @@           GT (GSize t) n ~ T,           GIxed n s t a b)       => GIxed' T n s s' t s' a b where+  gix' _ n f (s :*: s') = (:*: s') <$> gix n f s   {-# INLINE gix' #-}-  gix' _ n f (s :*: s') = fmap (:*: s') $ gix n f s  instance (GT (GSize s) n ~ F,           n' ~ Subtract (GSize s) n,           GIxed n' s' t' a b)       => GIxed' F n s s' s t' a b where+  gix' _ _  f (s :*: s') = (s :*:) <$> gix (Proxy :: Proxy n') f s'   {-# INLINE gix' #-}-  gix' _ _  f (s :*: s') = fmap (s :*:) $ gix (Proxy :: Proxy n') f s'  data Z data S a@@ -464,37 +464,37 @@ type N8 = S N7  proxyN0 :: Proxy N0-{-# INLINE proxyN0 #-} proxyN0 = Proxy+{-# INLINE proxyN0 #-}  proxyN1 :: Proxy N1-{-# INLINE proxyN1 #-} proxyN1 = Proxy+{-# INLINE proxyN1 #-}  proxyN2 :: Proxy N2-{-# INLINE proxyN2 #-} proxyN2 = Proxy+{-# INLINE proxyN2 #-}  proxyN3 :: Proxy N3-{-# INLINE proxyN3 #-} proxyN3 = Proxy+{-# INLINE proxyN3 #-}  proxyN4 :: Proxy N4-{-# INLINE proxyN4 #-} proxyN4 = Proxy+{-# INLINE proxyN4 #-}  proxyN5 :: Proxy N5-{-# INLINE proxyN5 #-} proxyN5 = Proxy+{-# INLINE proxyN5 #-}  proxyN6 :: Proxy N6-{-# INLINE proxyN6 #-} proxyN6 = Proxy+{-# INLINE proxyN6 #-}  proxyN7 :: Proxy N7-{-# INLINE proxyN7 #-} proxyN7 = Proxy+{-# INLINE proxyN7 #-}  proxyN8 :: Proxy N8-{-# INLINE proxyN8 #-} proxyN8 = Proxy+{-# INLINE proxyN8 #-}
src/Control/Lens/Wrapped.hs view
@@ -50,7 +50,7 @@   , _Unwrapped'   , _Wrapping', _Unwrapping'   -- * Wrapping and unwrapping polymorphically-  , Rewrapped+  , Rewrapped, Rewrapping   , _Wrapped, _Unwrapped   , _Wrapping, _Unwrapping   -- * Operations
src/Data/Text/Lazy/Lens.hs view
@@ -22,8 +22,8 @@   ) where  import Control.Lens-import Data.ByteString.Lazy (ByteString)-import Data.Text.Lazy+import Data.ByteString.Lazy as ByteString+import Data.Text.Lazy as Text import Data.Text.Lazy.Builder import Data.Text.Lazy.Encoding @@ -41,7 +41,7 @@ -- 'packed' ≡ 'from' 'unpacked' -- @ packed :: Iso' String Text-packed = iso pack unpack+packed = iso Text.pack Text.unpack {-# INLINE packed #-}  -- | This isomorphism can be used to 'unpack' (or 'pack') lazy 'Text'.@@ -60,7 +60,7 @@ -- 'unpacked' ≡ 'from' 'packed' -- @ unpacked :: Iso' Text String-unpacked = iso unpack pack+unpacked = iso Text.unpack Text.pack {-# INLINE unpacked #-}  -- | Convert between lazy 'Text' and 'Builder' .@@ -96,8 +96,8 @@ -- Note: This function does not decode lazily, as it must consume the entire -- input before deciding whether or not it fails. ----- >>> utf8 # "☃"--- "\226\152\131"+-- >>> ByteString.unpack (utf8 # "☃")+-- [226,152,131] utf8 :: Prism' ByteString Text utf8 = prism' encodeUtf8 (preview _Right . decodeUtf8') {-# INLINE utf8 #-}