Data.Bifunctor.Clown

bifunctors-5.4.1: 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 #

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