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.Clown

Description

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

Synopsis

- newtype Clown f a b = Clown {
  - runClown :: f a
  }

# Documentation

newtype Clown f a b Source #

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

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

Constructors

Clown |

Fields

- runClown :: f a

Instances

Functor f => Bifunctor (Clown * * f) Source # |
Methods bimap :: (a -> b) -> (c -> d) -> Clown * * f a c -> Clown * * f b d # first :: (a -> b) -> Clown * * f a c -> Clown * * f b c # second :: (b -> c) -> Clown * * f a b -> Clown * * f a c #
Foldable f => Bifoldable (Clown * * f) Source # |
Methods bifold :: Monoid m => Clown * * f m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Clown * * f a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Clown * * f a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Clown * * f a b -> c Source #
Traversable f => Bitraversable (Clown * * f) Source # |
Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Clown * * f a b -> f (Clown * * f c d) Source #
Applicative f => Biapplicative (Clown * * f) Source # |
Methods bipure :: a -> b -> Clown * * f a b Source # (<<*>>) :: Clown * * f (a -> b) (c -> d) -> Clown * * f a c -> Clown * * f b d Source # (*>>) :: Clown * * f a b -> Clown * * f c d -> Clown * * f c d Source # (<<*) :: Clown * * f a b -> Clown * * f c d -> Clown * * f a b Source #
Functor (Clown * k f a) Source # |
Methods fmap :: (a -> b) -> Clown * k f a a -> Clown * k f a b # (<$) :: a -> Clown * k f a b -> Clown * k f a a #
Foldable (Clown * k f a) Source # |

Methods

fold :: Monoid m => Clown * k f a m -> m #

foldMap :: Monoid m => (a -> m) -> Clown * k f a a -> m #

foldr :: (a -> b -> b) -> b -> Clown * k f a a -> b #

foldr' :: (a -> b -> b) -> b -> Clown * k f a a -> b #

foldl :: (b -> a -> b) -> b -> Clown * k f a a -> b #

foldl' :: (b -> a -> b) -> b -> Clown * k f a a -> b #

foldr1 :: (a -> a -> a) -> Clown * k f a a -> a #

foldl1 :: (a -> a -> a) -> Clown * k f a a -> a #

toList :: Clown * k f a a -> [a] #

null :: Clown * k f a a -> Bool #

length :: Clown * k f a a -> Int #

elem :: Eq a => a -> Clown * k f a a -> Bool #

maximum :: Ord a => Clown * k f a a -> a #

minimum :: Ord a => Clown * k f a a -> a #

sum :: Num a => Clown * k f a a -> a #

product :: Num a => Clown * k f a a -> a #

Traversable (Clown * k f a) Source # |
Methods traverse :: Applicative f => (a -> f b) -> Clown * k f a a -> f (Clown * k f a b) # sequenceA :: Applicative f => Clown * k f a (f a) -> f (Clown * k f a a) # mapM :: Monad m => (a -> m b) -> Clown * k f a a -> m (Clown * k f a b) # sequence :: Monad m => Clown * k f a (m a) -> m (Clown * k f a a) #
Generic1 (Clown * k f a) Source # |
Associated Types type Rep1 (Clown * k f a :: * -> *) :: * -> * # Methods from1 :: Clown * k f a a -> Rep1 (Clown * k f a) a # to1 :: Rep1 (Clown * k f a) a -> Clown * k f a a #
Eq (f a) => Eq (Clown k1 k f a b) Source # |
Methods (==) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool # (/=) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool #
Ord (f a) => Ord (Clown k1 k f a b) Source # |

Methods

compare :: Clown k1 k f a b -> Clown k1 k f a b -> Ordering #

(<) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool #

(<=) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool #

(>) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool #

(>=) :: Clown k1 k f a b -> Clown k1 k f a b -> Bool #

max :: Clown k1 k f a b -> Clown k1 k f a b -> Clown k1 k f a b #

min :: Clown k1 k f a b -> Clown k1 k f a b -> Clown k1 k f a b #

Read (f a) => Read (Clown k1 k f a b) Source # |
Methods readsPrec :: Int -> ReadS (Clown k1 k f a b) # readList :: ReadS [Clown k1 k f a b] # readPrec :: ReadPrec (Clown k1 k f a b) # readListPrec :: ReadPrec [Clown k1 k f a b] #
Show (f a) => Show (Clown k1 k f a b) Source # |
Methods showsPrec :: Int -> Clown k1 k f a b -> ShowS # show :: Clown k1 k f a b -> String # showList :: [Clown k1 k f a b] -> ShowS #
Generic (Clown k1 k f a b) Source # |
Associated Types type Rep (Clown k1 k f a b) :: * -> * # Methods from :: Clown k1 k f a b -> Rep (Clown k1 k f a b) x # to :: Rep (Clown k1 k f a b) x -> Clown k1 k f a b #
type Rep1 (Clown * k f a) Source # |
type Rep1 (Clown * k f a) = D1 (MetaData "Clown" "Data.Bifunctor.Clown" "bifunctors-5.4.2-D9NYUY1YNw7CNbta2tOtAS" True) (C1 (MetaCons "Clown" PrefixI True) (S1 (MetaSel (Just Symbol "runClown") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))))
type Rep (Clown k1 k f a b) Source # |
type Rep (Clown k1 k f a b) = D1 (MetaData "Clown" "Data.Bifunctor.Clown" "bifunctors-5.4.2-D9NYUY1YNw7CNbta2tOtAS" True) (C1 (MetaCons "Clown" PrefixI True) (S1 (MetaSel (Just Symbol "runClown") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))))