Skip to content

Commit

Permalink
was mappending on the wrong side. fiddled with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Aug 10, 2012
1 parent 40edc5f commit e474652
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Control/Lens/Setter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ l -~ n = adjust l (subtract n)
{-# INLINE (-~) #-}

-- | Divide the target(s) of a numerically valued 'Control.Lens.Type.Lens', 'Control.Lens.Iso.Iso', 'Setter' or 'Control.Lens.Traversal.Traversal'
-- >>> import Control.Lens
-- >>> id //~ 2 $ 1
-- 0.5
--
-- @
-- (//~) :: 'Fractional' c => 'Setter' a b c c -> c -> a -> b
-- (//~) :: 'Fractional' c => 'Control.Lens.Iso.Iso' a b c c -> c -> a -> b
Expand Down Expand Up @@ -424,9 +428,13 @@ l **~ n = adjust l (** n)
-- | Logically '||' the target(s) of a 'Bool'-valued 'Control.Lens.Type.Lens' or 'Setter'
--
-- >>> :m + Control.Lens Data.Pair.Lens
--
-- >>> both ||~ True $ (False,True)
-- (True,True)
--
-- >>> both ||~ False $ (False,True)
-- (False,True)
--
-- @
-- (||~):: 'Setter' a b 'Bool' 'Bool' -> 'Bool' -> a -> b
-- (||~):: 'Control.Lens.Iso.Iso' a b 'Bool' 'Bool' -> 'Bool' -> a -> b
Expand All @@ -440,7 +448,11 @@ l ||~ n = adjust l (|| n)
-- | Logically '&&' the target(s) of a 'Bool'-valued 'Control.Lens.Type.Lens' or 'Setter'
--
-- >>> :m + Control.Lens Data.Pair.Lens
--
-- >>> both &&~ True $ (False, True)
-- (False,True)
--
-- >>> both &&~ False $ (False, True)
-- (False,False)
--
-- @
Expand All @@ -466,7 +478,7 @@ l &&~ n = adjust l (&& n)
-- (<>~) :: 'Monoid' c => 'Control.Lens.Traversal.Traversal' a b c c -> c -> a -> b
-- @
(<>~) :: Monoid c => Setting a b c c -> c -> a -> b
l <>~ n = adjust l (mappend n)
l <>~ n = adjust l (`mappend` n)
{-# INLINE (<>~) #-}

------------------------------------------------------------------------------
Expand Down

0 comments on commit e474652

Please sign in to comment.