bifunctors-5.4.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 | Haskell98

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 #

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

Functor g => Bifunctor (Joker * * g) # |
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) # |
Methods bifold :: Monoid m => Joker * * g m m -> m # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Joker * * g a b -> m # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Joker * * g a b -> c # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Joker * * g a b -> c #
Traversable g => Bitraversable (Joker * * g) # |
Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Joker * * g a b -> f (Joker * * g c d) #
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 #
Functor g => Functor (Joker k * g a) # |
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) # |
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) # |
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) # |
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) # |
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) # |
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) # |
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) # |
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) # |
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) # |
type Rep1 (Joker k * g a) = D1 (MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.4.2-8sihn7PNvccAEMEjqQmBaw" True) (C1 (MetaCons "Joker" PrefixI True) (S1 (MetaSel (Just Symbol "runJoker") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 g)))
type Rep (Joker k1 k g a b) # |
type Rep (Joker k1 k g a b) = D1 (MetaData "Joker" "Data.Bifunctor.Joker" "bifunctors-5.4.2-8sihn7PNvccAEMEjqQmBaw" True) (C1 (MetaCons "Joker" PrefixI True) (S1 (MetaSel (Just Symbol "runJoker") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (g b))))