profunctors-5.3: Profunctors

Data.Profunctor.Closed

Description

Synopsis

# Documentation

class Profunctor p => Closed p where Source #

A strong profunctor allows the monoidal structure to pass through.

A closed profunctor allows the closed structure to pass through.

Minimal complete definition

closed

Methods

closed :: p a b -> p (x -> a) (x -> b) Source #

Laws:

lmap (. f) . closed ≡ rmap (. f) . closed
closed . closed ≡ dimap uncurry curry . closed
dimap const ($()) . closed ≡ id  Instances  (Distributive f, Monad f) => Closed (Kleisli f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Kleisli f a b -> Kleisli f (x -> a) (x -> b) Source # Closed (Tagged :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Tagged a b -> Tagged (x -> a) (x -> b) Source # Functor f => Closed (Costar f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Costar f a b -> Costar f (x -> a) (x -> b) Source # Distributive f => Closed (Star f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Star f a b -> Star f (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Environment p a b -> Environment p (x -> a) (x -> b) Source # Profunctor p => Closed (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Closure p a b -> Closure p (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsclosed :: FreeMapping p a b -> FreeMapping p (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsclosed :: CofreeMapping p a b -> CofreeMapping p (x -> a) (x -> b) Source # Closed p => Closed (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsclosed :: Coyoneda p a b -> Coyoneda p (x -> a) (x -> b) Source # Closed p => Closed (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsclosed :: Yoneda p a b -> Yoneda p (x -> a) (x -> b) Source # Closed ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: (a -> b) -> (x -> a) -> x -> b Source # Functor f => Closed (Cokleisli f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Cokleisli f a b -> Cokleisli f (x -> a) (x -> b) Source # (Closed p, Closed q) => Closed (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsclosed :: Procompose p q a b -> Procompose p q (x -> a) (x -> b) Source # (Closed p, Closed q) => Closed (Product p q) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Product p q a b -> Product p q (x -> a) (x -> b) Source # (Functor f, Closed p) => Closed (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Tannen f p a b -> Tannen f p (x -> a) (x -> b) Source # newtype Closure p a b Source # Closure adjoins a Closed structure to any Profunctor. Analogous to Tambara for Strong. Constructors  Closure FieldsrunClosure :: forall x. p (x -> a) (x -> b) Instances  Source # Instance detailsDefined in Data.Profunctor.Closed Methods Source # Instance detailsDefined in Data.Profunctor.Closed Methodspromap :: Profunctor p => (p :-> q) -> Closure p :-> Closure q Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsunit :: Profunctor p => p :-> Closure (Environment p) Source # Arrow p => Arrow (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsarr :: (b -> c) -> Closure p b c #first :: Closure p b c -> Closure p (b, d) (c, d) #second :: Closure p b c -> Closure p (d, b) (d, c) #(***) :: Closure p b c -> Closure p b' c' -> Closure p (b, b') (c, c') #(&&&) :: Closure p b c -> Closure p b c' -> Closure p b (c, c') # ArrowZero p => ArrowZero (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed MethodszeroArrow :: Closure p b c # ArrowPlus p => ArrowPlus (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methods(<+>) :: Closure p b c -> Closure p b c -> Closure p b c # ArrowLoop p => ArrowLoop (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsloop :: Closure p (b, d) (c, d) -> Closure p b c # Profunctor p => Profunctor (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsdimap :: (a -> b) -> (c -> d) -> Closure p b c -> Closure p a d Source #lmap :: (a -> b) -> Closure p b c -> Closure p a c Source #rmap :: (b -> c) -> Closure p a b -> Closure p a c Source #(#.) :: Coercible c b => q b c -> Closure p a b -> Closure p a c Source #(.#) :: Coercible b a => Closure p b c -> q a b -> Closure p a c Source # Strong p => Strong (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsfirst' :: Closure p a b -> Closure p (a, c) (b, c) Source #second' :: Closure p a b -> Closure p (c, a) (c, b) Source # Profunctor p => Closed (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Closure p a b -> Closure p (x -> a) (x -> b) Source # Category p => Category (Closure p :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsid :: Closure p a a #(.) :: Closure p b c -> Closure p a b -> Closure p a c # Profunctor p => Functor (Closure p a) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsfmap :: (a0 -> b) -> Closure p a a0 -> Closure p a b #(<$) :: a0 -> Closure p a b -> Closure p a a0 # (Profunctor p, Arrow p) => Applicative (Closure p a) Source # Instance detailsDefined in Data.Profunctor.Closed Methodspure :: a0 -> Closure p a a0 #(<*>) :: Closure p a (a0 -> b) -> Closure p a a0 -> Closure p a b #liftA2 :: (a0 -> b -> c) -> Closure p a a0 -> Closure p a b -> Closure p a c #(*>) :: Closure p a a0 -> Closure p a b -> Closure p a b #(<*) :: Closure p a a0 -> Closure p a b -> Closure p a a0 # (Profunctor p, ArrowPlus p) => Alternative (Closure p a) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsempty :: Closure p a a0 #(<|>) :: Closure p a a0 -> Closure p a a0 -> Closure p a a0 #some :: Closure p a a0 -> Closure p a [a0] #many :: Closure p a a0 -> Closure p a [a0] # (Profunctor p, Arrow p, Semigroup b) => Semigroup (Closure p a b) Source # Instance detailsDefined in Data.Profunctor.Closed Methods(<>) :: Closure p a b -> Closure p a b -> Closure p a b #sconcat :: NonEmpty (Closure p a b) -> Closure p a b #stimes :: Integral b0 => b0 -> Closure p a b -> Closure p a b # (Profunctor p, Arrow p, Semigroup b, Monoid b) => Monoid (Closure p a b) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsmempty :: Closure p a b #mappend :: Closure p a b -> Closure p a b -> Closure p a b #mconcat :: [Closure p a b] -> Closure p a b #

close :: Closed p => (p :-> q) -> p :-> Closure q Source #

close . unclose ≡ id
unclose . close ≡ id


unclose :: Profunctor q => (p :-> Closure q) -> p :-> q Source #

close . unclose ≡ id
unclose . close ≡ id


data Environment p a b where Source #

Constructors

 Environment :: ((z -> y) -> b) -> p x y -> (a -> z -> x) -> Environment p a b
Instances
 Source # Instance detailsDefined in Data.Profunctor.Closed Methods Source # Instance detailsDefined in Data.Profunctor.Closed Methodspromap :: Profunctor p => (p :-> q) -> Environment p :-> Environment q Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsunit :: Profunctor p => p :-> Closure (Environment p) Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsdimap :: (a -> b) -> (c -> d) -> Environment p b c -> Environment p a d Source #lmap :: (a -> b) -> Environment p b c -> Environment p a c Source #rmap :: (b -> c) -> Environment p a b -> Environment p a c Source #(#.) :: Coercible c b => q b c -> Environment p a b -> Environment p a c Source #(.#) :: Coercible b a => Environment p b c -> q a b -> Environment p a c Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Environment p a b -> Environment p (x -> a) (x -> b) Source #

curry' :: Closed p => p (a, b) c -> p a (b -> c) Source #