bifunctors-5.1: 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
  - 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

Minimal complete definition

bipure, (<<*>>)

Methods

bipure :: a -> b -> p a b Source

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

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

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

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

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

Instances

Biapplicative (,) Source |
Biapplicative Const Source |
Biapplicative Arg Source |
Monoid x => Biapplicative ((,,) x) Source |
Biapplicative (Tagged *) Source |
Applicative f => Biapplicative (Clown f) Source |
Biapplicative p => Biapplicative (Flip p) Source |
Applicative g => Biapplicative (Joker g) Source |
Biapplicative p => Biapplicative (WrappedBifunctor p) Source |
(Monoid x, Monoid y) => Biapplicative ((,,,) x y) Source |
(Biapplicative f, Biapplicative g) => Biapplicative (Product f g) Source |
(Applicative f, Biapplicative p) => Biapplicative (Tannen f p) Source |
(Monoid x, Monoid y, Monoid z) => Biapplicative ((,,,,) x y z) Source |
(Biapplicative p, Applicative f, Applicative g) => Biapplicative (Biff p f g) Source |
(Monoid x, Monoid y, Monoid z, Monoid w) => Biapplicative ((,,,,,) x y z w) Source |
(Monoid x, Monoid y, Monoid z, Monoid w, Monoid v) => Biapplicative ((,,,,,,) x y z w v) Source |

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

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

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

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 Source

Lift ternary functions

module Data.Bifunctor