bifunctors-5.4.2: Bifunctors

Copyright | (C) 2011-2015 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Data.Biapplicative

Contents

- Biapplicative bifunctors

Description

Synopsis

- class Bifunctor p => Biapplicative p where
- (<<$>>) :: (a -> b) -> a -> b
- (<<**>>) :: Biapplicative p => p a c -> p (a -> b) (c -> d) -> p b d
- biliftA2 :: Biapplicative w => (a -> b -> c) -> (d -> e -> f) -> w a d -> w b e -> w c f
- biliftA3 :: Biapplicative w => (a -> b -> c -> d) -> (e -> f -> g -> h) -> w a e -> w b f -> w c g -> w d h
- module Data.Bifunctor

# Biapplicative bifunctors

class Bifunctor p => Biapplicative p where #

Minimal complete definition

bipure, (<<*>>)

Methods

bipure :: a -> b -> p a b #

(<<*>>) :: p (a -> b) (c -> d) -> p a c -> p b d infixl 4 #

(*>>) :: p a b -> p c d -> p c d infixl 4 #

    a *>> b ≡ bimap (const id) (const id) <<$>> a <<*>> b

(<<*) :: p a b -> p c d -> p a b infixl 4 #

    a <<* b ≡ bimap const const <<$>> a <<*>> b

Instances

Biapplicative (,) # |
Methods bipure :: a -> b -> (a, b) # (<<*>>) :: (a -> b, c -> d) -> (a, c) -> (b, d) # (*>>) :: (a, b) -> (c, d) -> (c, d) # (<<*) :: (a, b) -> (c, d) -> (a, b) #
Biapplicative Arg # |
Methods bipure :: a -> b -> Arg a b # (<<*>>) :: Arg (a -> b) (c -> d) -> Arg a c -> Arg b d # (*>>) :: Arg a b -> Arg c d -> Arg c d # (<<*) :: Arg a b -> Arg c d -> Arg a b #
Monoid x => Biapplicative ((,,) x) # |
Methods bipure :: a -> b -> (x, a, b) # (<<*>>) :: (x, a -> b, c -> d) -> (x, a, c) -> (x, b, d) # (*>>) :: (x, a, b) -> (x, c, d) -> (x, c, d) # (<<*) :: (x, a, b) -> (x, c, d) -> (x, a, b) #
Biapplicative (Const *) # |
Methods bipure :: a -> b -> Const * a b # (<<*>>) :: Const * (a -> b) (c -> d) -> Const * a c -> Const * b d # (*>>) :: Const * a b -> Const * c d -> Const * c d # (<<*) :: Const * a b -> Const * c d -> Const * a b #
Biapplicative (Tagged *) # |
Methods bipure :: a -> b -> Tagged * a b # (<<*>>) :: Tagged * (a -> b) (c -> d) -> Tagged * a c -> Tagged * b d # (*>>) :: Tagged * a b -> Tagged * c d -> Tagged * c d # (<<*) :: Tagged * a b -> Tagged * c d -> Tagged * a b #
(Monoid x, Monoid y) => Biapplicative ((,,,) x y) # |
Methods bipure :: a -> b -> (x, y, a, b) # (<<*>>) :: (x, y, a -> b, c -> d) -> (x, y, a, c) -> (x, y, b, d) # (*>>) :: (x, y, a, b) -> (x, y, c, d) -> (x, y, c, d) # (<<*) :: (x, y, a, b) -> (x, y, c, d) -> (x, y, a, b) #
(Monoid x, Monoid y, Monoid z) => Biapplicative ((,,,,) x y z) # |
Methods bipure :: a -> b -> (x, y, z, a, b) # (<<*>>) :: (x, y, z, a -> b, c -> d) -> (x, y, z, a, c) -> (x, y, z, b, d) # (*>>) :: (x, y, z, a, b) -> (x, y, z, c, d) -> (x, y, z, c, d) # (<<*) :: (x, y, z, a, b) -> (x, y, z, c, d) -> (x, y, z, a, b) #
Applicative f => Biapplicative (Clown * * f) # |
Methods bipure :: a -> b -> Clown * * f a b # (<<*>>) :: Clown * * f (a -> b) (c -> d) -> Clown * * f a c -> Clown * * f b d # (*>>) :: Clown * * f a b -> Clown * * f c d -> Clown * * f c d # (<<*) :: Clown * * f a b -> Clown * * f c d -> Clown * * f a b #
Biapplicative p => Biapplicative (Flip * * p) # |
Methods bipure :: a -> b -> Flip * * p a b # (<<*>>) :: Flip * * p (a -> b) (c -> d) -> Flip * * p a c -> Flip * * p b d # (*>>) :: Flip * * p a b -> Flip * * p c d -> Flip * * p c d # (<<*) :: Flip * * p a b -> Flip * * p c d -> Flip * * p a b #
Applicative g => Biapplicative (Joker * * g) # |
Methods bipure :: a -> b -> Joker * * g a b # (<<*>>) :: Joker * * g (a -> b) (c -> d) -> Joker * * g a c -> Joker * * g b d # (*>>) :: Joker * * g a b -> Joker * * g c d -> Joker * * g c d # (<<*) :: Joker * * g a b -> Joker * * g c d -> Joker * * g a b #
Biapplicative p => Biapplicative (WrappedBifunctor * * p) # |
Methods bipure :: a -> b -> WrappedBifunctor * * p a b # (<<*>>) :: WrappedBifunctor * * p (a -> b) (c -> d) -> WrappedBifunctor * * p a c -> WrappedBifunctor * * p b d # (*>>) :: WrappedBifunctor * * p a b -> WrappedBifunctor * * p c d -> WrappedBifunctor * * p c d # (<<*) :: WrappedBifunctor * * p a b -> WrappedBifunctor * * p c d -> WrappedBifunctor * * p a b #
(Monoid x, Monoid y, Monoid z, Monoid w) => Biapplicative ((,,,,,) x y z w) # |
Methods bipure :: a -> b -> (x, y, z, w, a, b) # (<<*>>) :: (x, y, z, w, a -> b, c -> d) -> (x, y, z, w, a, c) -> (x, y, z, w, b, d) # (*>>) :: (x, y, z, w, a, b) -> (x, y, z, w, c, d) -> (x, y, z, w, c, d) # (<<*) :: (x, y, z, w, a, b) -> (x, y, z, w, c, d) -> (x, y, z, w, a, b) #
(Biapplicative f, Biapplicative g) => Biapplicative (Product * * f g) # |
Methods bipure :: a -> b -> Product * * f g a b # (<<*>>) :: Product * * f g (a -> b) (c -> d) -> Product * * f g a c -> Product * * f g b d # (*>>) :: Product * * f g a b -> Product * * f g c d -> Product * * f g c d # (<<*) :: Product * * f g a b -> Product * * f g c d -> Product * * f g a b #
(Monoid x, Monoid y, Monoid z, Monoid w, Monoid v) => Biapplicative ((,,,,,,) x y z w v) # |
Methods bipure :: a -> b -> (x, y, z, w, v, a, b) # (<<*>>) :: (x, y, z, w, v, a -> b, c -> d) -> (x, y, z, w, v, a, c) -> (x, y, z, w, v, b, d) # (*>>) :: (x, y, z, w, v, a, b) -> (x, y, z, w, v, c, d) -> (x, y, z, w, v, c, d) # (<<*) :: (x, y, z, w, v, a, b) -> (x, y, z, w, v, c, d) -> (x, y, z, w, v, a, b) #
(Applicative f, Biapplicative p) => Biapplicative (Tannen * * * f p) # |
Methods bipure :: a -> b -> Tannen * * * f p a b # (<<*>>) :: Tannen * * * f p (a -> b) (c -> d) -> Tannen * * * f p a c -> Tannen * * * f p b d # (*>>) :: Tannen * * * f p a b -> Tannen * * * f p c d -> Tannen * * * f p c d # (<<*) :: Tannen * * * f p a b -> Tannen * * * f p c d -> Tannen * * * f p a b #
(Biapplicative p, Applicative f, Applicative g) => Biapplicative (Biff * * * * p f g) # |
Methods bipure :: a -> b -> Biff * * * * p f g a b # (<<*>>) :: Biff * * * * p f g (a -> b) (c -> d) -> Biff * * * * p f g a c -> Biff * * * * p f g b d # (*>>) :: Biff * * * * p f g a b -> Biff * * * * p f g c d -> Biff * * * * p f g c d # (<<*) :: Biff * * * * p f g a b -> Biff * * * * p f g c d -> Biff * * * * p f g a b #

(<<$>>) :: (a -> b) -> a -> b infixl 4 #

(<<**>>) :: Biapplicative p => p a c -> p (a -> b) (c -> d) -> p b d infixl 4 #

biliftA2 :: Biapplicative w => (a -> b -> c) -> (d -> e -> f) -> w a d -> w b e -> w c f #

Lift binary functions

biliftA3 :: Biapplicative w => (a -> b -> c -> d) -> (e -> f -> g -> h) -> w a e -> w b f -> w c g -> w d h #

Lift ternary functions

module Data.Bifunctor