Skip to content

Commit

Permalink
Revert "More instances that are now possible"
Browse files Browse the repository at this point in the history
This reverts commit d4cfb0e.
  • Loading branch information
ekmett committed Feb 21, 2013
1 parent 50795d7 commit 1f9baf2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
25 changes: 0 additions & 25 deletions src/Control/Lens/Indexed.hs
Expand Up @@ -672,31 +672,6 @@ instance (Eq k, Hashable k) => TraversableWithIndex k (HashMap k) where
itraverse = HashMap.traverseWithKey
{-# INLINE itraverse #-}

instance FunctorWithIndex i (Accessor r) where
imap _ = Accessor . runAccessor
{-# INLINE imap #-}

instance FoldableWithIndex i (Accessor r) where
ifoldMap _ = mempty . runAccessor
{-# INLINE ifoldMap #-}

instance TraversableWithIndex i (Accessor r) where
itraverse _ = pure . Accessor . runAccessor
{-# INLINE itraverse #-}


instance FunctorWithIndex i (Const r) where
imap _ = Const . getConst
{-# INLINE imap #-}

instance FoldableWithIndex i (Const r) where
ifoldMap _ = mempty . getConst
{-# INLINE ifoldMap #-}

instance TraversableWithIndex i (Const r) where
itraverse _ = pure . Const . getConst
{-# INLINE itraverse #-}

instance FunctorWithIndex r ((->) r) where
imap f g x = f x (g x)
{-# INLINE imap #-}
Expand Down
12 changes: 1 addition & 11 deletions src/Control/Lens/Internal/Getter.hs
Expand Up @@ -21,11 +21,9 @@ module Control.Lens.Internal.Getter
) where

import Control.Applicative
import Data.Foldable
import Data.Functor.Apply
import Data.Functor.Contravariant
import Data.Semigroup
import Data.Traversable
import Data.Void

-- | This class is provided mostly for backwards compatibility with lens 3.8,
Expand Down Expand Up @@ -68,17 +66,9 @@ noEffect = coerce $ pure ()
newtype Accessor r a = Accessor { runAccessor :: r }

instance Functor (Accessor r) where
fmap _ = Accessor . runAccessor
fmap _ (Accessor m) = Accessor m
{-# INLINE fmap #-}

instance Foldable (Accessor r) where
foldMap _ _ = mempty
{-# INLINE foldMap #-}

instance Traversable (Accessor r) where
traverse _ = pure . Accessor . runAccessor
{-# INLINE traverse #-}

instance Contravariant (Accessor r) where
contramap _ (Accessor m) = Accessor m
{-# INLINE contramap #-}
Expand Down

0 comments on commit 1f9baf2

Please sign in to comment.