Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

alongside (and doc cleanup)

  • Loading branch information...
commit f31a76580a4023e7153ccfd5b55f8d62285ed6a8 1 parent b75afea
@ekmett authored
Showing with 7 additions and 7 deletions.
  1. +2 −2 src/Control/Lens/Iso.hs
  2. +5 −5 src/Control/Lens/Type.hs
View
4 src/Control/Lens/Iso.hs
@@ -179,8 +179,8 @@ au l f e = f (view l) e ^. from l
-- |
-- Based on @ala'@ from Conor McBride's work on Epigram.
--
--- Mnemonically, the German /auf/ both plays a similar role to /à la/, and it is /au/ with an
--- extra function argument.
+-- Mnemonically, the German /auf/ plays a similar role to /à la/, and the combinator
+-- is /au/ with an extra function argument.
auf :: Simple Iso a b -> ((d -> b) -> c -> b) -> (d -> a) -> c -> a
auf l f g e = f (view l . g) e ^. from l
{-# INLINE auf #-}
View
10 src/Control/Lens/Type.hs
@@ -78,7 +78,7 @@ module Control.Lens.Type
-- * Lateral Composition
, merged
- , bothLenses
+ , alongside
-- * Setting Functionally with Passthrough
, (<%~), (<+~), (<-~), (<*~), (<//~)
@@ -395,14 +395,14 @@ merged l _ f (Left a) = Left <$> l f a
merged _ r f (Right a') = Right <$> r f a'
{-# INLINE merged #-}
--- | 'bothLenses' makes a 'Lens' from two other lenses (or isomorphisms)
-bothLenses :: Lens a b c d
+-- | 'alongside' makes a 'Lens' from two other lenses (or isomorphisms)
+alongside :: Lens a b c d
-> Lens a' b' c' d'
-> Lens (a,a') (b,b') (c,c') (d,d')
-bothLenses l r f (a, a') = case l (IndexedStore id) a of
+alongside l r f (a, a') = case l (IndexedStore id) a of
IndexedStore db c -> case r (IndexedStore id) a' of
IndexedStore db' c' -> (\(d,d') -> (db d, db' d')) <$> f (c,c')
-{-# INLINE bothLenses #-}
+{-# INLINE alongside #-}
-------------------------------------------------------------------------------
-- Cloning Lenses
Please sign in to comment.
Something went wrong with that request. Please try again.