bifunctors-5.4.2: Bifunctors

Copyright(C) 2008-2016 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

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

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

Instances

Functor g => Bifunctor (Joker * * g) Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> Joker * * g a c -> Joker * * g b d #

first :: (a -> b) -> Joker * * g a c -> Joker * * g b c #

second :: (b -> c) -> Joker * * g a b -> Joker * * g a c #

Foldable g => Bifoldable (Joker * * g) Source # 

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 #

Traversable g => Bitraversable (Joker * * g) Source # 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Joker * * g a b -> f (Joker * * g c d) Source #

Applicative g => Biapplicative (Joker * * g) Source # 

Methods

bipure :: a -> b -> Joker * * g a b Source #

(<<*>>) :: Joker * * g (a -> b) (c -> d) -> Joker * * g a c -> Joker * * g b d 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 #

Functor g => Functor (Joker k * g a) Source # 

Methods

fmap :: (a -> b) -> Joker k * g a a -> Joker k * g a b #

(<$) :: a -> Joker k * g a b -> Joker k * g a a #

Foldable g => Foldable (Joker k * g a) Source # 

Methods

fold :: Monoid m => Joker k * g a m -> m #

foldMap :: Monoid m => (a -> m) -> Joker k * g a a -> m #

foldr :: (a -> b -> b) -> b -> Joker k * g a a -> b #

foldr' :: (a -> b -> b) -> b -> Joker k * g a a -> b #

foldl :: (b -> a -> b) -> b -> Joker k * g a a -> b #

foldl' :: (b -> a -> b) -> b -> Joker k * g a a -> b #

foldr1 :: (a -> a -> a) -> Joker k * g a a -> a #

foldl1 :: (a -> a -> a) -> Joker k * g a a -> a #

toList :: Joker k * g a a -> [a] #

null :: Joker k * g a a -> Bool #

length :: Joker k * g a a -> Int #

elem :: Eq a => a -> Joker k * g a a -> Bool #

maximum :: Ord a => Joker k * g a a -> a #

minimum :: Ord a => Joker k * g a a -> a #

sum :: Num a => Joker k * g a a -> a #

product :: Num a => Joker k * g a a -> a #

Traversable g => Traversable (Joker k * g a) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Joker k * g a a -> f (Joker k * g a b) #

sequenceA :: Applicative f => Joker k * g a (f a) -> f (Joker k * g a a) #

mapM :: Monad m => (a -> m b) -> Joker k * g a a -> m (Joker k * g a b) #

sequence :: Monad m => Joker k * g a (m a) -> m (Joker k * g a a) #

Generic1 (Joker k * g a) Source # 

Associated Types

type Rep1 (Joker k * g a :: * -> *) :: * -> * #

Methods

from1 :: Joker k * g a a -> Rep1 (Joker k * g a) a #

to1 :: Rep1 (Joker k * g a) a -> Joker k * g a a #

Eq (g b) => Eq (Joker k1 k g a b) Source # 

Methods

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

(/=) :: Joker k1 k g a b -> Joker k1 k g a b -> Bool #

Ord (g b) => Ord (Joker k1 k g a b) Source # 

Methods

compare :: Joker k1 k g a b -> Joker k1 k g a b -> Ordering #

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

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

(>) :: Joker k1 k g a b -> Joker k1 k g a b -> Bool #

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

max :: Joker k1 k g a b -> Joker k1 k g a b -> Joker k1 k g a b #

min :: Joker k1 k g a b -> Joker k1 k g a b -> Joker k1 k g a b #

Read (g b) => Read (Joker k1 k g a b) Source # 

Methods

readsPrec :: Int -> ReadS (Joker k1 k g a b) #

readList :: ReadS [Joker k1 k g a b] #

readPrec :: ReadPrec (Joker k1 k g a b) #

readListPrec :: ReadPrec [Joker k1 k g a b] #

Show (g b) => Show (Joker k1 k g a b) Source # 

Methods

showsPrec :: Int -> Joker k1 k g a b -> ShowS #

show :: Joker k1 k g a b -> String #

showList :: [Joker k1 k g a b] -> ShowS #

Generic (Joker k1 k g a b) Source # 

Associated Types

type Rep (Joker k1 k g a b) :: * -> * #

Methods

from :: Joker k1 k g a b -> Rep (Joker k1 k g a b) x #

to :: Rep (Joker k1 k g a b) x -> Joker k1 k g a b #

type Rep1 (Joker k * g a) Source # 
type Rep1 (Joker k * g a) = D1 (MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.4.2-FZrmj8WklPbIT4LBQhjbnY" True) (C1 (MetaCons "Joker" PrefixI True) (S1 (MetaSel (Just Symbol "runJoker") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 g)))
type Rep (Joker k1 k g a b) Source # 
type Rep (Joker k1 k g a b) = D1 (MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.4.2-FZrmj8WklPbIT4LBQhjbnY" True) (C1 (MetaCons "Joker" PrefixI True) (S1 (MetaSel (Just Symbol "runJoker") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (g b))))