bifunctors-4.1.0.1: Bifunctors

Portability | portable
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>
Safe Haskell | Safe-Inferred

Data.Biapplicative

Contents

- Biapplicative bifunctors

Description

Synopsis

- class Bifunctor p => Biapplicative p where
  - bipure :: a -> b -> p a b
  - (<<*>>) :: p (a -> b) (c -> d) -> p a c -> p b d
  - (*>>) :: p a b -> p c d -> p c d
  - (<<*) :: p a b -> p c d -> p a b
- (<<$>>) :: (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 Source

Methods

bipure :: a -> b -> p a bSource

(<<*>>) :: p (a -> b) (c -> d) -> p a c -> p b dSource

(*>>) :: p a b -> p c d -> p c dSource

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

(<<*) :: p a b -> p c d -> p a bSource

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

Instances

Biapplicative (,) |
Biapplicative Const |
Monoid x => Biapplicative ((,,) x) |
Biapplicative (Tagged *) |
Applicative f => Biapplicative (Clown f) |
Biapplicative p => Biapplicative (Flip p) |
Applicative g => Biapplicative (Joker g) |
Biapplicative p => Biapplicative (WrappedBifunctor p) |
(Monoid x, Monoid y) => Biapplicative ((,,,) x y) |
(Biapplicative f, Biapplicative g) => Biapplicative (Product f g) |
(Monoid x, Monoid y, Monoid z) => Biapplicative ((,,,,) x y z) |

(<<$>>) :: (a -> b) -> a -> bSource

(<<**>>) :: Biapplicative p => p a c -> p (a -> b) (c -> d) -> p b dSource

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

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 hSource

Lift ternary functions

module Data.Bifunctor