Permalink
Browse files

haddocks: post-"Internalization" clean-up, round 6

  • Loading branch information...
1 parent a8d0793 commit 26fb229042705c3d39ce222165733a0afe9e97c7 @basdirks basdirks committed Jan 14, 2013
Showing with 31 additions and 31 deletions.
  1. +13 −13 src/Control/Lens/Lens.hs
  2. +9 −9 src/Control/Lens/Plated.hs
  3. +2 −2 src/Control/Lens/Prism.hs
  4. +5 −5 src/Control/Lens/Setter.hs
  5. +2 −2 src/Control/Lens/Type.hs
View
@@ -531,7 +531,7 @@ l <<.~ b = l $ \a -> (a, b)
-- Setting and Remembering State
-------------------------------------------------------------------------------
--- | Modify the target of a 'Lens' into your @'Monad'@'s state by a user supplied
+-- | Modify the target of a 'Lens' into your 'Monad'\'s state by a user supplied
-- function and return the result.
--
-- When applied to a 'Control.Lens.Traversal.Traversal', it this will return a monoidal summary of all of the intermediate
@@ -549,7 +549,7 @@ l <%= f = l %%= rmap (\b -> (b, b)) f
{-# INLINE (<%=) #-}
--- | Add to the target of a numerically valued 'Lens' into your @'Monad'@'s state
+-- | Add to the target of a numerically valued 'Lens' into your 'Monad'\'s state
-- and return the result.
--
-- When you do not need the result of the addition, ('Control.Lens.Setter.+=') is more
@@ -563,7 +563,7 @@ l <%= f = l %%= rmap (\b -> (b, b)) f
l <+= a = l <%= (+ a)
{-# INLINE (<+=) #-}
--- | Subtract from the target of a numerically valued 'Lens' into your @'Monad'@'s
+-- | Subtract from the target of a numerically valued 'Lens' into your 'Monad'\'s
-- state and return the result.
--
-- When you do not need the result of the subtraction, ('Control.Lens.Setter.-=') is more
@@ -577,7 +577,7 @@ l <+= a = l <%= (+ a)
l <-= a = l <%= subtract a
{-# INLINE (<-=) #-}
--- | Multiply the target of a numerically valued 'Lens' into your @'Monad'@'s
+-- | Multiply the target of a numerically valued 'Lens' into your 'Monad'\'s
-- state and return the result.
--
-- When you do not need the result of the multiplication, ('Control.Lens.Setter.*=') is more
@@ -591,7 +591,7 @@ l <-= a = l <%= subtract a
l <*= a = l <%= (* a)
{-# INLINE (<*=) #-}
--- | Divide the target of a fractionally valued 'Lens' into your @'Monad'@'s state
+-- | Divide the target of a fractionally valued 'Lens' into your 'Monad'\'s state
-- and return the result.
--
-- When you do not need the result of the division, ('Control.Lens.Setter.//=') is more flexible.
@@ -604,7 +604,7 @@ l <*= a = l <%= (* a)
l <//= a = l <%= (/ a)
{-# INLINE (<//=) #-}
--- | Raise the target of a numerically valued 'Lens' into your @'Monad'@'s state
+-- | Raise the target of a numerically valued 'Lens' into your 'Monad'\'s state
-- to a non-negative 'Integral' power and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.**=') is more flexible.
@@ -617,7 +617,7 @@ l <//= a = l <%= (/ a)
l <^= e = l <%= (^ e)
{-# INLINE (<^=) #-}
--- | Raise the target of a fractionally valued 'Lens' into your @'Monad'@'s state
+-- | Raise the target of a fractionally valued 'Lens' into your 'Monad'\'s state
-- to an 'Integral' power and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.^^=') is more flexible.
@@ -630,7 +630,7 @@ l <^= e = l <%= (^ e)
l <^^= e = l <%= (^^ e)
{-# INLINE (<^^=) #-}
--- | Raise the target of a floating-point valued 'Lens' into your @'Monad'@'s
+-- | Raise the target of a floating-point valued 'Lens' into your 'Monad'\'s
-- state to an arbitrary power and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.**=') is more flexible.
@@ -643,7 +643,7 @@ l <^^= e = l <%= (^^ e)
l <**= a = l <%= (** a)
{-# INLINE (<**=) #-}
--- | Logically '||' a Boolean valued 'Lens' into your @'Monad'@'s state and return
+-- | Logically '||' a Boolean valued 'Lens' into your 'Monad'\'s state and return
-- the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.||=') is more flexible.
@@ -656,7 +656,7 @@ l <**= a = l <%= (** a)
l <||= b = l <%= (|| b)
{-# INLINE (<||=) #-}
--- | Logically '&&' a Boolean valued 'Lens' into your @'Monad'@'s state and return
+-- | Logically '&&' a Boolean valued 'Lens' into your 'Monad'\'s state and return
-- the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.&&=') is more flexible.
@@ -669,7 +669,7 @@ l <||= b = l <%= (|| b)
l <&&= b = l <%= (&& b)
{-# INLINE (<&&=) #-}
--- | Modify the target of a 'Lens' into your @'Monad'@'s state by a user supplied
+-- | Modify the target of a 'Lens' into your 'Monad'\'s state by a user supplied
-- function and return the /old/ value that was replaced.
--
-- When applied to a 'Control.Lens.Traversal.Traversal', it this will return a monoidal summary of all of the old values
@@ -688,7 +688,7 @@ l <&&= b = l <%= (&& b)
l <<%= f = l %%= lmap (\a -> (a,a)) (second' f)
{-# INLINE (<<%=) #-}
--- | Modify the target of a 'Lens' into your @'Monad'@'s state by a user supplied
+-- | Modify the target of a 'Lens' into your 'Monad'\'s state by a user supplied
-- function and return the /old/ value that was replaced.
--
-- When applied to a 'Control.Lens.Traversal.Traversal', it this will return a monoidal summary of all of the old values
@@ -730,7 +730,7 @@ l <<>~ m = l <%~ (`mappend` m)
{-# INLINE (<<>~) #-}
-- | 'mappend' a monoidal value onto the end of the target of a 'Lens' into
--- your @'Monad'@'s state and return the result.
+-- your 'Monad'\'s state and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.<>=') is more flexible.
(<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,)r) s r -> r -> m r
View
@@ -181,7 +181,7 @@ import Data.Tree
-- analogue to uniplate's @Biplate@.
--
-- Moreover, since we can allow custom traversals, we implement reasonable defaults for
--- polymorphic data types, that only traverse into themselves, and /not/ their
+-- polymorphic data types, that only 'Control.Traversable.traverse' into themselves, and /not/ their
-- polymorphic arguments.
class Plated a where
@@ -272,7 +272,7 @@ rewriteOn :: Plated a => ASetter s t a a -> (a -> Maybe a) -> s -> t
rewriteOn b = over b . rewrite
{-# INLINE rewriteOn #-}
--- | Rewrite recursively over part of a larger structure using a specified setter.
+-- | Rewrite recursively over part of a larger structure using a specified 'Setter'.
--
-- @
-- 'rewriteOnOf' :: 'Plated' a => 'Control.Lens.Iso.Iso'' s a -> 'Control.Lens.Iso.Iso'' a a -> (a -> 'Maybe' a) -> s -> s
@@ -318,7 +318,7 @@ universe :: Plated a => a -> [a]
universe = universeOf plate
{-# INLINE universe #-}
--- | Given a fold that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.
+-- | Given a 'Fold' that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.
--
-- @'universeOf' :: 'Fold' a a -> a -> [a]@
universeOf :: Getting [a] a b a b -> a -> [a]
@@ -423,7 +423,7 @@ transformMOnOf b l = mapMOf b . transformMOf l
-- | Return a list of all of the editable contexts for every location in the structure, recursively.
--
-- @
--- propUniverse x = 'universe' x == 'map' 'Control.Comonad.Store.Class.pos' ('contexts' x)
+-- propUniverse x = 'universe' x '==' 'map' 'Control.Comonad.Store.Class.pos' ('contexts' x)
-- propId x = 'all' ('==' x) ['extract' w | w <- 'contexts' x]
-- @
--
@@ -491,23 +491,23 @@ holes = holesOf plate
-- 'holesOn' :: 'Iso'' s a -> s -> ['Pretext' (->) a a s]
-- 'holesOn' :: 'Lens'' s a -> s -> ['Pretext' (->) a a s]
-- 'holesOn' :: 'Traversal'' s a -> s -> ['Pretext' (->) a a s]
--- 'holesOn' :: 'IndexedLens'' i s a -> s -> ['Pretext' ('Indexed' i) a a s]
--- 'holesOn' :: 'IndexedTraversal'' i s a -> s -> ['Pretext' ('Indexed' i) a a s]
+-- 'holesOn' :: 'IndexedLens'' i s a -> s -> ['Pretext' ('Control.Lens.Internal.Indexed.Indexed' i) a a s]
+-- 'holesOn' :: 'IndexedTraversal'' i s a -> s -> ['Pretext' ('Control.Lens.Internal.Indexed.Indexed' i) a a s]
-- @
holesOn :: (Corepresentable p, Comonad (Corep p)) => Overloading p (->) (Bazaar p a a) s t a a -> s -> [Pretext p a a t]
holesOn = holesOf
{-# INLINE holesOn #-}
--- | Extract one level of holes from a container in a region specified by one 'Traversal', using another.
+-- | Extract one level of 'holes' from a container in a region specified by one 'Traversal', using another.
--
-- @'holesOnOf' b l ≡ 'holesOf' (b '.' l)@
--
-- @
-- 'holesOnOf' :: 'Iso'' s a -> 'Iso'' a a -> s -> ['Pretext' (->) a a s]
-- 'holesOnOf' :: 'Lens'' s a -> 'Lens'' a a -> s -> ['Pretext' (->) a a s]
-- 'holesOnOf' :: 'Traversal'' s a -> 'Traversal'' a a -> s -> ['Pretext' (->) a a s]
--- 'holesOnOf' :: 'Lens'' s a -> 'IndexedLens'' i a a -> s -> ['Pretext' ('Indexed' i) a a s]
--- 'holesOnOf' :: 'Traversal'' s a -> 'IndexedTraversal'' i a a -> s -> ['Pretext' ('Indexed' i) a a s]
+-- 'holesOnOf' :: 'Lens'' s a -> 'IndexedLens'' i a a -> s -> ['Pretext' ('Control.Lens.Internal.Indexed.Indexed' i) a a s]
+-- 'holesOnOf' :: 'Traversal'' s a -> 'IndexedTraversal'' i a a -> s -> ['Pretext' ('Control.Lens.Internal.Indexed.Indexed' i) a a s]
-- @
holesOnOf :: (Corepresentable p, Comonad (Corep p))
=> LensLike (Bazaar p r r) s t a b
@@ -126,7 +126,7 @@ without k = case runPrism k of
-- Common Prisms
------------------------------------------------------------------------------
--- | This 'Prism' provides a 'Traversal' for tweaking the left-hand value of an 'Either':
+-- | This 'Prism' provides a 'Traversal' for tweaking the 'Left' half of an 'Either':
--
-- >>> over _Left (+1) (Left 2)
-- Left 3
@@ -148,7 +148,7 @@ _Left :: Prism (Either a c) (Either b c) a b
_Left = prism Left $ either Right (Left . Right)
{-# INLINE _Left #-}
--- | This 'Prism' provides a 'Traversal' for tweaking the right-hand value of an 'Either':
+-- | This 'Prism' provides a 'Traversal' for tweaking the 'Right' half of an 'Either':
--
-- >>> over _Right (+1) (Left 2)
-- Left 2
View
@@ -18,7 +18,7 @@
-- A @'Setter' s t a b@ is a generalization of 'fmap' from 'Functor'. It allows you to map into a
-- structure and change out the contents, but it isn't strong enough to allow you to
-- enumerate those contents. Starting with @'fmap' :: 'Functor' f => (a -> b) -> f a -> f b@
--- we monomorphize the type to obtain @(a -> b) -> s -> t@ and then decorate it with 'Data.Functor.Identity.Identity' to obtain
+-- we monomorphize the type to obtain @(a -> b) -> s -> t@ and then decorate it with 'Data.Functor.Identity.Identity' to obtain:
--
-- @type 'Setter' s t a b = (a -> 'Data.Functor.Identity.Identity' b) -> s -> 'Data.Functor.Identity.Identity' t@
--
@@ -157,14 +157,14 @@ type AnIndexedSetter' i s a = AnIndexedSetter i s s a a
--
-- @'mapped' :: 'Functor' f => 'Setter' (f a) (f b) a b@
--
--- If you want an 'IndexPreservingSetter' use 'setting fmap'
+-- If you want an 'IndexPreservingSetter' use @'setting' 'fmap'@.
mapped :: Functor f => Setter (f a) (f b) a b
mapped = sets fmap
{-# INLINE mapped #-}
--- | This setter can be used to modify all of the values in a 'Monad'.
+-- | This 'setter' can be used to modify all of the values in a 'Monad'.
--
--- You sometimes have to use this, rather than 'mapped', because due to
+-- You sometimes have to use this rather than 'mapped' -- due to
-- temporary insanity 'Functor' is not a superclass of 'Monad'.
--
-- @'liftM' ≡ 'over' 'lifted'@
@@ -175,7 +175,7 @@ mapped = sets fmap
-- >>> set lifted b (Just a)
-- Just b
--
--- If you want an 'IndexPreservingSetter' use 'setting liftM'
+-- If you want an 'IndexPreservingSetter' use @'setting' 'liftM'@.
lifted :: Monad m => Setter (m a) (m b) a b
lifted = sets liftM
{-# INLINE lifted #-}
View
@@ -320,7 +320,7 @@ type Iso' s a = Iso s s a a
-- >>> 5 ^. re nat -- :: Natural
-- 5
--
--- Similarly we can use a 'Prism' to 'Data.Traversable.traverse' the left half of an 'Either':
+-- Similarly we can use a 'Prism' to 'Data.Traversable.traverse' the 'Left' half of an 'Either':
--
-- >>> Left "hello" & _Left %~ length
-- Left 5
@@ -336,7 +336,7 @@ type Iso' s a = Iso s s a a
-- 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 'Control.Lens.Prism.outside'.
+-- -- a co-'Lens', so to speak. This is what permits the construction of 'Control.Lens.Prism.outside'.
--
-- Note: Composition with a 'Prism' is index-preserving.
type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t)

0 comments on commit 26fb229

Please sign in to comment.