Permalink
Browse files

haddocks: formatting, punctuation and linking

  • Loading branch information...
1 parent f68d2c3 commit 40e0b6cc752d51ec3b5a1e7f0702532eb8d491e5 @basdirks basdirks committed Jan 6, 2013
Showing with 36 additions and 36 deletions.
  1. +2 −2 src/Control/Lens/Internal.hs
  2. +5 −5 src/Control/Lens/Iso.hs
  3. +27 −27 src/Control/Lens/Lens.hs
  4. +2 −2 src/Control/Lens/Type.hs
View
4 src/Control/Lens/Internal.hs
@@ -886,10 +886,10 @@ class IndexedComonad w => IndexedComonadStore w where
context wabt = Context (`ipeek` wabt) (ipos wabt)
-- | The indexed store can be used to characterize a 'Control.Lens.Lens.Lens'
--- and is used by 'Control.Lens.Lens.clone'
+-- and is used by 'Control.Lens.Lens.clone'.
--
-- @'Context' a b t@ is isomorphic to
--- @newtype Context a b t = Context { runContext :: forall f. Functor f => (a -> f b) -> f t }@,
+-- @newtype 'Context' a b t = 'Context' { runContext :: forall f. 'Functor' f => (a -> f b) -> f t }@,
-- and to @exists s. (s, 'Control.Lens.Lens.Lens' s t a b)@.
--
-- A 'Context' is like a 'Control.Lens.Lens.Lens' that has already been applied to a some structure.
View
10 src/Control/Lens/Iso.hs
@@ -78,7 +78,7 @@ type AnIso s t a b = Exchange a b a (Mutator b) -> Exchange a b s (Mutator t)
type AnIso' s a = AnIso s s a a
--- | Build a simple isomorphism from a pair of inverse functions
+-- | Build a simple isomorphism from a pair of inverse functions.
--
-- @
-- 'Control.Lens.Getter.view' ('iso' f g) ≡ f
@@ -107,7 +107,7 @@ from k = case runIso k of
-- This is useful when you need to store an isomorphism as a data type inside a container
-- and later reconstitute it as an overloaded function.
--
--- See 'cloneLens' or 'Control.Lens.Traversal.cloneTraversal' for more information on why you might want to do this.
+-- See 'Control.Lens.Lens.cloneLens' or 'Control.Lens.Traversal.cloneTraversal' for more information on why you might want to do this.
cloneIso :: AnIso s t a b -> Iso s t a b
cloneIso k = case runIso k of
(sa, bt) -> iso sa bt
@@ -117,7 +117,7 @@ cloneIso k = case runIso k of
-- Isomorphisms families as Lenses
-----------------------------------------------------------------------------
--- | Safely decompose 'AnIso'
+-- | Safely decompose 'AnIso'.
--
-- @'cloneIso' ≡ 'uncurry' 'iso' '.' 'runIso'@
--
@@ -208,7 +208,7 @@ simple = id
-- | If @v@ is an element of a type @a@, and @a'@ is @a@ sans the element @v@, then @'non' v@ is an isomorphism from
-- @'Maybe' a'@ to @a@.
--
--- Keep in mind this is only a real isomorphism if you treat the domain as being @'Maybe' (a sans v)@
+-- Keep in mind this is only a real isomorphism if you treat the domain as being @'Maybe' (a sans v)@.
--
-- This is practically quite useful when you want to have a 'Data.Map.Map' where all the entries should have non-zero values.
--
@@ -242,7 +242,7 @@ non a = anon a (a==)
-- | @'anon' a p@ generalizes @'non' a@ to take any value and a predicate.
--
--- This function assumes that @p a@ holds @'True'@ and generates an isomorphism between @'Maybe' (a | 'not' (p a))@ and @a@
+-- This function assumes that @p a@ holds @'True'@ and generates an isomorphism between @'Maybe' (a | 'not' (p a))@ and @a@.
--
-- >>> Map.empty & at "hello" . anon Map.empty Map.null . at "world" ?~ "!!!"
-- fromList [("hello",fromList [("world","!!!")])]
View
54 src/Control/Lens/Lens.hs
@@ -42,7 +42,7 @@
-- the 'Functor' part of the 'Applicative' it is supplied.
--
-- Every 'Lens' can be used for 'Control.Lens.Getter.Getting' like a valid
--- 'Control.Lens.Getter.Getter', since 'Functor' is a superclass of 'Control.Lens.Getter.Gettable'
+-- 'Control.Lens.Getter.Getter', since 'Functor' is a superclass of 'Control.Lens.Getter.Gettable'.
--
-- Since every 'Lens' can be used for 'Control.Lens.Getter.Getting' like a
-- valid 'Control.Lens.Getter.Getter' it follows that it must view exactly one element in the
@@ -189,8 +189,8 @@ ilens sia sbt iafb s = sbt s <$> uncurry (indexed iafb) (sia s)
-- When applied to a 'Lens', it can edit the target of the 'Lens' in a
-- structure, extracting a functorial result.
--
--- When applied to a 'Control.Lens.Traversal.Traversal', it can edit the
--- targets of the 'Traversals', extracting an applicative summary of its
+-- When applied to a 'Traversal', it can edit the
+-- targets of the 'Traversal's, extracting an applicative summary of its
-- actions.
--
-- For all that the definition of this combinator is just:
@@ -204,10 +204,10 @@ ilens sia sbt iafb s = sbt s <$> uncurry (indexed iafb) (sia s)
-- @
--
-- It may be beneficial to think about it as if it had these even more
--- restrictive types, however:
+-- restricted types, however:
--
--- When applied to a 'Control.Lens.Traversal.Traversal', it can edit the
--- targets of the 'Traversals', extracting a supplemental monoidal summary
+-- When applied to a 'Traversal', it can edit the
+-- targets of the 'Traversal's, extracting a supplemental monoidal summary
-- of its actions, by choosing @f = ((,) m)@
--
-- @
@@ -267,8 +267,8 @@ inside l f es = o <$> f i where
-- @'chosen' ≡ 'choosing' 'id' 'id'@
--
-- @
--- 'choosing' :: 'Control.Lens.Getter.Getter' s a -> 'Control.Lens.Getter.Getter' s' a -> 'Control.Lens.Getter.Getter' ('Either' s s') a
--- 'choosing' :: 'Control.Lens.Fold.Fold' s a -> 'Control.Lens.Fold.Fold' s' a -> 'Control.Lens.Fold.Fold' ('Either' s s') a
+-- 'choosing' :: 'Control.Lens.Getter.Getter' s a -> 'Control.Lens.Getter.Getter' s' a -> 'Control.Lens.Getter.Getter' ('Either' s s') a
+-- 'choosing' :: 'Control.Lens.Fold.Fold' s a -> 'Control.Lens.Fold.Fold' s' a -> 'Control.Lens.Fold.Fold' ('Either' s s') a
-- 'choosing' :: 'Lens'' s a -> 'Lens'' s' a -> 'Lens'' ('Either' s s') a
-- 'choosing' :: 'Control.Lens.Traversal.Traversal'' s a -> 'Control.Lens.Traversal.Traversal'' s' a -> 'Control.Lens.Traversal.Traversal'' ('Either' s s') a
-- 'choosing' :: 'Control.Lens.Setter.Setter'' s a -> 'Control.Lens.Setter.Setter'' s' a -> 'Control.Lens.Setter.Setter'' ('Either' s s') a
@@ -373,7 +373,7 @@ cloneIndexedLens l f s = runPretext (l sell s) (Indexed (indexed f))
-- Setting and Remembering
-------------------------------------------------------------------------------
--- | Modify the target of a 'Lens' and return the result
+-- | Modify the target of a 'Lens' and return the result.
--
-- When you do not need the result of the addition, ('Control.Lens.Setter.%~') is more flexible.
--
@@ -386,7 +386,7 @@ cloneIndexedLens l f s = runPretext (l sell s) (Indexed (indexed f))
l <%~ f = l $ rmap (\t -> (t, t)) f
{-# INLINE (<%~) #-}
--- | Increment the target of a numerically valued 'Lens' and return the result
+-- | Increment the target of a numerically valued 'Lens' and return the result.
--
-- When you do not need the result of the addition, ('Control.Lens.Setter.+~') is more flexible.
--
@@ -398,7 +398,7 @@ l <%~ f = l $ rmap (\t -> (t, t)) f
l <+~ a = l <%~ (+ a)
{-# INLINE (<+~) #-}
--- | Decrement the target of a numerically valued 'Lens' and return the result
+-- | Decrement the target of a numerically valued 'Lens' and return the result.
--
-- When you do not need the result of the subtraction, ('Control.Lens.Setter.-~') is more flexible.
--
@@ -410,7 +410,7 @@ l <+~ a = l <%~ (+ a)
l <-~ a = l <%~ subtract a
{-# INLINE (<-~) #-}
--- | Multiply the target of a numerically valued 'Lens' and return the result
+-- | Multiply the target of a numerically valued 'Lens' and return the result.
--
-- When you do not need the result of the multiplication, ('Control.Lens.Setter.*~') is more
-- flexible.
@@ -436,7 +436,7 @@ l <//~ a = l <%~ (/ a)
{-# INLINE (<//~) #-}
-- | Raise the target of a numerically valued 'Lens' to a non-negative
--- 'Integral' power and return the result
+-- 'Integral' power and return the result.
--
-- When you do not need the result of the division, ('Control.Lens.Setter.^~') is more flexible.
--
@@ -474,7 +474,7 @@ l <^^~ e = l <%~ (^^ e)
l <**~ a = l <%~ (** a)
{-# INLINE (<**~) #-}
--- | Logically '||' a Boolean valued 'Lens' and return the result
+-- | Logically '||' a Boolean valued 'Lens' and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.||~') is more flexible.
--
@@ -486,7 +486,7 @@ l <**~ a = l <%~ (** a)
l <||~ b = l <%~ (|| b)
{-# INLINE (<||~) #-}
--- | Logically '&&' a Boolean valued 'Lens' and return the result
+-- | Logically '&&' a Boolean valued 'Lens' and return the result.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.&&~') is more flexible.
--
@@ -537,8 +537,8 @@ l <<.~ b = l $ \a -> (a, b)
-- When you do not need the result of the operation, ('Control.Lens.Setter.%=') is more flexible.
--
-- @
--- ('<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
--- ('<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
+-- ('<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
+-- ('<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
-- ('<%=') :: ('MonadState' s m, 'Monoid' a) => 'Control.Lens.Traversal.Traversal'' s a -> (a -> a) -> m a
-- @
(<%=) :: (Profunctor p, MonadState s m) => Overloading p (->) ((,)b) s s a b -> p a b -> m b
@@ -675,8 +675,8 @@ l <&&= b = l <%= (&& b)
-- When you do not need the result of the operation, ('Control.Lens.Setter.%=') is more flexible.
--
-- @
--- ('<<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
--- ('<<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
+-- ('<<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
+-- ('<<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
-- ('<<%=') :: ('MonadState' s m, 'Monoid' b) => 'Control.Lens.Traversal.Traversal'' s a -> (a -> a) -> m a
-- @
--
@@ -694,8 +694,8 @@ l <<%= f = l %%= lenticular f
-- When you do not need the result of the operation, ('Control.Lens.Setter.%=') is more flexible.
--
-- @
--- ('<<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
--- ('<<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
+-- ('<<%=') :: 'MonadState' s m => 'Lens'' s a -> (a -> a) -> m a
+-- ('<<%=') :: 'MonadState' s m => 'Control.Lens.Iso.Iso'' s a -> (a -> a) -> m a
-- ('<<%=') :: ('MonadState' s m, 'Monoid' t) => 'Control.Lens.Traversal.Traversal'' s a -> (a -> a) -> m a
-- @
(<<.=) :: MonadState s m => LensLike ((,)a) s s a b -> b -> m a
@@ -719,17 +719,17 @@ l <<~ mb = do
{-# INLINE (<<~) #-}
-- | 'mappend' a monoidal value onto the end of the target of a 'Lens' and
--- return the result
+-- return the result.
--
--- When you do not need the result of the operation, ('<>~') is more flexible.
+-- When you do not need the result of the operation, ('Control.Lens.Setter.<>~') is more flexible.
(<<>~) :: Monoid m => Overloading (->) q ((,)m) s t m m -> m -> q s (m, t)
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.
--
--- When you do not need the result of the operation, ('<>=') is more flexible.
+-- 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
l <<>= r = l <%= (`mappend` r)
{-# INLINE (<<>=) #-}
@@ -746,10 +746,10 @@ l <<>= r = l <%= (`mappend` r)
--
-- When you do not need access to the index then ('<%~') is more liberal in what it can accept.
--
--- If you do not need the intermediate result, you can use ('%@~') or even ('%~').
+-- If you do not need the intermediate result, you can use ('Control.Lens.Setter.%@~') or even ('Control.Lens.Setter.%~').
--
-- @
--- ('<%@~') :: 'IndexedLens' i s t a b -> (i -> a -> b) -> s -> (b, t)
+-- ('<%@~') :: 'IndexedLens' i s t a b -> (i -> a -> b) -> s -> (b, t)
-- ('<%@~') :: 'Monoid' b => 'Control.Lens.Traversal.IndexedTraversal' i s t a b -> (i -> a -> b) -> s -> (b, t)
-- @
(<%@~) :: Overloading (Indexed i) q ((,) b) s t a b -> (i -> a -> b) -> q s (b, t)
@@ -768,7 +768,7 @@ l <%@~ f = l (Indexed $ \i a -> let b = f i a in (b, b))
-- @
--
-- In particular, it is often useful to think of this function as having one of these even more
--- restrictive type signatures
+-- restricted type signatures:
--
-- @
-- ('%%@~') :: 'IndexedLens' i s t a b -> (i -> a -> (r, b)) -> s -> (r, t)
View
4 src/Control/Lens/Type.hs
@@ -100,8 +100,8 @@ import Data.Profunctor
-- You can also use a 'Lens' for 'Control.Lens.Getter.Getting' as if it were a
-- 'Fold' or 'Getter'.
--
--- Since every lens is a valid 'Traversal', the
--- traversal laws are required of any lenses you create:
+-- Since every 'Lens' is a valid 'Traversal', the
+-- 'Traversal' laws are required of any lenses you create:
--
-- @
-- l 'pure' ≡ 'pure'

0 comments on commit 40e0b6c

Please sign in to comment.