Permalink
Browse files

Converted `remit` to `re` in doctests and other test suites.

  • Loading branch information...
1 parent 59efcf0 commit 1d79c2d19b12503168960f0105226988393dc46f @ekmett committed Jan 10, 2013
Showing with 11 additions and 11 deletions.
  1. +3 −3 src/Control/Lens/Prism.hs
  2. +3 −3 src/Control/Lens/Type.hs
  3. +1 −1 src/Data/List/Lens.hs
  4. +1 −1 src/Numeric/Lens.hs
  5. +3 −3 tests/properties.hs
@@ -143,7 +143,7 @@ without k = case runPrism k of
--
-- It also can be turned around to obtain the embedding into the 'Left' half of an 'Either':
--
--- >>> 5^.remit _left
+-- >>> 5^.re _left
-- Left 5
_left :: Prism (Either a c) (Either b c) a b
_left = prism Left $ either Right (Left . Right)
@@ -165,7 +165,7 @@ _left = prism Left $ either Right (Left . Right)
--
-- It also can be turned around to obtain the embedding into the 'Right' half of an 'Either':
--
--- >>> 5^.remit _right
+-- >>> 5^.re _right
-- Right 5
_right :: Prism (Either c a) (Either c b) a b
_right = prism Right $ either (Left . Left) Right
@@ -178,7 +178,7 @@ _right = prism Right $ either (Left . Left) Right
--
-- Unlike 'Data.Traversable.traverse' this is a 'Prism', and so you can use it to inject as well:
--
--- >>> 5^.remit _just
+-- >>> 5^.re _just
-- Just 5
_just :: Prism (Maybe a) (Maybe b) a b
_just = prism Just $ maybe (Left Nothing) Right
View
@@ -319,7 +319,7 @@ type Iso' s a = Iso s s a a
--
-- And we can then convert from a 'Numeric.Natural.Natural' to an 'Integer'.
--
--- >>> 5 ^. remit nat -- :: Natural
+-- >>> 5 ^. re nat -- :: Natural
-- 5
--
-- Similarly we can use a 'Prism' to 'Data.Traversable.traverse' the left half of an 'Either':
@@ -329,12 +329,12 @@ type Iso' s a = Iso s s a a
--
-- or to construct an 'Either':
--
--- >>> 5^.remit _left
+-- >>> 5^.re _left
-- Left 5
--
-- such that if you query it with the 'Prism', you will get your original input back.
--
--- >>> 5^.remit _left ^? _left
+-- >>> 5^.re _left ^? _left
-- Just 5
--
-- Another interesting way to think of a 'Prism' is as the categorical dual of a 'Lens'
View
@@ -172,7 +172,7 @@ _init f as = (++ [Prelude.last as]) <$> f (Prelude.init as)
-- >>> "review" ^? strippingPrefix "pre"
-- Nothing
--
--- >>> "amble"^.remit (strippingPrefix "pre")
+-- >>> "amble"^.re (strippingPrefix "pre")
-- "preamble"
strippingPrefix :: Eq a => [a] -> Prism' [a] [a]
strippingPrefix ps = prism (ps ++) $ \xs -> case stripPrefix ps xs of
View
@@ -20,7 +20,7 @@ import Numeric (readInt, showIntAtBase)
-- >>> "100" ^? base 16
-- Just 256
--
--- >>> 1767707668033969 ^. remit (base 36)
+-- >>> 1767707668033969 ^. re (base 36)
-- "helloworld"
base :: (Integral a, Show a) => a -> Prism' String a
base b
View
@@ -135,9 +135,9 @@ prop_text s = s^.packed.from packed == s
-- Numeric.Lens
prop_base_show (n :: Integer) =
- conjoin [ show n == n ^. remit (base 10)
- , showSigned showOct 0 n "" == n ^. remit (base 8)
- , showSigned showHex 0 n "" == n ^. remit (base 16)
+ conjoin [ show n == n ^. re (base 10)
+ , showSigned showOct 0 n "" == n ^. re (base 8)
+ , showSigned showHex 0 n "" == n ^. re (base 16)
]
prop_base_read (n :: Integer) =
conjoin [ show n ^? base 10 == Just n

0 comments on commit 1d79c2d

Please sign in to comment.