bifunctors-5.6.2: Bifunctors

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

Data.Bifunctor.Joker

Description

From the Functional Pearl "Clowns to the Left of me, Jokers to the Right: Dissecting Data Structures" by Conor McBride.

Synopsis

- newtype Joker g a b = Joker {
  - runJoker :: g b
  }

# Documentation

newtype Joker g a b Source #

Make a `Functor` over the second argument of a `Bifunctor`.

Mnemonic: Clowns to the left (parameter of the Bifunctor), jokers to the right.

Constructors

Joker |

Fields

- runJoker :: g b

#### Instances

Instances details

Generic1 (Joker g a :: k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Associated Types type Rep1 (Joker g a) :: k -> Type Source # Methods from1 :: forall (a0 :: k). Joker g a a0 -> Rep1 (Joker g a) a0 Source # to1 :: forall (a0 :: k). Rep1 (Joker g a) a0 -> Joker g a a0 Source #
Foldable g => Bifoldable (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods bifold :: Monoid m => Joker g m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Joker g a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Joker g a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Joker g a b -> c Source #
Foldable1 g => Bifoldable1 (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods bifold1 :: Semigroup m => Joker g m m -> m Source # bifoldMap1 :: Semigroup m => (a -> m) -> (b -> m) -> Joker g a b -> m Source #
Functor g => Bifunctor (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods bimap :: (a -> b) -> (c -> d) -> Joker g a c -> Joker g b d Source # first :: (a -> b) -> Joker g a c -> Joker g b c Source # second :: (b -> c) -> Joker g a b -> Joker g a c Source #
Traversable g => Bitraversable (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Joker g a b -> f (Joker g c d) Source #
Eq1 g => Eq2 (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Joker g a c -> Joker g b d -> Bool Source #
Ord1 g => Ord2 (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Joker g a c -> Joker g b d -> Ordering Source #
Read1 g => Read2 (Joker g :: Type -> Type -> Type) Source # |

Instance details

Defined in Data.Bifunctor.Joker

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Joker g a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Joker g a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Joker g a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Joker g a b] Source #

Show1 g => Show2 (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Joker g a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Joker g a b] -> ShowS Source #
Applicative g => Biapplicative (Joker g :: Type -> Type -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods bipure :: a -> b -> Joker g a b Source # (<<*>>) :: Joker g (a -> b) (c -> d) -> Joker g a c -> Joker g b d Source # biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> Joker g a d -> Joker g b e -> Joker g c f Source # (*>>) :: Joker g a b -> Joker g c d -> Joker g c d Source # (<<*) :: Joker g a b -> Joker g c d -> Joker g a b Source #
Foldable g => Foldable (Joker g a) Source # |

Instance details

Defined in Data.Bifunctor.Joker

Methods

fold :: Monoid m => Joker g a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Joker g a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> Joker g a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Joker g a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Joker g a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Joker g a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Joker g a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Joker g a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Joker g a a0 -> a0 Source #

toList :: Joker g a a0 -> [a0] Source #

null :: Joker g a a0 -> Bool Source #

length :: Joker g a a0 -> Int Source #

elem :: Eq a0 => a0 -> Joker g a a0 -> Bool Source #

maximum :: Ord a0 => Joker g a a0 -> a0 Source #

minimum :: Ord a0 => Joker g a a0 -> a0 Source #

sum :: Num a0 => Joker g a a0 -> a0 Source #

product :: Num a0 => Joker g a a0 -> a0 Source #

Foldable1 g => Foldable1 (Joker g a) Source # |

Instance details

Defined in Data.Bifunctor.Joker

Methods

fold1 :: Semigroup m => Joker g a m -> m Source #

foldMap1 :: Semigroup m => (a0 -> m) -> Joker g a a0 -> m Source #

foldMap1' :: Semigroup m => (a0 -> m) -> Joker g a a0 -> m Source #

toNonEmpty :: Joker g a a0 -> NonEmpty a0 Source #

maximum :: Ord a0 => Joker g a a0 -> a0 Source #

minimum :: Ord a0 => Joker g a a0 -> a0 Source #

head :: Joker g a a0 -> a0 Source #

last :: Joker g a a0 -> a0 Source #

foldrMap1 :: (a0 -> b) -> (a0 -> b -> b) -> Joker g a a0 -> b Source #

foldlMap1' :: (a0 -> b) -> (b -> a0 -> b) -> Joker g a a0 -> b Source #

foldlMap1 :: (a0 -> b) -> (b -> a0 -> b) -> Joker g a a0 -> b Source #

foldrMap1' :: (a0 -> b) -> (a0 -> b -> b) -> Joker g a a0 -> b Source #

Eq1 g => Eq1 (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftEq :: (a0 -> b -> Bool) -> Joker g a a0 -> Joker g a b -> Bool Source #
Ord1 g => Ord1 (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftCompare :: (a0 -> b -> Ordering) -> Joker g a a0 -> Joker g a b -> Ordering Source #
Read1 g => Read1 (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Joker g a a0) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Joker g a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Joker g a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Joker g a a0] Source #
Show1 g => Show1 (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Joker g a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Joker g a a0] -> ShowS Source #
Traversable g => Traversable (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods traverse :: Applicative f => (a0 -> f b) -> Joker g a a0 -> f (Joker g a b) Source # sequenceA :: Applicative f => Joker g a (f a0) -> f (Joker g a a0) Source # mapM :: Monad m => (a0 -> m b) -> Joker g a a0 -> m (Joker g a b) Source # sequence :: Monad m => Joker g a (m a0) -> m (Joker g a a0) Source #
Functor g => Functor (Joker g a) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods fmap :: (a0 -> b) -> Joker g a a0 -> Joker g a b Source # (<$) :: a0 -> Joker g a b -> Joker g a a0 Source #
Generic (Joker g a b) Source # |
Instance details Defined in Data.Bifunctor.Joker Associated Types type Rep (Joker g a b) :: Type -> Type Source # Methods from :: Joker g a b -> Rep (Joker g a b) x Source # to :: Rep (Joker g a b) x -> Joker g a b Source #
Read (g b) => Read (Joker g a b) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods readsPrec :: Int -> ReadS (Joker g a b) Source # readList :: ReadS [Joker g a b] Source # readPrec :: ReadPrec (Joker g a b) Source # readListPrec :: ReadPrec [Joker g a b] Source #
Show (g b) => Show (Joker g a b) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods showsPrec :: Int -> Joker g a b -> ShowS Source # show :: Joker g a b -> String Source # showList :: [Joker g a b] -> ShowS Source #
Eq (g b) => Eq (Joker g a b) Source # |
Instance details Defined in Data.Bifunctor.Joker Methods (==) :: Joker g a b -> Joker g a b -> Bool Source # (/=) :: Joker g a b -> Joker g a b -> Bool Source #
Ord (g b) => Ord (Joker g a b) Source # |

Instance details

Defined in Data.Bifunctor.Joker

Methods

compare :: Joker g a b -> Joker g a b -> Ordering Source #

(<) :: Joker g a b -> Joker g a b -> Bool Source #

(<=) :: Joker g a b -> Joker g a b -> Bool Source #

(>) :: Joker g a b -> Joker g a b -> Bool Source #

(>=) :: Joker g a b -> Joker g a b -> Bool Source #

max :: Joker g a b -> Joker g a b -> Joker g a b Source #

min :: Joker g a b -> Joker g a b -> Joker g a b Source #

type Rep1 (Joker g a :: k1 -> Type) Source # |
Instance details Defined in Data.Bifunctor.Joker type Rep1 (Joker g a :: k1 -> Type) = D1 ('MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.6.2-KsAAHBmzKwpDPdrUe1LfsZ" 'True) (C1 ('MetaCons "Joker" 'PrefixI 'True) (S1 ('MetaSel ('Just "runJoker") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g)))
type Rep (Joker g a b) Source # |
Instance details Defined in Data.Bifunctor.Joker type Rep (Joker g a b) = D1 ('MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.6.2-KsAAHBmzKwpDPdrUe1LfsZ" 'True) (C1 ('MetaCons "Joker" 'PrefixI 'True) (S1 ('MetaSel ('Just "runJoker") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g b))))