Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/Data/Profunctor/Clown.purs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ instance functorClown :: Functor (Clown f a) where

instance profunctorClown :: Contravariant f => Profunctor (Clown f) where
dimap f g (Clown a) = Clown (cmap f a)

hoistClown :: forall f g a b. (f ~> g) -> Clown f a b -> Clown g a b
hoistClown f (Clown a) = Clown (f a)
5 changes: 4 additions & 1 deletion src/Data/Profunctor/Costar.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Data.Distributive (class Distributive, distribute)
import Data.Either (Either(..), either)
import Data.Functor.Invariant (class Invariant, imapF)
import Data.Newtype (class Newtype)
import Data.Profunctor (class Profunctor)
import Data.Profunctor (class Profunctor, lmap)
import Data.Profunctor.Closed (class Closed)
import Data.Profunctor.Cochoice (class Cochoice)
import Data.Profunctor.Costrong (class Costrong)
Expand Down Expand Up @@ -73,3 +73,6 @@ instance cochoiceCostar :: Applicative f => Cochoice (Costar f) where

instance closedCostar :: Functor f => Closed (Costar f) where
closed (Costar f) = Costar \g x -> f (map (_ $ x) g)

hoistCostar :: forall f g a b. (g ~> f) -> Costar f a b -> Costar g a b
hoistCostar f (Costar g) = Costar (lmap f g)
3 changes: 3 additions & 0 deletions src/Data/Profunctor/Joker.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ instance functorJoker :: Functor f => Functor (Joker f a) where

instance profunctorJoker :: Functor f => Profunctor (Joker f) where
dimap f g (Joker a) = Joker (map g a)

hoistJoker :: forall f g a b. (f ~> g) -> Joker f a b -> Joker g a b
hoistJoker f (Joker a) = Joker (f a)
3 changes: 3 additions & 0 deletions src/Data/Profunctor/Star.purs
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ instance choiceStar :: Applicative f => Choice (Star f) where

instance closedStar :: Distributive f => Closed (Star f) where
closed (Star f) = Star \g -> distribute (f <<< g)

hoistStar :: forall f g a b. (f ~> g) -> Star f a b -> Star g a b
hoistStar f (Star g) = Star (f <<< g)