Skip to content

Commit

Permalink
untainted# (issue #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Nov 6, 2012
1 parent 7e91392 commit 3e6e538
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Control/Lens/Internal.hs
Expand Up @@ -688,19 +688,23 @@ class Applicative f => Settable f where
-- | so you can pass our a 'Control.Lens.Setter.Setter' into combinators from other lens libraries
instance Settable Identity where
untainted = runIdentity
untainted# = unsafeCoerce
{-# INLINE untainted #-}

-- | 'Control.Lens.Fold.backwards'
instance Settable f => Settable (Backwards f) where
untainted = untainted . forwards
-- untainted# = untainted# forwards
{-# INLINE untainted #-}

instance (Settable f, Settable g) => Settable (Compose f g) where
untainted = untainted . untainted . getCompose
-- untainted# = untainted# (untainted# getCompose)
{-# INLINE untainted #-}

instance Settable Mutator where
untainted = runMutator
untainted# = unsafeCoerce
{-# INLINE untainted #-}

-- | 'Mutator' is just a renamed 'Identity' functor to give better error
Expand Down

0 comments on commit 3e6e538

Please sign in to comment.