Permalink
Browse files

Exiled (:->) and (:=>) (from issue #61) to `Control.Lens.Simple`, whi…

…ch is not exported by default.
  • Loading branch information...
1 parent 654ab5a commit f06d6b81ff3d72f662e559bd55672dafcb5c87b9 @ekmett committed Nov 6, 2012
Showing with 30 additions and 14 deletions.
  1. +1 −0 CHANGELOG.markdown
  2. +1 −0 lens.cabal
  3. +28 −0 src/Control/Lens/Simple.hs
  4. +0 −6 src/Control/Lens/Traversal.hs
  5. +0 −8 src/Control/Lens/Type.hs
View
@@ -7,6 +7,7 @@
* Added `Control.Lens.Loupe`, which provides a limited form of `Lens` that can be read from and written to and which can compose
with other lenses, but can also be returned in a list or as a monadic result, but cannot be used directly for most combinators
without cloning it first. It is easier to compose than a `ReifiedLens`, but slightly slower.
+* Moved (`:=>`) and (`:->`) into `Control.Lens.Simple`, which is not exported by `Control.Lens` by default to reduce name conflicts with third party libraries.
3.1
---
View
@@ -176,6 +176,7 @@ library
Control.Lens.Projection
Control.Lens.Representable
Control.Lens.Setter
+ Control.Lens.Simple
Control.Lens.Traversal
Control.Lens.Tuple
Control.Lens.Type
View
@@ -0,0 +1,28 @@
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE TypeOperators #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : Control.Lens.Simple
+-- Copyright : (C) 2012 Edward Kmett
+-- License : BSD-style (see the file LICENSE)
+-- Maintainer : Edward Kmett <ekmett@gmail.com>
+-- Stability : provisional
+-- Portability : Rank2Types
+--
+-- Infix type operators for simple lenses and traversals.
+----------------------------------------------------------------------------
+
+module Control.Lens.Simple
+ ( (:->)
+ , (:=>)
+ ) where
+
+import Control.Applicative
+
+infixr 0 :=>, :->
+
+-- | This is a commonly used infix alias for a @'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens'@.
+type s :-> a = forall f. Functor f => (a -> f a) -> s -> f s
+
+-- | This is a commonly-used infix alias for a @'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal'@.
+type s :=> a = forall f. Applicative f => (a -> f a) -> s -> f s
@@ -31,7 +31,6 @@ module Control.Lens.Traversal
(
-- * Lenses
Traversal
- , (:=>)
-- * Traversing and Lensing
, traverseOf, forOf, sequenceAOf
@@ -70,8 +69,6 @@ import Data.Traversable
-- $setup
-- >>> import Control.Lens
-infixr 0 :=>
-
------------------------------------------------------------------------------
-- Traversals
------------------------------------------------------------------------------
@@ -106,9 +103,6 @@ type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
-- | @type SimpleTraversal = 'Simple' 'Traversal'@
type SimpleTraversal s a = Traversal s s a a
--- | This is a commonly-used infix alias for a @'Simple' 'Traversal'@.
-type s :=> a = forall f. Applicative f => (a -> f a) -> s -> f s
-
--------------------------
-- Traversal Combinators
--------------------------
View
@@ -56,7 +56,6 @@ module Control.Lens.Type
-- * Lenses
Lens
, Simple
- , (:->)
, lens
, simple
@@ -103,10 +102,6 @@ import Control.Monad.State.Class as State
-- $setup
-- >>> import Control.Lens
--- types
-infixr 0 :->
-
--- terms
infixr 4 %%~
infix 4 %%=
infixr 4 <+~, <*~, <-~, <//~, <^~, <^^~, <**~, <&&~, <||~, <%~, <<%~, <<.~
@@ -170,9 +165,6 @@ type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t
-- 'Control.Lens.Setter.Setter', you may have to turn on @LiberalTypeSynonyms@.
type Simple f s a = f s s a a
--- | This is a commonly used infix alias for a @'Simple' 'Lens'@.
-type s :-> a = forall f. Functor f => (a -> f a) -> s -> f s
-
-- | @type 'SimpleLens' = 'Simple' 'Lens'@
type SimpleLens s a = Lens s s a a

0 comments on commit f06d6b8

Please sign in to comment.