Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Control/Lens/Internal/Bazaar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ instance Conjoined p => IndexedComonad (Bazaar p) where
{-# INLINE iduplicate #-}

instance Corepresentable p => Sellable p (Bazaar p) where
sell = cotabulate $ \ w -> Bazaar $ tabulate $ \k -> pure (cosieve k w)
sell = cotabulate $ \ w -> Bazaar (`cosieve` w)
{-# INLINE sell #-}

instance Profunctor p => Bizarre p (Bazaar p) where
Expand All @@ -108,7 +108,7 @@ instance Functor (Bazaar p a b) where
{-# INLINE fmap #-}

instance Apply (Bazaar p a b) where
Bazaar mf <.> Bazaar ma = Bazaar $ \ pafb -> mf pafb <*> ma pafb
(<.>) = (<*>)
{-# INLINE (<.>) #-}

instance Applicative (Bazaar p a b) where
Expand Down Expand Up @@ -171,11 +171,11 @@ instance Functor (BazaarT p g a b) where
{-# INLINE fmap #-}

instance Apply (BazaarT p g a b) where
BazaarT mf <.> BazaarT ma = BazaarT $ \ pafb -> mf pafb <*> ma pafb
(<.>) = (<*>)
{-# INLINE (<.>) #-}

instance Applicative (BazaarT p g a b) where
pure a = BazaarT $ tabulate $ \_ -> pure (pure a)
pure a = BazaarT $ \_ -> pure a
{-# INLINE pure #-}
BazaarT mf <*> BazaarT ma = BazaarT $ \ pafb -> mf pafb <*> ma pafb
{-# INLINE (<*>) #-}
Expand Down Expand Up @@ -252,7 +252,7 @@ instance Conjoined p => IndexedComonad (Bazaar1 p) where
{-# INLINE iduplicate #-}

instance Corepresentable p => Sellable p (Bazaar1 p) where
sell = cotabulate $ \ w -> Bazaar1 $ tabulate $ \k -> pure (cosieve k w)
sell = cotabulate $ \ w -> Bazaar1 (`cosieve` w)
{-# INLINE sell #-}

instance Profunctor p => Bizarre1 p (Bazaar1 p) where
Expand All @@ -274,7 +274,7 @@ instance (a ~ b, Conjoined p) => Comonad (Bazaar1 p a b) where
{-# INLINE duplicate #-}

instance (a ~ b, Conjoined p) => ComonadApply (Bazaar1 p a b) where
Bazaar1 mf <@> Bazaar1 ma = Bazaar1 $ \ pafb -> mf pafb <.> ma pafb
(<@>) = (<.>)
{-# INLINE (<@>) #-}

------------------------------------------------------------------------------
Expand Down Expand Up @@ -331,7 +331,7 @@ instance (a ~ b, Conjoined p) => Comonad (BazaarT1 p g a b) where
{-# INLINE duplicate #-}

instance (a ~ b, Conjoined p) => ComonadApply (BazaarT1 p g a b) where
BazaarT1 mf <@> BazaarT1 ma = BazaarT1 $ \ pafb -> mf pafb <.> ma pafb
(<@>) = (<.>)
{-# INLINE (<@>) #-}

instance (Profunctor p, Contravariant g) => Contravariant (BazaarT1 p g a b) where
Expand Down
8 changes: 4 additions & 4 deletions src/Control/Lens/Internal/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ instance IndexedComonadStore Context where
{-# INLINE context #-}

instance Functor (Context a b) where
fmap f (Context g t) = Context (f . g) t
fmap = ifmap
{-# INLINE fmap #-}

instance a ~ b => Comonad (Context a b) where
extract (Context f a) = f a
extract = iextract
{-# INLINE extract #-}
duplicate (Context f a) = Context (Context f) a
duplicate = iduplicate
{-# INLINE duplicate #-}
extend g (Context f a) = Context (g . Context f) a
extend = iextend
{-# INLINE extend #-}

instance a ~ b => ComonadStore a (Context a b) where
Expand Down