Skip to content

Commit

Permalink
hlint changes to source
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorris committed Feb 28, 2012
1 parent 671b808 commit ee12b97
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Control/Category/Choice.hs
Expand Up @@ -17,6 +17,6 @@ instance Choice Lens where
instance Choice PartialLens where
PLens f ||| PLens g =
PLens $ either
(\a -> fmap (\x -> store (Left . flip peek x) (pos x)) (f a))
(\b -> fmap (\y -> store (Right . flip peek y) (pos y)) (g b))
(fmap (\x -> store (Left . flip peek x) (pos x)) . f)
(fmap (\y -> store (Right . flip peek y) (pos y)) . g)

2 changes: 1 addition & 1 deletion src/Data/Lens/Common.hs
Expand Up @@ -60,7 +60,7 @@ instance Category Lens where

-- | build a lens out of a getter and setter
lens :: (a -> b) -> (b -> a -> a) -> Lens a b
lens get set = Lens $ \a -> store (\b -> set b a) (get a)
lens get set = Lens $ \a -> store (`set` a) (get a)

-- | build a lens out of an isomorphism
iso :: (a -> b) -> (b -> a) -> Lens a b
Expand Down
3 changes: 2 additions & 1 deletion src/Data/Lens/Lazy.hs
Expand Up @@ -14,6 +14,7 @@ module Data.Lens.Lazy
, focus -- modify -- :: Monad m => Lens a b -> StateT m b c -> StateT m a c
) where

import Control.Arrow
import Control.Comonad.Trans.Store
import Control.Monad.Trans.State
import Control.Monad (liftM)
Expand All @@ -29,7 +30,7 @@ access (Lens f) = gets (pos . f)

focus :: Monad m => Lens a b -> StateT b m c -> StateT a m c
focus (Lens f) (StateT g) = StateT $ \a -> case f a of
StoreT (Identity h) b -> liftM (\(c, b') -> (c, h b')) (g b)
StoreT (Identity h) b -> liftM (second h) (g b)

infixr 4 ~=, !=

Expand Down
2 changes: 1 addition & 1 deletion src/Data/Lens/Multi/Common.hs
Expand Up @@ -30,7 +30,7 @@ totalLens (Lens f) = MLens $ fromStore . f

-- totalLens is a homomorphism of categories; ie a functor.
partialLens :: PartialLens a b -> MultiLens a b
partialLens l = MLens $ coproduct (pure . runIdentity) fromStore . (runPLens l)
partialLens l = MLens $ coproduct (pure . runIdentity) fromStore . runPLens l

getML :: MultiLens a b -> a -> [b]
getML (MLens f) = poss . f
Expand Down
3 changes: 2 additions & 1 deletion src/Data/Lens/Strict.hs
Expand Up @@ -14,6 +14,7 @@ module Data.Lens.Strict
, focus -- modify -- :: Monad m => Lens a b -> StateT m b c -> StateT m a c
) where

import Control.Arrow
import Control.Comonad.Trans.Store
import Control.Monad.Trans.State.Strict
import Control.Monad (liftM)
Expand All @@ -29,7 +30,7 @@ access (Lens f) = gets (pos . f)

focus :: Monad m => Lens a b -> StateT b m c -> StateT a m c
focus (Lens f) (StateT g) = StateT $ \a -> case f a of
StoreT (Identity h) b -> liftM (\(c, b') -> (c, h b')) (g b)
StoreT (Identity h) b -> liftM (second h) (g b)

infixr 4 ~=, !=

Expand Down

0 comments on commit ee12b97

Please sign in to comment.