praglude-0.4.1.0: A pragmatic Prelude

Safe HaskellNone
LanguageHaskell2010

Praglude

Contents

Synopsis

The Original Prelude

module Prelude

Monoids

class Monoid a where #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

  • mappend mempty x = x
  • mappend x mempty = x
  • mappend x (mappend y z) = mappend (mappend x y) z
  • mconcat = foldr mappend mempty

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

Minimal complete definition

mempty, mappend

Methods

mempty :: a #

Identity of mappend

mappend :: a -> a -> a #

An associative operation

mconcat :: [a] -> a #

Fold a list using the monoid. For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances

Monoid Ordering 
Monoid () 

Methods

mempty :: () #

mappend :: () -> () -> () #

mconcat :: [()] -> () #

Monoid ByteString 
Monoid ByteString 
Monoid Encoding 
Monoid Series 
Monoid Buffer 

Methods

mempty :: Buffer #

mappend :: Buffer -> Buffer -> Buffer #

mconcat :: [Buffer] -> Buffer #

Monoid Buffer 

Methods

mempty :: Buffer #

mappend :: Buffer -> Buffer -> Buffer #

mconcat :: [Buffer] -> Buffer #

Monoid More 

Methods

mempty :: More #

mappend :: More -> More -> More #

mconcat :: [More] -> More #

Monoid All 

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Monoid Any 

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Monoid ShortByteString 
Monoid [a] 

Methods

mempty :: [a] #

mappend :: [a] -> [a] -> [a] #

mconcat :: [[a]] -> [a] #

Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S." Since there is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Monoid a => Monoid (IO a) 

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

Monoid (IResult a) 

Methods

mempty :: IResult a #

mappend :: IResult a -> IResult a -> IResult a #

mconcat :: [IResult a] -> IResult a #

Monoid (Result a) 

Methods

mempty :: Result a #

mappend :: Result a -> Result a -> Result a #

mconcat :: [Result a] -> Result a #

Monoid (Parser a) 

Methods

mempty :: Parser a #

mappend :: Parser a -> Parser a -> Parser a #

mconcat :: [Parser a] -> Parser a #

Ord a => Monoid (Max a) 

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Ord a => Monoid (Min a) 

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

Monoid a => Monoid (Identity a) 

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

(Ord a, Bounded a) => Monoid (Min a) 

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

(Ord a, Bounded a) => Monoid (Max a) 

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Monoid m => Monoid (WrappedMonoid m) 
Semigroup a => Monoid (Option a) 

Methods

mempty :: Option a #

mappend :: Option a -> Option a -> Option a #

mconcat :: [Option a] -> Option a #

Monoid a => Monoid (Dual a) 

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Monoid (Endo a) 

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Num a => Monoid (Sum a) 

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Monoid (Product a) 

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Monoid (First a) 

Methods

mempty :: First a #

mappend :: First a -> First a -> First a #

mconcat :: [First a] -> First a #

Monoid (Last a) 

Methods

mempty :: Last a #

mappend :: Last a -> Last a -> Last a #

mconcat :: [Last a] -> Last a #

Monoid (Seq a) 

Methods

mempty :: Seq a #

mappend :: Seq a -> Seq a -> Seq a #

mconcat :: [Seq a] -> Seq a #

Ord a => Monoid (Set a) 

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

Monoid (Comparison a) 
Monoid (Equivalence a) 
Monoid (DList a) 

Methods

mempty :: DList a #

mappend :: DList a -> DList a -> DList a #

mconcat :: [DList a] -> DList a #

Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

(Hashable a, Eq a) => Monoid (HashSet a) 

Methods

mempty :: HashSet a #

mappend :: HashSet a -> HashSet a -> HashSet a #

mconcat :: [HashSet a] -> HashSet a #

Ord a => Monoid (Min a) 

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

Ord a => Monoid (Max a) 

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Monoid (Leftmost a) 

Methods

mempty :: Leftmost a #

mappend :: Leftmost a -> Leftmost a -> Leftmost a #

mconcat :: [Leftmost a] -> Leftmost a #

Monoid (Rightmost a) 
Monoid b => Monoid (a -> b) 

Methods

mempty :: a -> b #

mappend :: (a -> b) -> (a -> b) -> a -> b #

mconcat :: [a -> b] -> a -> b #

(Monoid a, Monoid b) => Monoid (a, b) 

Methods

mempty :: (a, b) #

mappend :: (a, b) -> (a, b) -> (a, b) #

mconcat :: [(a, b)] -> (a, b) #

Monoid a => Monoid (Op a b) 

Methods

mempty :: Op a b #

mappend :: Op a b -> Op a b -> Op a b #

mconcat :: [Op a b] -> Op a b #

(Eq k, Hashable k) => Monoid (HashMap k v) 

Methods

mempty :: HashMap k v #

mappend :: HashMap k v -> HashMap k v -> HashMap k v #

mconcat :: [HashMap k v] -> HashMap k v #

Ord k => Monoid (Map k v) 

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

Monoid (Parser i a) 

Methods

mempty :: Parser i a #

mappend :: Parser i a -> Parser i a -> Parser i a #

mconcat :: [Parser i a] -> Parser i a #

Monoid (Proxy k s) 

Methods

mempty :: Proxy k s #

mappend :: Proxy k s -> Proxy k s -> Proxy k s #

mconcat :: [Proxy k s] -> Proxy k s #

Monoid (ReifiedFold s a) 

Methods

mempty :: ReifiedFold s a #

mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

mconcat :: [ReifiedFold s a] -> ReifiedFold s a #

(Contravariant f, Applicative f) => Monoid (Folding f a) 

Methods

mempty :: Folding f a #

mappend :: Folding f a -> Folding f a -> Folding f a #

mconcat :: [Folding f a] -> Folding f a #

Applicative f => Monoid (Traversed a f) 

Methods

mempty :: Traversed a f #

mappend :: Traversed a f -> Traversed a f -> Traversed a f #

mconcat :: [Traversed a f] -> Traversed a f #

Monad m => Monoid (Sequenced a m) 

Methods

mempty :: Sequenced a m #

mappend :: Sequenced a m -> Sequenced a m -> Sequenced a m #

mconcat :: [Sequenced a m] -> Sequenced a m #

Monoid (Deepening i a)

This is an illegal Monoid.

Methods

mempty :: Deepening i a #

mappend :: Deepening i a -> Deepening i a -> Deepening i a #

mconcat :: [Deepening i a] -> Deepening i a #

(Hashable k, Eq k) => Monoid (LHashMap k v) # 

Methods

mempty :: LHashMap k v #

mappend :: LHashMap k v -> LHashMap k v -> LHashMap k v #

mconcat :: [LHashMap k v] -> LHashMap k v #

(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) 

Methods

mempty :: (a, b, c) #

mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) #

mconcat :: [(a, b, c)] -> (a, b, c) #

Monoid a => Monoid (Const k a b) 

Methods

mempty :: Const k a b #

mappend :: Const k a b -> Const k a b -> Const k a b #

mconcat :: [Const k a b] -> Const k a b #

Alternative f => Monoid (Alt * f a) 

Methods

mempty :: Alt * f a #

mappend :: Alt * f a -> Alt * f a -> Alt * f a #

mconcat :: [Alt * f a] -> Alt * f a #

Monoid (ReifiedIndexedFold i s a) 
ArrowPlus p => Monoid (Tambara p a b) 

Methods

mempty :: Tambara p a b #

mappend :: Tambara p a b -> Tambara p a b -> Tambara p a b #

mconcat :: [Tambara p a b] -> Tambara p a b #

Reifies k s (ReifiedMonoid a) => Monoid (ReflectedMonoid k a s) 
(Semigroup a, Monoid a) => Monoid (Tagged k s a) 

Methods

mempty :: Tagged k s a #

mappend :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mconcat :: [Tagged k s a] -> Tagged k s a #

(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) 

Methods

mempty :: (a, b, c, d) #

mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

mconcat :: [(a, b, c, d)] -> (a, b, c, d) #

(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) 

Methods

mempty :: (a, b, c, d, e) #

mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

Contravariant g => Monoid (BazaarT p g a b t) 

Methods

mempty :: BazaarT p g a b t #

mappend :: BazaarT p g a b t -> BazaarT p g a b t -> BazaarT p g a b t #

mconcat :: [BazaarT p g a b t] -> BazaarT p g a b t #

(<>) :: Semigroup a => a -> a -> a #

An associative operation.

(a <> b) <> c = a <> (b <> c)

If a is also a Monoid we further require

(<>) = mappend

newtype Dual a :: * -> * #

The dual of a Monoid, obtained by swapping the arguments of mappend.

Constructors

Dual 

Fields

Instances

Monad Dual 

Methods

(>>=) :: Dual a -> (a -> Dual b) -> Dual b #

(>>) :: Dual a -> Dual b -> Dual b #

return :: a -> Dual a #

fail :: String -> Dual a #

Functor Dual 

Methods

fmap :: (a -> b) -> Dual a -> Dual b #

(<$) :: a -> Dual b -> Dual a #

Applicative Dual 

Methods

pure :: a -> Dual a #

(<*>) :: Dual (a -> b) -> Dual a -> Dual b #

(*>) :: Dual a -> Dual b -> Dual b #

(<*) :: Dual a -> Dual b -> Dual a #

Foldable Dual 

Methods

fold :: Monoid m => Dual m -> m #

foldMap :: Monoid m => (a -> m) -> Dual a -> m #

foldr :: (a -> b -> b) -> b -> Dual a -> b #

foldr' :: (a -> b -> b) -> b -> Dual a -> b #

foldl :: (b -> a -> b) -> b -> Dual a -> b #

foldl' :: (b -> a -> b) -> b -> Dual a -> b #

foldr1 :: (a -> a -> a) -> Dual a -> a #

foldl1 :: (a -> a -> a) -> Dual a -> a #

toList :: Dual a -> [a] #

null :: Dual a -> Bool #

length :: Dual a -> Int #

elem :: Eq a => a -> Dual a -> Bool #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

sum :: Num a => Dual a -> a #

product :: Num a => Dual a -> a #

Traversable Dual 

Methods

traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) #

sequenceA :: Applicative f => Dual (f a) -> f (Dual a) #

mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) #

sequence :: Monad m => Dual (m a) -> m (Dual a) #

Generic1 Dual 

Associated Types

type Rep1 (Dual :: * -> *) :: * -> * #

Methods

from1 :: Dual a -> Rep1 Dual a #

to1 :: Rep1 Dual a -> Dual a #

Representable Dual 

Associated Types

type Rep (Dual :: * -> *) :: * #

Methods

tabulate :: (Rep Dual -> a) -> Dual a #

index :: Dual a -> Rep Dual -> a #

Bounded a => Bounded (Dual a) 

Methods

minBound :: Dual a #

maxBound :: Dual a #

Eq a => Eq (Dual a) 

Methods

(==) :: Dual a -> Dual a -> Bool #

(/=) :: Dual a -> Dual a -> Bool #

Data a => Data (Dual a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dual a -> c (Dual a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dual a) #

toConstr :: Dual a -> Constr #

dataTypeOf :: Dual a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Dual a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dual a)) #

gmapT :: (forall b. Data b => b -> b) -> Dual a -> Dual a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dual a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dual a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) #

Ord a => Ord (Dual a) 

Methods

compare :: Dual a -> Dual a -> Ordering #

(<) :: Dual a -> Dual a -> Bool #

(<=) :: Dual a -> Dual a -> Bool #

(>) :: Dual a -> Dual a -> Bool #

(>=) :: Dual a -> Dual a -> Bool #

max :: Dual a -> Dual a -> Dual a #

min :: Dual a -> Dual a -> Dual a #

Read a => Read (Dual a) 
Show a => Show (Dual a) 

Methods

showsPrec :: Int -> Dual a -> ShowS #

show :: Dual a -> String #

showList :: [Dual a] -> ShowS #

Generic (Dual a) 

Associated Types

type Rep (Dual a) :: * -> * #

Methods

from :: Dual a -> Rep (Dual a) x #

to :: Rep (Dual a) x -> Dual a #

Semigroup a => Semigroup (Dual a) 

Methods

(<>) :: Dual a -> Dual a -> Dual a #

sconcat :: NonEmpty (Dual a) -> Dual a #

stimes :: Integral b => b -> Dual a -> Dual a #

Monoid a => Monoid (Dual a) 

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Default a => Default (Dual a) 

Methods

def :: Dual a #

NFData a => NFData (Dual a)

Since: 1.4.0.0

Methods

rnf :: Dual a -> () #

AsEmpty a => AsEmpty (Dual a) 

Methods

_Empty :: Prism' (Dual a) () #

Wrapped (Dual a) 

Associated Types

type Unwrapped (Dual a) :: * #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

(~) * t (Dual b) => Rewrapped (Dual a) t 
type Rep1 Dual 
type Rep1 Dual = D1 (MetaData "Dual" "Data.Monoid" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just Symbol "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep Dual 
type Rep Dual = ()
type Rep (Dual a) 
type Rep (Dual a) = D1 (MetaData "Dual" "Data.Monoid" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just Symbol "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Dual a) 
type Unwrapped (Dual a) = a

newtype Endo a :: * -> * #

The monoid of endomorphisms under composition.

Constructors

Endo 

Fields

Instances

Generic (Endo a) 

Associated Types

type Rep (Endo a) :: * -> * #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Semigroup (Endo a) 

Methods

(<>) :: Endo a -> Endo a -> Endo a #

sconcat :: NonEmpty (Endo a) -> Endo a #

stimes :: Integral b => b -> Endo a -> Endo a #

Monoid (Endo a) 

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Default (Endo a) 

Methods

def :: Endo a #

Wrapped (Endo a) 

Associated Types

type Unwrapped (Endo a) :: * #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

(~) * t (Endo b) => Rewrapped (Endo b) t 
type Rep (Endo a) 
type Rep (Endo a) = D1 (MetaData "Endo" "Data.Monoid" "base" True) (C1 (MetaCons "Endo" PrefixI True) (S1 (MetaSel (Just Symbol "appEndo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a -> a))))
type Unwrapped (Endo a) 
type Unwrapped (Endo a) = a -> a

newtype All :: * #

Boolean monoid under conjunction (&&).

Constructors

All 

Fields

Instances

Bounded All 

Methods

minBound :: All #

maxBound :: All #

Eq All 

Methods

(==) :: All -> All -> Bool #

(/=) :: All -> All -> Bool #

Data All 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All #

toConstr :: All -> Constr #

dataTypeOf :: All -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c All) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) #

gmapT :: (forall b. Data b => b -> b) -> All -> All #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r #

gmapQ :: (forall d. Data d => d -> u) -> All -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All #

Ord All 

Methods

compare :: All -> All -> Ordering #

(<) :: All -> All -> Bool #

(<=) :: All -> All -> Bool #

(>) :: All -> All -> Bool #

(>=) :: All -> All -> Bool #

max :: All -> All -> All #

min :: All -> All -> All #

Read All 
Show All 

Methods

showsPrec :: Int -> All -> ShowS #

show :: All -> String #

showList :: [All] -> ShowS #

Generic All 

Associated Types

type Rep All :: * -> * #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Semigroup All 

Methods

(<>) :: All -> All -> All #

sconcat :: NonEmpty All -> All #

stimes :: Integral b => b -> All -> All #

Monoid All 

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Default All 

Methods

def :: All #

NFData All

Since: 1.4.0.0

Methods

rnf :: All -> () #

AsEmpty All 

Methods

_Empty :: Prism' All () #

Wrapped All 

Associated Types

type Unwrapped All :: * #

(~) * t All => Rewrapped All t 
type Rep All 
type Rep All = D1 (MetaData "All" "Data.Monoid" "base" True) (C1 (MetaCons "All" PrefixI True) (S1 (MetaSel (Just Symbol "getAll") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))
type Unwrapped All 

newtype Any :: * #

Boolean monoid under disjunction (||).

Constructors

Any 

Fields

Instances

Bounded Any 

Methods

minBound :: Any #

maxBound :: Any #

Eq Any 

Methods

(==) :: Any -> Any -> Bool #

(/=) :: Any -> Any -> Bool #

Data Any 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any #

toConstr :: Any -> Constr #

dataTypeOf :: Any -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Any) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) #

gmapT :: (forall b. Data b => b -> b) -> Any -> Any #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r #

gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any #

Ord Any 

Methods

compare :: Any -> Any -> Ordering #

(<) :: Any -> Any -> Bool #

(<=) :: Any -> Any -> Bool #

(>) :: Any -> Any -> Bool #

(>=) :: Any -> Any -> Bool #

max :: Any -> Any -> Any #

min :: Any -> Any -> Any #

Read Any 
Show Any 

Methods

showsPrec :: Int -> Any -> ShowS #

show :: Any -> String #

showList :: [Any] -> ShowS #

Generic Any 

Associated Types

type Rep Any :: * -> * #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Semigroup Any 

Methods

(<>) :: Any -> Any -> Any #

sconcat :: NonEmpty Any -> Any #

stimes :: Integral b => b -> Any -> Any #

Monoid Any 

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Default Any 

Methods

def :: Any #

NFData Any

Since: 1.4.0.0

Methods

rnf :: Any -> () #

AsEmpty Any 

Methods

_Empty :: Prism' Any () #

Wrapped Any 

Associated Types

type Unwrapped Any :: * #

(~) * t Any => Rewrapped Any t 
type Rep Any 
type Rep Any = D1 (MetaData "Any" "Data.Monoid" "base" True) (C1 (MetaCons "Any" PrefixI True) (S1 (MetaSel (Just Symbol "getAny") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))
type Unwrapped Any 

newtype Sum a :: * -> * #

Monoid under addition.

Constructors

Sum 

Fields

Instances

Monad Sum 

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b #

(>>) :: Sum a -> Sum b -> Sum b #

return :: a -> Sum a #

fail :: String -> Sum a #

Functor Sum 

Methods

fmap :: (a -> b) -> Sum a -> Sum b #

(<$) :: a -> Sum b -> Sum a #

Applicative Sum 

Methods

pure :: a -> Sum a #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b #

(*>) :: Sum a -> Sum b -> Sum b #

(<*) :: Sum a -> Sum b -> Sum a #

Foldable Sum 

Methods

fold :: Monoid m => Sum m -> m #

foldMap :: Monoid m => (a -> m) -> Sum a -> m #

foldr :: (a -> b -> b) -> b -> Sum a -> b #

foldr' :: (a -> b -> b) -> b -> Sum a -> b #

foldl :: (b -> a -> b) -> b -> Sum a -> b #

foldl' :: (b -> a -> b) -> b -> Sum a -> b #

foldr1 :: (a -> a -> a) -> Sum a -> a #

foldl1 :: (a -> a -> a) -> Sum a -> a #

toList :: Sum a -> [a] #

null :: Sum a -> Bool #

length :: Sum a -> Int #

elem :: Eq a => a -> Sum a -> Bool #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

sum :: Num a => Sum a -> a #

product :: Num a => Sum a -> a #

Traversable Sum 

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) #

mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) #

sequence :: Monad m => Sum (m a) -> m (Sum a) #

Generic1 Sum 

Associated Types

type Rep1 (Sum :: * -> *) :: * -> * #

Methods

from1 :: Sum a -> Rep1 Sum a #

to1 :: Rep1 Sum a -> Sum a #

Representable Sum 

Associated Types

type Rep (Sum :: * -> *) :: * #

Methods

tabulate :: (Rep Sum -> a) -> Sum a #

index :: Sum a -> Rep Sum -> a #

Bounded a => Bounded (Sum a) 

Methods

minBound :: Sum a #

maxBound :: Sum a #

Eq a => Eq (Sum a) 

Methods

(==) :: Sum a -> Sum a -> Bool #

(/=) :: Sum a -> Sum a -> Bool #

Data a => Data (Sum a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum a -> c (Sum a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum a) #

toConstr :: Sum a -> Constr #

dataTypeOf :: Sum a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Sum a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum a)) #

gmapT :: (forall b. Data b => b -> b) -> Sum a -> Sum a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Sum a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) #

Num a => Num (Sum a) 

Methods

(+) :: Sum a -> Sum a -> Sum a #

(-) :: Sum a -> Sum a -> Sum a #

(*) :: Sum a -> Sum a -> Sum a #

negate :: Sum a -> Sum a #

abs :: Sum a -> Sum a #

signum :: Sum a -> Sum a #

fromInteger :: Integer -> Sum a #

Ord a => Ord (Sum a) 

Methods

compare :: Sum a -> Sum a -> Ordering #

(<) :: Sum a -> Sum a -> Bool #

(<=) :: Sum a -> Sum a -> Bool #

(>) :: Sum a -> Sum a -> Bool #

(>=) :: Sum a -> Sum a -> Bool #

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Read a => Read (Sum a) 
Show a => Show (Sum a) 

Methods

showsPrec :: Int -> Sum a -> ShowS #

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

Generic (Sum a) 

Associated Types

type Rep (Sum a) :: * -> * #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

Num a => Semigroup (Sum a) 

Methods

(<>) :: Sum a -> Sum a -> Sum a #

sconcat :: NonEmpty (Sum a) -> Sum a #

stimes :: Integral b => b -> Sum a -> Sum a #

Num a => Monoid (Sum a) 

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Default (Sum a) 

Methods

def :: Sum a #

NFData a => NFData (Sum a)

Since: 1.4.0.0

Methods

rnf :: Sum a -> () #

(Eq a, Num a) => AsEmpty (Sum a) 

Methods

_Empty :: Prism' (Sum a) () #

Wrapped (Sum a) 

Associated Types

type Unwrapped (Sum a) :: * #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

(~) * t (Sum b) => Rewrapped (Sum a) t 
type Rep1 Sum 
type Rep1 Sum = D1 (MetaData "Sum" "Data.Monoid" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just Symbol "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep Sum 
type Rep Sum = ()
type Rep (Sum a) 
type Rep (Sum a) = D1 (MetaData "Sum" "Data.Monoid" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just Symbol "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Sum a) 
type Unwrapped (Sum a) = a

newtype Product a :: * -> * #

Monoid under multiplication.

Constructors

Product 

Fields

Instances

Monad Product 

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b #

(>>) :: Product a -> Product b -> Product b #

return :: a -> Product a #

fail :: String -> Product a #

Functor Product 

Methods

fmap :: (a -> b) -> Product a -> Product b #

(<$) :: a -> Product b -> Product a #

Applicative Product 

Methods

pure :: a -> Product a #

(<*>) :: Product (a -> b) -> Product a -> Product b #

(*>) :: Product a -> Product b -> Product b #

(<*) :: Product a -> Product b -> Product a #

Foldable Product 

Methods

fold :: Monoid m => Product m -> m #

foldMap :: Monoid m => (a -> m) -> Product a -> m #

foldr :: (a -> b -> b) -> b -> Product a -> b #

foldr' :: (a -> b -> b) -> b -> Product a -> b #

foldl :: (b -> a -> b) -> b -> Product a -> b #

foldl' :: (b -> a -> b) -> b -> Product a -> b #

foldr1 :: (a -> a -> a) -> Product a -> a #

foldl1 :: (a -> a -> a) -> Product a -> a #

toList :: Product a -> [a] #

null :: Product a -> Bool #

length :: Product a -> Int #

elem :: Eq a => a -> Product a -> Bool #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

sum :: Num a => Product a -> a #

product :: Num a => Product a -> a #

Traversable Product 

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) #

sequenceA :: Applicative f => Product (f a) -> f (Product a) #

mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) #

sequence :: Monad m => Product (m a) -> m (Product a) #

Generic1 Product 

Associated Types

type Rep1 (Product :: * -> *) :: * -> * #

Methods

from1 :: Product a -> Rep1 Product a #

to1 :: Rep1 Product a -> Product a #

Representable Product 

Associated Types

type Rep (Product :: * -> *) :: * #

Methods

tabulate :: (Rep Product -> a) -> Product a #

index :: Product a -> Rep Product -> a #

Bounded a => Bounded (Product a) 
Eq a => Eq (Product a) 

Methods

(==) :: Product a -> Product a -> Bool #

(/=) :: Product a -> Product a -> Bool #

Data a => Data (Product a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Product a -> c (Product a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product a) #

toConstr :: Product a -> Constr #

dataTypeOf :: Product a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Product a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product a)) #

gmapT :: (forall b. Data b => b -> b) -> Product a -> Product a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Product a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Product a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) #

Num a => Num (Product a) 

Methods

(+) :: Product a -> Product a -> Product a #

(-) :: Product a -> Product a -> Product a #

(*) :: Product a -> Product a -> Product a #

negate :: Product a -> Product a #

abs :: Product a -> Product a #

signum :: Product a -> Product a #

fromInteger :: Integer -> Product a #

Ord a => Ord (Product a) 

Methods

compare :: Product a -> Product a -> Ordering #

(<) :: Product a -> Product a -> Bool #

(<=) :: Product a -> Product a -> Bool #

(>) :: Product a -> Product a -> Bool #

(>=) :: Product a -> Product a -> Bool #

max :: Product a -> Product a -> Product a #

min :: Product a -> Product a -> Product a #

Read a => Read (Product a) 
Show a => Show (Product a) 

Methods

showsPrec :: Int -> Product a -> ShowS #

show :: Product a -> String #

showList :: [Product a] -> ShowS #

Generic (Product a) 

Associated Types

type Rep (Product a) :: * -> * #

Methods

from :: Product a -> Rep (Product a) x #

to :: Rep (Product a) x -> Product a #

Num a => Semigroup (Product a) 

Methods

(<>) :: Product a -> Product a -> Product a #

sconcat :: NonEmpty (Product a) -> Product a #

stimes :: Integral b => b -> Product a -> Product a #

Num a => Monoid (Product a) 

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Num a => Default (Product a) 

Methods

def :: Product a #

NFData a => NFData (Product a)

Since: 1.4.0.0

Methods

rnf :: Product a -> () #

(Eq a, Num a) => AsEmpty (Product a) 

Methods

_Empty :: Prism' (Product a) () #

Wrapped (Product a) 

Associated Types

type Unwrapped (Product a) :: * #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

(~) * t (Product b) => Rewrapped (Product a) t 
type Rep1 Product 
type Rep1 Product = D1 (MetaData "Product" "Data.Monoid" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just Symbol "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep Product 
type Rep Product = ()
type Rep (Product a) 
type Rep (Product a) = D1 (MetaData "Product" "Data.Monoid" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just Symbol "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Product a) 
type Unwrapped (Product a) = a

newtype First a :: * -> * #

Use Option (First a) to get the behavior of First from Data.Monoid.

Constructors

First 

Fields

Instances

Monad First 

Methods

(>>=) :: First a -> (a -> First b) -> First b #

(>>) :: First a -> First b -> First b #

return :: a -> First a #

fail :: String -> First a #

Functor First 

Methods

fmap :: (a -> b) -> First a -> First b #

(<$) :: a -> First b -> First a #

MonadFix First 

Methods

mfix :: (a -> First a) -> First a #

Applicative First 

Methods

pure :: a -> First a #

(<*>) :: First (a -> b) -> First a -> First b #

(*>) :: First a -> First b -> First b #

(<*) :: First a -> First b -> First a #

Foldable First 

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Traversable First 

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) #

sequenceA :: Applicative f => First (f a) -> f (First a) #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) #

sequence :: Monad m => First (m a) -> m (First a) #

Generic1 First 

Associated Types

type Rep1 (First :: * -> *) :: * -> * #

Methods

from1 :: First a -> Rep1 First a #

to1 :: Rep1 First a -> First a #

Bounded a => Bounded (First a) 

Methods

minBound :: First a #

maxBound :: First a #

Enum a => Enum (First a) 

Methods

succ :: First a -> First a #

pred :: First a -> First a #

toEnum :: Int -> First a #

fromEnum :: First a -> Int #

enumFrom :: First a -> [First a] #

enumFromThen :: First a -> First a -> [First a] #

enumFromTo :: First a -> First a -> [First a] #

enumFromThenTo :: First a -> First a -> First a -> [First a] #

Eq a => Eq (First a) 

Methods

(==) :: First a -> First a -> Bool #

(/=) :: First a -> First a -> Bool #

Data a => Data (First a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) #

toConstr :: First a -> Constr #

dataTypeOf :: First a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) #

gmapT :: (forall b. Data b => b -> b) -> First a -> First a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #

gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

Ord a => Ord (First a) 

Methods

compare :: First a -> First a -> Ordering #

(<) :: First a -> First a -> Bool #

(<=) :: First a -> First a -> Bool #

(>) :: First a -> First a -> Bool #

(>=) :: First a -> First a -> Bool #

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Read a => Read (First a) 
Show a => Show (First a) 

Methods

showsPrec :: Int -> First a -> ShowS #

show :: First a -> String #

showList :: [First a] -> ShowS #

Generic (First a) 

Associated Types

type Rep (First a) :: * -> * #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Semigroup (First a) 

Methods

(<>) :: First a -> First a -> First a #

sconcat :: NonEmpty (First a) -> First a #

stimes :: Integral b => b -> First a -> First a #

NFData a => NFData (First a)

Since: 1.4.2.0

Methods

rnf :: First a -> () #

Hashable a => Hashable (First a) 

Methods

hashWithSalt :: Int -> First a -> Int #

hash :: First a -> Int #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

(~) * t (First b) => Rewrapped (First a) t 
type Rep1 First 
type Rep1 First = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just Symbol "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (First a) 
type Rep (First a) = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just Symbol "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (First a) 
type Unwrapped (First a) = a

newtype Alt k f a :: forall k. (k -> *) -> k -> * #

Monoid under <|>.

Since: 4.8.0.0

Constructors

Alt 

Fields

Instances

Monad f => Monad (Alt * f) 

Methods

(>>=) :: Alt * f a -> (a -> Alt * f b) -> Alt * f b #

(>>) :: Alt * f a -> Alt * f b -> Alt * f b #

return :: a -> Alt * f a #

fail :: String -> Alt * f a #

Functor f => Functor (Alt * f) 

Methods

fmap :: (a -> b) -> Alt * f a -> Alt * f b #

(<$) :: a -> Alt * f b -> Alt * f a #

Applicative f => Applicative (Alt * f) 

Methods

pure :: a -> Alt * f a #

(<*>) :: Alt * f (a -> b) -> Alt * f a -> Alt * f b #

(*>) :: Alt * f a -> Alt * f b -> Alt * f b #

(<*) :: Alt * f a -> Alt * f b -> Alt * f a #

Generic1 (Alt * f) 

Associated Types

type Rep1 (Alt * f :: * -> *) :: * -> * #

Methods

from1 :: Alt * f a -> Rep1 (Alt * f) a #

to1 :: Rep1 (Alt * f) a -> Alt * f a #

Contravariant f => Contravariant (Alt * f) 

Methods

contramap :: (a -> b) -> Alt * f b -> Alt * f a #

(>$) :: b -> Alt * f b -> Alt * f a #

Alternative f => Alternative (Alt * f) 

Methods

empty :: Alt * f a #

(<|>) :: Alt * f a -> Alt * f a -> Alt * f a #

some :: Alt * f a -> Alt * f [a] #

many :: Alt * f a -> Alt * f [a] #

MonadPlus f => MonadPlus (Alt * f) 

Methods

mzero :: Alt * f a #

mplus :: Alt * f a -> Alt * f a -> Alt * f a #

Enum (f a) => Enum (Alt k f a) 

Methods

succ :: Alt k f a -> Alt k f a #

pred :: Alt k f a -> Alt k f a #

toEnum :: Int -> Alt k f a #

fromEnum :: Alt k f a -> Int #

enumFrom :: Alt k f a -> [Alt k f a] #

enumFromThen :: Alt k f a -> Alt k f a -> [Alt k f a] #

enumFromTo :: Alt k f a -> Alt k f a -> [Alt k f a] #

enumFromThenTo :: Alt k f a -> Alt k f a -> Alt k f a -> [Alt k f a] #

Eq (f a) => Eq (Alt k f a) 

Methods

(==) :: Alt k f a -> Alt k f a -> Bool #

(/=) :: Alt k f a -> Alt k f a -> Bool #

(Data (f a), Data a, Typeable (* -> *) f) => Data (Alt * f a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alt * f a -> c (Alt * f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alt * f a) #

toConstr :: Alt * f a -> Constr #

dataTypeOf :: Alt * f a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Alt * f a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alt * f a)) #

gmapT :: (forall b. Data b => b -> b) -> Alt * f a -> Alt * f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alt * f a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alt * f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Alt * f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Alt * f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alt * f a -> m (Alt * f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt * f a -> m (Alt * f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt * f a -> m (Alt * f a) #

Num (f a) => Num (Alt k f a) 

Methods

(+) :: Alt k f a -> Alt k f a -> Alt k f a #

(-) :: Alt k f a -> Alt k f a -> Alt k f a #

(*) :: Alt k f a -> Alt k f a -> Alt k f a #

negate :: Alt k f a -> Alt k f a #

abs :: Alt k f a -> Alt k f a #

signum :: Alt k f a -> Alt k f a #

fromInteger :: Integer -> Alt k f a #

Ord (f a) => Ord (Alt k f a) 

Methods

compare :: Alt k f a -> Alt k f a -> Ordering #

(<) :: Alt k f a -> Alt k f a -> Bool #

(<=) :: Alt k f a -> Alt k f a -> Bool #

(>) :: Alt k f a -> Alt k f a -> Bool #

(>=) :: Alt k f a -> Alt k f a -> Bool #

max :: Alt k f a -> Alt k f a -> Alt k f a #

min :: Alt k f a -> Alt k f a -> Alt k f a #

Read (f a) => Read (Alt k f a) 

Methods

readsPrec :: Int -> ReadS (Alt k f a) #

readList :: ReadS [Alt k f a] #

readPrec :: ReadPrec (Alt k f a) #

readListPrec :: ReadPrec [Alt k f a] #

Show (f a) => Show (Alt k f a) 

Methods

showsPrec :: Int -> Alt k f a -> ShowS #

show :: Alt k f a -> String #

showList :: [Alt k f a] -> ShowS #

Generic (Alt k f a) 

Associated Types

type Rep (Alt k f a) :: * -> * #

Methods

from :: Alt k f a -> Rep (Alt k f a) x #

to :: Rep (Alt k f a) x -> Alt k f a #

Alternative f => Semigroup (Alt * f a) 

Methods

(<>) :: Alt * f a -> Alt * f a -> Alt * f a #

sconcat :: NonEmpty (Alt * f a) -> Alt * f a #

stimes :: Integral b => b -> Alt * f a -> Alt * f a #

Alternative f => Monoid (Alt * f a) 

Methods

mempty :: Alt * f a #

mappend :: Alt * f a -> Alt * f a -> Alt * f a #

mconcat :: [Alt * f a] -> Alt * f a #

Wrapped (Alt k f a) 

Associated Types

type Unwrapped (Alt k f a) :: * #

Methods

_Wrapped' :: Iso' (Alt k f a) (Unwrapped (Alt k f a)) #

(~) * t (Alt k1 g b) => Rewrapped (Alt k f a) t 
type Rep1 (Alt * f) 
type Rep1 (Alt * f) = D1 (MetaData "Alt" "Data.Monoid" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just Symbol "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 f)))
type Rep (Alt k f a) 
type Rep (Alt k f a) = D1 (MetaData "Alt" "Data.Monoid" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just Symbol "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))))
type Unwrapped (Alt k f a) 
type Unwrapped (Alt k f a) = f a

concat :: Monoid a => [a] -> a Source #

append :: Monoid a => a -> a -> a Source #

empty :: Monoid a => a Source #

Maybe

data Maybe a :: * -> * #

The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.

The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.

Constructors

Nothing 
Just a 

Instances

Monad Maybe 

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

(>>) :: Maybe a -> Maybe b -> Maybe b #

return :: a -> Maybe a #

fail :: String -> Maybe a #

Functor Maybe 

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

Applicative Maybe 

Methods

pure :: a -> Maybe a #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

(*>) :: Maybe a -> Maybe b -> Maybe b #

(<*) :: Maybe a -> Maybe b -> Maybe a #

Foldable Maybe 

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Traversable Maybe 

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) #

Generic1 Maybe 

Associated Types

type Rep1 (Maybe :: * -> *) :: * -> * #

Methods

from1 :: Maybe a -> Rep1 Maybe a #

to1 :: Rep1 Maybe a -> Maybe a #

Alternative Maybe 

Methods

empty :: Maybe a #

(<|>) :: Maybe a -> Maybe a -> Maybe a #

some :: Maybe a -> Maybe [a] #

many :: Maybe a -> Maybe [a] #

MonadPlus Maybe 

Methods

mzero :: Maybe a #

mplus :: Maybe a -> Maybe a -> Maybe a #

Eq1 Maybe 

Methods

liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #

Ord1 Maybe 

Methods

liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #

Read1 Maybe 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] #

Show1 Maybe 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #

Hashable1 Maybe 

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Maybe a -> Int #

Apply Maybe 

Methods

(<.>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

(.>) :: Maybe a -> Maybe b -> Maybe b #

(<.) :: Maybe a -> Maybe b -> Maybe a #

Bind Maybe 

Methods

(>>-) :: Maybe a -> (a -> Maybe b) -> Maybe b #

join :: Maybe (Maybe a) -> Maybe a #

FunctorWithIndex () Maybe 

Methods

imap :: (() -> a -> b) -> Maybe a -> Maybe b #

imapped :: (Indexable () p, Settable f) => p a (f b) -> Maybe a -> f (Maybe b) #

FoldableWithIndex () Maybe 

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Maybe a -> m #

ifolded :: (Indexable () p, Contravariant f, Applicative f) => p a (f a) -> Maybe a -> f (Maybe a) #

ifoldr :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Maybe a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Maybe a -> b #

TraversableWithIndex () Maybe 

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Maybe a -> f (Maybe b) #

itraversed :: (Indexable () p, Applicative f) => p a (f b) -> Maybe a -> f (Maybe b) #

Eq a => Eq (Maybe a) 

Methods

(==) :: Maybe a -> Maybe a -> Bool #

(/=) :: Maybe a -> Maybe a -> Bool #

Data a => Data (Maybe a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) #

toConstr :: Maybe a -> Constr #

dataTypeOf :: Maybe a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) #

gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #

Ord a => Ord (Maybe a) 

Methods

compare :: Maybe a -> Maybe a -> Ordering #

(<) :: Maybe a -> Maybe a -> Bool #

(<=) :: Maybe a -> Maybe a -> Bool #

(>) :: Maybe a -> Maybe a -> Bool #

(>=) :: Maybe a -> Maybe a -> Bool #

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Read a => Read (Maybe a) 
Show a => Show (Maybe a) 

Methods

showsPrec :: Int -> Maybe a -> ShowS #

show :: Maybe a -> String #

showList :: [Maybe a] -> ShowS #

Generic (Maybe a) 

Associated Types

type Rep (Maybe a) :: * -> * #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Semigroup a => Semigroup (Maybe a) 

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a #

sconcat :: NonEmpty (Maybe a) -> Maybe a #

stimes :: Integral b => b -> Maybe a -> Maybe a #

Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S." Since there is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Lift a => Lift (Maybe a) 

Methods

lift :: Maybe a -> Q Exp #

FromJSON a => LookupField (Maybe a) 

Methods

lookupField :: String -> String -> Object -> Text -> Parser (Maybe a)

Default (Maybe a) 

Methods

def :: Maybe a #

NFData a => NFData (Maybe a) 

Methods

rnf :: Maybe a -> () #

Hashable a => Hashable (Maybe a) 

Methods

hashWithSalt :: Int -> Maybe a -> Int #

hash :: Maybe a -> Int #

Ixed (Maybe a) 

Methods

ix :: Index (Maybe a) -> Traversal' (Maybe a) (IxValue (Maybe a)) #

At (Maybe a) 

Methods

at :: Index (Maybe a) -> Lens' (Maybe a) (Maybe (IxValue (Maybe a))) #

AsEmpty (Maybe a) 

Methods

_Empty :: Prism' (Maybe a) () #

SingI (Maybe a) (Nothing a) 

Methods

sing :: Sing (Nothing a) a

SingKind a (KProxy a) => SingKind (Maybe a) (KProxy (Maybe a)) 

Associated Types

type DemoteRep (KProxy (Maybe a)) (kparam :: KProxy (KProxy (Maybe a))) :: *

Methods

fromSing :: Sing (KProxy (Maybe a)) a -> DemoteRep (KProxy (Maybe a)) kparam

Each (Maybe a) (Maybe b) a b
each :: Traversal (Maybe a) (Maybe b) a b

Methods

each :: Traversal (Maybe a) (Maybe b) a b #

SingI a a1 => SingI (Maybe a) (Just a a1) 

Methods

sing :: Sing (Just a a1) a

(Selector Meta s, ToJSON a) => RecordToPairs (S1 s (K1 i (Maybe a))) 

Methods

recordToPairs :: Options -> S1 s (K1 i (Maybe a)) a -> DList Pair

(Selector Meta s, ToJSON a) => RecordToEncoding (S1 s (K1 i (Maybe a))) 

Methods

recordToEncoding :: Options -> S1 s (K1 i (Maybe a)) a -> Builder

(Selector Meta s, FromJSON a) => FromRecord (S1 s (K1 i (Maybe a))) 

Methods

parseRecord :: Options -> Maybe Text -> Object -> Parser (S1 s (K1 i (Maybe a)) a)

type Rep1 Maybe 
type Rep (Maybe a) 
data Sing (Maybe a) 
data Sing (Maybe a) where
type Index (Maybe a) 
type Index (Maybe a) = ()
type IxValue (Maybe a) 
type IxValue (Maybe a) = a
type (==) (Maybe k) a b 
type (==) (Maybe k) a b = EqMaybe k a b
type DemoteRep (Maybe a) (KProxy (Maybe a)) 
type DemoteRep (Maybe a) (KProxy (Maybe a)) = Maybe (DemoteRep a (KProxy a))

maybe :: b -> (a -> b) -> Maybe a -> b #

The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.

Examples

Basic usage:

>>> maybe False odd (Just 3)
True
>>> maybe False odd Nothing
False

Read an integer from a string using readMaybe. If we succeed, return twice the integer; that is, apply (*2) to it. If instead we fail to parse an integer, return 0 by default:

>>> import Text.Read ( readMaybe )
>>> maybe 0 (*2) (readMaybe "5")
10
>>> maybe 0 (*2) (readMaybe "")
0

Apply show to a Maybe Int. If we have Just n, we want to show the underlying Int n. But if we have Nothing, we return the empty string instead of (for example) "Nothing":

>>> maybe "" show (Just 5)
"5"
>>> maybe "" show Nothing
""

isJust :: Maybe a -> Bool #

The isJust function returns True iff its argument is of the form Just _.

Examples

Basic usage:

>>> isJust (Just 3)
True
>>> isJust (Just ())
True
>>> isJust Nothing
False

Only the outer constructor is taken into consideration:

>>> isJust (Just Nothing)
True

isNothing :: Maybe a -> Bool #

The isNothing function returns True iff its argument is Nothing.

Examples

Basic usage:

>>> isNothing (Just 3)
False
>>> isNothing (Just ())
False
>>> isNothing Nothing
True

Only the outer constructor is taken into consideration:

>>> isNothing (Just Nothing)
False

fromJust :: Maybe a -> a #

The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

Examples

Basic usage:

>>> fromJust (Just 1)
1
>>> 2 * (fromJust (Just 10))
20
>>> 2 * (fromJust Nothing)
*** Exception: Maybe.fromJust: Nothing

fromMaybe :: a -> Maybe a -> a #

The fromMaybe function takes a default value and and Maybe value. If the Maybe is Nothing, it returns the default values; otherwise, it returns the value contained in the Maybe.

Examples

Basic usage:

>>> fromMaybe "" (Just "Hello, World!")
"Hello, World!"
>>> fromMaybe "" Nothing
""

Read an integer from a string using readMaybe. If we fail to parse an integer, we want to return 0 by default:

>>> import Text.Read ( readMaybe )
>>> fromMaybe 0 (readMaybe "5")
5
>>> fromMaybe 0 (readMaybe "")
0

listToMaybe :: [a] -> Maybe a #

The listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list.

Examples

Basic usage:

>>> listToMaybe []
Nothing
>>> listToMaybe [9]
Just 9
>>> listToMaybe [1,2,3]
Just 1

Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:

>>> maybeToList $ listToMaybe [5]
[5]
>>> maybeToList $ listToMaybe []
[]

But not on lists with more than one element:

>>> maybeToList $ listToMaybe [1,2,3]
[1]

maybeToList :: Maybe a -> [a] #

The maybeToList function returns an empty list when given Nothing or a singleton list when not given Nothing.

Examples

Basic usage:

>>> maybeToList (Just 7)
[7]
>>> maybeToList Nothing
[]

One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:

>>> import Text.Read ( readMaybe )
>>> sum $ maybeToList (readMaybe "3")
3
>>> sum $ maybeToList (readMaybe "")
0

catMaybes :: [Maybe a] -> [a] #

The catMaybes function takes a list of Maybes and returns a list of all the Just values.

Examples

Basic usage:

>>> catMaybes [Just 1, Nothing, Just 3]
[1,3]

When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):

>>> import Text.Read ( readMaybe )
>>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
[Just 1,Nothing,Just 3]
>>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
[1,3]

mapMaybe :: (a -> Maybe b) -> [a] -> [b] #

The mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.

Examples

Using mapMaybe f x is a shortcut for catMaybes $ map f x in most cases:

>>> import Text.Read ( readMaybe )
>>> let readMaybeInt = readMaybe :: String -> Maybe Int
>>> mapMaybe readMaybeInt ["1", "Foo", "3"]
[1,3]
>>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
[1,3]

If we map the Just constructor, the entire list should be returned:

>>> mapMaybe Just [1,2,3]
[1,2,3]

Applicative

(<|>) :: Alternative f => forall a. f a -> f a -> f a #

An associative binary operation

Monads

class Applicative m => Monad m where #

The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions.

Instances of Monad should satisfy the following laws:

Furthermore, the Monad and Applicative operations should relate as follows:

The above laws imply:

and that pure and (<*>) satisfy the applicative functor laws.

The instances of Monad for lists, Maybe and IO defined in the Prelude satisfy these laws.

Minimal complete definition

(>>=)

Methods

(>>=) :: m a -> (a -> m b) -> m b infixl 1 #

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

(>>) :: m a -> m b -> m b infixl 1 #

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

return :: a -> m a #

Inject a value into the monadic type.

fail :: String -> m a #

Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a do expression.

As part of the MonadFail proposal (MFP), this function is moved to its own class MonadFail (see Control.Monad.Fail for more details). The definition here will be removed in a future release.

Instances

Monad [] 

Methods

(>>=) :: [a] -> (a -> [b]) -> [b] #

(>>) :: [a] -> [b] -> [b] #

return :: a -> [a] #

fail :: String -> [a] #

Monad Maybe 

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

(>>) :: Maybe a -> Maybe b -> Maybe b #

return :: a -> Maybe a #

fail :: String -> Maybe a #

Monad IO 

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b #

(>>) :: IO a -> IO b -> IO b #

return :: a -> IO a #

fail :: String -> IO a #

Monad U1 

Methods

(>>=) :: U1 a -> (a -> U1 b) -> U1 b #

(>>) :: U1 a -> U1 b -> U1 b #

return :: a -> U1 a #

fail :: String -> U1 a #

Monad Par1 

Methods

(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b #

(>>) :: Par1 a -> Par1 b -> Par1 b #

return :: a -> Par1 a #

fail :: String -> Par1 a #

Monad Q 

Methods

(>>=) :: Q a -> (a -> Q b) -> Q b #

(>>) :: Q a -> Q b -> Q b #

return :: a -> Q a #

fail :: String -> Q a #

Monad IResult 

Methods

(>>=) :: IResult a -> (a -> IResult b) -> IResult b #

(>>) :: IResult a -> IResult b -> IResult b #

return :: a -> IResult a #

fail :: String -> IResult a #

Monad Result 

Methods

(>>=) :: Result a -> (a -> Result b) -> Result b #

(>>) :: Result a -> Result b -> Result b #

return :: a -> Result a #

fail :: String -> Result a #

Monad Parser 

Methods

(>>=) :: Parser a -> (a -> Parser b) -> Parser b #

(>>) :: Parser a -> Parser b -> Parser b #

return :: a -> Parser a #

fail :: String -> Parser a #

Monad P 

Methods

(>>=) :: P a -> (a -> P b) -> P b #

(>>) :: P a -> P b -> P b #

return :: a -> P a #

fail :: String -> P a #

Monad Identity 

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

fail :: String -> Identity a #

Monad Min 

Methods

(>>=) :: Min a -> (a -> Min b) -> Min b #

(>>) :: Min a -> Min b -> Min b #

return :: a -> Min a #

fail :: String -> Min a #

Monad Max 

Methods

(>>=) :: Max a -> (a -> Max b) -> Max b #

(>>) :: Max a -> Max b -> Max b #

return :: a -> Max a #

fail :: String -> Max a #

Monad First 

Methods

(>>=) :: First a -> (a -> First b) -> First b #

(>>) :: First a -> First b -> First b #

return :: a -> First a #

fail :: String -> First a #

Monad Last 

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b #

(>>) :: Last a -> Last b -> Last b #

return :: a -> Last a #

fail :: String -> Last a #

Monad Option 

Methods

(>>=) :: Option a -> (a -> Option b) -> Option b #

(>>) :: Option a -> Option b -> Option b #

return :: a -> Option a #

fail :: String -> Option a #

Monad NonEmpty 

Methods

(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #

(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

return :: a -> NonEmpty a #

fail :: String -> NonEmpty a #

Monad Complex 

Methods

(>>=) :: Complex a -> (a -> Complex b) -> Complex b #

(>>) :: Complex a -> Complex b -> Complex b #

return :: a -> Complex a #

fail :: String -> Complex a #

Monad STM 

Methods

(>>=) :: STM a -> (a -> STM b) -> STM b #

(>>) :: STM a -> STM b -> STM b #

return :: a -> STM a #

fail :: String -> STM a #

Monad Dual 

Methods

(>>=) :: Dual a -> (a -> Dual b) -> Dual b #

(>>) :: Dual a -> Dual b -> Dual b #

return :: a -> Dual a #

fail :: String -> Dual a #

Monad Sum 

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b #

(>>) :: Sum a -> Sum b -> Sum b #

return :: a -> Sum a #

fail :: String -> Sum a #

Monad Product 

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b #

(>>) :: Product a -> Product b -> Product b #

return :: a -> Product a #

fail :: String -> Product a #

Monad First 

Methods

(>>=) :: First a -> (a -> First b) -> First b #

(>>) :: First a -> First b -> First b #

return :: a -> First a #

fail :: String -> First a #

Monad Last 

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b #

(>>) :: Last a -> Last b -> Last b #

return :: a -> Last a #

fail :: String -> Last a #

Monad ReadPrec 

Methods

(>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b #

(>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b #

return :: a -> ReadPrec a #

fail :: String -> ReadPrec a #

Monad ReadP 

Methods

(>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b #

(>>) :: ReadP a -> ReadP b -> ReadP b #

return :: a -> ReadP a #

fail :: String -> ReadP a #

Monad Identifier 

Methods

(>>=) :: Identifier a -> (a -> Identifier b) -> Identifier b #

(>>) :: Identifier a -> Identifier b -> Identifier b #

return :: a -> Identifier a #

fail :: String -> Identifier a #

Monad Tree 

Methods

(>>=) :: Tree a -> (a -> Tree b) -> Tree b #

(>>) :: Tree a -> Tree b -> Tree b #

return :: a -> Tree a #

fail :: String -> Tree a #

Monad Seq 

Methods

(>>=) :: Seq a -> (a -> Seq b) -> Seq b #

(>>) :: Seq a -> Seq b -> Seq b #

return :: a -> Seq a #

fail :: String -> Seq a #

Monad DList 

Methods

(>>=) :: DList a -> (a -> DList b) -> DList b #

(>>) :: DList a -> DList b -> DList b #

return :: a -> DList a #

fail :: String -> DList a #

Monad Vector 

Methods

(>>=) :: Vector a -> (a -> Vector b) -> Vector b #

(>>) :: Vector a -> Vector b -> Vector b #

return :: a -> Vector a #

fail :: String -> Vector a #

Monad Id 

Methods

(>>=) :: Id a -> (a -> Id b) -> Id b #

(>>) :: Id a -> Id b -> Id b #

return :: a -> Id a #

fail :: String -> Id a #

Monad Box 

Methods

(>>=) :: Box a -> (a -> Box b) -> Box b #

(>>) :: Box a -> Box b -> Box b #

return :: a -> Box a #

fail :: String -> Box a #

Monad ((->) r) 

Methods

(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b #

(>>) :: (r -> a) -> (r -> b) -> r -> b #

return :: a -> r -> a #

fail :: String -> r -> a #

Monad (Either e) 

Methods

(>>=) :: Either e a -> (a -> Either e b) -> Either e b #

(>>) :: Either e a -> Either e b -> Either e b #

return :: a -> Either e a #

fail :: String -> Either e a #

Monad f => Monad (Rec1 f) 

Methods

(>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b #

(>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #

return :: a -> Rec1 f a #

fail :: String -> Rec1 f a #

Monoid a => Monad ((,) a) 

Methods

(>>=) :: (a, a) -> (a -> (a, b)) -> (a, b) #

(>>) :: (a, a) -> (a, b) -> (a, b) #

return :: a -> (a, a) #

fail :: String -> (a, a) #

Representable f => Monad (Co f) 

Methods

(>>=) :: Co f a -> (a -> Co f b) -> Co f b #

(>>) :: Co f a -> Co f b -> Co f b #

return :: a -> Co f a #

fail :: String -> Co f a #

Monad (Parser i) 

Methods

(>>=) :: Parser i a -> (a -> Parser i b) -> Parser i b #

(>>) :: Parser i a -> Parser i b -> Parser i b #

return :: a -> Parser i a #

fail :: String -> Parser i a #

Monad m => Monad (WrappedMonad m) 

Methods

(>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b #

(>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #

return :: a -> WrappedMonad m a #

fail :: String -> WrappedMonad m a #

ArrowApply a => Monad (ArrowMonad a) 

Methods

(>>=) :: ArrowMonad a a -> (a -> ArrowMonad a b) -> ArrowMonad a b #

(>>) :: ArrowMonad a a -> ArrowMonad a b -> ArrowMonad a b #

return :: a -> ArrowMonad a a #

fail :: String -> ArrowMonad a a #

Monad (Proxy *) 

Methods

(>>=) :: Proxy * a -> (a -> Proxy * b) -> Proxy * b #

(>>) :: Proxy * a -> Proxy * b -> Proxy * b #

return :: a -> Proxy * a #

fail :: String -> Proxy * a #

Monad (State s) 

Methods

(>>=) :: State s a -> (a -> State s b) -> State s b #

(>>) :: State s a -> State s b -> State s b #

return :: a -> State s a #

fail :: String -> State s a #

Alternative f => Monad (Cofree f) 

Methods

(>>=) :: Cofree f a -> (a -> Cofree f b) -> Cofree f b #

(>>) :: Cofree f a -> Cofree f b -> Cofree f b #

return :: a -> Cofree f a #

fail :: String -> Cofree f a #

Monad m => Monad (Yoneda m) 

Methods

(>>=) :: Yoneda m a -> (a -> Yoneda m b) -> Yoneda m b #

(>>) :: Yoneda m a -> Yoneda m b -> Yoneda m b #

return :: a -> Yoneda m a #

fail :: String -> Yoneda m a #

Monad (ReifiedGetter s) 

Methods

(>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

(>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

return :: a -> ReifiedGetter s a #

fail :: String -> ReifiedGetter s a #

Monad (ReifiedFold s) 

Methods

(>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

(>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

return :: a -> ReifiedFold s a #

fail :: String -> ReifiedFold s a #

Monad m => Monad (ListT m) 

Methods

(>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b #

(>>) :: ListT m a -> ListT m b -> ListT m b #

return :: a -> ListT m a #

fail :: String -> ListT m a #

(Monad (Rep p), Representable p) => Monad (Prep p) 

Methods

(>>=) :: Prep p a -> (a -> Prep p b) -> Prep p b #

(>>) :: Prep p a -> Prep p b -> Prep p b #

return :: a -> Prep p a #

fail :: String -> Prep p a #

Monad m => Monad (MaybeT m) 

Methods

(>>=) :: MaybeT m a -> (a -> MaybeT m b) -> MaybeT m b #

(>>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

return :: a -> MaybeT m a #

fail :: String -> MaybeT m a #

(Monad f, Monad g) => Monad ((:*:) f g) 

Methods

(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b #

(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

return :: a -> (f :*: g) a #

fail :: String -> (f :*: g) a #

Monad f => Monad (Alt * f) 

Methods

(>>=) :: Alt * f a -> (a -> Alt * f b) -> Alt * f b #

(>>) :: Alt * f a -> Alt * f b -> Alt * f b #

return :: a -> Alt * f a #

fail :: String -> Alt * f a #

Monad (Cokleisli w a) 

Methods

(>>=) :: Cokleisli w a a -> (a -> Cokleisli w a b) -> Cokleisli w a b #

(>>) :: Cokleisli w a a -> Cokleisli w a b -> Cokleisli w a b #

return :: a -> Cokleisli w a a #

fail :: String -> Cokleisli w a a #

Monad m => Monad (IdentityT * m) 

Methods

(>>=) :: IdentityT * m a -> (a -> IdentityT * m b) -> IdentityT * m b #

(>>) :: IdentityT * m a -> IdentityT * m b -> IdentityT * m b #

return :: a -> IdentityT * m a #

fail :: String -> IdentityT * m a #

(Functor f, Monad m) => Monad (FreeT f m) 

Methods

(>>=) :: FreeT f m a -> (a -> FreeT f m b) -> FreeT f m b #

(>>) :: FreeT f m a -> FreeT f m b -> FreeT f m b #

return :: a -> FreeT f m a #

fail :: String -> FreeT f m a #

(Monad m, Error e) => Monad (ErrorT e m) 

Methods

(>>=) :: ErrorT e m a -> (a -> ErrorT e m b) -> ErrorT e m b #

(>>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #

return :: a -> ErrorT e m a #

fail :: String -> ErrorT e m a #

Monad (Indexed i a) 

Methods

(>>=) :: Indexed i a a -> (a -> Indexed i a b) -> Indexed i a b #

(>>) :: Indexed i a a -> Indexed i a b -> Indexed i a b #

return :: a -> Indexed i a a #

fail :: String -> Indexed i a a #

Monad m => Monad (ExceptT e m) 

Methods

(>>=) :: ExceptT e m a -> (a -> ExceptT e m b) -> ExceptT e m b #

(>>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #

return :: a -> ExceptT e m a #

fail :: String -> ExceptT e m a #

Monad m => Monad (StateT s m) 

Methods

(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #

(>>) :: StateT s m a -> StateT s m b -> StateT s m b #

return :: a -> StateT s m a #

fail :: String -> StateT s m a #

Monad m => Monad (StateT s m) 

Methods

(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #

(>>) :: StateT s m a -> StateT s m b -> StateT s m b #

return :: a -> StateT s m a #

fail :: String -> StateT s m a #

(Monoid w, Monad m) => Monad (WriterT w m) 

Methods

(>>=) :: WriterT w m a -> (a -> WriterT w m b) -> WriterT w m b #

(>>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #

return :: a -> WriterT w m a #

fail :: String -> WriterT w m a #

(Monoid w, Monad m) => Monad (WriterT w m) 

Methods

(>>=) :: WriterT w m a -> (a -> WriterT w m b) -> WriterT w m b #

(>>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #

return :: a -> WriterT w m a #

fail :: String -> WriterT w m a #

Monad f => Monad (Star f a) 

Methods

(>>=) :: Star f a a -> (a -> Star f a b) -> Star f a b #

(>>) :: Star f a a -> Star f a b -> Star f a b #

return :: a -> Star f a a #

fail :: String -> Star f a a #

Monad (Costar f a) 

Methods

(>>=) :: Costar f a a -> (a -> Costar f a b) -> Costar f a b #

(>>) :: Costar f a a -> Costar f a b -> Costar f a b #

return :: a -> Costar f a a #

fail :: String -> Costar f a a #

Monad (Tagged k s) 

Methods

(>>=) :: Tagged k s a -> (a -> Tagged k s b) -> Tagged k s b #

(>>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

return :: a -> Tagged k s a #

fail :: String -> Tagged k s a #

Monad f => Monad (M1 i c f) 

Methods

(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b #

(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #

return :: a -> M1 i c f a #

fail :: String -> M1 i c f a #

(Monad f, Monad g) => Monad (Product * f g) 

Methods

(>>=) :: Product * f g a -> (a -> Product * f g b) -> Product * f g b #

(>>) :: Product * f g a -> Product * f g b -> Product * f g b #

return :: a -> Product * f g a #

fail :: String -> Product * f g a #

Monad (ContT k r m) 

Methods

(>>=) :: ContT k r m a -> (a -> ContT k r m b) -> ContT k r m b #

(>>) :: ContT k r m a -> ContT k r m b -> ContT k r m b #

return :: a -> ContT k r m a #

fail :: String -> ContT k r m a #

Monad m => Monad (ReaderT * r m) 

Methods

(>>=) :: ReaderT * r m a -> (a -> ReaderT * r m b) -> ReaderT * r m b #

(>>) :: ReaderT * r m a -> ReaderT * r m b -> ReaderT * r m b #

return :: a -> ReaderT * r m a #

fail :: String -> ReaderT * r m a #

(Monoid w, Monad m) => Monad (RWST r w s m) 

Methods

(>>=) :: RWST r w s m a -> (a -> RWST r w s m b) -> RWST r w s m b #

(>>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #

return :: a -> RWST r w s m a #

fail :: String -> RWST r w s m a #

(Monoid w, Monad m) => Monad (RWST r w s m) 

Methods

(>>=) :: RWST r w s m a -> (a -> RWST r w s m b) -> RWST r w s m b #

(>>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #

return :: a -> RWST r w s m a #

fail :: String -> RWST r w s m a #

class (Alternative m, Monad m) => MonadPlus m where #

Monads that also support choice and failure.

Methods

mzero :: m a #

the identity of mplus. It should also satisfy the equations

mzero >>= f  =  mzero
v >> mzero   =  mzero

mplus :: m a -> m a -> m a #

an associative operation

Instances

MonadPlus [] 

Methods

mzero :: [a] #

mplus :: [a] -> [a] -> [a] #

MonadPlus Maybe 

Methods

mzero :: Maybe a #

mplus :: Maybe a -> Maybe a -> Maybe a #

MonadPlus IO 

Methods

mzero :: IO a #

mplus :: IO a -> IO a -> IO a #

MonadPlus U1 

Methods

mzero :: U1 a #

mplus :: U1 a -> U1 a -> U1 a #

MonadPlus IResult 

Methods

mzero :: IResult a #

mplus :: IResult a -> IResult a -> IResult a #

MonadPlus Result 

Methods

mzero :: Result a #

mplus :: Result a -> Result a -> Result a #

MonadPlus Parser 

Methods

mzero :: Parser a #

mplus :: Parser a -> Parser a -> Parser a #

MonadPlus P 

Methods

mzero :: P a #

mplus :: P a -> P a -> P a #

MonadPlus Option 

Methods

mzero :: Option a #

mplus :: Option a -> Option a -> Option a #

MonadPlus STM 

Methods

mzero :: STM a #

mplus :: STM a -> STM a -> STM a #

MonadPlus ReadPrec 

Methods

mzero :: ReadPrec a #

mplus :: ReadPrec a -> ReadPrec a -> ReadPrec a #

MonadPlus ReadP 

Methods

mzero :: ReadP a #

mplus :: ReadP a -> ReadP a -> ReadP a #

MonadPlus Seq 

Methods

mzero :: Seq a #

mplus :: Seq a -> Seq a -> Seq a #

MonadPlus DList 

Methods

mzero :: DList a #

mplus :: DList a -> DList a -> DList a #

MonadPlus Vector 

Methods

mzero :: Vector a #

mplus :: Vector a -> Vector a -> Vector a #

MonadPlus f => MonadPlus (Rec1 f) 

Methods

mzero :: Rec1 f a #

mplus :: Rec1 f a -> Rec1 f a -> Rec1 f a #

MonadPlus (Parser i) 

Methods

mzero :: Parser i a #

mplus :: Parser i a -> Parser i a -> Parser i a #

(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) 

Methods

mzero :: ArrowMonad a a #

mplus :: ArrowMonad a a -> ArrowMonad a a -> ArrowMonad a a #

MonadPlus (Proxy *) 

Methods

mzero :: Proxy * a #

mplus :: Proxy * a -> Proxy * a -> Proxy * a #

MonadPlus m => MonadPlus (Yoneda m) 

Methods

mzero :: Yoneda m a #

mplus :: Yoneda m a -> Yoneda m a -> Yoneda m a #

MonadPlus (ReifiedFold s) 

Methods

mzero :: ReifiedFold s a #

mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

Monad m => MonadPlus (ListT m) 

Methods

mzero :: ListT m a #

mplus :: ListT m a -> ListT m a -> ListT m a #

Monad m => MonadPlus (MaybeT m) 

Methods

mzero :: MaybeT m a #

mplus :: MaybeT m a -> MaybeT m a -> MaybeT m a #

(MonadPlus f, MonadPlus g) => MonadPlus ((:*:) f g) 

Methods

mzero :: (f :*: g) a #

mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

MonadPlus f => MonadPlus (Alt * f) 

Methods

mzero :: Alt * f a #

mplus :: Alt * f a -> Alt * f a -> Alt * f a #

MonadPlus m => MonadPlus (IdentityT * m) 

Methods

mzero :: IdentityT * m a #

mplus :: IdentityT * m a -> IdentityT * m a -> IdentityT * m a #

(Functor f, MonadPlus m) => MonadPlus (FreeT f m) 

Methods

mzero :: FreeT f m a #

mplus :: FreeT f m a -> FreeT f m a -> FreeT f m a #

(Monad m, Error e) => MonadPlus (ErrorT e m) 

Methods

mzero :: ErrorT e m a #

mplus :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #

(Monad m, Monoid e) => MonadPlus (ExceptT e m) 

Methods

mzero :: ExceptT e m a #

mplus :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

MonadPlus m => MonadPlus (StateT s m) 

Methods

mzero :: StateT s m a #

mplus :: StateT s m a -> StateT s m a -> StateT s m a #

MonadPlus m => MonadPlus (StateT s m) 

Methods

mzero :: StateT s m a #

mplus :: StateT s m a -> StateT s m a -> StateT s m a #

(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) 

Methods

mzero :: WriterT w m a #

mplus :: WriterT w m a -> WriterT w m a -> WriterT w m a #

(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) 

Methods

mzero :: WriterT w m a #

mplus :: WriterT w m a -> WriterT w m a -> WriterT w m a #

MonadPlus f => MonadPlus (Star f a) 

Methods

mzero :: Star f a a #

mplus :: Star f a a -> Star f a a -> Star f a a #

MonadPlus f => MonadPlus (M1 i c f) 

Methods

mzero :: M1 i c f a #

mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a #

(MonadPlus f, MonadPlus g) => MonadPlus (Product * f g) 

Methods

mzero :: Product * f g a #

mplus :: Product * f g a -> Product * f g a -> Product * f g a #

MonadPlus m => MonadPlus (ReaderT * r m) 

Methods

mzero :: ReaderT * r m a #

mplus :: ReaderT * r m a -> ReaderT * r m a -> ReaderT * r m a #

(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) 

Methods

mzero :: RWST r w s m a #

mplus :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a #

(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) 

Methods

mzero :: RWST r w s m a #

mplus :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a #

mapM :: Traversable t => forall m a b. Monad m => (a -> m b) -> t a -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM.

As of base 4.8.0.0, mapM_ is just traverse_, specialized to Monad.

forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #

forM is mapM with its arguments flipped. For a version that ignores the results see forM_.

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () #

forM_ is mapM_ with its arguments flipped. For a version that doesn't ignore the results see forM.

As of base 4.8.0.0, forM_ is just for_, specialized to Monad.

sequence :: Traversable t => forall m a. Monad m => t (m a) -> m (t a) #

Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see sequence_.

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequence.

As of base 4.8.0.0, sequence_ is just sequenceA_, specialized to Monad.

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #

Same as >>=, but with the arguments interchanged.

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #

Left-to-right Kleisli composition of monads.

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 #

Right-to-left Kleisli composition of monads. (>=>), with the arguments flipped.

Note how this operator resembles function composition (.):

(.)   ::            (b ->   c) -> (a ->   b) -> a ->   c
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c

forever :: Applicative f => f a -> f b #

forever act repeats the action infinitely.

void :: Functor f => f a -> f () #

void value discards or ignores the result of evaluation, such as the return value of an IO action.

Examples

Replace the contents of a Maybe Int with unit:

>>> void Nothing
Nothing
>>> void (Just 3)
Just ()

Replace the contents of an Either Int Int with unit, resulting in an Either Int '()':

>>> void (Left 8675309)
Left 8675309
>>> void (Right 8675309)
Right ()

Replace every element of a list with unit:

>>> void [1,2,3]
[(),(),()]

Replace the second element of a pair with unit:

>>> void (1,2)
(1,())

Discard the result of an IO action:

>>> mapM print [1,2]
1
2
[(),()]
>>> void $ mapM print [1,2]
1
2

join :: Monad m => m (m a) -> m a #

The join function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.

msum :: (Foldable t, MonadPlus m) => t (m a) -> m a #

The sum of a collection of actions, generalizing concat. As of base 4.8.0.0, msum is just asum, specialized to MonadPlus.

mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a #

Direct MonadPlus equivalent of filter filter = (mfilter:: (a -> Bool) -> [a] -> [a] applicable to any MonadPlus, for example mfilter odd (Just 1) == Just 1 mfilter odd (Just 2) == Nothing

filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #

This generalizes the list-based filter function.

mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) #

The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state-transforming monad.

zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #

The zipWithM function generalizes zipWith to arbitrary applicative functors.

zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #

zipWithM_ is the extension of zipWithM which ignores the final result.

foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

The foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue where (>>) and the `folded function' are not commutative.

      foldM f a1 [x1, x2, ..., xm]

==

      do
        a2 <- f a1 x1
        a3 <- f a2 x2
        ...
        f am xm

If right-to-left evaluation is required, the input list should be reversed.

Note: foldM is the same as foldlM

foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #

Like foldM, but discards the result.

replicateM :: Applicative m => Int -> m a -> m [a] #

replicateM n act performs the action n times, gathering the results.

replicateM_ :: Applicative m => Int -> m a -> m () #

Like replicateM, but discards the result.

guard :: Alternative f => Bool -> f () #

guard b is pure () if b is True, and empty if b is False.

when :: Applicative f => Bool -> f () -> f () #

Conditional execution of Applicative expressions. For example,

when debug (putStrLn "Debugging")

will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.

unless :: Applicative f => Bool -> f () -> f () #

The reverse of when.

liftM :: Monad m => (a1 -> r) -> m a1 -> m r #

Promote a function to a monad.

liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right. For example,

   liftM2 (+) [0,1] [0,2] = [0,2,1,3]
   liftM2 (+) (Just 1) Nothing = Nothing

liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).

liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).

liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2).

ap :: Monad m => m (a -> b) -> m a -> m b #

In many situations, the liftM operations can be replaced by uses of ap, which promotes function application.

      return f `ap` x1 `ap` ... `ap` xn

is equivalent to

      liftMn f x1 x2 ... xn

(<$!>) :: Monad m => (a -> b) -> m a -> m b infixl 4 #

Strict version of <$>.

Since: 4.8.0.0

Arrows

class Category * a => Arrow a where #

The basic arrow class.

Instances should satisfy the following laws:

where

assoc ((a,b),c) = (a,(b,c))

The other combinators have sensible default definitions, which may be overridden for efficiency.

Minimal complete definition

arr, (first | (***))

Methods

arr :: (b -> c) -> a b c #

Lift a function to an arrow.

first :: a b c -> a (b, d) (c, d) #

Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.

second :: a b c -> a (d, b) (d, c) #

A mirror image of first.

The default definition may be overridden with a more efficient version if desired.

(***) :: a b c -> a b' c' -> a (b, b') (c, c') infixr 3 #

Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

(&&&) :: a b c -> a b c' -> a b (c, c') infixr 3 #

Fanout: send the input to both argument arrows and combine their output.

The default definition may be overridden with a more efficient version if desired.

Instances

Arrow (->) 

Methods

arr :: (b -> c) -> b -> c #

first :: (b -> c) -> (b, d) -> (c, d) #

second :: (b -> c) -> (d, b) -> (d, c) #

(***) :: (b -> c) -> (b' -> c') -> (b, b') -> (c, c') #

(&&&) :: (b -> c) -> (b -> c') -> b -> (c, c') #

Arrow ReifiedGetter 

Methods

arr :: (b -> c) -> ReifiedGetter b c #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') #

Arrow ReifiedFold 

Methods

arr :: (b -> c) -> ReifiedFold b c #

first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) #

second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) #

(***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') #

(&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') #

Monad m => Arrow (Kleisli m) 

Methods

arr :: (b -> c) -> Kleisli m b c #

first :: Kleisli m b c -> Kleisli m (b, d) (c, d) #

second :: Kleisli m b c -> Kleisli m (d, b) (d, c) #

(***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') #

(&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #

Comonad w => Arrow (Cokleisli w) 

Methods

arr :: (b -> c) -> Cokleisli w b c #

first :: Cokleisli w b c -> Cokleisli w (b, d) (c, d) #

second :: Cokleisli w b c -> Cokleisli w (d, b) (d, c) #

(***) :: Cokleisli w b c -> Cokleisli w b' c' -> Cokleisli w (b, b') (c, c') #

(&&&) :: Cokleisli w b c -> Cokleisli w b c' -> Cokleisli w b (c, c') #

Arrow (Indexed i) 

Methods

arr :: (b -> c) -> Indexed i b c #

first :: Indexed i b c -> Indexed i (b, d) (c, d) #

second :: Indexed i b c -> Indexed i (d, b) (d, c) #

(***) :: Indexed i b c -> Indexed i b' c' -> Indexed i (b, b') (c, c') #

(&&&) :: Indexed i b c -> Indexed i b c' -> Indexed i b (c, c') #

Arrow p => Arrow (Tambara p) 

Methods

arr :: (b -> c) -> Tambara p b c #

first :: Tambara p b c -> Tambara p (b, d) (c, d) #

second :: Tambara p b c -> Tambara p (d, b) (d, c) #

(***) :: Tambara p b c -> Tambara p b' c' -> Tambara p (b, b') (c, c') #

(&&&) :: Tambara p b c -> Tambara p b c' -> Tambara p b (c, c') #

Arrow p => Arrow (WrappedArrow p) 

Methods

arr :: (b -> c) -> WrappedArrow p b c #

first :: WrappedArrow p b c -> WrappedArrow p (b, d) (c, d) #

second :: WrappedArrow p b c -> WrappedArrow p (d, b) (d, c) #

(***) :: WrappedArrow p b c -> WrappedArrow p b' c' -> WrappedArrow p (b, b') (c, c') #

(&&&) :: WrappedArrow p b c -> WrappedArrow p b c' -> WrappedArrow p b (c, c') #

(Applicative f, Arrow p) => Arrow (Tannen * * * f p) 

Methods

arr :: (b -> c) -> Tannen * * * f p b c #

first :: Tannen * * * f p b c -> Tannen * * * f p (b, d) (c, d) #

second :: Tannen * * * f p b c -> Tannen * * * f p (d, b) (d, c) #

(***) :: Tannen * * * f p b c -> Tannen * * * f p b' c' -> Tannen * * * f p (b, b') (c, c') #

(&&&) :: Tannen * * * f p b c -> Tannen * * * f p b c' -> Tannen * * * f p b (c, c') #

newtype Kleisli m a b :: (* -> *) -> * -> * -> * #

Kleisli arrows of a monad.

Constructors

Kleisli 

Fields

Instances

Monad m => Arrow (Kleisli m) 

Methods

arr :: (b -> c) -> Kleisli m b c #

first :: Kleisli m b c -> Kleisli m (b, d) (c, d) #

second :: Kleisli m b c -> Kleisli m (d, b) (d, c) #

(***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') #

(&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #

MonadPlus m => ArrowZero (Kleisli m) 

Methods

zeroArrow :: Kleisli m b c #

MonadPlus m => ArrowPlus (Kleisli m) 

Methods

(<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #

Monad m => ArrowChoice (Kleisli m) 

Methods

left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) #

right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) #

(+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') #

(|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #

Monad m => ArrowApply (Kleisli m) 

Methods

app :: Kleisli m (Kleisli m b c, b) c #

MonadFix m => ArrowLoop (Kleisli m)

Beware that for many monads (those for which the >>= operation is strict) this instance will not satisfy the right-tightening law required by the ArrowLoop class.

Methods

loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #

(Monad m, Functor m) => Representable (Kleisli m) 

Associated Types

type Rep (Kleisli m :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (Kleisli m) c) -> Kleisli m d c #

Monad m => Profunctor (Kleisli m) 

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c #

(#.) :: Coercible * c b => (b -> c) -> Kleisli m a b -> Kleisli m a c #

(.#) :: Coercible * b a => Kleisli m b c -> (a -> b) -> Kleisli m a c #

Monad m => Choice (Kleisli m) 

Methods

left' :: Kleisli m a b -> Kleisli m (Either a c) (Either b c) #

right' :: Kleisli m a b -> Kleisli m (Either c a) (Either c b) #

Monad m => Strong (Kleisli m) 

Methods

first' :: Kleisli m a b -> Kleisli m (a, c) (b, c) #

second' :: Kleisli m a b -> Kleisli m (c, a) (c, b) #

MonadFix m => Costrong (Kleisli m) 

Methods

unfirst :: Kleisli m (a, d) (b, d) -> Kleisli m a b #

unsecond :: Kleisli m (d, a) (d, b) -> Kleisli m a b #

Monad m => Category * (Kleisli m) 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Wrapped (Kleisli m a b) 

Associated Types

type Unwrapped (Kleisli m a b) :: * #

Methods

_Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) #

(~) * t (Kleisli m' a' b') => Rewrapped (Kleisli m a b) t 
type Rep (Kleisli m) 
type Rep (Kleisli m) = m
type Unwrapped (Kleisli m a b) 
type Unwrapped (Kleisli m a b) = a -> m b

returnA :: Arrow a => a b b #

The identity arrow, which plays the role of return in arrow notation.

(^>>) :: Arrow a => (b -> c) -> a c d -> a b d infixr 1 #

Precomposition with a pure function.

(>>^) :: Arrow a => a b c -> (c -> d) -> a b d infixr 1 #

Postcomposition with a pure function.

(>>>) :: Category k cat => cat a b -> cat b c -> cat a c infixr 1 #

Left-to-right composition

(<<<) :: Category k cat => cat b c -> cat a b -> cat a c infixr 1 #

Right-to-left composition

(<<^) :: Arrow a => a c d -> (b -> c) -> a b d infixr 1 #

Precomposition with a pure function (right-to-left variant).

(^<<) :: Arrow a => (c -> d) -> a b c -> a b d infixr 1 #

Postcomposition with a pure function (right-to-left variant).

class Arrow a => ArrowZero a where #

Minimal complete definition

zeroArrow

Methods

zeroArrow :: a b c #

Instances

MonadPlus m => ArrowZero (Kleisli m) 

Methods

zeroArrow :: Kleisli m b c #

ArrowZero p => ArrowZero (Tambara p) 

Methods

zeroArrow :: Tambara p b c #

ArrowZero p => ArrowZero (WrappedArrow p) 

Methods

zeroArrow :: WrappedArrow p b c #

(Applicative f, ArrowZero p) => ArrowZero (Tannen * * * f p) 

Methods

zeroArrow :: Tannen * * * f p b c #

class ArrowZero a => ArrowPlus a where #

A monoid on arrows.

Minimal complete definition

(<+>)

Methods

(<+>) :: a b c -> a b c -> a b c infixr 5 #

An associative operation with identity zeroArrow.

Instances

MonadPlus m => ArrowPlus (Kleisli m) 

Methods

(<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #

ArrowPlus p => ArrowPlus (Tambara p) 

Methods

(<+>) :: Tambara p b c -> Tambara p b c -> Tambara p b c #

(Applicative f, ArrowPlus p) => ArrowPlus (Tannen * * * f p) 

Methods

(<+>) :: Tannen * * * f p b c -> Tannen * * * f p b c -> Tannen * * * f p b c #

class Arrow a => ArrowChoice a where #

Choice, for arrows that support it. This class underlies the if and case constructs in arrow notation.

Instances should satisfy the following laws:

where

assocsum (Left (Left x)) = Left x
assocsum (Left (Right y)) = Right (Left y)
assocsum (Right z) = Right (Right z)

The other combinators have sensible default definitions, which may be overridden for efficiency.

Minimal complete definition

left | (+++)

Methods

left :: a b c -> a (Either b d) (Either c d) #

Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.

right :: a b c -> a (Either d b) (Either d c) #

A mirror image of left.

The default definition may be overridden with a more efficient version if desired.

(+++) :: a b c -> a b' c' -> a (Either b b') (Either c c') infixr 2 #

Split the input between the two argument arrows, retagging and merging their outputs. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

(|||) :: a b d -> a c d -> a (Either b c) d infixr 2 #

Fanin: Split the input between the two argument arrows and merge their outputs.

The default definition may be overridden with a more efficient version if desired.

Instances

ArrowChoice (->) 

Methods

left :: (b -> c) -> Either b d -> Either c d #

right :: (b -> c) -> Either d b -> Either d c #

(+++) :: (b -> c) -> (b' -> c') -> Either b b' -> Either c c' #

(|||) :: (b -> d) -> (c -> d) -> Either b c -> d #

ArrowChoice ReifiedGetter 

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d #

ArrowChoice ReifiedFold 

Methods

left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) #

right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) #

(+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') #

(|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d #

Monad m => ArrowChoice (Kleisli m) 

Methods

left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) #

right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) #

(+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') #

(|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #

Comonad w => ArrowChoice (Cokleisli w) 

Methods

left :: Cokleisli w b c -> Cokleisli w (Either b d) (Either c d) #

right :: Cokleisli w b c -> Cokleisli w (Either d b) (Either d c) #

(+++) :: Cokleisli w b c -> Cokleisli w b' c' -> Cokleisli w (Either b b') (Either c c') #

(|||) :: Cokleisli w b d -> Cokleisli w c d -> Cokleisli w (Either b c) d #

ArrowChoice (Indexed i) 

Methods

left :: Indexed i b c -> Indexed i (Either b d) (Either c d) #

right :: Indexed i b c -> Indexed i (Either d b) (Either d c) #

(+++) :: Indexed i b c -> Indexed i b' c' -> Indexed i (Either b b') (Either c c') #

(|||) :: Indexed i b d -> Indexed i c d -> Indexed i (Either b c) d #

ArrowChoice p => ArrowChoice (Tambara p) 

Methods

left :: Tambara p b c -> Tambara p (Either b d) (Either c d) #

right :: Tambara p b c -> Tambara p (Either d b) (Either d c) #

(+++) :: Tambara p b c -> Tambara p b' c' -> Tambara p (Either b b') (Either c c') #

(|||) :: Tambara p b d -> Tambara p c d -> Tambara p (Either b c) d #

ArrowChoice p => ArrowChoice (WrappedArrow p) 

Methods

left :: WrappedArrow p b c -> WrappedArrow p (Either b d) (Either c d) #

right :: WrappedArrow p b c -> WrappedArrow p (Either d b) (Either d c) #

(+++) :: WrappedArrow p b c -> WrappedArrow p b' c' -> WrappedArrow p (Either b b') (Either c c') #

(|||) :: WrappedArrow p b d -> WrappedArrow p c d -> WrappedArrow p (Either b c) d #

(Applicative f, ArrowChoice p) => ArrowChoice (Tannen * * * f p) 

Methods

left :: Tannen * * * f p b c -> Tannen * * * f p (Either b d) (Either c d) #

right :: Tannen * * * f p b c -> Tannen * * * f p (Either d b) (Either d c) #

(+++) :: Tannen * * * f p b c -> Tannen * * * f p b' c' -> Tannen * * * f p (Either b b') (Either c c') #

(|||) :: Tannen * * * f p b d -> Tannen * * * f p c d -> Tannen * * * f p (Either b c) d #

class Arrow a => ArrowApply a where #

Some arrows allow application of arrow inputs to other inputs. Instances should satisfy the following laws:

Such arrows are equivalent to monads (see ArrowMonad).

Minimal complete definition

app

Methods

app :: a (a b c, b) c #

Instances

ArrowApply (->) 

Methods

app :: (b -> c, b) -> c #

ArrowApply ReifiedGetter 

Methods

app :: ReifiedGetter (ReifiedGetter b c, b) c #

ArrowApply ReifiedFold 

Methods

app :: ReifiedFold (ReifiedFold b c, b) c #

Monad m => ArrowApply (Kleisli m) 

Methods

app :: Kleisli m (Kleisli m b c, b) c #

Comonad w => ArrowApply (Cokleisli w) 

Methods

app :: Cokleisli w (Cokleisli w b c, b) c #

ArrowApply (Indexed i) 

Methods

app :: Indexed i (Indexed i b c, b) c #

ArrowApply p => ArrowApply (Tambara p) 

Methods

app :: Tambara p (Tambara p b c, b) c #

ArrowApply p => ArrowApply (WrappedArrow p) 

Methods

app :: WrappedArrow p (WrappedArrow p b c, b) c #

newtype ArrowMonad a b :: (* -> * -> *) -> * -> * #

The ArrowApply class is equivalent to Monad: any monad gives rise to a Kleisli arrow, and any instance of ArrowApply defines a monad.

Constructors

ArrowMonad (a () b) 

Instances

ArrowApply a => Monad (ArrowMonad a) 

Methods

(>>=) :: ArrowMonad a a -> (a -> ArrowMonad a b) -> ArrowMonad a b #

(>>) :: ArrowMonad a a -> ArrowMonad a b -> ArrowMonad a b #

return :: a -> ArrowMonad a a #

fail :: String -> ArrowMonad a a #

Arrow a => Functor (ArrowMonad a) 

Methods

fmap :: (a -> b) -> ArrowMonad a a -> ArrowMonad a b #

(<$) :: a -> ArrowMonad a b -> ArrowMonad a a #

Arrow a => Applicative (ArrowMonad a) 

Methods

pure :: a -> ArrowMonad a a #

(<*>) :: ArrowMonad a (a -> b) -> ArrowMonad a a -> ArrowMonad a b #

(*>) :: ArrowMonad a a -> ArrowMonad a b -> ArrowMonad a b #

(<*) :: ArrowMonad a a -> ArrowMonad a b -> ArrowMonad a a #

ArrowPlus a => Alternative (ArrowMonad a) 

Methods

empty :: ArrowMonad a a #

(<|>) :: ArrowMonad a a -> ArrowMonad a a -> ArrowMonad a a #

some :: ArrowMonad a a -> ArrowMonad a [a] #

many :: ArrowMonad a a -> ArrowMonad a [a] #

(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) 

Methods

mzero :: ArrowMonad a a #

mplus :: ArrowMonad a a -> ArrowMonad a a -> ArrowMonad a a #

Wrapped (ArrowMonad m a) 

Associated Types

type Unwrapped (ArrowMonad m a) :: * #

Methods

_Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) #

(~) * t (ArrowMonad m' a') => Rewrapped (ArrowMonad m a) t 
type Unwrapped (ArrowMonad m a) 
type Unwrapped (ArrowMonad m a) = m () a

leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) #

Any instance of ArrowApply can be made into an instance of ArrowChoice by defining left = leftApp.

class Arrow a => ArrowLoop a where #

The loop operator expresses computations in which an output value is fed back as input, although the computation occurs only once. It underlies the rec value recursion construct in arrow notation. loop should satisfy the following laws:

extension
loop (arr f) = arr (\ b -> fst (fix (\ (c,d) -> f (b,d))))
left tightening
loop (first h >>> f) = h >>> loop f
right tightening
loop (f >>> first h) = loop f >>> h
sliding
loop (f >>> arr (id *** k)) = loop (arr (id *** k) >>> f)
vanishing
loop (loop f) = loop (arr unassoc >>> f >>> arr assoc)
superposing
second (loop f) = loop (arr assoc >>> second f >>> arr unassoc)

where

assoc ((a,b),c) = (a,(b,c))
unassoc (a,(b,c)) = ((a,b),c)

Minimal complete definition

loop

Methods

loop :: a (b, d) (c, d) -> a b c #

Instances

ArrowLoop (->) 

Methods

loop :: ((b, d) -> (c, d)) -> b -> c #

ArrowLoop ReifiedGetter 

Methods

loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c #

MonadFix m => ArrowLoop (Kleisli m)

Beware that for many monads (those for which the >>= operation is strict) this instance will not satisfy the right-tightening law required by the ArrowLoop class.

Methods

loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #

ComonadApply w => ArrowLoop (Cokleisli w) 

Methods

loop :: Cokleisli w (b, d) (c, d) -> Cokleisli w b c #

ArrowLoop (Indexed i) 

Methods

loop :: Indexed i (b, d) (c, d) -> Indexed i b c #

ArrowLoop p => ArrowLoop (Tambara p) 

Methods

loop :: Tambara p (b, d) (c, d) -> Tambara p b c #

ArrowLoop p => ArrowLoop (WrappedArrow p) 

Methods

loop :: WrappedArrow p (b, d) (c, d) -> WrappedArrow p b c #

(Applicative f, ArrowLoop p) => ArrowLoop (Tannen * * * f p) 

Methods

loop :: Tannen * * * f p (b, d) (c, d) -> Tannen * * * f p b c #

left :: ArrowChoice a => forall b c d. a b c -> a (Either b d) (Either c d) #

Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.

right :: ArrowChoice a => forall b c d. a b c -> a (Either d b) (Either d c) #

A mirror image of left.

The default definition may be overridden with a more efficient version if desired.

(+++) :: ArrowChoice a => forall b c b' c'. a b c -> a b' c' -> a (Either b b') (Either c c') #

Split the input between the two argument arrows, retagging and merging their outputs. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

(|||) :: ArrowChoice a => forall b d c. a b d -> a c d -> a (Either b c) d #

Fanin: Split the input between the two argument arrows and merge their outputs.

The default definition may be overridden with a more efficient version if desired.

Mutable Variables In IO

IORef

data IORef a :: * -> * #

A mutable variable in the IO monad

Instances

Eq (IORef a) 

Methods

(==) :: IORef a -> IORef a -> Bool #

(/=) :: IORef a -> IORef a -> Bool #

NFData (IORef a)

NOTE: Only strict in the reference and not the referenced value.

Since: 1.4.2.0

Methods

rnf :: IORef a -> () #

newIORef :: a -> IO (IORef a) #

Build a new IORef

readIORef :: IORef a -> IO a #

Read the value of an IORef

writeIORef :: IORef a -> a -> IO () #

Write a new value into an IORef

modifyIORef :: IORef a -> (a -> a) -> IO () #

Mutate the contents of an IORef.

Be warned that modifyIORef does not apply the function strictly. This means if the program calls modifyIORef many times, but seldomly uses the value, thunks will pile up in memory resulting in a space leak. This is a common mistake made when using an IORef as a counter. For example, the following will likely produce a stack overflow:

ref <- newIORef 0
replicateM_ 1000000 $ modifyIORef ref (+1)
readIORef ref >>= print

To avoid this problem, use modifyIORef' instead.

modifyIORef' :: IORef a -> (a -> a) -> IO () #

Strict version of modifyIORef

Since: 4.6.0.0

atomicModifyIORef :: IORef a -> (a -> (a, b)) -> IO b #

Atomically modifies the contents of an IORef.

This function is useful for using IORef in a safe way in a multithreaded program. If you only have one IORef, then using atomicModifyIORef to access and modify it will prevent race conditions.

Extending the atomicity to multiple IORefs is problematic, so it is recommended that if you need to do anything more complicated then using MVar instead is a good idea.

atomicModifyIORef does not apply the function strictly. This is important to know even if all you are doing is replacing the value. For example, this will leak memory:

ref <- newIORef '1'
forever $ atomicModifyIORef ref (\_ -> ('2', ()))

Use atomicModifyIORef' or atomicWriteIORef to avoid this problem.

atomicModifyIORef' :: IORef a -> (a -> (a, b)) -> IO b #

Strict version of atomicModifyIORef. This forces both the value stored in the IORef as well as the value returned.

Since: 4.6.0.0

atomicWriteIORef :: IORef a -> a -> IO () #

Variant of writeIORef with the "barrier to reordering" property that atomicModifyIORef has.

Since: 4.6.0.0

mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a)) #

Make a Weak pointer to an IORef, using the second argument as a finalizer to run when IORef is garbage-collected

MVar

data MVar a :: * -> * #

An MVar (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a a box, which may be empty or full.

Instances

Eq (MVar a) 

Methods

(==) :: MVar a -> MVar a -> Bool #

(/=) :: MVar a -> MVar a -> Bool #

NFData (MVar a)

NOTE: Only strict in the reference and not the referenced value.

Since: 1.4.2.0

Methods

rnf :: MVar a -> () #

newEmptyMVar :: IO (MVar a) #

Create an MVar which is initially empty.

newMVar :: a -> IO (MVar a) #

Create an MVar which contains the supplied value.

takeMVar :: MVar a -> IO a #

Return the contents of the MVar. If the MVar is currently empty, takeMVar will wait until it is full. After a takeMVar, the MVar is left empty.

There are two further important properties of takeMVar:

  • takeMVar is single-wakeup. That is, if there are multiple threads blocked in takeMVar, and the MVar becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its takeMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.

putMVar :: MVar a -> a -> IO () #

Put a value into an MVar. If the MVar is currently full, putMVar will wait until it becomes empty.

There are two further important properties of putMVar:

  • putMVar is single-wakeup. That is, if there are multiple threads blocked in putMVar, and the MVar becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its putMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.

readMVar :: MVar a -> IO a #

Atomically read the contents of an MVar. If the MVar is currently empty, readMVar will wait until its full. readMVar is guaranteed to receive the next putMVar.

readMVar is multiple-wakeup, so when multiple readers are blocked on an MVar, all of them are woken up at the same time.

Compatibility note: Prior to base 4.7, readMVar was a combination of takeMVar and putMVar. This mean that in the presence of other threads attempting to putMVar, readMVar could block. Furthermore, readMVar would not receive the next putMVar if there was already a pending thread blocked on takeMVar. The old behavior can be recovered by implementing 'readMVar as follows:

 readMVar :: MVar a -> IO a
 readMVar m =
   mask_ $ do
     a <- takeMVar m
     putMVar m a
     return a

swapMVar :: MVar a -> a -> IO a #

Take a value from an MVar, put a new value into the MVar and return the value taken. This function is atomic only if there are no other producers for this MVar.

tryTakeMVar :: MVar a -> IO (Maybe a) #

A non-blocking version of takeMVar. The tryTakeMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a. After tryTakeMVar, the MVar is left empty.

tryPutMVar :: MVar a -> a -> IO Bool #

A non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise.

isEmptyMVar :: MVar a -> IO Bool #

Check whether a given MVar is empty.

Notice that the boolean value returned is just a snapshot of the state of the MVar. By the time you get to react on its result, the MVar may have been filled (or emptied) - so be extremely careful when using this operation. Use tryTakeMVar instead if possible.

withMVar :: MVar a -> (a -> IO b) -> IO b #

withMVar is an exception-safe wrapper for operating on the contents of an MVar. This operation is exception-safe: it will replace the original contents of the MVar if an exception is raised (see Control.Exception). However, it is only atomic if there are no other producers for this MVar.

withMVarMasked :: MVar a -> (a -> IO b) -> IO b #

Like withMVar, but the IO action in the second argument is executed with asynchronous exceptions masked.

Since: 4.7.0.0

modifyMVar_ :: MVar a -> (a -> IO a) -> IO () #

An exception-safe wrapper for modifying the contents of an MVar. Like withMVar, modifyMVar will replace the original contents of the MVar if an exception is raised during the operation. This function is only atomic if there are no other producers for this MVar.

modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b #

A slight variation on modifyMVar_ that allows a value to be returned (b) in addition to the modified value of the MVar.

modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO () #

Like modifyMVar_, but the IO action in the second argument is executed with asynchronous exceptions masked.

Since: 4.6.0.0

modifyMVarMasked :: MVar a -> (a -> IO (a, b)) -> IO b #

Like modifyMVar, but the IO action in the second argument is executed with asynchronous exceptions masked.

Since: 4.6.0.0

tryReadMVar :: MVar a -> IO (Maybe a) #

A non-blocking version of readMVar. The tryReadMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a.

Since: 4.7.0.0

mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a)) #

Make a Weak pointer to an MVar, using the second argument as a finalizer to run when MVar is garbage-collected

Since: 4.6.0.0

addMVarFinalizer :: MVar a -> IO () -> IO () #

Chan

data Chan a :: * -> * #

Chan is an abstract type representing an unbounded FIFO channel.

Instances

Eq (Chan a) 

Methods

(==) :: Chan a -> Chan a -> Bool #

(/=) :: Chan a -> Chan a -> Bool #

newChan :: IO (Chan a) #

Build and returns a new instance of Chan.

writeChan :: Chan a -> a -> IO () #

Write a value to a Chan.

readChan :: Chan a -> IO a #

Read the next value from the Chan.

dupChan :: Chan a -> IO (Chan a) #

Duplicate a Chan: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, where data written by anyone is seen by everyone else.

(Note that a duplicated channel is not equal to its original. So: fmap (c /=) $ dupChan c returns True for all c.)

getChanContents :: Chan a -> IO [a] #

Return a lazy list representing the contents of the supplied Chan, much like hGetContents.

writeList2Chan :: Chan a -> [a] -> IO () #

Write an entire list of items to a Chan.

Default

class Default a where #

A class for types with a default value.

Methods

def :: a #

The default value for this type.

Instances

Default Double 

Methods

def :: Double #

Default Float 

Methods

def :: Float #

Default Int 

Methods

def :: Int #

Default Int8 

Methods

def :: Int8 #

Default Int16 

Methods

def :: Int16 #

Default Int32 

Methods

def :: Int32 #

Default Int64 

Methods

def :: Int64 #

Default Integer 

Methods

def :: Integer #

Default Ordering 

Methods

def :: Ordering #

Default Word 

Methods

def :: Word #

Default Word8 

Methods

def :: Word8 #

Default Word16 

Methods

def :: Word16 #

Default Word32 

Methods

def :: Word32 #

Default Word64 

Methods

def :: Word64 #

Default () 

Methods

def :: () #

Default CShort 

Methods

def :: CShort #

Default CUShort 

Methods

def :: CUShort #

Default CInt 

Methods

def :: CInt #

Default CUInt 

Methods

def :: CUInt #

Default CLong 

Methods

def :: CLong #

Default CULong 

Methods

def :: CULong #

Default CLLong 

Methods

def :: CLLong #

Default CULLong 

Methods

def :: CULLong #

Default CFloat 

Methods

def :: CFloat #

Default CDouble 

Methods

def :: CDouble #

Default CPtrdiff 

Methods

def :: CPtrdiff #

Default CSize 

Methods

def :: CSize #

Default CSigAtomic 

Methods

def :: CSigAtomic #

Default CClock 

Methods

def :: CClock #

Default CTime 

Methods

def :: CTime #

Default CUSeconds 

Methods

def :: CUSeconds #

Default CSUSeconds 

Methods

def :: CSUSeconds #

Default CIntPtr 

Methods

def :: CIntPtr #

Default CUIntPtr 

Methods

def :: CUIntPtr #

Default CIntMax 

Methods

def :: CIntMax #

Default CUIntMax 

Methods

def :: CUIntMax #

Default All 

Methods

def :: All #

Default Any 

Methods

def :: Any #

Default [a] 

Methods

def :: [a] #

Default (Maybe a) 

Methods

def :: Maybe a #

Integral a => Default (Ratio a) 

Methods

def :: Ratio a #

Default a => Default (IO a) 

Methods

def :: IO a #

(Default a, RealFloat a) => Default (Complex a) 

Methods

def :: Complex a #

Default a => Default (Dual a) 

Methods

def :: Dual a #

Default (Endo a) 

Methods

def :: Endo a #

Num a => Default (Sum a) 

Methods

def :: Sum a #

Num a => Default (Product a) 

Methods

def :: Product a #

Default (First a) 

Methods

def :: First a #

Default (Last a) 

Methods

def :: Last a #

Default r => Default (e -> r) 

Methods

def :: e -> r #

(Default a, Default b) => Default (a, b) 

Methods

def :: (a, b) #

(Default a, Default b, Default c) => Default (a, b, c) 

Methods

def :: (a, b, c) #

(Default a, Default b, Default c, Default d) => Default (a, b, c, d) 

Methods

def :: (a, b, c, d) #

(Default a, Default b, Default c, Default d, Default e) => Default (a, b, c, d, e) 

Methods

def :: (a, b, c, d, e) #

(Default a, Default b, Default c, Default d, Default e, Default f) => Default (a, b, c, d, e, f) 

Methods

def :: (a, b, c, d, e, f) #

(Default a, Default b, Default c, Default d, Default e, Default f, Default g) => Default (a, b, c, d, e, f, g) 

Methods

def :: (a, b, c, d, e, f, g) #

Lens

(#) :: AReview t b -> b -> t infixr 8 #

An infix alias for review.

unto f # x ≡ f x
l # x ≡ x ^. re l

This is commonly used when using a Prism as a smart constructor.

>>> _Left # 4
Left 4

But it can be used for any Prism

>>> base 16 # 123
"7b"
(#) :: Iso'      s a -> a -> s
(#) :: Prism'    s a -> a -> s
(#) :: Review    s a -> a -> s
(#) :: Equality' s a -> a -> s

(#%%=) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r infix 4 #

A version of (%%=) that works on ALens.

(#%%~) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t infixr 4 #

A version of (%%~) that works on ALens.

>>> ("hello","world") & _2 #%%~ \x -> (length x, x ++ "!")
(5,("hello","world!"))

(#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m () infix 4 #

A version of (%=) that works on ALens.

(#%~) :: ALens s t a b -> (a -> b) -> s -> t infixr 4 #

A version of (%~) that works on ALens.

>>> ("hello","world") & _2 #%~ length
("hello",5)

(#=) :: MonadState s m => ALens s s a b -> b -> m () infix 4 #

A version of (.=) that works on ALens.

(#~) :: ALens s t a b -> b -> s -> t infixr 4 #

A version of (.~) that works on ALens.

>>> ("hello","there") & _2 #~ "world"
("hello","world")

(%%=) :: MonadState s m => Over * * p ((,) r) s s a b -> p a (r, b) -> m r infix 4 #

Modify the target of a Lens in the current state returning some extra information of type r or modify all targets of a Traversal in the current state, extracting extra information of type r and return a monoidal summary of the changes.

>>> runState (_1 %%= \x -> (f x, g x)) (a,b)
(f a,(g a,b))
(%%=) ≡ (state .)

It may be useful to think of (%%=), instead, as having either of the following more restricted type signatures:

(%%=) :: MonadState s m             => Iso s s a b       -> (a -> (r, b)) -> m r
(%%=) :: MonadState s m             => Lens s s a b      -> (a -> (r, b)) -> m r
(%%=) :: (MonadState s m, Monoid r) => Traversal s s a b -> (a -> (r, b)) -> m r

(%%@=) :: MonadState s m => IndexedLensLike * i ((,) r) s s a b -> (i -> a -> (r, b)) -> m r infix 4 #

Adjust the target of an IndexedLens returning a supplementary result, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the supplementary results.

l %%@= f ≡ state (l %%@~ f)
(%%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> (r, b)) -> s -> m r
(%%@=) :: (MonadState s m, Monoid r) => IndexedTraversal i s s a b -> (i -> a -> (r, b)) -> s -> m r

(%%@~) :: IndexedLensLike * i f s t a b -> (i -> a -> f b) -> s -> f t infixr 4 #

Adjust the target of an IndexedLens returning a supplementary result, or adjust all of the targets of an IndexedTraversal and return a monoidal summary of the supplementary results and the answer.

(%%@~) ≡ withIndex
(%%@~) :: Functor f => IndexedLens i s t a b      -> (i -> a -> f b) -> s -> f t
(%%@~) :: Applicative f => IndexedTraversal i s t a b -> (i -> a -> f b) -> s -> f t

In particular, it is often useful to think of this function as having one of these even more restricted type signatures:

(%%@~) ::             IndexedLens i s t a b      -> (i -> a -> (r, b)) -> s -> (r, t)
(%%@~) :: Monoid r => IndexedTraversal i s t a b -> (i -> a -> (r, b)) -> s -> (r, t)

(%%~) :: LensLike * f s t a b -> (a -> f b) -> s -> f t infixr 4 #

(%%~) can be used in one of two scenarios:

When applied to a Lens, it can edit the target of the Lens in a structure, extracting a functorial result.

When applied to a Traversal, it can edit the targets of the traversals, extracting an applicative summary of its actions.

>>> [66,97,116,109,97,110] & each %%~ \a -> ("na", chr a)
("nananananana","Batman")

For all that the definition of this combinator is just:

(%%~) ≡ id

It may be beneficial to think about it as if it had these even more restricted types, however:

(%%~) :: Functor f =>     Iso s t a b       -> (a -> f b) -> s -> f t
(%%~) :: Functor f =>     Lens s t a b      -> (a -> f b) -> s -> f t
(%%~) :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t

When applied to a Traversal, it can edit the targets of the traversals, extracting a supplemental monoidal summary of its actions, by choosing f = ((,) m)

(%%~) ::             Iso s t a b       -> (a -> (r, b)) -> s -> (r, t)
(%%~) ::             Lens s t a b      -> (a -> (r, b)) -> s -> (r, t)
(%%~) :: Monoid m => Traversal s t a b -> (a -> (m, b)) -> s -> (m, t)

(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m () infix 4 #

Map over the target of a Lens or all of the targets of a Setter or Traversal in our monadic state.

>>> execState (do _1 %= f;_2 %= g) (a,b)
(f a,g b)
>>> execState (do both %= f) (a,b)
(f a,f b)
(%=) :: MonadState s m => Iso' s a       -> (a -> a) -> m ()
(%=) :: MonadState s m => Lens' s a      -> (a -> a) -> m ()
(%=) :: MonadState s m => Traversal' s a -> (a -> a) -> m ()
(%=) :: MonadState s m => Setter' s a    -> (a -> a) -> m ()
(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()

(%@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () infix 4 #

Adjust every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

When you do not need access to the index then (%=) is more liberal in what it can accept.

l %= f ≡ l %@= const f
(%@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> a -> b) -> m ()
(%@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> a -> b) -> m ()
(%@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> a -> b) -> m ()

(%@~) :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t infixr 4 #

Adjust every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

(%@~) ≡ iover

When you do not need access to the index then (%~) is more liberal in what it can accept.

l %~ f ≡ l %@~ const f
(%@~) :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
(%@~) :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
(%@~) :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

(%~) :: ASetter s t a b -> (a -> b) -> s -> t infixr 4 #

Modifies the target of a Lens or all of the targets of a Setter or Traversal with a user supplied function.

This is an infix version of over.

fmap f ≡ mapped %~ f
fmapDefault f ≡ traverse %~ f
>>> (a,b,c) & _3 %~ f
(a,b,f c)
>>> (a,b) & both %~ f
(f a,f b)
>>> _2 %~ length $ (1,"hello")
(1,5)
>>> traverse %~ f $ [a,b,c]
[f a,f b,f c]
>>> traverse %~ even $ [1,2,3]
[False,True,False]
>>> traverse.traverse %~ length $ [["hello","world"],["!!!"]]
[[5,5],[3]]
(%~) :: Setter s t a b    -> (a -> b) -> s -> t
(%~) :: Iso s t a b       -> (a -> b) -> s -> t
(%~) :: Lens s t a b      -> (a -> b) -> s -> t
(%~) :: Traversal s t a b -> (a -> b) -> s -> t

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

Since: 4.8.0.0

(&&=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by taking their logical && with a value.

>>> execState (do _1 &&= True; _2 &&= False; _3 &&= True; _4 &&= False) (True,True,False,False)
(True,False,False,False)
(&&=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
(&&=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
(&&=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
(&&=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(&&~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 #

Logically && the target(s) of a Bool-valued Lens or Setter.

>>> both &&~ True $ (False, True)
(False,True)
>>> both &&~ False $ (False, True)
(False,False)
(&&~) :: Setter' s Bool    -> Bool -> s -> s
(&&~) :: Iso' s Bool       -> Bool -> s -> s
(&&~) :: Lens' s Bool      -> Bool -> s -> s
(&&~) :: Traversal' s Bool -> Bool -> s -> s

(&~) :: s -> State s a -> s infixl 1 #

This can be used to chain lens operations using op= syntax rather than op~ syntax for simple non-type-changing cases.

>>> (10,20) & _1 .~ 30 & _2 .~ 40
(30,40)
>>> (10,20) &~ do _1 .= 30; _2 .= 40
(30,40)

This does not support type-changing assignment, e.g.

>>> (10,20) & _1 .~ "hello"
("hello",20)

(**=) :: (MonadState s m, Floating a) => ASetter' s a -> a -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to an arbitrary power

>>> execState (do _1 **= c; _2 **= d) (a,b)
(a**c,b**d)
(**=) ::  (MonadState s m, Floating a) => Setter' s a    -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Iso' s a       -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Lens' s a      -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Traversal' s a -> a -> m ()

(**~) :: Floating a => ASetter s t a a -> a -> s -> t infixr 4 #

Raise the target(s) of a floating-point valued Lens, Setter or Traversal to an arbitrary power.

>>> (a,b) & _1 **~ c
(a**c,b)
>>> (a,b) & both **~ c
(a**c,b**c)
>>> _2 **~ 10 $ (3,2)
(3,1024.0)
(**~) :: Floating a => Setter' s a    -> a -> s -> s
(**~) :: Floating a => Iso' s a       -> a -> s -> s
(**~) :: Floating a => Lens' s a      -> a -> s -> s
(**~) :: Floating a => Traversal' s a -> a -> s -> s

(*=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by multiplying by value.

>>> execState (do _1 *= c; _2 *= d) (a,b)
(a * c,b * d)
(*=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(*=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(*=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(*=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(*~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Multiply the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 *~ c
(a * c,b)
>>> (a,b) & both *~ c
(a * c,b * c)
>>> (1,2) & _2 *~ 4
(1,8)
>>> Just 24 & mapped *~ 2
Just 48
(*~) :: Num a => Setter' s a    -> a -> s -> s
(*~) :: Num a => Iso' s a       -> a -> s -> s
(*~) :: Num a => Lens' s a      -> a -> s -> s
(*~) :: Num a => Traversal' s a -> a -> s -> s

(+=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by adding a value.

Example:

fresh :: MonadState Int m => m Int
fresh = do
  id += 1
  use id
>>> execState (do _1 += c; _2 += d) (a,b)
(a + c,b + d)
>>> execState (do _1.at 1.non 0 += 10) (Map.fromList [(2,100)],"hello")
(fromList [(1,10),(2,100)],"hello")
(+=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(+=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(+=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(+=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(+~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Increment the target(s) of a numerically valued Lens, Setter or Traversal.

>>> (a,b) & _1 +~ c
(a + c,b)
>>> (a,b) & both +~ c
(a + c,b + c)
>>> (1,2) & _2 +~ 1
(1,3)
>>> [(a,b),(c,d)] & traverse.both +~ e
[(a + e,b + e),(c + e,d + e)]
(+~) :: Num a => Setter' s a    -> a -> s -> s
(+~) :: Num a => Iso' s a       -> a -> s -> s
(+~) :: Num a => Lens' s a      -> a -> s -> s
(+~) :: Num a => Traversal' s a -> a -> s -> s

(-=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by subtracting a value.

>>> execState (do _1 -= c; _2 -= d) (a,b)
(a - c,b - d)
(-=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(-=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(-=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(-=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(-~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Decrement the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 -~ c
(a - c,b)
>>> (a,b) & both -~ c
(a - c,b - c)
>>> _1 -~ 2 $ (1,2)
(-1,2)
>>> mapped.mapped -~ 1 $ [[4,5],[6,7]]
[[3,4],[5,6]]
(-~) :: Num a => Setter' s a    -> a -> s -> s
(-~) :: Num a => Iso' s a       -> a -> s -> s
(-~) :: Num a => Lens' s a      -> a -> s -> s
(-~) :: Num a => Traversal' s a -> a -> s -> s

(...) :: (Applicative f, Plated c) => LensLike * f s t c c -> Over * * p f c c a b -> Over * * p f s t a b infixr 9 #

Compose through a plate

(.=) :: MonadState s m => ASetter s s a b -> b -> m () infix 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is an infix version of assign.

>>> execState (do _1 .= c; _2 .= d) (a,b)
(c,d)
>>> execState (both .= c) (a,b)
(c,c)
(.=) :: MonadState s m => Iso' s a       -> a -> m ()
(.=) :: MonadState s m => Lens' s a      -> a -> m ()
(.=) :: MonadState s m => Traversal' s a -> a -> m ()
(.=) :: MonadState s m => Setter' s a    -> a -> m ()

It puts the state in the monad or it gets the hose again.

(.>) :: (st -> r) -> (kab -> st) -> kab -> r infixr 9 #

Compose a non-indexed function with an Indexed function.

Mnemonically, the > points to the indexing we want to preserve.

This is the same as (.).

f . g (and f .> g) gives you the index of g unless g is index-preserving, like a Prism, Iso or Equality, in which case it'll pass through the index of f.

>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
>>> nestedMap^..(itraversed.>itraversed).withIndex
[(10,"one,ten"),(20,"one,twenty"),(30,"two,thirty"),(40,"two,forty")]

(.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m () infix 4 #

Replace every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

When you do not need access to the index then (.=) is more liberal in what it can accept.

l .= b ≡ l .@= const b
(.@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> b) -> m ()
(.@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> b) -> m ()
(.@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> b) -> m ()

(.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t infixr 4 #

Replace every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

(.@~) ≡ iset

When you do not need access to the index then (.~) is more liberal in what it can accept.

l .~ b ≡ l .@~ const b
(.@~) :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
(.@~) :: IndexedLens i s t a b      -> (i -> b) -> s -> t
(.@~) :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

(.~) :: ASetter s t a b -> b -> s -> t infixr 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

This is an infix version of set, provided for consistency with (.=).

f <$ a ≡ mapped .~ f $ a
>>> (a,b,c,d) & _4 .~ e
(a,b,c,e)
>>> (42,"world") & _1 .~ "hello"
("hello","world")
>>> (a,b) & both .~ c
(c,c)
(.~) :: Setter s t a b    -> b -> s -> t
(.~) :: Iso s t a b       -> b -> s -> t
(.~) :: Lens s t a b      -> b -> s -> t
(.~) :: Traversal s t a b -> b -> s -> t

(//=) :: (MonadState s m, Fractional a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by dividing by a value.

>>> execState (do _1 //= c; _2 //= d) (a,b)
(a / c,b / d)
(//=) :: (MonadState s m, Fractional a) => Setter' s a    -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Iso' s a       -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Lens' s a      -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Traversal' s a -> a -> m ()

(//~) :: Fractional a => ASetter s t a a -> a -> s -> t infixr 4 #

Divide the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 //~ c
(a / c,b)
>>> (a,b) & both //~ c
(a / c,b / c)
>>> ("Hawaii",10) & _2 //~ 2
("Hawaii",5.0)
(//~) :: Fractional a => Setter' s a    -> a -> s -> s
(//~) :: Fractional a => Iso' s a       -> a -> s -> s
(//~) :: Fractional a => Lens' s a      -> a -> s -> s
(//~) :: Fractional a => Traversal' s a -> a -> s -> s

(<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b infix 4 #

A version of (<%=) that works on ALens.

(<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t) infixr 4 #

A version of (<%~) that works on ALens.

>>> ("hello","world") & _2 <#%~ length
(5,("hello",5))

(<#=) :: MonadState s m => ALens s s a b -> b -> m b infix 4 #

A version of (<.=) that works on ALens.

(<#~) :: ALens s t a b -> b -> s -> (b, t) infixr 4 #

A version of (<.~) that works on ALens.

>>> ("hello","there") & _2 <#~ "world"
("world",("hello","world"))

(<%=) :: MonadState s m => LensLike * ((,) b) s s a b -> (a -> b) -> m b infix 4 #

Modify the target of a Lens into your Monad's state by a user supplied function and return the result.

When applied to a Traversal, it this will return a monoidal summary of all of the intermediate results.

When you do not need the result of the operation, (%=) is more flexible.

(<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
(<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
(<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a

(<%@=) :: MonadState s m => IndexedLensLike * i ((,) b) s s a b -> (i -> a -> b) -> m b infix 4 #

Adjust the target of an IndexedLens returning the intermediate result, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the intermediate results.

(<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m b
(<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m b

(<%@~) :: Over * * (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t) infixr 4 #

Adjust the target of an IndexedLens returning the intermediate result, or adjust all of the targets of an IndexedTraversal and return a monoidal summary along with the answer.

l <%~ f ≡ l <%@~ const f

When you do not need access to the index then (<%~) is more liberal in what it can accept.

If you do not need the intermediate result, you can use (%@~) or even (%~).

(<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (b, t)
(<%@~) :: Monoid b => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (b, t)

(<%~) :: LensLike * ((,) b) s t a b -> (a -> b) -> s -> (b, t) infixr 4 #

Modify the target of a Lens and return the result.

When you do not need the result of the operation, (%~) is more flexible.

(<%~) ::             Lens s t a b      -> (a -> b) -> s -> (b, t)
(<%~) ::             Iso s t a b       -> (a -> b) -> s -> (b, t)
(<%~) :: Monoid b => Traversal s t a b -> (a -> b) -> s -> (b, t)

(<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Logically && a Boolean valued Lens into your Monad's state and return the result.

When you do not need the result of the operation, (&&=) is more flexible.

(<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<&&=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<&&~) :: LensLike * ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 #

Logically && a Boolean valued Lens and return the result.

When you do not need the result of the operation, (&&~) is more flexible.

(<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<&&~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 #

Infix flipped fmap.

(<&>) = flip fmap

(<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Raise the target of a floating-point valued Lens into your Monad's state to an arbitrary power and return the result.

When you do not need the result of the operation, (**=) is more flexible.

(<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
(<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<**~) :: Floating a => LensLike * ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Raise the target of a floating-point valued Lens to an arbitrary power and return the result.

When you do not need the result of the operation, (**~) is more flexible.

(<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
(<**~) :: Floating a => Iso' s a  -> a -> s -> (a, s)

(<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Multiply the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the multiplication, (*=) is more flexible.

(<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<*~) :: Num a => LensLike * ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Multiply the target of a numerically valued Lens and return the result.

When you do not need the result of the multiplication, (*~) is more flexible.

(<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<*~) :: Num a => Iso'  s a -> a -> s -> (a, s)

(<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Add to the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the addition, (+=) is more flexible.

(<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<+~) :: Num a => LensLike * ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Increment the target of a numerically valued Lens and return the result.

When you do not need the result of the addition, (+~) is more flexible.

(<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<+~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Subtract from the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the subtraction, (-=) is more flexible.

(<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<-~) :: Num a => LensLike * ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Decrement the target of a numerically valued Lens and return the result.

When you do not need the result of the subtraction, (-~) is more flexible.

(<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<-~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<.) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> r infixr 9 #

Compose an Indexed function with a non-indexed function.

Mnemonically, the < points to the indexing we want to preserve.

>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
>>> nestedMap^..(itraversed<.itraversed).withIndex
[(1,"one,ten"),(1,"one,twenty"),(2,"two,thirty"),(2,"two,forty")]

(<.=) :: MonadState s m => ASetter s s a b -> b -> m b infix 4 #

Set with pass-through

This is useful for chaining assignment without round-tripping through your Monad stack.

do x <- _2 <.= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using l .= d will avoid unused binding warnings.

(<.=) :: MonadState s m => Setter s s a b    -> b -> m b
(<.=) :: MonadState s m => Iso s s a b       -> b -> m b
(<.=) :: MonadState s m => Lens s s a b      -> b -> m b
(<.=) :: MonadState s m => Traversal s s a b -> b -> m b

(<.>) :: Indexable (i, j) p => (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> p a b -> r infixr 9 #

Composition of Indexed functions.

Mnemonically, the < and > points to the fact that we want to preserve the indices.

>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
>>> nestedMap^..(itraversed<.>itraversed).withIndex
[((1,10),"one,ten"),((1,20),"one,twenty"),((2,30),"two,thirty"),((2,40),"two,forty")]

(<.~) :: ASetter s t a b -> b -> s -> (b, t) infixr 4 #

Set with pass-through.

This is mostly present for consistency, but may be useful for chaining assignments.

If you do not need a copy of the intermediate result, then using l .~ t directly is a good idea.

>>> (a,b) & _1 <.~ c
(c,(c,b))
>>> ("good","morning","vietnam") & _3 <.~ "world"
("world",("good","morning","world"))
>>> (42,Map.fromList [("goodnight","gracie")]) & _2.at "hello" <.~ Just "world"
(Just "world",(42,fromList [("goodnight","gracie"),("hello","world")]))
(<.~) :: Setter s t a b    -> b -> s -> (b, t)
(<.~) :: Iso s t a b       -> b -> s -> (b, t)
(<.~) :: Lens s t a b      -> b -> s -> (b, t)
(<.~) :: Traversal s t a b -> b -> s -> (b, t)

(<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Divide the target of a fractionally valued Lens into your Monad's state and return the result.

When you do not need the result of the division, (//=) is more flexible.

(<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
(<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<//~) :: Fractional a => LensLike * ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Divide the target of a fractionally valued Lens and return the result.

When you do not need the result of the division, (//~) is more flexible.

(<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
(<//~) :: Fractional a => Iso'  s a -> a -> s -> (a, s)

(<<%=) :: (Strong p, MonadState s m) => Over * * p ((,) a) s s a b -> p a b -> m a infix 4 #

Modify the target of a Lens into your Monad's state by a user supplied function and return the old value that was replaced.

When applied to a Traversal, it this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (%=) is more flexible.

(<<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
(<<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
(<<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a
(<<%=) :: MonadState s m => LensLike ((,)a) s s a b -> (a -> b) -> m a

(<<%@=) :: MonadState s m => IndexedLensLike * i ((,) a) s s a b -> (i -> a -> b) -> m a infix 4 #

Adjust the target of an IndexedLens returning the old value, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the old values.

(<<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m a
(<<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m a

(<<%@~) :: Over * * (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t) infixr 4 #

Adjust the target of an IndexedLens returning the old value, or adjust all of the targets of an IndexedTraversal and return a monoidal summary of the old values along with the answer.

(<<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (a, t)
(<<%@~) :: Monoid a => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (a, t)

(<<%~) :: LensLike * ((,) a) s t a b -> (a -> b) -> s -> (a, t) infixr 4 #

Modify the target of a Lens, but return the old value.

When you do not need the old value, (%~) is more flexible.

(<<%~) ::             Lens s t a b      -> (a -> b) -> s -> (a, t)
(<<%~) ::             Iso s t a b       -> (a -> b) -> s -> (a, t)
(<<%~) :: Monoid a => Traversal s t a b -> (a -> b) -> s -> (a, t)

(<<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Modify the target of a Lens into your Monad's state by taking its logical && with a value and return the old value that was replaced.

When you do not need the result of the operation, (&&=) is more flexible.

(<<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<<&&=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<&&~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 #

Logically && the target of a Bool-valued Lens and return the old value.

When you do not need the old value, (&&~) is more flexible.

>>> (False,6) & _1 <<&&~ True
(False,(False,6))
>>> ("hello",True) & _2 <<&&~ False
(True,("hello",False))
(<<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<<&&~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by an arbitrary power and return the old value that was replaced.

When you do not need the result of the operation, (**=) is more flexible.

(<<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
(<<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<<**~) :: Floating a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Raise the target of a floating-point valued Lens to an arbitrary power and return the old value.

When you do not need the old value, (**~) is more flexible.

>>> (a,b) & _1 <<**~ c
(a,(a**c,b))
>>> (a,b) & _2 <<**~ c
(b,(a,b**c))
(<<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
(<<**~) :: Floating a => Iso' s a -> a -> s -> (a, s)

(<<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by multipling a value and return the old value that was replaced.

When you do not need the result of the operation, (*=) is more flexible.

(<<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<*~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Multiply the target of a numerically valued Lens and return the old value.

When you do not need the old value, (-~) is more flexible.

>>> (a,b) & _1 <<*~ c
(a,(a * c,b))
>>> (a,b) & _2 <<*~ c
(b,(a,b * c))
(<<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<*~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by adding a value and return the old value that was replaced.

When you do not need the result of the operation, (+=) is more flexible.

(<<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<+~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Increment the target of a numerically valued Lens and return the old value.

When you do not need the old value, (+~) is more flexible.

>>> (a,b) & _1 <<+~ c
(a,(a + c,b))
>>> (a,b) & _2 <<+~ c
(b,(a,b + c))
(<<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<+~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by subtracting a value and return the old value that was replaced.

When you do not need the result of the operation, (-=) is more flexible.

(<<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<-~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Decrement the target of a numerically valued Lens and return the old value.

When you do not need the old value, (-~) is more flexible.

>>> (a,b) & _1 <<-~ c
(a,(a - c,b))
>>> (a,b) & _2 <<-~ c
(b,(a,b - c))
(<<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<-~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<.=) :: MonadState s m => LensLike * ((,) a) s s a b -> b -> m a infix 4 #

Replace the target of a Lens into your Monad's state with a user supplied value and return the old value that was replaced.

When applied to a Traversal, it this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (.=) is more flexible.

(<<.=) :: MonadState s m             => Lens' s a      -> a -> m a
(<<.=) :: MonadState s m             => Iso' s a       -> a -> m a
(<<.=) :: (MonadState s m, Monoid t) => Traversal' s a -> a -> m a

(<<.~) :: LensLike * ((,) a) s t a b -> b -> s -> (a, t) infixr 4 #

Replace the target of a Lens, but return the old value.

When you do not need the old value, (.~) is more flexible.

(<<.~) ::             Lens s t a b      -> b -> s -> (a, t)
(<<.~) ::             Iso s t a b       -> b -> s -> (a, t)
(<<.~) :: Monoid a => Traversal s t a b -> b -> s -> (a, t)

(<<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monads state by dividing by a value and return the old value that was replaced.

When you do not need the result of the operation, (//=) is more flexible.

(<<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
(<<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<<//~) :: Fractional a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Divide the target of a numerically valued Lens and return the old value.

When you do not need the old value, (//~) is more flexible.

>>> (a,b) & _1 <<//~ c
(a,(a / c,b))
>>> ("Hawaii",10) & _2 <<//~ 2
(10.0,("Hawaii",5.0))
(<<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
(<<//~) :: Fractional a => Iso' s a -> a -> s -> (a, s)

(<<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r infix 4 #

Modify the target of a Lens into your Monad's state by mappending a value and return the old value that was replaced.

When you do not need the result of the operation, (<>=) is more flexible.

(<<<>=) :: (MonadState s m, Monoid r) => Lens' s r -> r -> m r
(<<<>=) :: (MonadState s m, Monoid r) => Iso' s r -> r -> m r

(<<<>~) :: Monoid r => LensLike' ((,) r) s r -> r -> s -> (r, s) infixr 4 #

Modify the target of a monoidally valued Lens by mappending a new value and return the old value.

When you do not need the old value, (<>~) is more flexible.

>>> (Sum a,b) & _1 <<<>~ Sum c
(Sum {getSum = a},(Sum {getSum = a + c},b))
>>> _2 <<<>~ ", 007" $ ("James", "Bond")
("Bond",("James","Bond, 007"))
(<<<>~) :: Monoid r => Lens' s r -> r -> s -> (r, s)
(<<<>~) :: Monoid r => Iso' s r -> r -> s -> (r, s)

(<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r infix 4 #

mappend a monoidal value onto the end of the target of a Lens into your Monad's state and return the result.

When you do not need the result of the operation, (<>=) is more flexible.

(<<>~) :: Monoid m => LensLike * ((,) m) s t m m -> m -> s -> (m, t) infixr 4 #

mappend a monoidal value onto the end of the target of a Lens and return the result.

When you do not need the result of the operation, (<>~) is more flexible.

(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by a non-negative power and return the old value that was replaced.

When you do not need the result of the operation, (^=) is more flexible.

(<<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
(<<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> a -> m a

(<<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by an integral power and return the old value that was replaced.

When you do not need the result of the operation, (^^=) is more flexible.

(<<^^=) :: (MonadState s m, Fractional a, Integral e) => Lens' s a -> e -> m a
(<<^^=) :: (MonadState s m, Fractional a, Integral e) => Iso' s a -> e -> m a

(<<^^~) :: (Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 #

Raise the target of a fractionally valued Lens to an integral power and return the old value.

When you do not need the old value, (^^~) is more flexible.

(<<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> S -> (a, s)

(<<^~) :: (Num a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 #

Raise the target of a numerically valued Lens to a non-negative power and return the old value.

When you do not need the old value, (^~) is more flexible.

(<<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Modify the target of a Lens into your Monad's state by taking its logical || with a value and return the old value that was replaced.

When you do not need the result of the operation, (||=) is more flexible.

(<<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<<||=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<||~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 #

Logically || the target of a Bool-valued Lens and return the old value.

When you do not need the old value, (||~) is more flexible.

>>> (False,6) & _1 <<||~ True
(False,(True,6))
>>> ("hello",True) & _2 <<||~ False
(True,("hello",True))
(<<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<<||~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<~) :: MonadState s m => ALens s s a b -> m b -> m b infixr 2 #

Run a monadic action, and set the target of Lens to its result.

(<<~) :: MonadState s m => Iso s s a b   -> m b -> m b
(<<~) :: MonadState s m => Lens s s a b  -> m b -> m b

NB: This is limited to taking an actual Lens than admitting a Traversal because there are potential loss of state issues otherwise.

(<>=) :: (MonadState s m, Monoid a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by mappending a value.

>>> execState (do _1 <>= Sum c; _2 <>= Product d) (Sum a,Product b)
(Sum {getSum = a + c},Product {getProduct = b * d})
>>> execState (both <>= "!!!") ("hello","world")
("hello!!!","world!!!")
(<>=) :: (MonadState s m, Monoid a) => Setter' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Iso' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Lens' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Traversal' s a -> a -> m ()

(<>~) :: Monoid a => ASetter s t a a -> a -> s -> t infixr 4 #

Modify the target of a monoidally valued by mappending another value.

>>> (Sum a,b) & _1 <>~ Sum c
(Sum {getSum = a + c},b)
>>> (Sum a,Sum b) & both <>~ Sum c
(Sum {getSum = a + c},Sum {getSum = b + c})
>>> both <>~ "!!!" $ ("hello","world")
("hello!!!","world!!!")
(<>~) :: Monoid a => Setter s t a a    -> a -> s -> t
(<>~) :: Monoid a => Iso s t a a       -> a -> s -> t
(<>~) :: Monoid a => Lens s t a a      -> a -> s -> t
(<>~) :: Monoid a => Traversal s t a a -> a -> s -> t

(<?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m b infix 4 #

Set Just a value with pass-through

This is useful for chaining assignment without round-tripping through your Monad stack.

do x <- at "foo" <?= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using l ?= d will avoid unused binding warnings.

(<?=) :: MonadState s m => Setter s s a (Maybe b)    -> b -> m b
(<?=) :: MonadState s m => Iso s s a (Maybe b)       -> b -> m b
(<?=) :: MonadState s m => Lens s s a (Maybe b)      -> b -> m b
(<?=) :: MonadState s m => Traversal s s a (Maybe b) -> b -> m b

(<?~) :: ASetter s t a (Maybe b) -> b -> s -> (b, t) infixr 4 #

Set to Just a value with pass-through.

This is mostly present for consistency, but may be useful for for chaining assignments.

If you do not need a copy of the intermediate result, then using l ?~ d directly is a good idea.

>>> import Data.Map as Map
>>> _2.at "hello" <?~ "world" $ (42,Map.fromList [("goodnight","gracie")])
("world",(42,fromList [("goodnight","gracie"),("hello","world")]))
(<?~) :: Setter s t a (Maybe b)    -> b -> s -> (b, t)
(<?~) :: Iso s t a (Maybe b)       -> b -> s -> (b, t)
(<?~) :: Lens s t a (Maybe b)      -> b -> s -> (b, t)
(<?~) :: Traversal s t a (Maybe b) -> b -> s -> (b, t)

(<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Raise the target of a numerically valued Lens into your Monad's state to a non-negative Integral power and return the result.

When you do not need the result of the operation, (^=) is more flexible.

(<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
(<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> e -> m a

(<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Raise the target of a fractionally valued Lens into your Monad's state to an Integral power and return the result.

When you do not need the result of the operation, (^^=) is more flexible.

(<^^=) :: (MonadState s m, Fractional b, Integral e) => Lens' s a -> e -> m a
(<^^=) :: (MonadState s m, Fractional b, Integral e) => Iso' s a  -> e -> m a

(<^^~) :: (Fractional a, Integral e) => LensLike * ((,) a) s t a a -> e -> s -> (a, t) infixr 4 #

Raise the target of a fractionally valued Lens to an Integral power and return the result.

When you do not need the result of the operation, (^^~) is more flexible.

(<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<^~) :: (Num a, Integral e) => LensLike * ((,) a) s t a a -> e -> s -> (a, t) infixr 4 #

Raise the target of a numerically valued Lens to a non-negative Integral power and return the result.

When you do not need the result of the operation, (^~) is more flexible.

(<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<|) :: Cons s s a a => a -> s -> s infixr 5 #

cons an element onto a container.

This is an infix alias for cons.

>>> a <| []
[a]
>>> a <| [b, c]
[a,b,c]
>>> a <| Seq.fromList []
fromList [a]
>>> a <| Seq.fromList [b, c]
fromList [a,b,c]

(<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Logically || a Boolean valued Lens into your Monad's state and return the result.

When you do not need the result of the operation, (||=) is more flexible.

(<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<||=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<||~) :: LensLike * ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 #

Logically || a Boolean valued Lens and return the result.

When you do not need the result of the operation, (||~) is more flexible.

(<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<||~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<~) :: MonadState s m => ASetter s s a b -> m b -> m () infixr 2 #

Run a monadic action, and set all of the targets of a Lens, Setter or Traversal to its result.

(<~) :: MonadState s m => Iso s s a b       -> m b -> m ()
(<~) :: MonadState s m => Lens s s a b      -> m b -> m ()
(<~) :: MonadState s m => Traversal s s a b -> m b -> m ()
(<~) :: MonadState s m => Setter s s a b    -> m b -> m ()

As a reasonable mnemonic, this lets you store the result of a monadic action in a Lens rather than in a local variable.

do foo <- bar
   ...

will store the result in a variable, while

do foo <~ bar
   ...

will store the result in a Lens, Setter, or Traversal.

(?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m () infix 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with Just a new value, irrespective of the old.

>>> execState (do at 1 ?= a; at 2 ?= b) Map.empty
fromList [(1,a),(2,b)]
>>> execState (do _1 ?= b; _2 ?= c) (Just a, Nothing)
(Just b,Just c)
(?=) :: MonadState s m => Iso' s (Maybe a)       -> a -> m ()
(?=) :: MonadState s m => Lens' s (Maybe a)      -> a -> m ()
(?=) :: MonadState s m => Traversal' s (Maybe a) -> a -> m ()
(?=) :: MonadState s m => Setter' s (Maybe a)    -> a -> m ()

(??) :: Functor f => f (a -> b) -> a -> f b infixl 1 #

This is convenient to flip argument order of composite functions defined as:

fab ?? a = fmap ($ a) fab

For the Functor instance f = ((->) r) you can reason about this function as if the definition was (??) ≡ flip:

>>> (h ?? x) a
h a x
>>> execState ?? [] $ modify (1:)
[1]
>>> over _2 ?? ("hello","world") $ length
("hello",5)
>>> over ?? length ?? ("hello","world") $ _2
("hello",5)

(?~) :: ASetter s t a (Maybe b) -> b -> s -> t infixr 4 #

Set the target of a Lens, Traversal or Setter to Just a value.

l ?~ t ≡ set l (Just t)
>>> Nothing & id ?~ a
Just a
>>> Map.empty & at 3 ?~ x
fromList [(3,x)]
(?~) :: Setter s t a (Maybe b)    -> b -> s -> t
(?~) :: Iso s t a (Maybe b)       -> b -> s -> t
(?~) :: Lens s t a (Maybe b)      -> b -> s -> t
(?~) :: Traversal s t a (Maybe b) -> b -> s -> t

type ALens s t a b = LensLike * (Pretext (->) a b) s t a b #

When you see this as an argument to a function, it expects a Lens.

This type can also be used when you need to store a Lens in a container, since it is rank-1. You can turn them back into a Lens with cloneLens, or use it directly with combinators like storing and (^#).

type ALens' s a = ALens s s a a #

type APrism s t a b = Market a b a (Identity b) -> Market a b s (Identity t) #

If you see this in a signature for a function, the function is expecting a Prism.

type APrism' s a = APrism s s a a #

type APrism' = Simple APrism

type AReview t b = Optic' * * (Tagged *) Identity t b #

If you see this in a signature for a function, the function is expecting a Review (in practice, this usually means a Prism).

type ASetter s t a b = (a -> Identity b) -> s -> Identity t #

Running a Setter instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

type ASetter' s a = ASetter s s a a #

This is a useful alias for use when consuming a Setter'.

Most user code will never have to use this type.

type ASetter' = Simple ASetter

type ATraversal s t a b = LensLike * (Bazaar (->) a b) s t a b #

When you see this as an argument to a function, it expects a Traversal.

type ATraversal1 s t a b = LensLike * (Bazaar1 (->) a b) s t a b #

When you see this as an argument to a function, it expects a Traversal1.

type Accessing p m s a = p a (Const * m a) -> s -> Const * m s #

This is a convenient alias used when consuming (indexed) getters and (indexed) folds in a highly general fashion.

type AnEquality k2 k1 s t a b = Identical * k1 a (Proxy k2 b) a (Proxy k2 b) -> Identical * k1 a (Proxy k2 b) s (Proxy k2 t) #

When you see this as an argument to a function, it expects an Equality.

type AnEquality' k2 s a = AnEquality k2 k2 s s a a #

type AnIndexedLens i s t a b = Optical * * * * (Indexed i) (->) (Pretext (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedLens

type AnIndexedSetter i s t a b = Indexed i a (Identity b) -> s -> Identity t #

Running an IndexedSetter instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

type AnIndexedTraversal i s t a b = Over * * (Indexed i) (Bazaar (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedTraversal.

type AnIndexedTraversal1 i s t a b = Over * * (Indexed i) (Bazaar1 (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedTraversal1.

type AnIso s t a b = Exchange a b a (Identity b) -> Exchange a b s (Identity t) #

When you see this as an argument to a function, it expects an Iso.

type AnIso' s a = AnIso s s a a #

type As k2 a = Equality' k2 a a #

Composable asTypeOf. Useful for constraining excess polymorphism, foo . (id :: As Int) . bar.

class AsEmpty a where #

Methods

_Empty :: Prism' a () #

>>> isn't _Empty [1,2,3]
True

Instances

AsEmpty Ordering 

Methods

_Empty :: Prism' Ordering () #

AsEmpty () 

Methods

_Empty :: Prism' () () #

AsEmpty ByteString 

Methods

_Empty :: Prism' ByteString () #

AsEmpty ByteString 

Methods

_Empty :: Prism' ByteString () #

AsEmpty Text 

Methods

_Empty :: Prism' Text () #

AsEmpty Text 

Methods

_Empty :: Prism' Text () #

AsEmpty Event 

Methods

_Empty :: Prism' Event () #

AsEmpty All 

Methods

_Empty :: Prism' All () #

AsEmpty Any 

Methods

_Empty :: Prism' Any () #

AsEmpty IntSet 

Methods

_Empty :: Prism' IntSet () #

AsEmpty [a] 

Methods

_Empty :: Prism' [a] () #

AsEmpty (Maybe a) 

Methods

_Empty :: Prism' (Maybe a) () #

AsEmpty a => AsEmpty (Dual a) 

Methods

_Empty :: Prism' (Dual a) () #

(Eq a, Num a) => AsEmpty (Sum a) 

Methods

_Empty :: Prism' (Sum a) () #

(Eq a, Num a) => AsEmpty (Product a) 

Methods

_Empty :: Prism' (Product a) () #

AsEmpty (First a) 

Methods

_Empty :: Prism' (First a) () #

AsEmpty (Last a) 

Methods

_Empty :: Prism' (Last a) () #

AsEmpty (IntMap a) 

Methods

_Empty :: Prism' (IntMap a) () #

AsEmpty (Seq a) 

Methods

_Empty :: Prism' (Seq a) () #

AsEmpty (Set a) 

Methods

_Empty :: Prism' (Set a) () #

AsEmpty (Vector a) 

Methods

_Empty :: Prism' (Vector a) () #

Storable a => AsEmpty (Vector a) 

Methods

_Empty :: Prism' (Vector a) () #

Unbox a => AsEmpty (Vector a) 

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (HashSet a) 

Methods

_Empty :: Prism' (HashSet a) () #

(AsEmpty a, AsEmpty b) => AsEmpty (a, b) 

Methods

_Empty :: Prism' (a, b) () #

AsEmpty (HashMap k a) 

Methods

_Empty :: Prism' (HashMap k a) () #

AsEmpty (Map k a) 

Methods

_Empty :: Prism' (Map k a) () #

(AsEmpty a, AsEmpty b, AsEmpty c) => AsEmpty (a, b, c) 

Methods

_Empty :: Prism' (a, b, c) () #

class Ixed m where #

This simple Traversal lets you traverse the value at a given key in a Map or element at an ordinal position in a list or Seq.

Methods

ix :: Index m -> Traversal' m (IxValue m) #

This simple Traversal lets you traverse the value at a given key in a Map or element at an ordinal position in a list or Seq.

NB: Setting the value of this Traversal will only set the value in at if it is already present.

If you want to be able to insert missing values, you want at.

>>> Seq.fromList [a,b,c,d] & ix 2 %~ f
fromList [a,b,f c,d]
>>> Seq.fromList [a,b,c,d] & ix 2 .~ e
fromList [a,b,e,d]
>>> Seq.fromList [a,b,c,d] ^? ix 2
Just c
>>> Seq.fromList [] ^? ix 2
Nothing

Instances

Ixed ByteString 
Ixed ByteString 
Ixed Text 
Ixed Text 
Ixed IntSet 
Ixed [a] 

Methods

ix :: Index [a] -> Traversal' [a] (IxValue [a]) #

Ixed (Maybe a) 

Methods

ix :: Index (Maybe a) -> Traversal' (Maybe a) (IxValue (Maybe a)) #

Ixed (Identity a) 

Methods

ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) #

Ixed (NonEmpty a) 

Methods

ix :: Index (NonEmpty a) -> Traversal' (NonEmpty a) (IxValue (NonEmpty a)) #

Ixed (IntMap a) 

Methods

ix :: Index (IntMap a) -> Traversal' (IntMap a) (IxValue (IntMap a)) #

Ixed (Tree a) 

Methods

ix :: Index (Tree a) -> Traversal' (Tree a) (IxValue (Tree a)) #

Ixed (Seq a) 

Methods

ix :: Index (Seq a) -> Traversal' (Seq a) (IxValue (Seq a)) #

Ord k => Ixed (Set k) 

Methods

ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) #

Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Prim a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Storable a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Unbox a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

(Eq k, Hashable k) => Ixed (HashSet k) 

Methods

ix :: Index (HashSet k) -> Traversal' (HashSet k) (IxValue (HashSet k)) #

Eq e => Ixed (e -> a) 

Methods

ix :: Index (e -> a) -> Traversal' (e -> a) (IxValue (e -> a)) #

(~) * a a2 => Ixed (a, a2) 

Methods

ix :: Index (a, a2) -> Traversal' (a, a2) (IxValue (a, a2)) #

(Eq k, Hashable k) => Ixed (HashMap k a) 

Methods

ix :: Index (HashMap k a) -> Traversal' (HashMap k a) (IxValue (HashMap k a)) #

Ord k => Ixed (Map k a) 

Methods

ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) #

(IArray UArray e, Ix i) => Ixed (UArray i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr

Methods

ix :: Index (UArray i e) -> Traversal' (UArray i e) (IxValue (UArray i e)) #

Ix i => Ixed (Array i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr

Methods

ix :: Index (Array i e) -> Traversal' (Array i e) (IxValue (Array i e)) #

((~) * a a2, (~) * a a3) => Ixed (a, a2, a3) 

Methods

ix :: Index (a, a2, a3) -> Traversal' (a, a2, a3) (IxValue (a, a2, a3)) #

((~) * a a2, (~) * a a3, (~) * a a4) => Ixed (a, a2, a3, a4) 

Methods

ix :: Index (a, a2, a3, a4) -> Traversal' (a, a2, a3, a4) (IxValue (a, a2, a3, a4)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5) => Ixed (a, a2, a3, a4, a5) 

Methods

ix :: Index (a, a2, a3, a4, a5) -> Traversal' (a, a2, a3, a4, a5) (IxValue (a, a2, a3, a4, a5)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6) => Ixed (a, a2, a3, a4, a5, a6) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6) -> Traversal' (a, a2, a3, a4, a5, a6) (IxValue (a, a2, a3, a4, a5, a6)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7) => Ixed (a, a2, a3, a4, a5, a6, a7) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7) -> Traversal' (a, a2, a3, a4, a5, a6, a7) (IxValue (a, a2, a3, a4, a5, a6, a7)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8) => Ixed (a, a2, a3, a4, a5, a6, a7, a8) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8) (IxValue (a, a2, a3, a4, a5, a6, a7, a8)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8, (~) * a a9) => Ixed (a, a2, a3, a4, a5, a6, a7, a8, a9) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8, a9) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8, a9) (IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)) #

newtype Bazaar p a b t :: (* -> * -> *) -> * -> * -> * -> * #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

http://twanvl.nl/blog/haskell/non-regular1

A Bazaar is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar holds many stores and you can easily add more.

This is a final encoding of Bazaar.

Constructors

Bazaar 

Fields

Instances

Profunctor p => Bizarre p (Bazaar p) 

Methods

bazaar :: Applicative f => p a (f b) -> Bazaar p a b t -> f t #

Corepresentable p => Sellable p (Bazaar p) 

Methods

sell :: p a (Bazaar p a b b) #

IndexedFunctor (Bazaar p) 

Methods

ifmap :: (s -> t) -> Bazaar p a b s -> Bazaar p a b t #

Conjoined p => IndexedComonad (Bazaar p) 

Methods

iextract :: Bazaar p a a t -> t #

iduplicate :: Bazaar p a c t -> Bazaar p a b (Bazaar p b c t) #

iextend :: (Bazaar p b c t -> r) -> Bazaar p a c t -> Bazaar p a b r #

Functor (Bazaar p a b) 

Methods

fmap :: (a -> b) -> Bazaar p a b a -> Bazaar p a b b #

(<$) :: a -> Bazaar p a b b -> Bazaar p a b a #

Applicative (Bazaar p a b) 

Methods

pure :: a -> Bazaar p a b a #

(<*>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #

(*>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #

(<*) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a #

((~) * a b, Conjoined p) => Comonad (Bazaar p a b) 

Methods

extract :: Bazaar p a b a -> a #

duplicate :: Bazaar p a b a -> Bazaar p a b (Bazaar p a b a) #

extend :: (Bazaar p a b a -> b) -> Bazaar p a b a -> Bazaar p a b b #

((~) * a b, Conjoined p) => ComonadApply (Bazaar p a b) 

Methods

(<@>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #

(@>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #

(<@) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a #

Apply (Bazaar p a b) 

Methods

(<.>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #

(.>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #

(<.) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a #

type Bazaar' p a = Bazaar p a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type Bazaar' p a t = Bazaar p a a t

newtype Bazaar1 p a b t :: (* -> * -> *) -> * -> * -> * -> * #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

http://twanvl.nl/blog/haskell/non-regular1

A Bazaar1 is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar1 a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar1 holds many stores and you can easily add more.

This is a final encoding of Bazaar1.

Constructors

Bazaar1 

Fields

Instances

Profunctor p => Bizarre1 p (Bazaar1 p) 

Methods

bazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t #

Corepresentable p => Sellable p (Bazaar1 p) 

Methods

sell :: p a (Bazaar1 p a b b) #

IndexedFunctor (Bazaar1 p) 

Methods

ifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t #

Conjoined p => IndexedComonad (Bazaar1 p) 

Methods

iextract :: Bazaar1 p a a t -> t #

iduplicate :: Bazaar1 p a c t -> Bazaar1 p a b (Bazaar1 p b c t) #

iextend :: (Bazaar1 p b c t -> r) -> Bazaar1 p a c t -> Bazaar1 p a b r #

Functor (Bazaar1 p a b) 

Methods

fmap :: (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(<$) :: a -> Bazaar1 p a b b -> Bazaar1 p a b a #

((~) * a b, Conjoined p) => Comonad (Bazaar1 p a b) 

Methods

extract :: Bazaar1 p a b a -> a #

duplicate :: Bazaar1 p a b a -> Bazaar1 p a b (Bazaar1 p a b a) #

extend :: (Bazaar1 p a b a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

((~) * a b, Conjoined p) => ComonadApply (Bazaar1 p a b) 

Methods

(<@>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(@>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #

(<@) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a #

Apply (Bazaar1 p a b) 

Methods

(<.>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(.>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #

(<.) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a #

newtype Bazaar1 p a b t :: (* -> * -> *) -> * -> * -> * -> * #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

http://twanvl.nl/blog/haskell/non-regular1

A Bazaar1 is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar1 a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar1 holds many stores and you can easily add more.

This is a final encoding of Bazaar1.

Constructors

Bazaar1 

Fields

Instances

Profunctor p => Bizarre1 p (Bazaar1 p) 

Methods

bazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t #

Corepresentable p => Sellable p (Bazaar1 p) 

Methods

sell :: p a (Bazaar1 p a b b) #

IndexedFunctor (Bazaar1 p) 

Methods

ifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t #

Conjoined p => IndexedComonad (Bazaar1 p) 

Methods

iextract :: Bazaar1 p a a t -> t #

iduplicate :: Bazaar1 p a c t -> Bazaar1 p a b (Bazaar1 p b c t) #

iextend :: (Bazaar1 p b c t -> r) -> Bazaar1 p a c t -> Bazaar1 p a b r #

Functor (Bazaar1 p a b) 

Methods

fmap :: (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(<$) :: a -> Bazaar1 p a b b -> Bazaar1 p a b a #

((~) * a b, Conjoined p) => Comonad (Bazaar1 p a b) 

Methods

extract :: Bazaar1 p a b a -> a #

duplicate :: Bazaar1 p a b a -> Bazaar1 p a b (Bazaar1 p a b a) #

extend :: (Bazaar1 p a b a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

((~) * a b, Conjoined p) => ComonadApply (Bazaar1 p a b) 

Methods

(<@>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(@>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #

(<@) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a #

Apply (Bazaar1 p a b) 

Methods

(<.>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(.>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #

(<.) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a #

type Bazaar1' p a = Bazaar1 p a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type Bazaar1' p a t = Bazaar1 p a a t

class Bifunctor p where #

Formally, the class Bifunctor represents a bifunctor from Hask -> Hask.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

You can define a Bifunctor by either defining bimap or by defining both first and second.

If you supply bimap, you should ensure that:

bimap id idid

If you supply first and second, ensure:

first idid
second idid

If you supply both, you should also ensure:

bimap f g ≡ first f . second g

These ensure by parametricity:

bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
first  (f . g) ≡ first  f . first  g
second (f . g) ≡ second f . second g

Since: 4.8.0.0

Minimal complete definition

bimap | first, second

Methods

bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #

Map over both arguments at the same time.

bimap f g ≡ first f . second g

Instances

Bifunctor Either 

Methods

bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d #

first :: (a -> b) -> Either a c -> Either b c #

second :: (b -> c) -> Either a b -> Either a c #

Bifunctor (,) 

Methods

bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) #

first :: (a -> b) -> (a, c) -> (b, c) #

second :: (b -> c) -> (a, b) -> (a, c) #

Bifunctor Arg 

Methods

bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d #

first :: (a -> b) -> Arg a c -> Arg b c #

second :: (b -> c) -> Arg a b -> Arg a c #

Bifunctor (K1 i) 

Methods

bimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d #

first :: (a -> b) -> K1 i a c -> K1 i b c #

second :: (b -> c) -> K1 i a b -> K1 i a c #

Bifunctor ((,,) x1) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) #

first :: (a -> b) -> (x1, a, c) -> (x1, b, c) #

second :: (b -> c) -> (x1, a, b) -> (x1, a, c) #

Bifunctor (Const *) 

Methods

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

first :: (a -> b) -> Const * a c -> Const * b c #

second :: (b -> c) -> Const * a b -> Const * a c #

Functor f => Bifunctor (FreeF f) 

Methods

bimap :: (a -> b) -> (c -> d) -> FreeF f a c -> FreeF f b d #

first :: (a -> b) -> FreeF f a c -> FreeF f b c #

second :: (b -> c) -> FreeF f a b -> FreeF f a c #

Functor f => Bifunctor (AlongsideLeft f) 

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideLeft f a c -> AlongsideLeft f b d #

first :: (a -> b) -> AlongsideLeft f a c -> AlongsideLeft f b c #

second :: (b -> c) -> AlongsideLeft f a b -> AlongsideLeft f a c #

Functor f => Bifunctor (AlongsideRight f) 

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideRight f a c -> AlongsideRight f b d #

first :: (a -> b) -> AlongsideRight f a c -> AlongsideRight f b c #

second :: (b -> c) -> AlongsideRight f a b -> AlongsideRight f a c #

Bifunctor (Tagged *) 

Methods

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

first :: (a -> b) -> Tagged * a c -> Tagged * b c #

second :: (b -> c) -> Tagged * a b -> Tagged * a c #

Bifunctor (Constant *) 

Methods

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

first :: (a -> b) -> Constant * a c -> Constant * b c #

second :: (b -> c) -> Constant * a b -> Constant * a c #

Bifunctor ((,,,) x1 x2) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) #

first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) #

second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) #

Bifunctor ((,,,,) x1 x2 x3) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) #

first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) #

second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) #

Bifunctor p => Bifunctor (WrappedBifunctor * * p) 

Methods

bimap :: (a -> b) -> (c -> d) -> WrappedBifunctor * * p a c -> WrappedBifunctor * * p b d #

first :: (a -> b) -> WrappedBifunctor * * p a c -> WrappedBifunctor * * p b c #

second :: (b -> c) -> WrappedBifunctor * * p a b -> WrappedBifunctor * * p a c #

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 #

Bifunctor p => Bifunctor (Flip * * p) 

Methods

bimap :: (a -> b) -> (c -> d) -> Flip * * p a c -> Flip * * p b d #

first :: (a -> b) -> Flip * * p a c -> Flip * * p b c #

second :: (b -> c) -> Flip * * p a b -> Flip * * p a c #

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 #

Bifunctor ((,,,,,) x1 x2 x3 x4) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) #

(Bifunctor f, Bifunctor g) => Bifunctor (Product * * f g) 

Methods

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

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

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

(Bifunctor p, Bifunctor q) => Bifunctor (Sum * * p q) 

Methods

bimap :: (a -> b) -> (c -> d) -> Sum * * p q a c -> Sum * * p q b d #

first :: (a -> b) -> Sum * * p q a c -> Sum * * p q b c #

second :: (b -> c) -> Sum * * p q a b -> Sum * * p q a c #

Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) #

(Functor f, Bifunctor p) => Bifunctor (Tannen * * * f p) 

Methods

bimap :: (a -> b) -> (c -> d) -> Tannen * * * f p a c -> Tannen * * * f p b d #

first :: (a -> b) -> Tannen * * * f p a c -> Tannen * * * f p b c #

second :: (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(Bifunctor p, Functor f, Functor g) => Bifunctor (Biff * * * * p f g) 

Methods

bimap :: (a -> b) -> (c -> d) -> Biff * * * * p f g a c -> Biff * * * * p f g b d #

first :: (a -> b) -> Biff * * * * p f g a c -> Biff * * * * p f g b c #

second :: (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

class Profunctor p where #

Formally, the class Profunctor represents a profunctor from Hask -> Hask.

Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.

You can define a Profunctor by either defining dimap or by defining both lmap and rmap.

If you supply dimap, you should ensure that:

dimap id idid

If you supply lmap and rmap, ensure:

lmap idid
rmap idid

If you supply both, you should also ensure:

dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

dimap (f . g) (h . i) ≡ dimap g h . dimap f i
lmap (f . g) ≡ lmap g . lmap f
rmap (f . g) ≡ rmap f . rmap g

Minimal complete definition

dimap | lmap, rmap

Methods

dimap :: (a -> b) -> (c -> d) -> p b c -> p a d #

Map over both arguments at the same time.

dimap f g ≡ lmap f . rmap g

lmap :: (a -> b) -> p b c -> p a c #

Map the first argument contravariantly.

lmap f ≡ dimap f id

rmap :: (b -> c) -> p a b -> p a c #

Map the second argument covariantly.

rmapdimap id

Instances

Profunctor (->) 

Methods

dimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d #

lmap :: (a -> b) -> (b -> c) -> a -> c #

rmap :: (b -> c) -> (a -> b) -> a -> c #

(#.) :: Coercible * c b => (b -> c) -> (a -> b) -> a -> c #

(.#) :: Coercible * b a => (b -> c) -> (a -> b) -> a -> c #

Profunctor ReifiedGetter 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible * b a => ReifiedGetter b c -> (a -> b) -> ReifiedGetter a c #

Profunctor ReifiedFold 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible * b a => ReifiedFold b c -> (a -> b) -> ReifiedFold a c #

Monad m => Profunctor (Kleisli m) 

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c #

(#.) :: Coercible * c b => (b -> c) -> Kleisli m a b -> Kleisli m a c #

(.#) :: Coercible * b a => Kleisli m b c -> (a -> b) -> Kleisli m a c #

Functor w => Profunctor (Cokleisli w) 

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d #

lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c #

rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

(#.) :: Coercible * c b => (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

(.#) :: Coercible * b a => Cokleisli w b c -> (a -> b) -> Cokleisli w a c #

Profunctor (ReifiedIndexedGetter i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible * b a => ReifiedIndexedGetter i b c -> (a -> b) -> ReifiedIndexedGetter i a c #

Profunctor (ReifiedIndexedFold i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible * b a => ReifiedIndexedFold i b c -> (a -> b) -> ReifiedIndexedFold i a c #

Profunctor (Indexed i) 

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c #

(#.) :: Coercible * c b => (b -> c) -> Indexed i a b -> Indexed i a c #

(.#) :: Coercible * b a => Indexed i b c -> (a -> b) -> Indexed i a c #

Profunctor p => Profunctor (TambaraSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d #

lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c #

rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c #

(#.) :: Coercible * c b => (b -> c) -> TambaraSum p a b -> TambaraSum p a c #

(.#) :: Coercible * b a => TambaraSum p b c -> (a -> b) -> TambaraSum p a c #

Profunctor (PastroSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d #

lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c #

rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c #

(#.) :: Coercible * c b => (b -> c) -> PastroSum p a b -> PastroSum p a c #

(.#) :: Coercible * b a => PastroSum p b c -> (a -> b) -> PastroSum p a c #

Profunctor (CotambaraSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d #

lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c #

rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c #

(#.) :: Coercible * c b => (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c #

(.#) :: Coercible * b a => CotambaraSum p b c -> (a -> b) -> CotambaraSum p a c #

Profunctor (CopastroSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d #

lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c #

rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c #

(#.) :: Coercible * c b => (b -> c) -> CopastroSum p a b -> CopastroSum p a c #

(.#) :: Coercible * b a => CopastroSum p b c -> (a -> b) -> CopastroSum p a c #

Profunctor p => Profunctor (Tambara p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d #

lmap :: (a -> b) -> Tambara p b c -> Tambara p a c #

rmap :: (b -> c) -> Tambara p a b -> Tambara p a c #

(#.) :: Coercible * c b => (b -> c) -> Tambara p a b -> Tambara p a c #

(.#) :: Coercible * b a => Tambara p b c -> (a -> b) -> Tambara p a c #

Profunctor (Pastro p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d #

lmap :: (a -> b) -> Pastro p b c -> Pastro p a c #

rmap :: (b -> c) -> Pastro p a b -> Pastro p a c #

(#.) :: Coercible * c b => (b -> c) -> Pastro p a b -> Pastro p a c #

(.#) :: Coercible * b a => Pastro p b c -> (a -> b) -> Pastro p a c #

Profunctor (Cotambara p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d #

lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c #

rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c #

(#.) :: Coercible * c b => (b -> c) -> Cotambara p a b -> Cotambara p a c #

(.#) :: Coercible * b a => Cotambara p b c -> (a -> b) -> Cotambara p a c #

Profunctor (Copastro p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d #

lmap :: (a -> b) -> Copastro p b c -> Copastro p a c #

rmap :: (b -> c) -> Copastro p a b -> Copastro p a c #

(#.) :: Coercible * c b => (b -> c) -> Copastro p a b -> Copastro p a c #

(.#) :: Coercible * b a => Copastro p b c -> (a -> b) -> Copastro p a c #

Functor f => Profunctor (Star f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

(#.) :: Coercible * c b => (b -> c) -> Star f a b -> Star f a c #

(.#) :: Coercible * b a => Star f b c -> (a -> b) -> Star f a c #

Functor f => Profunctor (Costar f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

(#.) :: Coercible * c b => (b -> c) -> Costar f a b -> Costar f a c #

(.#) :: Coercible * b a => Costar f b c -> (a -> b) -> Costar f a c #

Arrow p => Profunctor (WrappedArrow p) 

Methods

dimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d #

lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c #

rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c #

(#.) :: Coercible * c b => (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c #

(.#) :: Coercible * b a => WrappedArrow p b c -> (a -> b) -> WrappedArrow p a c #

Profunctor (Forget r) 

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d #

lmap :: (a -> b) -> Forget r b c -> Forget r a c #

rmap :: (b -> c) -> Forget r a b -> Forget r a c #

(#.) :: Coercible * c b => (b -> c) -> Forget r a b -> Forget r a c #

(.#) :: Coercible * b a => Forget r b c -> (a -> b) -> Forget r a c #

Profunctor (Tagged *) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged * b c -> Tagged * a d #

lmap :: (a -> b) -> Tagged * b c -> Tagged * a c #

rmap :: (b -> c) -> Tagged * a b -> Tagged * a c #

(#.) :: Coercible * c b => (b -> c) -> Tagged * a b -> Tagged * a c #

(.#) :: Coercible * b a => Tagged * b c -> (a -> b) -> Tagged * a c #

Profunctor (Exchange a b) 

Methods

dimap :: (a -> b) -> (c -> d) -> Exchange a b b c -> Exchange a b a d #

lmap :: (a -> b) -> Exchange a b b c -> Exchange a b a c #

rmap :: (b -> c) -> Exchange a b a b -> Exchange a b a c #

(#.) :: Coercible * c b => (b -> c) -> Exchange a b a b -> Exchange a b a c #

(.#) :: Coercible * b a => Exchange a b b c -> (a -> b) -> Exchange a b a c #

Functor f => Profunctor (Joker * * f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Joker * * f b c -> Joker * * f a d #

lmap :: (a -> b) -> Joker * * f b c -> Joker * * f a c #

rmap :: (b -> c) -> Joker * * f a b -> Joker * * f a c #

(#.) :: Coercible * c b => (b -> c) -> Joker * * f a b -> Joker * * f a c #

(.#) :: Coercible * b a => Joker * * f b c -> (a -> b) -> Joker * * f a c #

Contravariant f => Profunctor (Clown * * f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Clown * * f b c -> Clown * * f a d #

lmap :: (a -> b) -> Clown * * f b c -> Clown * * f a c #

rmap :: (b -> c) -> Clown * * f a b -> Clown * * f a c #

(#.) :: Coercible * c b => (b -> c) -> Clown * * f a b -> Clown * * f a c #

(.#) :: Coercible * b a => Clown * * f b c -> (a -> b) -> Clown * * f a c #

(Profunctor p, Profunctor q) => Profunctor (Product * * p q) 

Methods

dimap :: (a -> b) -> (c -> d) -> Product * * p q b c -> Product * * p q a d #

lmap :: (a -> b) -> Product * * p q b c -> Product * * p q a c #

rmap :: (b -> c) -> Product * * p q a b -> Product * * p q a c #

(#.) :: Coercible * c b => (b -> c) -> Product * * p q a b -> Product * * p q a c #

(.#) :: Coercible * b a => Product * * p q b c -> (a -> b) -> Product * * p q a c #

(Functor f, Profunctor p) => Profunctor (Tannen * * * f p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tannen * * * f p b c -> Tannen * * * f p a d #

lmap :: (a -> b) -> Tannen * * * f p b c -> Tannen * * * f p a c #

rmap :: (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(#.) :: Coercible * c b => (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(.#) :: Coercible * b a => Tannen * * * f p b c -> (a -> b) -> Tannen * * * f p a c #

(Profunctor p, Functor f, Functor g) => Profunctor (Biff * * * * p f g) 

Methods

dimap :: (a -> b) -> (c -> d) -> Biff * * * * p f g b c -> Biff * * * * p f g a d #

lmap :: (a -> b) -> Biff * * * * p f g b c -> Biff * * * * p f g a c #

rmap :: (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

(#.) :: Coercible * c b => (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

(.#) :: Coercible * b a => Biff * * * * p f g b c -> (a -> b) -> Biff * * * * p f g a c #

type ClassyNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> Maybe (Name, Name)

Names of the class and the main method it generates, respectively.

The optional rule to create a class and method around a monomorphic data type. If this naming convention is provided, it generates a "classy" lens.

class Cons s t a b | s -> a, t -> b, s b -> t, t a -> s where #

This class provides a way to attach or detach elements on the left side of a structure in a flexible manner.

Methods

_Cons :: Prism s t (a, s) (b, t) #

_Cons :: Prism [a] [b] (a, [a]) (b, [b])
_Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b)
_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b)
_Cons :: Prism' String (Char, String)
_Cons :: Prism' Text (Char, Text)
_Cons :: Prism' ByteString (Word8, ByteString)

Instances

Cons ByteString ByteString Word8 Word8 
Cons ByteString ByteString Word8 Word8 
Cons Text Text Char Char 

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Cons Text Text Char Char 

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Cons [a] [b] a b 

Methods

_Cons :: Prism [a] [b] (a, [a]) (b, [b]) #

Cons (Seq a) (Seq b) a b 

Methods

_Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b) #

Cons (Vector a) (Vector b) a b 

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

(Prim a, Prim b) => Cons (Vector a) (Vector b) a b 

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

(Storable a, Storable b) => Cons (Vector a) (Vector b) a b 

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

(Unbox a, Unbox b) => Cons (Vector a) (Vector b) a b 

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

newtype Const k a b :: forall k. * -> k -> * #

The Const functor.

Constructors

Const 

Fields

Instances

Eq2 (Const *) 

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const * a c -> Const * b d -> Bool #

Ord2 (Const *) 

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const * a c -> Const * b d -> Ordering #

Read2 (Const *) 

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const * a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const * a b] #

Show2 (Const *) 

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const * a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const * a b] -> ShowS #

Bifunctor (Const *) 

Methods

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

first :: (a -> b) -> Const * a c -> Const * b c #

second :: (b -> c) -> Const * a b -> Const * a c #

Bitraversable (Const *) 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Const * a b -> f (Const * c d) #

Hashable2 (Const *) 

Methods

liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Const * a b -> Int #

Bitraversable1 (Const *) 

Methods

bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Const * a c -> f (Const * b d) #

bisequence1 :: Apply f => Const * (f a) (f b) -> f (Const * a b) #

Biapply (Const *) 

Methods

(<<.>>) :: Const * (a -> b) (c -> d) -> Const * a c -> Const * b d #

(.>>) :: Const * a b -> Const * c d -> Const * c d #

(<<.) :: Const * a b -> Const * c d -> Const * a b #

Functor (Const * m) 

Methods

fmap :: (a -> b) -> Const * m a -> Const * m b #

(<$) :: a -> Const * m b -> Const * m a #

Monoid m => Applicative (Const * m) 

Methods

pure :: a -> Const * m a #

(<*>) :: Const * m (a -> b) -> Const * m a -> Const * m b #

(*>) :: Const * m a -> Const * m b -> Const * m b #

(<*) :: Const * m a -> Const * m b -> Const * m a #

Foldable (Const * m) 

Methods

fold :: Monoid m => Const * m m -> m #

foldMap :: Monoid m => (a -> m) -> Const * m a -> m #

foldr :: (a -> b -> b) -> b -> Const * m a -> b #

foldr' :: (a -> b -> b) -> b -> Const * m a -> b #

foldl :: (b -> a -> b) -> b -> Const * m a -> b #

foldl' :: (b -> a -> b) -> b -> Const * m a -> b #

foldr1 :: (a -> a -> a) -> Const * m a -> a #

foldl1 :: (a -> a -> a) -> Const * m a -> a #

toList :: Const * m a -> [a] #

null :: Const * m a -> Bool #

length :: Const * m a -> Int #

elem :: Eq a => a -> Const * m a -> Bool #

maximum :: Ord a => Const * m a -> a #

minimum :: Ord a => Const * m a -> a #

sum :: Num a => Const * m a -> a #

product :: Num a => Const * m a -> a #

Traversable (Const * m) 

Methods

traverse :: Applicative f => (a -> f b) -> Const * m a -> f (Const * m b) #

sequenceA :: Applicative f => Const * m (f a) -> f (Const * m a) #

mapM :: Monad m => (a -> m b) -> Const * m a -> m (Const * m b) #

sequence :: Monad m => Const * m (m a) -> m (Const * m a) #

Generic1 (Const * a) 

Associated Types

type Rep1 (Const * a :: * -> *) :: * -> * #

Methods

from1 :: Const * a a -> Rep1 (Const * a) a #

to1 :: Rep1 (Const * a) a -> Const * a a #

Contravariant (Const * a) 

Methods

contramap :: (a -> b) -> Const * a b -> Const * a a #

(>$) :: b -> Const * a b -> Const * a a #

Eq a => Eq1 (Const * a) 

Methods

liftEq :: (a -> b -> Bool) -> Const * a a -> Const * a b -> Bool #

Ord a => Ord1 (Const * a) 

Methods

liftCompare :: (a -> b -> Ordering) -> Const * a a -> Const * a b -> Ordering #

Read a => Read1 (Const * a) 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Const * a a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Const * a a] #

Show a => Show1 (Const * a) 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Const * a a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Const * a a] -> ShowS #

Hashable a => Hashable1 (Const * a) 

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Const * a a -> Int #

Semigroup m => Apply (Const * m) 

Methods

(<.>) :: Const * m (a -> b) -> Const * m a -> Const * m b #

(.>) :: Const * m a -> Const * m b -> Const * m b #

(<.) :: Const * m a -> Const * m b -> Const * m a #

Bounded a => Bounded (Const k a b) 

Methods

minBound :: Const k a b #

maxBound :: Const k a b #

Enum a => Enum (Const k a b) 

Methods

succ :: Const k a b -> Const k a b #

pred :: Const k a b -> Const k a b #

toEnum :: Int -> Const k a b #

fromEnum :: Const k a b -> Int #

enumFrom :: Const k a b -> [Const k a b] #

enumFromThen :: Const k a b -> Const k a b -> [Const k a b] #

enumFromTo :: Const k a b -> Const k a b -> [Const k a b] #

enumFromThenTo :: Const k a b -> Const k a b -> Const k a b -> [Const k a b] #

Eq a => Eq (Const k a b) 

Methods

(==) :: Const k a b -> Const k a b -> Bool #

(/=) :: Const k a b -> Const k a b -> Bool #

Floating a => Floating (Const k a b) 

Methods

pi :: Const k a b #

exp :: Const k a b -> Const k a b #

log :: Const k a b -> Const k a b #

sqrt :: Const k a b -> Const k a b #

(**) :: Const k a b -> Const k a b -> Const k a b #

logBase :: Const k a b -> Const k a b -> Const k a b #

sin :: Const k a b -> Const k a b #

cos :: Const k a b -> Const k a b #

tan :: Const k a b -> Const k a b #

asin :: Const k a b -> Const k a b #

acos :: Const k a b -> Const k a b #

atan :: Const k a b -> Const k a b #

sinh :: Const k a b -> Const k a b #

cosh :: Const k a b -> Const k a b #

tanh :: Const k a b -> Const k a b #

asinh :: Const k a b -> Const k a b #

acosh :: Const k a b -> Const k a b #

atanh :: Const k a b -> Const k a b #

log1p :: Const k a b -> Const k a b #

expm1 :: Const k a b -> Const k a b #

log1pexp :: Const k a b -> Const k a b #

log1mexp :: Const k a b -> Const k a b #

Fractional a => Fractional (Const k a b) 

Methods

(/) :: Const k a b -> Const k a b -> Const k a b #

recip :: Const k a b -> Const k a b #

fromRational :: Rational -> Const k a b #

Integral a => Integral (Const k a b) 

Methods

quot :: Const k a b -> Const k a b -> Const k a b #

rem :: Const k a b -> Const k a b -> Const k a b #

div :: Const k a b -> Const k a b -> Const k a b #

mod :: Const k a b -> Const k a b -> Const k a b #

quotRem :: Const k a b -> Const k a b -> (Const k a b, Const k a b) #

divMod :: Const k a b -> Const k a b -> (Const k a b, Const k a b) #

toInteger :: Const k a b -> Integer #

Num a => Num (Const k a b) 

Methods

(+) :: Const k a b -> Const k a b -> Const k a b #

(-) :: Const k a b -> Const k a b -> Const k a b #

(*) :: Const k a b -> Const k a b -> Const k a b #

negate :: Const k a b -> Const k a b #

abs :: Const k a b -> Const k a b #

signum :: Const k a b -> Const k a b #

fromInteger :: Integer -> Const k a b #

Ord a => Ord (Const k a b) 

Methods

compare :: Const k a b -> Const k a b -> Ordering #

(<) :: Const k a b -> Const k a b -> Bool #

(<=) :: Const k a b -> Const k a b -> Bool #

(>) :: Const k a b -> Const k a b -> Bool #

(>=) :: Const k a b -> Const k a b -> Bool #

max :: Const k a b -> Const k a b -> Const k a b #

min :: Const k a b -> Const k a b -> Const k a b #

Read a => Read (Const k a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Methods

readsPrec :: Int -> ReadS (Const k a b) #

readList :: ReadS [Const k a b] #

readPrec :: ReadPrec (Const k a b) #

readListPrec :: ReadPrec [Const k a b] #

Real a => Real (Const k a b) 

Methods

toRational :: Const k a b -> Rational #

RealFloat a => RealFloat (Const k a b) 

Methods

floatRadix :: Const k a b -> Integer #

floatDigits :: Const k a b -> Int #

floatRange :: Const k a b -> (Int, Int) #

decodeFloat :: Const k a b -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Const k a b #

exponent :: Const k a b -> Int #

significand :: Const k a b -> Const k a b #

scaleFloat :: Int -> Const k a b -> Const k a b #

isNaN :: Const k a b -> Bool #

isInfinite :: Const k a b -> Bool #

isDenormalized :: Const k a b -> Bool #

isNegativeZero :: Const k a b -> Bool #

isIEEE :: Const k a b -> Bool #

atan2 :: Const k a b -> Const k a b -> Const k a b #

RealFrac a => RealFrac (Const k a b) 

Methods

properFraction :: Integral b => Const k a b -> (b, Const k a b) #

truncate :: Integral b => Const k a b -> b #

round :: Integral b => Const k a b -> b #

ceiling :: Integral b => Const k a b -> b #

floor :: Integral b => Const k a b -> b #

Show a => Show (Const k a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Methods

showsPrec :: Int -> Const k a b -> ShowS #

show :: Const k a b -> String #

showList :: [Const k a b] -> ShowS #

Ix a => Ix (Const k a b) 

Methods

range :: (Const k a b, Const k a b) -> [Const k a b] #

index :: (Const k a b, Const k a b) -> Const k a b -> Int #

unsafeIndex :: (Const k a b, Const k a b) -> Const k a b -> Int

inRange :: (Const k a b, Const k a b) -> Const k a b -> Bool #

rangeSize :: (Const k a b, Const k a b) -> Int #

unsafeRangeSize :: (Const k a b, Const k a b) -> Int

IsString a => IsString (Const * a b) 

Methods

fromString :: String -> Const * a b #

Generic (Const k a b) 

Associated Types

type Rep (Const k a b) :: * -> * #

Methods

from :: Const k a b -> Rep (Const k a b) x #

to :: Rep (Const k a b) x -> Const k a b #

Semigroup a => Semigroup (Const k a b) 

Methods

(<>) :: Const k a b -> Const k a b -> Const k a b #

sconcat :: NonEmpty (Const k a b) -> Const k a b #

stimes :: Integral b => b -> Const k a b -> Const k a b #

Monoid a => Monoid (Const k a b) 

Methods

mempty :: Const k a b #

mappend :: Const k a b -> Const k a b -> Const k a b #

mconcat :: [Const k a b] -> Const k a b #

Storable a => Storable (Const k a b) 

Methods

sizeOf :: Const k a b -> Int #

alignment :: Const k a b -> Int #

peekElemOff :: Ptr (Const k a b) -> Int -> IO (Const k a b) #

pokeElemOff :: Ptr (Const k a b) -> Int -> Const k a b -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Const k a b) #

pokeByteOff :: Ptr b -> Int -> Const k a b -> IO () #

peek :: Ptr (Const k a b) -> IO (Const k a b) #

poke :: Ptr (Const k a b) -> Const k a b -> IO () #

Bits a => Bits (Const k a b) 

Methods

(.&.) :: Const k a b -> Const k a b -> Const k a b #

(.|.) :: Const k a b -> Const k a b -> Const k a b #

xor :: Const k a b -> Const k a b -> Const k a b #

complement :: Const k a b -> Const k a b #

shift :: Const k a b -> Int -> Const k a b #

rotate :: Const k a b -> Int -> Const k a b #

zeroBits :: Const k a b #

bit :: Int -> Const k a b #

setBit :: Const k a b -> Int -> Const k a b #

clearBit :: Const k a b -> Int -> Const k a b #

complementBit :: Const k a b -> Int -> Const k a b #

testBit :: Const k a b -> Int -> Bool #

bitSizeMaybe :: Const k a b -> Maybe Int #

bitSize :: Const k a b -> Int #

isSigned :: Const k a b -> Bool #

shiftL :: Const k a b -> Int -> Const k a b #

unsafeShiftL :: Const k a b -> Int -> Const k a b #

shiftR :: Const k a b -> Int -> Const k a b #

unsafeShiftR :: Const k a b -> Int -> Const k a b #

rotateL :: Const k a b -> Int -> Const k a b #

rotateR :: Const k a b -> Int -> Const k a b #

popCount :: Const k a b -> Int #

FiniteBits a => FiniteBits (Const k a b) 

Methods

finiteBitSize :: Const k a b -> Int #

countLeadingZeros :: Const k a b -> Int #

countTrailingZeros :: Const k a b -> Int #

NFData a => NFData (Const k a b)

Since: 1.4.0.0

Methods

rnf :: Const k a b -> () #

Hashable a => Hashable (Const * a b) 

Methods

hashWithSalt :: Int -> Const * a b -> Int #

hash :: Const * a b -> Int #

Wrapped (Const k a x) 

Associated Types

type Unwrapped (Const k a x) :: * #

Methods

_Wrapped' :: Iso' (Const k a x) (Unwrapped (Const k a x)) #

(~) * t (Const k1 a' x') => Rewrapped (Const k a x) t 
type Rep1 (Const * a) 
type Rep1 (Const * a) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just Symbol "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep (Const k a b) 
type Rep (Const k a b) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just Symbol "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Const k a x) 
type Unwrapped (Const k a x) = a

newtype Const k a b :: forall k. * -> k -> * #

The Const functor.

Constructors

Const 

Fields

Instances

Eq2 (Const *) 

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const * a c -> Const * b d -> Bool #

Ord2 (Const *) 

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const * a c -> Const * b d -> Ordering #

Read2 (Const *) 

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const * a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const * a b] #

Show2 (Const *) 

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const * a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const * a b] -> ShowS #

Bifunctor (Const *) 

Methods

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

first :: (a -> b) -> Const * a c -> Const * b c #

second :: (b -> c) -> Const * a b -> Const * a c #

Bitraversable (Const *) 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Const * a b -> f (Const * c d) #

Hashable2 (Const *) 

Methods

liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Const * a b -> Int #

Bitraversable1 (Const *) 

Methods

bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Const * a c -> f (Const * b d) #

bisequence1 :: Apply f => Const * (f a) (f b) -> f (Const * a b) #

Biapply (Const *) 

Methods

(<<.>>) :: Const * (a -> b) (c -> d) -> Const * a c -> Const * b d #

(.>>) :: Const * a b -> Const * c d -> Const * c d #

(<<.) :: Const * a b -> Const * c d -> Const * a b #

Functor (Const * m) 

Methods

fmap :: (a -> b) -> Const * m a -> Const * m b #

(<$) :: a -> Const * m b -> Const * m a #

Monoid m => Applicative (Const * m) 

Methods

pure :: a -> Const * m a #

(<*>) :: Const * m (a -> b) -> Const * m a -> Const * m b #

(*>) :: Const * m a -> Const * m b -> Const * m b #

(<*) :: Const * m a -> Const * m b -> Const * m a #

Foldable (Const * m) 

Methods

fold :: Monoid m => Const * m m -> m #

foldMap :: Monoid m => (a -> m) -> Const * m a -> m #

foldr :: (a -> b -> b) -> b -> Const * m a -> b #

foldr' :: (a -> b -> b) -> b -> Const * m a -> b #

foldl :: (b -> a -> b) -> b -> Const * m a -> b #

foldl' :: (b -> a -> b) -> b -> Const * m a -> b #

foldr1 :: (a -> a -> a) -> Const * m a -> a #

foldl1 :: (a -> a -> a) -> Const * m a -> a #

toList :: Const * m a -> [a] #

null :: Const * m a -> Bool #

length :: Const * m a -> Int #

elem :: Eq a => a -> Const * m a -> Bool #

maximum :: Ord a => Const * m a -> a #

minimum :: Ord a => Const * m a -> a #

sum :: Num a => Const * m a -> a #

product :: Num a => Const * m a -> a #

Traversable (Const * m) 

Methods

traverse :: Applicative f => (a -> f b) -> Const * m a -> f (Const * m b) #

sequenceA :: Applicative f => Const * m (f a) -> f (Const * m a) #

mapM :: Monad m => (a -> m b) -> Const * m a -> m (Const * m b) #

sequence :: Monad m => Const * m (m a) -> m (Const * m a) #

Generic1 (Const * a) 

Associated Types

type Rep1 (Const * a :: * -> *) :: * -> * #

Methods

from1 :: Const * a a -> Rep1 (Const * a) a #

to1 :: Rep1 (Const * a) a -> Const * a a #

Contravariant (Const * a) 

Methods

contramap :: (a -> b) -> Const * a b -> Const * a a #

(>$) :: b -> Const * a b -> Const * a a #

Eq a => Eq1 (Const * a) 

Methods

liftEq :: (a -> b -> Bool) -> Const * a a -> Const * a b -> Bool #

Ord a => Ord1 (Const * a) 

Methods

liftCompare :: (a -> b -> Ordering) -> Const * a a -> Const * a b -> Ordering #

Read a => Read1 (Const * a) 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Const * a a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Const * a a] #

Show a => Show1 (Const * a) 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Const * a a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Const * a a] -> ShowS #

Hashable a => Hashable1 (Const * a) 

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Const * a a -> Int #

Semigroup m => Apply (Const * m) 

Methods

(<.>) :: Const * m (a -> b) -> Const * m a -> Const * m b #

(.>) :: Const * m a -> Const * m b -> Const * m b #

(<.) :: Const * m a -> Const * m b -> Const * m a #

Bounded a => Bounded (Const k a b) 

Methods

minBound :: Const k a b #

maxBound :: Const k a b #

Enum a => Enum (Const k a b) 

Methods

succ :: Const k a b -> Const k a b #

pred :: Const k a b -> Const k a b #

toEnum :: Int -> Const k a b #

fromEnum :: Const k a b -> Int #

enumFrom :: Const k a b -> [Const k a b] #

enumFromThen :: Const k a b -> Const k a b -> [Const k a b] #

enumFromTo :: Const k a b -> Const k a b -> [Const k a b] #

enumFromThenTo :: Const k a b -> Const k a b -> Const k a b -> [Const k a b] #

Eq a => Eq (Const k a b) 

Methods

(==) :: Const k a b -> Const k a b -> Bool #

(/=) :: Const k a b -> Const k a b -> Bool #

Floating a => Floating (Const k a b) 

Methods

pi :: Const k a b #

exp :: Const k a b -> Const k a b #

log :: Const k a b -> Const k a b #

sqrt :: Const k a b -> Const k a b #

(**) :: Const k a b -> Const k a b -> Const k a b #

logBase :: Const k a b -> Const k a b -> Const k a b #

sin :: Const k a b -> Const k a b #

cos :: Const k a b -> Const k a b #

tan :: Const k a b -> Const k a b #

asin :: Const k a b -> Const k a b #

acos :: Const k a b -> Const k a b #

atan :: Const k a b -> Const k a b #

sinh :: Const k a b -> Const k a b #

cosh :: Const k a b -> Const k a b #

tanh :: Const k a b -> Const k a b #

asinh :: Const k a b -> Const k a b #

acosh :: Const k a b -> Const k a b #

atanh :: Const k a b -> Const k a b #

log1p :: Const k a b -> Const k a b #

expm1 :: Const k a b -> Const k a b #

log1pexp :: Const k a b -> Const k a b #

log1mexp :: Const k a b -> Const k a b #

Fractional a => Fractional (Const k a b) 

Methods

(/) :: Const k a b -> Const k a b -> Const k a b #

recip :: Const k a b -> Const k a b #

fromRational :: Rational -> Const k a b #

Integral a => Integral (Const k a b) 

Methods

quot :: Const k a b -> Const k a b -> Const k a b #

rem :: Const k a b -> Const k a b -> Const k a b #

div :: Const k a b -> Const k a b -> Const k a b #

mod :: Const k a b -> Const k a b -> Const k a b #

quotRem :: Const k a b -> Const k a b -> (Const k a b, Const k a b) #

divMod :: Const k a b -> Const k a b -> (Const k a b, Const k a b) #

toInteger :: Const k a b -> Integer #

Num a => Num (Const k a b) 

Methods

(+) :: Const k a b -> Const k a b -> Const k a b #

(-) :: Const k a b -> Const k a b -> Const k a b #

(*) :: Const k a b -> Const k a b -> Const k a b #

negate :: Const k a b -> Const k a b #

abs :: Const k a b -> Const k a b #

signum :: Const k a b -> Const k a b #

fromInteger :: Integer -> Const k a b #

Ord a => Ord (Const k a b) 

Methods

compare :: Const k a b -> Const k a b -> Ordering #

(<) :: Const k a b -> Const k a b -> Bool #

(<=) :: Const k a b -> Const k a b -> Bool #

(>) :: Const k a b -> Const k a b -> Bool #

(>=) :: Const k a b -> Const k a b -> Bool #

max :: Const k a b -> Const k a b -> Const k a b #

min :: Const k a b -> Const k a b -> Const k a b #

Read a => Read (Const k a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Methods

readsPrec :: Int -> ReadS (Const k a b) #

readList :: ReadS [Const k a b] #

readPrec :: ReadPrec (Const k a b) #

readListPrec :: ReadPrec [Const k a b] #

Real a => Real (Const k a b) 

Methods

toRational :: Const k a b -> Rational #

RealFloat a => RealFloat (Const k a b) 

Methods

floatRadix :: Const k a b -> Integer #

floatDigits :: Const k a b -> Int #

floatRange :: Const k a b -> (Int, Int) #

decodeFloat :: Const k a b -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Const k a b #

exponent :: Const k a b -> Int #

significand :: Const k a b -> Const k a b #

scaleFloat :: Int -> Const k a b -> Const k a b #

isNaN :: Const k a b -> Bool #

isInfinite :: Const k a b -> Bool #

isDenormalized :: Const k a b -> Bool #

isNegativeZero :: Const k a b -> Bool #

isIEEE :: Const k a b -> Bool #

atan2 :: Const k a b -> Const k a b -> Const k a b #

RealFrac a => RealFrac (Const k a b) 

Methods

properFraction :: Integral b => Const k a b -> (b, Const k a b) #

truncate :: Integral b => Const k a b -> b #

round :: Integral b => Const k a b -> b #

ceiling :: Integral b => Const k a b -> b #

floor :: Integral b => Const k a b -> b #

Show a => Show (Const k a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Methods

showsPrec :: Int -> Const k a b -> ShowS #

show :: Const k a b -> String #

showList :: [Const k a b] -> ShowS #

Ix a => Ix (Const k a b) 

Methods

range :: (Const k a b, Const k a b) -> [Const k a b] #

index :: (Const k a b, Const k a b) -> Const k a b -> Int #

unsafeIndex :: (Const k a b, Const k a b) -> Const k a b -> Int

inRange :: (Const k a b, Const k a b) -> Const k a b -> Bool #

rangeSize :: (Const k a b, Const k a b) -> Int #

unsafeRangeSize :: (Const k a b, Const k a b) -> Int

IsString a => IsString (Const * a b) 

Methods

fromString :: String -> Const * a b #

Generic (Const k a b) 

Associated Types

type Rep (Const k a b) :: * -> * #

Methods

from :: Const k a b -> Rep (Const k a b) x #

to :: Rep (Const k a b) x -> Const k a b #

Semigroup a => Semigroup (Const k a b) 

Methods

(<>) :: Const k a b -> Const k a b -> Const k a b #

sconcat :: NonEmpty (Const k a b) -> Const k a b #

stimes :: Integral b => b -> Const k a b -> Const k a b #

Monoid a => Monoid (Const k a b) 

Methods

mempty :: Const k a b #

mappend :: Const k a b -> Const k a b -> Const k a b #

mconcat :: [Const k a b] -> Const k a b #

Storable a => Storable (Const k a b) 

Methods

sizeOf :: Const k a b -> Int #

alignment :: Const k a b -> Int #

peekElemOff :: Ptr (Const k a b) -> Int -> IO (Const k a b) #

pokeElemOff :: Ptr (Const k a b) -> Int -> Const k a b -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Const k a b) #

pokeByteOff :: Ptr b -> Int -> Const k a b -> IO () #

peek :: Ptr (Const k a b) -> IO (Const k a b) #

poke :: Ptr (Const k a b) -> Const k a b -> IO () #

Bits a => Bits (Const k a b) 

Methods

(.&.) :: Const k a b -> Const k a b -> Const k a b #

(.|.) :: Const k a b -> Const k a b -> Const k a b #

xor :: Const k a b -> Const k a b -> Const k a b #

complement :: Const k a b -> Const k a b #

shift :: Const k a b -> Int -> Const k a b #

rotate :: Const k a b -> Int -> Const k a b #

zeroBits :: Const k a b #

bit :: Int -> Const k a b #

setBit :: Const k a b -> Int -> Const k a b #

clearBit :: Const k a b -> Int -> Const k a b #

complementBit :: Const k a b -> Int -> Const k a b #

testBit :: Const k a b -> Int -> Bool #

bitSizeMaybe :: Const k a b -> Maybe Int #

bitSize :: Const k a b -> Int #

isSigned :: Const k a b -> Bool #

shiftL :: Const k a b -> Int -> Const k a b #

unsafeShiftL :: Const k a b -> Int -> Const k a b #

shiftR :: Const k a b -> Int -> Const k a b #

unsafeShiftR :: Const k a b -> Int -> Const k a b #

rotateL :: Const k a b -> Int -> Const k a b #

rotateR :: Const k a b -> Int -> Const k a b #

popCount :: Const k a b -> Int #

FiniteBits a => FiniteBits (Const k a b) 

Methods

finiteBitSize :: Const k a b -> Int #

countLeadingZeros :: Const k a b -> Int #

countTrailingZeros :: Const k a b -> Int #

NFData a => NFData (Const k a b)

Since: 1.4.0.0

Methods

rnf :: Const k a b -> () #

Hashable a => Hashable (Const * a b) 

Methods

hashWithSalt :: Int -> Const * a b -> Int #

hash :: Const * a b -> Int #

Wrapped (Const k a x) 

Associated Types

type Unwrapped (Const k a x) :: * #

Methods

_Wrapped' :: Iso' (Const k a x) (Unwrapped (Const k a x)) #

(~) * t (Const k1 a' x') => Rewrapped (Const k a x) t 
type Rep1 (Const * a) 
type Rep1 (Const * a) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just Symbol "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep (Const k a b) 
type Rep (Const k a b) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just Symbol "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Const k a x) 
type Unwrapped (Const k a x) = a

class Contains m where #

This class provides a simple Lens that lets you view (and modify) information about whether or not a container contains a given Index.

Minimal complete definition

contains

Methods

contains :: Index m -> Lens' m Bool #

>>> IntSet.fromList [1,2,3,4] ^. contains 3
True
>>> IntSet.fromList [1,2,3,4] ^. contains 5
False
>>> IntSet.fromList [1,2,3,4] & contains 3 .~ False
fromList [1,2,4]

Instances

Contains IntSet 
Ord a => Contains (Set a) 

Methods

contains :: Index (Set a) -> Lens' (Set a) Bool #

(Eq a, Hashable a) => Contains (HashSet a) 

Methods

contains :: Index (HashSet a) -> Lens' (HashSet a) Bool #

data Context a b t :: * -> * -> * -> * #

The indexed store can be used to characterize a Lens and is used by clone.

Context a b t is isomorphic to newtype Context a b t = Context { runContext :: forall f. Functor f => (a -> f b) -> f t }, and to exists s. (s, Lens s t a b).

A Context is like a Lens that has already been applied to a some structure.

Constructors

Context (b -> t) a 

Instances

IndexedFunctor Context 

Methods

ifmap :: (s -> t) -> Context a b s -> Context a b t #

IndexedComonad Context 

Methods

iextract :: Context a a t -> t #

iduplicate :: Context a c t -> Context a b (Context b c t) #

iextend :: (Context b c t -> r) -> Context a c t -> Context a b r #

IndexedComonadStore Context 

Methods

ipos :: Context a c t -> a #

ipeek :: c -> Context a c t -> t #

ipeeks :: (a -> c) -> Context a c t -> t #

iseek :: b -> Context a c t -> Context b c t #

iseeks :: (a -> b) -> Context a c t -> Context b c t #

iexperiment :: Functor f => (b -> f c) -> Context b c t -> f t #

context :: Context a b t -> Context a b t #

Sellable (->) Context 

Methods

sell :: a -> Context a b b #

(~) * a b => ComonadStore a (Context a b) 

Methods

pos :: Context a b a -> a #

peek :: a -> Context a b a -> a #

peeks :: (a -> a) -> Context a b a -> a #

seek :: a -> Context a b a -> Context a b a #

seeks :: (a -> a) -> Context a b a -> Context a b a #

experiment :: Functor f => (a -> f a) -> Context a b a -> f a #

Functor (Context a b) 

Methods

fmap :: (a -> b) -> Context a b a -> Context a b b #

(<$) :: a -> Context a b b -> Context a b a #

(~) * a b => Comonad (Context a b) 

Methods

extract :: Context a b a -> a #

duplicate :: Context a b a -> Context a b (Context a b a) #

extend :: (Context a b a -> b) -> Context a b a -> Context a b b #

type Context' a = Context a a #

type Context' a s = Context a a s

class Contravariant f where #

Any instance should be subject to the following laws:

contramap id = id
contramap f . contramap g = contramap (g . f)

Note, that the second law follows from the free theorem of the type of contramap and the first law, so you need only check that the former condition holds.

Minimal complete definition

contramap

Methods

contramap :: (a -> b) -> f b -> f a #

(>$) :: b -> f b -> f a infixl 4 #

Replace all locations in the output with the same value. The default definition is contramap . const, but this may be overridden with a more efficient version.

Instances

Contravariant V1 

Methods

contramap :: (a -> b) -> V1 b -> V1 a #

(>$) :: b -> V1 b -> V1 a #

Contravariant U1 

Methods

contramap :: (a -> b) -> U1 b -> U1 a #

(>$) :: b -> U1 b -> U1 a #

Contravariant SettableStateVar 
Contravariant Predicate

A Predicate is a Contravariant Functor, because contramap can apply its function argument to the input of the predicate.

Methods

contramap :: (a -> b) -> Predicate b -> Predicate a #

(>$) :: b -> Predicate b -> Predicate a #

Contravariant Comparison

A Comparison is a Contravariant Functor, because contramap can apply its function argument to each input of the comparison function.

Methods

contramap :: (a -> b) -> Comparison b -> Comparison a #

(>$) :: b -> Comparison b -> Comparison a #

Contravariant Equivalence

Equivalence relations are Contravariant, because you can apply the contramapped function to each input to the equivalence relation.

Methods

contramap :: (a -> b) -> Equivalence b -> Equivalence a #

(>$) :: b -> Equivalence b -> Equivalence a #

Contravariant f => Contravariant (Rec1 f) 

Methods

contramap :: (a -> b) -> Rec1 f b -> Rec1 f a #

(>$) :: b -> Rec1 f b -> Rec1 f a #

Contravariant (Op a) 

Methods

contramap :: (a -> b) -> Op a b -> Op a a #

(>$) :: b -> Op a b -> Op a a #

Contravariant (Proxy *) 

Methods

contramap :: (a -> b) -> Proxy * b -> Proxy * a #

(>$) :: b -> Proxy * b -> Proxy * a #

Contravariant f => Contravariant (Indexing f) 

Methods

contramap :: (a -> b) -> Indexing f b -> Indexing f a #

(>$) :: b -> Indexing f b -> Indexing f a #

Contravariant f => Contravariant (Indexing64 f) 

Methods

contramap :: (a -> b) -> Indexing64 f b -> Indexing64 f a #

(>$) :: b -> Indexing64 f b -> Indexing64 f a #

Contravariant m => Contravariant (ListT m) 

Methods

contramap :: (a -> b) -> ListT m b -> ListT m a #

(>$) :: b -> ListT m b -> ListT m a #

Contravariant m => Contravariant (MaybeT m) 

Methods

contramap :: (a -> b) -> MaybeT m b -> MaybeT m a #

(>$) :: b -> MaybeT m b -> MaybeT m a #

Contravariant (K1 i c) 

Methods

contramap :: (a -> b) -> K1 i c b -> K1 i c a #

(>$) :: b -> K1 i c b -> K1 i c a #

(Contravariant f, Contravariant g) => Contravariant ((:+:) f g) 

Methods

contramap :: (a -> b) -> (f :+: g) b -> (f :+: g) a #

(>$) :: b -> (f :+: g) b -> (f :+: g) a #

(Contravariant f, Contravariant g) => Contravariant ((:*:) f g) 

Methods

contramap :: (a -> b) -> (f :*: g) b -> (f :*: g) a #

(>$) :: b -> (f :*: g) b -> (f :*: g) a #

(Functor f, Contravariant g) => Contravariant ((:.:) f g) 

Methods

contramap :: (a -> b) -> (f :.: g) b -> (f :.: g) a #

(>$) :: b -> (f :.: g) b -> (f :.: g) a #

Contravariant (Const * a) 

Methods

contramap :: (a -> b) -> Const * a b -> Const * a a #

(>$) :: b -> Const * a b -> Const * a a #

Contravariant f => Contravariant (Alt * f) 

Methods

contramap :: (a -> b) -> Alt * f b -> Alt * f a #

(>$) :: b -> Alt * f b -> Alt * f a #

Contravariant f => Contravariant (IdentityT * f) 

Methods

contramap :: (a -> b) -> IdentityT * f b -> IdentityT * f a #

(>$) :: b -> IdentityT * f b -> IdentityT * f a #

(Functor f, Contravariant g) => Contravariant (ComposeFC f g) 

Methods

contramap :: (a -> b) -> ComposeFC f g b -> ComposeFC f g a #

(>$) :: b -> ComposeFC f g b -> ComposeFC f g a #

(Contravariant f, Functor g) => Contravariant (ComposeCF f g) 

Methods

contramap :: (a -> b) -> ComposeCF f g b -> ComposeCF f g a #

(>$) :: b -> ComposeCF f g b -> ComposeCF f g a #

Contravariant f => Contravariant (Backwards * f) 

Methods

contramap :: (a -> b) -> Backwards * f b -> Backwards * f a #

(>$) :: b -> Backwards * f b -> Backwards * f a #

Contravariant m => Contravariant (ErrorT e m) 

Methods

contramap :: (a -> b) -> ErrorT e m b -> ErrorT e m a #

(>$) :: b -> ErrorT e m b -> ErrorT e m a #

Contravariant f => Contravariant (AlongsideLeft f b) 

Methods

contramap :: (a -> b) -> AlongsideLeft f b b -> AlongsideLeft f b a #

(>$) :: b -> AlongsideLeft f b b -> AlongsideLeft f b a #

Contravariant f => Contravariant (AlongsideRight f a) 

Methods

contramap :: (a -> b) -> AlongsideRight f a b -> AlongsideRight f a a #

(>$) :: b -> AlongsideRight f a b -> AlongsideRight f a a #

Contravariant (Effect m r) 

Methods

contramap :: (a -> b) -> Effect m r b -> Effect m r a #

(>$) :: b -> Effect m r b -> Effect m r a #

Contravariant m => Contravariant (ExceptT e m) 

Methods

contramap :: (a -> b) -> ExceptT e m b -> ExceptT e m a #

(>$) :: b -> ExceptT e m b -> ExceptT e m a #

Contravariant m => Contravariant (StateT s m) 

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (StateT s m) 

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (WriterT w m) 

Methods

contramap :: (a -> b) -> WriterT w m b -> WriterT w m a #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant m => Contravariant (WriterT w m) 

Methods

contramap :: (a -> b) -> WriterT w m b -> WriterT w m a #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant f => Contravariant (Reverse * f) 

Methods

contramap :: (a -> b) -> Reverse * f b -> Reverse * f a #

(>$) :: b -> Reverse * f b -> Reverse * f a #

Contravariant (Constant * a) 

Methods

contramap :: (a -> b) -> Constant * a b -> Constant * a a #

(>$) :: b -> Constant * a b -> Constant * a a #

Contravariant f => Contravariant (M1 i c f) 

Methods

contramap :: (a -> b) -> M1 i c f b -> M1 i c f a #

(>$) :: b -> M1 i c f b -> M1 i c f a #

(Contravariant f, Contravariant g) => Contravariant (Sum * f g) 

Methods

contramap :: (a -> b) -> Sum * f g b -> Sum * f g a #

(>$) :: b -> Sum * f g b -> Sum * f g a #

(Contravariant f, Contravariant g) => Contravariant (Product * f g) 

Methods

contramap :: (a -> b) -> Product * f g b -> Product * f g a #

(>$) :: b -> Product * f g b -> Product * f g a #

Contravariant m => Contravariant (ReaderT * r m) 

Methods

contramap :: (a -> b) -> ReaderT * r m b -> ReaderT * r m a #

(>$) :: b -> ReaderT * r m b -> ReaderT * r m a #

(Functor f, Contravariant g) => Contravariant (Compose * * f g) 

Methods

contramap :: (a -> b) -> Compose * * f g b -> Compose * * f g a #

(>$) :: b -> Compose * * f g b -> Compose * * f g a #

Contravariant f => Contravariant (TakingWhile p f a b) 

Methods

contramap :: (a -> b) -> TakingWhile p f a b b -> TakingWhile p f a b a #

(>$) :: b -> TakingWhile p f a b b -> TakingWhile p f a b a #

(Profunctor p, Contravariant g) => Contravariant (BazaarT p g a b) 

Methods

contramap :: (a -> b) -> BazaarT p g a b b -> BazaarT p g a b a #

(>$) :: b -> BazaarT p g a b b -> BazaarT p g a b a #

(Profunctor p, Contravariant g) => Contravariant (BazaarT1 p g a b) 

Methods

contramap :: (a -> b) -> BazaarT1 p g a b b -> BazaarT1 p g a b a #

(>$) :: b -> BazaarT1 p g a b b -> BazaarT1 p g a b a #

(Profunctor p, Contravariant g) => Contravariant (PretextT p g a b) 

Methods

contramap :: (a -> b) -> PretextT p g a b b -> PretextT p g a b a #

(>$) :: b -> PretextT p g a b b -> PretextT p g a b a #

Contravariant (EffectRWS w st m s) 

Methods

contramap :: (a -> b) -> EffectRWS w st m s b -> EffectRWS w st m s a #

(>$) :: b -> EffectRWS w st m s b -> EffectRWS w st m s a #

Contravariant m => Contravariant (RWST r w s m) 

Methods

contramap :: (a -> b) -> RWST r w s m b -> RWST r w s m a #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

Contravariant m => Contravariant (RWST r w s m) 

Methods

contramap :: (a -> b) -> RWST r w s m b -> RWST r w s m a #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

data DefName :: * #

Name to give to generated field optics.

class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Extract each element of a (potentially monomorphic) container.

Notably, when applied to a tuple, this generalizes both to arbitrary homogeneous tuples.

>>> (1,2,3) & each *~ 10
(10,20,30)

It can also be used on monomorphic containers like Text or ByteString.

>>> over each Char.toUpper ("hello"^.Text.packed)
"HELLO"
>>> ("hello","world") & each.each %~ Char.toUpper
("HELLO","WORLD")

Methods

each :: Traversal s t a b #

Instances

((~) * a Word8, (~) * b Word8) => Each ByteString ByteString a b
each :: Traversal ByteString ByteString Word8 Word8
((~) * a Word8, (~) * b Word8) => Each ByteString ByteString a b
each :: Traversal ByteString ByteString Word8 Word8
((~) * a Char, (~) * b Char) => Each Text Text a b
each :: Traversal Text Text Char Char

Methods

each :: Traversal Text Text a b #

((~) * a Char, (~) * b Char) => Each Text Text a b
each :: Traversal Text Text Char Char

Methods

each :: Traversal Text Text a b #

Each [a] [b] a b
each :: Traversal [a] [b] a b

Methods

each :: Traversal [a] [b] a b #

Each (Maybe a) (Maybe b) a b
each :: Traversal (Maybe a) (Maybe b) a b

Methods

each :: Traversal (Maybe a) (Maybe b) a b #

Each (Identity a) (Identity b) a b
each :: Traversal (Identity a) (Identity b) a b

Methods

each :: Traversal (Identity a) (Identity b) a b #

Each (NonEmpty a) (NonEmpty b) a b
each :: Traversal (NonEmpty a) (NonEmpty b) a b

Methods

each :: Traversal (NonEmpty a) (NonEmpty b) a b #

Each (Complex a) (Complex b) a b
each :: (RealFloat a, RealFloat b) => Traversal (Complex a) (Complex b) a b

Methods

each :: Traversal (Complex a) (Complex b) a b #

Each (IntMap a) (IntMap b) a b
each :: Traversal (Map c a) (Map c b) a b

Methods

each :: Traversal (IntMap a) (IntMap b) a b #

Each (Tree a) (Tree b) a b
each :: Traversal (Tree a) (Tree b) a b

Methods

each :: Traversal (Tree a) (Tree b) a b #

Each (Seq a) (Seq b) a b
each :: Traversal (Seq a) (Seq b) a b

Methods

each :: Traversal (Seq a) (Seq b) a b #

Each (Vector a) (Vector b) a b
each :: Traversal (Vector a) (Vector b) a b

Methods

each :: Traversal (Vector a) (Vector b) a b #

(Prim a, Prim b) => Each (Vector a) (Vector b) a b
each :: (Prim a, Prim b) => Traversal (Vector a) (Vector b) a b

Methods

each :: Traversal (Vector a) (Vector b) a b #

(Storable a, Storable b) => Each (Vector a) (Vector b) a b
each :: (Storable a, Storable b) => Traversal (Vector a) (Vector b) a b

Methods

each :: Traversal (Vector a) (Vector b) a b #

(Unbox a, Unbox b) => Each (Vector a) (Vector b) a b
each :: (Unbox a, Unbox b) => Traversal (Vector a) (Vector b) a b

Methods

each :: Traversal (Vector a) (Vector b) a b #

((~) * a a', (~) * b b') => Each (a, a') (b, b') a b
each :: Traversal (a,a) (b,b) a b

Methods

each :: Traversal (a, a') (b, b') a b #

(~) * c d => Each (HashMap c a) (HashMap d b) a b
each :: Traversal (HashMap c a) (HashMap c b) a b

Methods

each :: Traversal (HashMap c a) (HashMap d b) a b #

(~) * c d => Each (Map c a) (Map d b) a b
each :: Traversal (Map c a) (Map c b) a b

Methods

each :: Traversal (Map c a) (Map d b) a b #

(Ix i, IArray UArray a, IArray UArray b, (~) * i j) => Each (UArray i a) (UArray j b) a b
each :: (Ix i, IArray UArray a, IArray UArray b) => Traversal (Array i a) (Array i b) a b

Methods

each :: Traversal (UArray i a) (UArray j b) a b #

(Ix i, (~) * i j) => Each (Array i a) (Array j b) a b
each :: Ix i => Traversal (Array i a) (Array i b) a b

Methods

each :: Traversal (Array i a) (Array j b) a b #

((~) * a a2, (~) * a a3, (~) * b b2, (~) * b b3) => Each (a, a2, a3) (b, b2, b3) a b
each :: Traversal (a,a,a) (b,b,b) a b

Methods

each :: Traversal (a, a2, a3) (b, b2, b3) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * b b2, (~) * b b3, (~) * b b4) => Each (a, a2, a3, a4) (b, b2, b3, b4) a b
each :: Traversal (a,a,a,a) (b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4) (b, b2, b3, b4) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * b b2, (~) * b b3, (~) * b b4, (~) * b b5) => Each (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b
each :: Traversal (a,a,a,a,a) (b,b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * b b2, (~) * b b3, (~) * b b4, (~) * b b5, (~) * b b6) => Each (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b
each :: Traversal (a,a,a,a,a,a) (b,b,b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * b b2, (~) * b b3, (~) * b b4, (~) * b b5, (~) * b b6, (~) * b b7) => Each (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b
each :: Traversal (a,a,a,a,a,a,a) (b,b,b,b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8, (~) * b b2, (~) * b b3, (~) * b b4, (~) * b b5, (~) * b b6, (~) * b b7, (~) * b b8) => Each (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b
each :: Traversal (a,a,a,a,a,a,a,a) (b,b,b,b,b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8, (~) * a a9, (~) * b b2, (~) * b b3, (~) * b b4, (~) * b b5, (~) * b b6, (~) * b b7, (~) * b b8, (~) * b b9) => Each (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b
each :: Traversal (a,a,a,a,a,a,a,a,a) (b,b,b,b,b,b,b,b,b) a b

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b #

type Equality k2 k1 s t a b = forall k3 p f. p a (f b) -> p s (f t) #

A witness that (a ~ s, b ~ t).

Note: Composition with an Equality is index-preserving.

type Equality' k2 s a = Equality k2 k2 s s a a #

class Field1 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to 1st field of a tuple.

Methods

_1 :: Lens s t a b #

Access the 1st field of a tuple (and possibly change its type).

>>> (1,2)^._1
1
>>> _1 .~ "hello" $ (1,2)
("hello",2)
>>> (1,2) & _1 .~ "hello"
("hello",2)
>>> _1 putStrLn ("hello","world")
hello
((),"world")

This can also be used on larger tuples as well:

>>> (1,2,3,4,5) & _1 +~ 41
(42,2,3,4,5)
_1 :: Lens (a,b) (a',b) a a'
_1 :: Lens (a,b,c) (a',b,c) a a'
_1 :: Lens (a,b,c,d) (a',b,c,d) a a'
...
_1 :: Lens (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a'

Instances

Field1 (Identity a) (Identity b) a b 

Methods

_1 :: Lens (Identity a) (Identity b) a b #

Field1 (a, b) (a', b) a a'
_1 k ~(a,b) = (\a' -> (a',b)) <$> k a

Methods

_1 :: Lens (a, b) (a', b) a a' #

Field1 (a, b, c) (a', b, c) a a' 

Methods

_1 :: Lens (a, b, c) (a', b, c) a a' #

Field1 ((:*:) f g p) ((:*:) f' g p) (f p) (f' p) 

Methods

_1 :: Lens ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) #

Field1 (a, b, c, d) (a', b, c, d) a a' 

Methods

_1 :: Lens (a, b, c, d) (a', b, c, d) a a' #

Field1 (Product * f g a) (Product * f' g a) (f a) (f' a) 

Methods

_1 :: Lens (Product * f g a) (Product * f' g a) (f a) (f' a) #

Field1 (a, b, c, d, e) (a', b, c, d, e) a a' 

Methods

_1 :: Lens (a, b, c, d, e) (a', b, c, d, e) a a' #

Field1 (a, b, c, d, e, f) (a', b, c, d, e, f) a a' 

Methods

_1 :: Lens (a, b, c, d, e, f) (a', b, c, d, e, f) a a' #

Field1 (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' 

Methods

_1 :: Lens (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' #

Field1 (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' 

Methods

_1 :: Lens (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' #

Field1 (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' 

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' #

class Field2 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 2nd field of a tuple.

Methods

_2 :: Lens s t a b #

Access the 2nd field of a tuple.

>>> _2 .~ "hello" $ (1,(),3,4)
(1,"hello",3,4)
>>> (1,2,3,4) & _2 *~ 3
(1,6,3,4)
>>> _2 print (1,2)
2
(1,())
anyOf _2 :: (s -> Bool) -> (a, s) -> Bool
traverse . _2 :: (Applicative f, Traversable t) => (a -> f b) -> t (s, a) -> f (t (s, b))
foldMapOf (traverse . _2) :: (Traversable t, Monoid m) => (s -> m) -> t (b, s) -> m

Instances

Field2 (a, b) (a, b') b b'
_2 k ~(a,b) = (\b' -> (a,b')) <$> k b

Methods

_2 :: Lens (a, b) (a, b') b b' #

Field2 (a, b, c) (a, b', c) b b' 

Methods

_2 :: Lens (a, b, c) (a, b', c) b b' #

Field2 ((:*:) f g p) ((:*:) f g' p) (g p) (g' p) 

Methods

_2 :: Lens ((f :*: g) p) ((f :*: g') p) (g p) (g' p) #

Field2 (a, b, c, d) (a, b', c, d) b b' 

Methods

_2 :: Lens (a, b, c, d) (a, b', c, d) b b' #

Field2 (Product * f g a) (Product * f g' a) (g a) (g' a) 

Methods

_2 :: Lens (Product * f g a) (Product * f g' a) (g a) (g' a) #

Field2 (a, b, c, d, e) (a, b', c, d, e) b b' 

Methods

_2 :: Lens (a, b, c, d, e) (a, b', c, d, e) b b' #

Field2 (a, b, c, d, e, f) (a, b', c, d, e, f) b b' 

Methods

_2 :: Lens (a, b, c, d, e, f) (a, b', c, d, e, f) b b' #

Field2 (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' 

Methods

_2 :: Lens (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' #

Field2 (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' 

Methods

_2 :: Lens (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' #

Field2 (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' 

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' #

class Field3 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 3rd field of a tuple.

Methods

_3 :: Lens s t a b #

Access the 3rd field of a tuple.

Instances

Field3 (a, b, c) (a, b, c') c c' 

Methods

_3 :: Lens (a, b, c) (a, b, c') c c' #

Field3 (a, b, c, d) (a, b, c', d) c c' 

Methods

_3 :: Lens (a, b, c, d) (a, b, c', d) c c' #

Field3 (a, b, c, d, e) (a, b, c', d, e) c c' 

Methods

_3 :: Lens (a, b, c, d, e) (a, b, c', d, e) c c' #

Field3 (a, b, c, d, e, f) (a, b, c', d, e, f) c c' 

Methods

_3 :: Lens (a, b, c, d, e, f) (a, b, c', d, e, f) c c' #

Field3 (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' 

Methods

_3 :: Lens (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' #

Field3 (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' 

Methods

_3 :: Lens (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' #

Field3 (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' 

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' #

class Field4 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 4th field of a tuple.

Methods

_4 :: Lens s t a b #

Access the 4th field of a tuple.

Instances

Field4 (a, b, c, d) (a, b, c, d') d d' 

Methods

_4 :: Lens (a, b, c, d) (a, b, c, d') d d' #

Field4 (a, b, c, d, e) (a, b, c, d', e) d d' 

Methods

_4 :: Lens (a, b, c, d, e) (a, b, c, d', e) d d' #

Field4 (a, b, c, d, e, f) (a, b, c, d', e, f) d d' 

Methods

_4 :: Lens (a, b, c, d, e, f) (a, b, c, d', e, f) d d' #

Field4 (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' 

Methods

_4 :: Lens (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' #

Field4 (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' 

Methods

_4 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' #

Field4 (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' 

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' #

class Field5 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 5th field of a tuple.

Methods

_5 :: Lens s t a b #

Access the 5th field of a tuple.

Instances

Field5 (a, b, c, d, e) (a, b, c, d, e') e e' 

Methods

_5 :: Lens (a, b, c, d, e) (a, b, c, d, e') e e' #

Field5 (a, b, c, d, e, f) (a, b, c, d, e', f) e e' 

Methods

_5 :: Lens (a, b, c, d, e, f) (a, b, c, d, e', f) e e' #

Field5 (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' 

Methods

_5 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' #

Field5 (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' 

Methods

_5 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' #

Field5 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' 

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' #

class Field6 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 6th element of a tuple.

Methods

_6 :: Lens s t a b #

Access the 6th field of a tuple.

Instances

Field6 (a, b, c, d, e, f) (a, b, c, d, e, f') f f' 

Methods

_6 :: Lens (a, b, c, d, e, f) (a, b, c, d, e, f') f f' #

Field6 (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' 

Methods

_6 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' #

Field6 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' 

Methods

_6 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' #

Field6 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' 

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' #

class Field7 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 7th field of a tuple.

Methods

_7 :: Lens s t a b #

Access the 7th field of a tuple.

Instances

Field7 (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' 

Methods

_7 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' #

Field7 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' 

Methods

_7 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' #

Field7 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' 

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' #

class Field8 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 8th field of a tuple.

Methods

_8 :: Lens s t a b #

Access the 8th field of a tuple.

Instances

Field8 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' 

Methods

_8 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' #

Field8 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' 

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' #

class Field9 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 9th field of a tuple.

Methods

_9 :: Lens s t a b #

Access the 9th field of a tuple.

Instances

Field9 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' 

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' #

type FieldNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> [Name]

Names of all fields (including the field being named) in the data type.

-> Name

Name of the field being named.

-> [DefName]

Name(s) of the lens functions. If empty, no lens is created for that field.

The rule to create function names of lenses for data fields.

Although it's sometimes useful, you won't need the first two arguments most of the time.

type Fold s a = forall f. (Contravariant f, Applicative f) => (a -> f a) -> s -> f s #

A Fold describes how to retrieve multiple values in a way that can be composed with other LensLike constructions.

A Fold s a provides a structure with operations very similar to those of the Foldable typeclass, see foldMapOf and the other Fold combinators.

By convention, if there exists a foo method that expects a Foldable (f a), then there should be a fooOf method that takes a Fold s a and a value of type s.

A Getter is a legal Fold that just ignores the supplied Monoid.

Unlike a Traversal a Fold is read-only. Since a Fold cannot be used to write back there are no Lens laws that apply.

type Fold1 s a = forall f. (Contravariant f, Apply f) => (a -> f a) -> s -> f s #

A relevant Fold (aka Fold1) has one or more targets.

class Foldable t where #

Data structures that can be folded.

For example, given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Foldable Tree where
   foldMap f Empty = mempty
   foldMap f (Leaf x) = f x
   foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define foldr:

instance Foldable Tree where
   foldr f z Empty = z
   foldr f z (Leaf x) = f x z
   foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

Foldable instances are expected to satisfy the following laws:

foldr f z t = appEndo (foldMap (Endo . f) t ) z
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
fold = foldMap id

sum, product, maximum, and minimum should all be essentially equivalent to foldMap forms, such as

sum = getSum . foldMap Sum

but may be less defined.

If the type is also a Functor instance, it should satisfy

foldMap f = fold . fmap f

which implies that

foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

foldMap | foldr

Methods

fold :: Monoid m => t m -> m #

Combine the elements of a structure using a monoid.

foldMap :: Monoid m => (a -> m) -> t a -> m #

Map each element of the structure to a monoid, and combine the results.

foldr :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure.

In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, foldr can produce a terminating expression from an infinite list.

For a general Foldable structure this should be semantically identical to,

foldr f z = foldr f z . toList

foldr' :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure, but with strict application of the operator.

foldl :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure.

In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.

Also note that if you want an efficient left-fold, you probably want to use foldl' instead of foldl. The reason for this is that latter does not force the "inner" results (e.g. z f x1 in the above example) before applying them to the operator (e.g. to (f x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl f z . toList

foldl' :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure but with strict application of the operator.

This ensures that each step of the fold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite list to a single, monolithic result (e.g. length).

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl' f z . toList

foldr1 :: (a -> a -> a) -> t a -> a #

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.

foldr1 f = foldr1 f . toList

foldl1 :: (a -> a -> a) -> t a -> a #

A variant of foldl that has no base case, and thus may only be applied to non-empty structures.

foldl1 f = foldl1 f . toList

toList :: t a -> [a] #

List of elements of a structure, from left to right.

null :: t a -> Bool #

Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

length :: t a -> Int #

Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

elem :: Eq a => a -> t a -> Bool infix 4 #

Does the element occur in the structure?

maximum :: Ord a => t a -> a #

The largest element of a non-empty structure.

minimum :: Ord a => t a -> a #

The least element of a non-empty structure.

sum :: Num a => t a -> a #

The sum function computes the sum of the numbers of a structure.

product :: Num a => t a -> a #

The product function computes the product of the numbers of a structure.

Instances

Foldable [] 

Methods

fold :: Monoid m => [m] -> m #

foldMap :: Monoid m => (a -> m) -> [a] -> m #

foldr :: (a -> b -> b) -> b -> [a] -> b #

foldr' :: (a -> b -> b) -> b -> [a] -> b #

foldl :: (b -> a -> b) -> b -> [a] -> b #

foldl' :: (b -> a -> b) -> b -> [a] -> b #

foldr1 :: (a -> a -> a) -> [a] -> a #

foldl1 :: (a -> a -> a) -> [a] -> a #

toList :: [a] -> [a] #

null :: [a] -> Bool #

length :: [a] -> Int #

elem :: Eq a => a -> [a] -> Bool #

maximum :: Ord a => [a] -> a #

minimum :: Ord a => [a] -> a #

sum :: Num a => [a] -> a #

product :: Num a => [a] -> a #

Foldable Maybe 

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Foldable V1 

Methods

fold :: Monoid m => V1 m -> m #

foldMap :: Monoid m => (a -> m) -> V1 a -> m #

foldr :: (a -> b -> b) -> b -> V1 a -> b #

foldr' :: (a -> b -> b) -> b -> V1 a -> b #

foldl :: (b -> a -> b) -> b -> V1 a -> b #

foldl' :: (b -> a -> b) -> b -> V1 a -> b #

foldr1 :: (a -> a -> a) -> V1 a -> a #

foldl1 :: (a -> a -> a) -> V1 a -> a #

toList :: V1 a -> [a] #

null :: V1 a -> Bool #

length :: V1 a -> Int #

elem :: Eq a => a -> V1 a -> Bool #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

sum :: Num a => V1 a -> a #

product :: Num a => V1 a -> a #

Foldable U1 

Methods

fold :: Monoid m => U1 m -> m #

foldMap :: Monoid m => (a -> m) -> U1 a -> m #

foldr :: (a -> b -> b) -> b -> U1 a -> b #

foldr' :: (a -> b -> b) -> b -> U1 a -> b #

foldl :: (b -> a -> b) -> b -> U1 a -> b #

foldl' :: (b -> a -> b) -> b -> U1 a -> b #

foldr1 :: (a -> a -> a) -> U1 a -> a #

foldl1 :: (a -> a -> a) -> U1 a -> a #

toList :: U1 a -> [a] #

null :: U1 a -> Bool #

length :: U1 a -> Int #

elem :: Eq a => a -> U1 a -> Bool #

maximum :: Ord a => U1 a -> a #

minimum :: Ord a => U1 a -> a #

sum :: Num a => U1 a -> a #

product :: Num a => U1 a -> a #

Foldable Par1 

Methods

fold :: Monoid m => Par1 m -> m #

foldMap :: Monoid m => (a -> m) -> Par1 a -> m #

foldr :: (a -> b -> b) -> b -> Par1 a -> b #

foldr' :: (a -> b -> b) -> b -> Par1 a -> b #

foldl :: (b -> a -> b) -> b -> Par1 a -> b #

foldl' :: (b -> a -> b) -> b -> Par1 a -> b #

foldr1 :: (a -> a -> a) -> Par1 a -> a #

foldl1 :: (a -> a -> a) -> Par1 a -> a #

toList :: Par1 a -> [a] #

null :: Par1 a -> Bool #

length :: Par1 a -> Int #

elem :: Eq a => a -> Par1 a -> Bool #

maximum :: Ord a => Par1 a -> a #

minimum :: Ord a => Par1 a -> a #

sum :: Num a => Par1 a -> a #

product :: Num a => Par1 a -> a #

Foldable IResult 

Methods

fold :: Monoid m => IResult m -> m #

foldMap :: Monoid m => (a -> m) -> IResult a -> m #

foldr :: (a -> b -> b) -> b -> IResult a -> b #

foldr' :: (a -> b -> b) -> b -> IResult a -> b #

foldl :: (b -> a -> b) -> b -> IResult a -> b #

foldl' :: (b -> a -> b) -> b -> IResult a -> b #

foldr1 :: (a -> a -> a) -> IResult a -> a #

foldl1 :: (a -> a -> a) -> IResult a -> a #

toList :: IResult a -> [a] #

null :: IResult a -> Bool #

length :: IResult a -> Int #

elem :: Eq a => a -> IResult a -> Bool #

maximum :: Ord a => IResult a -> a #

minimum :: Ord a => IResult a -> a #

sum :: Num a => IResult a -> a #

product :: Num a => IResult a -> a #

Foldable Result 

Methods

fold :: Monoid m => Result m -> m #

foldMap :: Monoid m => (a -> m) -> Result a -> m #

foldr :: (a -> b -> b) -> b -> Result a -> b #

foldr' :: (a -> b -> b) -> b -> Result a -> b #

foldl :: (b -> a -> b) -> b -> Result a -> b #

foldl' :: (b -> a -> b) -> b -> Result a -> b #

foldr1 :: (a -> a -> a) -> Result a -> a #

foldl1 :: (a -> a -> a) -> Result a -> a #

toList :: Result a -> [a] #

null :: Result a -> Bool #

length :: Result a -> Int #

elem :: Eq a => a -> Result a -> Bool #

maximum :: Ord a => Result a -> a #

minimum :: Ord a => Result a -> a #

sum :: Num a => Result a -> a #

product :: Num a => Result a -> a #

Foldable Identity 

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Foldable Min 

Methods

fold :: Monoid m => Min m -> m #

foldMap :: Monoid m => (a -> m) -> Min a -> m #

foldr :: (a -> b -> b) -> b -> Min a -> b #

foldr' :: (a -> b -> b) -> b -> Min a -> b #

foldl :: (b -> a -> b) -> b -> Min a -> b #

foldl' :: (b -> a -> b) -> b -> Min a -> b #

foldr1 :: (a -> a -> a) -> Min a -> a #

foldl1 :: (a -> a -> a) -> Min a -> a #

toList :: Min a -> [a] #

null :: Min a -> Bool #

length :: Min a -> Int #

elem :: Eq a => a -> Min a -> Bool #

maximum :: Ord a => Min a -> a #

minimum :: Ord a => Min a -> a #

sum :: Num a => Min a -> a #

product :: Num a => Min a -> a #

Foldable Max 

Methods

fold :: Monoid m => Max m -> m #

foldMap :: Monoid m => (a -> m) -> Max a -> m #

foldr :: (a -> b -> b) -> b -> Max a -> b #

foldr' :: (a -> b -> b) -> b -> Max a -> b #

foldl :: (b -> a -> b) -> b -> Max a -> b #

foldl' :: (b -> a -> b) -> b -> Max a -> b #

foldr1 :: (a -> a -> a) -> Max a -> a #

foldl1 :: (a -> a -> a) -> Max a -> a #

toList :: Max a -> [a] #

null :: Max a -> Bool #

length :: Max a -> Int #

elem :: Eq a => a -> Max a -> Bool #

maximum :: Ord a => Max a -> a #

minimum :: Ord a => Max a -> a #

sum :: Num a => Max a -> a #

product :: Num a => Max a -> a #

Foldable First 

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Foldable Last 

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Foldable Option 

Methods

fold :: Monoid m => Option m -> m #

foldMap :: Monoid m => (a -> m) -> Option a -> m #

foldr :: (a -> b -> b) -> b -> Option a -> b #

foldr' :: (a -> b -> b) -> b -> Option a -> b #

foldl :: (b -> a -> b) -> b -> Option a -> b #

foldl' :: (b -> a -> b) -> b -> Option a -> b #

foldr1 :: (a -> a -> a) -> Option a -> a #

foldl1 :: (a -> a -> a) -> Option a -> a #

toList :: Option a -> [a] #

null :: Option a -> Bool #

length :: Option a -> Int #

elem :: Eq a => a -> Option a -> Bool #

maximum :: Ord a => Option a -> a #

minimum :: Ord a => Option a -> a #

sum :: Num a => Option a -> a #

product :: Num a => Option a -> a #

Foldable NonEmpty 

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Foldable Complex 

Methods

fold :: Monoid m => Complex m -> m #

foldMap :: Monoid m => (a -> m) -> Complex a -> m #

foldr :: (a -> b -> b) -> b -> Complex a -> b #

foldr' :: (a -> b -> b) -> b -> Complex a -> b #

foldl :: (b -> a -> b) -> b -> Complex a -> b #

foldl' :: (b -> a -> b) -> b -> Complex a -> b #

foldr1 :: (a -> a -> a) -> Complex a -> a #

foldl1 :: (a -> a -> a) -> Complex a -> a #

toList :: Complex a -> [a] #

null :: Complex a -> Bool #

length :: Complex a -> Int #

elem :: Eq a => a -> Complex a -> Bool #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

sum :: Num a => Complex a -> a #

product :: Num a => Complex a -> a #

Foldable ZipList 

Methods

fold :: Monoid m => ZipList m -> m #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m #

foldr :: (a -> b -> b) -> b -> ZipList a -> b #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b #

foldl :: (b -> a -> b) -> b -> ZipList a -> b #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b #

foldr1 :: (a -> a -> a) -> ZipList a -> a #

foldl1 :: (a -> a -> a) -> ZipList a -> a #

toList :: ZipList a -> [a] #

null :: ZipList a -> Bool #

length :: ZipList a -> Int #

elem :: Eq a => a -> ZipList a -> Bool #

maximum :: Ord a => ZipList a -> a #

minimum :: Ord a => ZipList a -> a #

sum :: Num a => ZipList a -> a #

product :: Num a => ZipList a -> a #

Foldable Dual 

Methods

fold :: Monoid m => Dual m -> m #

foldMap :: Monoid m => (a -> m) -> Dual a -> m #

foldr :: (a -> b -> b) -> b -> Dual a -> b #

foldr' :: (a -> b -> b) -> b -> Dual a -> b #

foldl :: (b -> a -> b) -> b -> Dual a -> b #

foldl' :: (b -> a -> b) -> b -> Dual a -> b #

foldr1 :: (a -> a -> a) -> Dual a -> a #

foldl1 :: (a -> a -> a) -> Dual a -> a #

toList :: Dual a -> [a] #

null :: Dual a -> Bool #

length :: Dual a -> Int #

elem :: Eq a => a -> Dual a -> Bool #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

sum :: Num a => Dual a -> a #

product :: Num a => Dual a -> a #

Foldable Sum 

Methods

fold :: Monoid m => Sum m -> m #

foldMap :: Monoid m => (a -> m) -> Sum a -> m #

foldr :: (a -> b -> b) -> b -> Sum a -> b #

foldr' :: (a -> b -> b) -> b -> Sum a -> b #

foldl :: (b -> a -> b) -> b -> Sum a -> b #

foldl' :: (b -> a -> b) -> b -> Sum a -> b #

foldr1 :: (a -> a -> a) -> Sum a -> a #

foldl1 :: (a -> a -> a) -> Sum a -> a #

toList :: Sum a -> [a] #

null :: Sum a -> Bool #

length :: Sum a -> Int #

elem :: Eq a => a -> Sum a -> Bool #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

sum :: Num a => Sum a -> a #

product :: Num a => Sum a -> a #

Foldable Product 

Methods

fold :: Monoid m => Product m -> m #

foldMap :: Monoid m => (a -> m) -> Product a -> m #

foldr :: (a -> b -> b) -> b -> Product a -> b #

foldr' :: (a -> b -> b) -> b -> Product a -> b #

foldl :: (b -> a -> b) -> b -> Product a -> b #

foldl' :: (b -> a -> b) -> b -> Product a -> b #

foldr1 :: (a -> a -> a) -> Product a -> a #

foldl1 :: (a -> a -> a) -> Product a -> a #

toList :: Product a -> [a] #

null :: Product a -> Bool #

length :: Product a -> Int #

elem :: Eq a => a -> Product a -> Bool #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

sum :: Num a => Product a -> a #

product :: Num a => Product a -> a #

Foldable First 

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Foldable Last 

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Foldable Identifier 

Methods

fold :: Monoid m => Identifier m -> m #

foldMap :: Monoid m => (a -> m) -> Identifier a -> m #

foldr :: (a -> b -> b) -> b -> Identifier a -> b #

foldr' :: (a -> b -> b) -> b -> Identifier a -> b #

foldl :: (b -> a -> b) -> b -> Identifier a -> b #

foldl' :: (b -> a -> b) -> b -> Identifier a -> b #

foldr1 :: (a -> a -> a) -> Identifier a -> a #

foldl1 :: (a -> a -> a) -> Identifier a -> a #

toList :: Identifier a -> [a] #

null :: Identifier a -> Bool #

length :: Identifier a -> Int #

elem :: Eq a => a -> Identifier a -> Bool #

maximum :: Ord a => Identifier a -> a #

minimum :: Ord a => Identifier a -> a #

sum :: Num a => Identifier a -> a #

product :: Num a => Identifier a -> a #

Foldable Digit 

Methods

fold :: Monoid m => Digit m -> m #

foldMap :: Monoid m => (a -> m) -> Digit a -> m #

foldr :: (a -> b -> b) -> b -> Digit a -> b #

foldr' :: (a -> b -> b) -> b -> Digit a -> b #

foldl :: (b -> a -> b) -> b -> Digit a -> b #

foldl' :: (b -> a -> b) -> b -> Digit a -> b #

foldr1 :: (a -> a -> a) -> Digit a -> a #

foldl1 :: (a -> a -> a) -> Digit a -> a #

toList :: Digit a -> [a] #

null :: Digit a -> Bool #

length :: Digit a -> Int #

elem :: Eq a => a -> Digit a -> Bool #

maximum :: Ord a => Digit a -> a #

minimum :: Ord a => Digit a -> a #

sum :: Num a => Digit a -> a #

product :: Num a => Digit a -> a #

Foldable Node 

Methods

fold :: Monoid m => Node m -> m #

foldMap :: Monoid m => (a -> m) -> Node a -> m #

foldr :: (a -> b -> b) -> b -> Node a -> b #

foldr' :: (a -> b -> b) -> b -> Node a -> b #

foldl :: (b -> a -> b) -> b -> Node a -> b #

foldl' :: (b -> a -> b) -> b -> Node a -> b #

foldr1 :: (a -> a -> a) -> Node a -> a #

foldl1 :: (a -> a -> a) -> Node a -> a #

toList :: Node a -> [a] #

null :: Node a -> Bool #

length :: Node a -> Int #

elem :: Eq a => a -> Node a -> Bool #

maximum :: Ord a => Node a -> a #

minimum :: Ord a => Node a -> a #

sum :: Num a => Node a -> a #

product :: Num a => Node a -> a #

Foldable Elem 

Methods

fold :: Monoid m => Elem m -> m #

foldMap :: Monoid m => (a -> m) -> Elem a -> m #

foldr :: (a -> b -> b) -> b -> Elem a -> b #

foldr' :: (a -> b -> b) -> b -> Elem a -> b #

foldl :: (b -> a -> b) -> b -> Elem a -> b #

foldl' :: (b -> a -> b) -> b -> Elem a -> b #

foldr1 :: (a -> a -> a) -> Elem a -> a #

foldl1 :: (a -> a -> a) -> Elem a -> a #

toList :: Elem a -> [a] #

null :: Elem a -> Bool #

length :: Elem a -> Int #

elem :: Eq a => a -> Elem a -> Bool #

maximum :: Ord a => Elem a -> a #

minimum :: Ord a => Elem a -> a #

sum :: Num a => Elem a -> a #

product :: Num a => Elem a -> a #

Foldable FingerTree 

Methods

fold :: Monoid m => FingerTree m -> m #

foldMap :: Monoid m => (a -> m) -> FingerTree a -> m #

foldr :: (a -> b -> b) -> b -> FingerTree a -> b #

foldr' :: (a -> b -> b) -> b -> FingerTree a -> b #

foldl :: (b -> a -> b) -> b -> FingerTree a -> b #

foldl' :: (b -> a -> b) -> b -> FingerTree a -> b #

foldr1 :: (a -> a -> a) -> FingerTree a -> a #

foldl1 :: (a -> a -> a) -> FingerTree a -> a #

toList :: FingerTree a -> [a] #

null :: FingerTree a -> Bool #

length :: FingerTree a -> Int #

elem :: Eq a => a -> FingerTree a -> Bool #

maximum :: Ord a => FingerTree a -> a #

minimum :: Ord a => FingerTree a -> a #

sum :: Num a => FingerTree a -> a #

product :: Num a => FingerTree a -> a #

Foldable IntMap 

Methods

fold :: Monoid m => IntMap m -> m #

foldMap :: Monoid m => (a -> m) -> IntMap a -> m #

foldr :: (a -> b -> b) -> b -> IntMap a -> b #

foldr' :: (a -> b -> b) -> b -> IntMap a -> b #

foldl :: (b -> a -> b) -> b -> IntMap a -> b #

foldl' :: (b -> a -> b) -> b -> IntMap a -> b #

foldr1 :: (a -> a -> a) -> IntMap a -> a #

foldl1 :: (a -> a -> a) -> IntMap a -> a #

toList :: IntMap a -> [a] #

null :: IntMap a -> Bool #

length :: IntMap a -> Int #

elem :: Eq a => a -> IntMap a -> Bool #

maximum :: Ord a => IntMap a -> a #

minimum :: Ord a => IntMap a -> a #

sum :: Num a => IntMap a -> a #

product :: Num a => IntMap a -> a #

Foldable Tree 

Methods

fold :: Monoid m => Tree m -> m #

foldMap :: Monoid m => (a -> m) -> Tree a -> m #

foldr :: (a -> b -> b) -> b -> Tree a -> b #

foldr' :: (a -> b -> b) -> b -> Tree a -> b #

foldl :: (b -> a -> b) -> b -> Tree a -> b #

foldl' :: (b -> a -> b) -> b -> Tree a -> b #

foldr1 :: (a -> a -> a) -> Tree a -> a #

foldl1 :: (a -> a -> a) -> Tree a -> a #

toList :: Tree a -> [a] #

null :: Tree a -> Bool #

length :: Tree a -> Int #

elem :: Eq a => a -> Tree a -> Bool #

maximum :: Ord a => Tree a -> a #

minimum :: Ord a => Tree a -> a #

sum :: Num a => Tree a -> a #

product :: Num a => Tree a -> a #

Foldable Seq 

Methods

fold :: Monoid m => Seq m -> m #

foldMap :: Monoid m => (a -> m) -> Seq a -> m #

foldr :: (a -> b -> b) -> b -> Seq a -> b #

foldr' :: (a -> b -> b) -> b -> Seq a -> b #

foldl :: (b -> a -> b) -> b -> Seq a -> b #

foldl' :: (b -> a -> b) -> b -> Seq a -> b #

foldr1 :: (a -> a -> a) -> Seq a -> a #

foldl1 :: (a -> a -> a) -> Seq a -> a #

toList :: Seq a -> [a] #

null :: Seq a -> Bool #

length :: Seq a -> Int #

elem :: Eq a => a -> Seq a -> Bool #

maximum :: Ord a => Seq a -> a #

minimum :: Ord a => Seq a -> a #

sum :: Num a => Seq a -> a #

product :: Num a => Seq a -> a #

Foldable ViewL 

Methods

fold :: Monoid m => ViewL m -> m #

foldMap :: Monoid m => (a -> m) -> ViewL a -> m #

foldr :: (a -> b -> b) -> b -> ViewL a -> b #

foldr' :: (a -> b -> b) -> b -> ViewL a -> b #

foldl :: (b -> a -> b) -> b -> ViewL a -> b #

foldl' :: (b -> a -> b) -> b -> ViewL a -> b #

foldr1 :: (a -> a -> a) -> ViewL a -> a #

foldl1 :: (a -> a -> a) -> ViewL a -> a #

toList :: ViewL a -> [a] #

null :: ViewL a -> Bool #

length :: ViewL a -> Int #

elem :: Eq a => a -> ViewL a -> Bool #

maximum :: Ord a => ViewL a -> a #

minimum :: Ord a => ViewL a -> a #

sum :: Num a => ViewL a -> a #

product :: Num a => ViewL a -> a #

Foldable ViewR 

Methods

fold :: Monoid m => ViewR m -> m #

foldMap :: Monoid m => (a -> m) -> ViewR a -> m #

foldr :: (a -> b -> b) -> b -> ViewR a -> b #

foldr' :: (a -> b -> b) -> b -> ViewR a -> b #

foldl :: (b -> a -> b) -> b -> ViewR a -> b #

foldl' :: (b -> a -> b) -> b -> ViewR a -> b #

foldr1 :: (a -> a -> a) -> ViewR a -> a #

foldl1 :: (a -> a -> a) -> ViewR a -> a #

toList :: ViewR a -> [a] #

null :: ViewR a -> Bool #

length :: ViewR a -> Int #

elem :: Eq a => a -> ViewR a -> Bool #

maximum :: Ord a => ViewR a -> a #

minimum :: Ord a => ViewR a -> a #

sum :: Num a => ViewR a -> a #

product :: Num a => ViewR a -> a #

Foldable Set 

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Foldable DList 

Methods

fold :: Monoid m => DList m -> m #

foldMap :: Monoid m => (a -> m) -> DList a -> m #

foldr :: (a -> b -> b) -> b -> DList a -> b #

foldr' :: (a -> b -> b) -> b -> DList a -> b #

foldl :: (b -> a -> b) -> b -> DList a -> b #

foldl' :: (b -> a -> b) -> b -> DList a -> b #

foldr1 :: (a -> a -> a) -> DList a -> a #

foldl1 :: (a -> a -> a) -> DList a -> a #

toList :: DList a -> [a] #

null :: DList a -> Bool #

length :: DList a -> Int #

elem :: Eq a => a -> DList a -> Bool #

maximum :: Ord a => DList a -> a #

minimum :: Ord a => DList a -> a #

sum :: Num a => DList a -> a #

product :: Num a => DList a -> a #

Foldable Hashed 

Methods

fold :: Monoid m => Hashed m -> m #

foldMap :: Monoid m => (a -> m) -> Hashed a -> m #

foldr :: (a -> b -> b) -> b -> Hashed a -> b #

foldr' :: (a -> b -> b) -> b -> Hashed a -> b #

foldl :: (b -> a -> b) -> b -> Hashed a -> b #

foldl' :: (b -> a -> b) -> b -> Hashed a -> b #

foldr1 :: (a -> a -> a) -> Hashed a -> a #

foldl1 :: (a -> a -> a) -> Hashed a -> a #

toList :: Hashed a -> [a] #

null :: Hashed a -> Bool #

length :: Hashed a -> Int #

elem :: Eq a => a -> Hashed a -> Bool #

maximum :: Ord a => Hashed a -> a #

minimum :: Ord a => Hashed a -> a #

sum :: Num a => Hashed a -> a #

product :: Num a => Hashed a -> a #

Foldable Vector 

Methods

fold :: Monoid m => Vector m -> m #

foldMap :: Monoid m => (a -> m) -> Vector a -> m #

foldr :: (a -> b -> b) -> b -> Vector a -> b #

foldr' :: (a -> b -> b) -> b -> Vector a -> b #

foldl :: (b -> a -> b) -> b -> Vector a -> b #

foldl' :: (b -> a -> b) -> b -> Vector a -> b #

foldr1 :: (a -> a -> a) -> Vector a -> a #

foldl1 :: (a -> a -> a) -> Vector a -> a #

toList :: Vector a -> [a] #

null :: Vector a -> Bool #

length :: Vector a -> Int #

elem :: Eq a => a -> Vector a -> Bool #

maximum :: Ord a => Vector a -> a #

minimum :: Ord a => Vector a -> a #

sum :: Num a => Vector a -> a #

product :: Num a => Vector a -> a #

Foldable HashSet 

Methods

fold :: Monoid m => HashSet m -> m #

foldMap :: Monoid m => (a -> m) -> HashSet a -> m #

foldr :: (a -> b -> b) -> b -> HashSet a -> b #

foldr' :: (a -> b -> b) -> b -> HashSet a -> b #

foldl :: (b -> a -> b) -> b -> HashSet a -> b #

foldl' :: (b -> a -> b) -> b -> HashSet a -> b #

foldr1 :: (a -> a -> a) -> HashSet a -> a #

foldl1 :: (a -> a -> a) -> HashSet a -> a #

toList :: HashSet a -> [a] #

null :: HashSet a -> Bool #

length :: HashSet a -> Int #

elem :: Eq a => a -> HashSet a -> Bool #

maximum :: Ord a => HashSet a -> a #

minimum :: Ord a => HashSet a -> a #

sum :: Num a => HashSet a -> a #

product :: Num a => HashSet a -> a #

Foldable (Either a) 

Methods

fold :: Monoid m => Either a m -> m #

foldMap :: Monoid m => (a -> m) -> Either a a -> m #

foldr :: (a -> b -> b) -> b -> Either a a -> b #

foldr' :: (a -> b -> b) -> b -> Either a a -> b #

foldl :: (b -> a -> b) -> b -> Either a a -> b #

foldl' :: (b -> a -> b) -> b -> Either a a -> b #

foldr1 :: (a -> a -> a) -> Either a a -> a #

foldl1 :: (a -> a -> a) -> Either a a -> a #

toList :: Either a a -> [a] #

null :: Either a a -> Bool #

length :: Either a a -> Int #

elem :: Eq a => a -> Either a a -> Bool #

maximum :: Ord a => Either a a -> a #

minimum :: Ord a => Either a a -> a #

sum :: Num a => Either a a -> a #

product :: Num a => Either a a -> a #

Foldable f => Foldable (Rec1 f) 

Methods

fold :: Monoid m => Rec1 f m -> m #

foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m #

foldr :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldl :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldr1 :: (a -> a -> a) -> Rec1 f a -> a #

foldl1 :: (a -> a -> a) -> Rec1 f a -> a #

toList :: Rec1 f a -> [a] #

null :: Rec1 f a -> Bool #

length :: Rec1 f a -> Int #

elem :: Eq a => a -> Rec1 f a -> Bool #

maximum :: Ord a => Rec1 f a -> a #

minimum :: Ord a => Rec1 f a -> a #

sum :: Num a => Rec1 f a -> a #

product :: Num a => Rec1 f a -> a #

Foldable (URec Char) 

Methods

fold :: Monoid m => URec Char m -> m #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m #

foldr :: (a -> b -> b) -> b -> URec Char a -> b #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b #

foldl :: (b -> a -> b) -> b -> URec Char a -> b #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b #

foldr1 :: (a -> a -> a) -> URec Char a -> a #

foldl1 :: (a -> a -> a) -> URec Char a -> a #

toList :: URec Char a -> [a] #

null :: URec Char a -> Bool #

length :: URec Char a -> Int #

elem :: Eq a => a -> URec Char a -> Bool #

maximum :: Ord a => URec Char a -> a #

minimum :: Ord a => URec Char a -> a #

sum :: Num a => URec Char a -> a #

product :: Num a => URec Char a -> a #

Foldable (URec Double) 

Methods

fold :: Monoid m => URec Double m -> m #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m #

foldr :: (a -> b -> b) -> b -> URec Double a -> b #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b #

foldl :: (b -> a -> b) -> b -> URec Double a -> b #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b #

foldr1 :: (a -> a -> a) -> URec Double a -> a #

foldl1 :: (a -> a -> a) -> URec Double a -> a #

toList :: URec Double a -> [a] #

null :: URec Double a -> Bool #

length :: URec Double a -> Int #

elem :: Eq a => a -> URec Double a -> Bool #

maximum :: Ord a => URec Double a -> a #

minimum :: Ord a => URec Double a -> a #

sum :: Num a => URec Double a -> a #

product :: Num a => URec Double a -> a #

Foldable (URec Float) 

Methods

fold :: Monoid m => URec Float m -> m #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m #

foldr :: (a -> b -> b) -> b -> URec Float a -> b #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b #

foldl :: (b -> a -> b) -> b -> URec Float a -> b #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b #

foldr1 :: (a -> a -> a) -> URec Float a -> a #

foldl1 :: (a -> a -> a) -> URec Float a -> a #

toList :: URec Float a -> [a] #

null :: URec Float a -> Bool #

length :: URec Float a -> Int #

elem :: Eq a => a -> URec Float a -> Bool #

maximum :: Ord a => URec Float a -> a #

minimum :: Ord a => URec Float a -> a #

sum :: Num a => URec Float a -> a #

product :: Num a => URec Float a -> a #

Foldable (URec Int) 

Methods

fold :: Monoid m => URec Int m -> m #

foldMap :: Monoid m => (a -> m) -> URec Int a -> m #

foldr :: (a -> b -> b) -> b -> URec Int a -> b #

foldr' :: (a -> b -> b) -> b -> URec Int a -> b #

foldl :: (b -> a -> b) -> b -> URec Int a -> b #

foldl' :: (b -> a -> b) -> b -> URec Int a -> b #

foldr1 :: (a -> a -> a) -> URec Int a -> a #

foldl1 :: (a -> a -> a) -> URec Int a -> a #

toList :: URec Int a -> [a] #

null :: URec Int a -> Bool #

length :: URec Int a -> Int #

elem :: Eq a => a -> URec Int a -> Bool #

maximum :: Ord a => URec Int a -> a #

minimum :: Ord a => URec Int a -> a #

sum :: Num a => URec Int a -> a #

product :: Num a => URec Int a -> a #

Foldable (URec Word) 

Methods

fold :: Monoid m => URec Word m -> m #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m #

foldr :: (a -> b -> b) -> b -> URec Word a -> b #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b #

foldl :: (b -> a -> b) -> b -> URec Word a -> b #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b #

foldr1 :: (a -> a -> a) -> URec Word a -> a #

foldl1 :: (a -> a -> a) -> URec Word a -> a #

toList :: URec Word a -> [a] #

null :: URec Word a -> Bool #

length :: URec Word a -> Int #

elem :: Eq a => a -> URec Word a -> Bool #

maximum :: Ord a => URec Word a -> a #

minimum :: Ord a => URec Word a -> a #

sum :: Num a => URec Word a -> a #

product :: Num a => URec Word a -> a #

Foldable (URec (Ptr ())) 

Methods

fold :: Monoid m => URec (Ptr ()) m -> m #

foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m #

foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b #

foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b #

foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b #

foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b #

foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a #

foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a #

toList :: URec (Ptr ()) a -> [a] #

null :: URec (Ptr ()) a -> Bool #

length :: URec (Ptr ()) a -> Int #

elem :: Eq a => a -> URec (Ptr ()) a -> Bool #

maximum :: Ord a => URec (Ptr ()) a -> a #

minimum :: Ord a => URec (Ptr ()) a -> a #

sum :: Num a => URec (Ptr ()) a -> a #

product :: Num a => URec (Ptr ()) a -> a #

Foldable ((,) a) 

Methods

fold :: Monoid m => (a, m) -> m #

foldMap :: Monoid m => (a -> m) -> (a, a) -> m #

foldr :: (a -> b -> b) -> b -> (a, a) -> b #

foldr' :: (a -> b -> b) -> b -> (a, a) -> b #

foldl :: (b -> a -> b) -> b -> (a, a) -> b #

foldl' :: (b -> a -> b) -> b -> (a, a) -> b #

foldr1 :: (a -> a -> a) -> (a, a) -> a #

foldl1 :: (a -> a -> a) -> (a, a) -> a #

toList :: (a, a) -> [a] #

null :: (a, a) -> Bool #

length :: (a, a) -> Int #

elem :: Eq a => a -> (a, a) -> Bool #

maximum :: Ord a => (a, a) -> a #

minimum :: Ord a => (a, a) -> a #

sum :: Num a => (a, a) -> a #

product :: Num a => (a, a) -> a #

Foldable (HashMap k) 

Methods

fold :: Monoid m => HashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> HashMap k a -> m #

foldr :: (a -> b -> b) -> b -> HashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> HashMap k a -> b #

foldl :: (b -> a -> b) -> b -> HashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> HashMap k a -> b #

foldr1 :: (a -> a -> a) -> HashMap k a -> a #

foldl1 :: (a -> a -> a) -> HashMap k a -> a #

toList :: HashMap k a -> [a] #

null :: HashMap k a -> Bool #

length :: HashMap k a -> Int #

elem :: Eq a => a -> HashMap k a -> Bool #

maximum :: Ord a => HashMap k a -> a #

minimum :: Ord a => HashMap k a -> a #

sum :: Num a => HashMap k a -> a #

product :: Num a => HashMap k a -> a #

Foldable (Map k) 

Methods

fold :: Monoid m => Map k m -> m #

foldMap :: Monoid m => (a -> m) -> Map k a -> m #

foldr :: (a -> b -> b) -> b -> Map k a -> b #

foldr' :: (a -> b -> b) -> b -> Map k a -> b #

foldl :: (b -> a -> b) -> b -> Map k a -> b #

foldl' :: (b -> a -> b) -> b -> Map k a -> b #

foldr1 :: (a -> a -> a) -> Map k a -> a #

foldl1 :: (a -> a -> a) -> Map k a -> a #

toList :: Map k a -> [a] #

null :: Map k a -> Bool #

length :: Map k a -> Int #

elem :: Eq a => a -> Map k a -> Bool #

maximum :: Ord a => Map k a -> a #

minimum :: Ord a => Map k a -> a #

sum :: Num a => Map k a -> a #

product :: Num a => Map k a -> a #

Foldable (Array i) 

Methods

fold :: Monoid m => Array i m -> m #

foldMap :: Monoid m => (a -> m) -> Array i a -> m #

foldr :: (a -> b -> b) -> b -> Array i a -> b #

foldr' :: (a -> b -> b) -> b -> Array i a -> b #

foldl :: (b -> a -> b) -> b -> Array i a -> b #

foldl' :: (b -> a -> b) -> b -> Array i a -> b #

foldr1 :: (a -> a -> a) -> Array i a -> a #

foldl1 :: (a -> a -> a) -> Array i a -> a #

toList :: Array i a -> [a] #

null :: Array i a -> Bool #

length :: Array i a -> Int #

elem :: Eq a => a -> Array i a -> Bool #

maximum :: Ord a => Array i a -> a #

minimum :: Ord a => Array i a -> a #

sum :: Num a => Array i a -> a #

product :: Num a => Array i a -> a #

Foldable (Arg a) 

Methods

fold :: Monoid m => Arg a m -> m #

foldMap :: Monoid m => (a -> m) -> Arg a a -> m #

foldr :: (a -> b -> b) -> b -> Arg a a -> b #

foldr' :: (a -> b -> b) -> b -> Arg a a -> b #

foldl :: (b -> a -> b) -> b -> Arg a a -> b #

foldl' :: (b -> a -> b) -> b -> Arg a a -> b #

foldr1 :: (a -> a -> a) -> Arg a a -> a #

foldl1 :: (a -> a -> a) -> Arg a a -> a #

toList :: Arg a a -> [a] #

null :: Arg a a -> Bool #

length :: Arg a a -> Int #

elem :: Eq a => a -> Arg a a -> Bool #

maximum :: Ord a => Arg a a -> a #

minimum :: Ord a => Arg a a -> a #

sum :: Num a => Arg a a -> a #

product :: Num a => Arg a a -> a #

Foldable (Proxy *) 

Methods

fold :: Monoid m => Proxy * m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy * a -> m #

foldr :: (a -> b -> b) -> b -> Proxy * a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy * a -> b #

foldl :: (b -> a -> b) -> b -> Proxy * a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy * a -> b #

foldr1 :: (a -> a -> a) -> Proxy * a -> a #

foldl1 :: (a -> a -> a) -> Proxy * a -> a #

toList :: Proxy * a -> [a] #

null :: Proxy * a -> Bool #

length :: Proxy * a -> Int #

elem :: Eq a => a -> Proxy * a -> Bool #

maximum :: Ord a => Proxy * a -> a #

minimum :: Ord a => Proxy * a -> a #

sum :: Num a => Proxy * a -> a #

product :: Num a => Proxy * a -> a #

Foldable f => Foldable (Cofree f) 

Methods

fold :: Monoid m => Cofree f m -> m #

foldMap :: Monoid m => (a -> m) -> Cofree f a -> m #

foldr :: (a -> b -> b) -> b -> Cofree f a -> b #

foldr' :: (a -> b -> b) -> b -> Cofree f a -> b #

foldl :: (b -> a -> b) -> b -> Cofree f a -> b #

foldl' :: (b -> a -> b) -> b -> Cofree f a -> b #

foldr1 :: (a -> a -> a) -> Cofree f a -> a #

foldl1 :: (a -> a -> a) -> Cofree f a -> a #

toList :: Cofree f a -> [a] #

null :: Cofree f a -> Bool #

length :: Cofree f a -> Int #

elem :: Eq a => a -> Cofree f a -> Bool #

maximum :: Ord a => Cofree f a -> a #

minimum :: Ord a => Cofree f a -> a #

sum :: Num a => Cofree f a -> a #

product :: Num a => Cofree f a -> a #

Foldable f => Foldable (Yoneda f) 

Methods

fold :: Monoid m => Yoneda f m -> m #

foldMap :: Monoid m => (a -> m) -> Yoneda f a -> m #

foldr :: (a -> b -> b) -> b -> Yoneda f a -> b #

foldr' :: (a -> b -> b) -> b -> Yoneda f a -> b #

foldl :: (b -> a -> b) -> b -> Yoneda f a -> b #

foldl' :: (b -> a -> b) -> b -> Yoneda f a -> b #

foldr1 :: (a -> a -> a) -> Yoneda f a -> a #

foldl1 :: (a -> a -> a) -> Yoneda f a -> a #

toList :: Yoneda f a -> [a] #

null :: Yoneda f a -> Bool #

length :: Yoneda f a -> Int #

elem :: Eq a => a -> Yoneda f a -> Bool #

maximum :: Ord a => Yoneda f a -> a #

minimum :: Ord a => Yoneda f a -> a #

sum :: Num a => Yoneda f a -> a #

product :: Num a => Yoneda f a -> a #

Foldable (Level i) 

Methods

fold :: Monoid m => Level i m -> m #

foldMap :: Monoid m => (a -> m) -> Level i a -> m #

foldr :: (a -> b -> b) -> b -> Level i a -> b #

foldr' :: (a -> b -> b) -> b -> Level i a -> b #

foldl :: (b -> a -> b) -> b -> Level i a -> b #

foldl' :: (b -> a -> b) -> b -> Level i a -> b #

foldr1 :: (a -> a -> a) -> Level i a -> a #

foldl1 :: (a -> a -> a) -> Level i a -> a #

toList :: Level i a -> [a] #

null :: Level i a -> Bool #

length :: Level i a -> Int #

elem :: Eq a => a -> Level i a -> Bool #

maximum :: Ord a => Level i a -> a #

minimum :: Ord a => Level i a -> a #

sum :: Num a => Level i a -> a #

product :: Num a => Level i a -> a #

Foldable f => Foldable (ListT f) 

Methods

fold :: Monoid m => ListT f m -> m #

foldMap :: Monoid m => (a -> m) -> ListT f a -> m #

foldr :: (a -> b -> b) -> b -> ListT f a -> b #

foldr' :: (a -> b -> b) -> b -> ListT f a -> b #

foldl :: (b -> a -> b) -> b -> ListT f a -> b #

foldl' :: (b -> a -> b) -> b -> ListT f a -> b #

foldr1 :: (a -> a -> a) -> ListT f a -> a #

foldl1 :: (a -> a -> a) -> ListT f a -> a #

toList :: ListT f a -> [a] #

null :: ListT f a -> Bool #

length :: ListT f a -> Int #

elem :: Eq a => a -> ListT f a -> Bool #

maximum :: Ord a => ListT f a -> a #

minimum :: Ord a => ListT f a -> a #

sum :: Num a => ListT f a -> a #

product :: Num a => ListT f a -> a #

Foldable f => Foldable (MaybeT f) 

Methods

fold :: Monoid m => MaybeT f m -> m #

foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m #

foldr :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldl :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldr1 :: (a -> a -> a) -> MaybeT f a -> a #

foldl1 :: (a -> a -> a) -> MaybeT f a -> a #

toList :: MaybeT f a -> [a] #

null :: MaybeT f a -> Bool #

length :: MaybeT f a -> Int #

elem :: Eq a => a -> MaybeT f a -> Bool #

maximum :: Ord a => MaybeT f a -> a #

minimum :: Ord a => MaybeT f a -> a #

sum :: Num a => MaybeT f a -> a #

product :: Num a => MaybeT f a -> a #

Foldable (LHashMap k) # 

Methods

fold :: Monoid m => LHashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> LHashMap k a -> m #

foldr :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldl :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldr1 :: (a -> a -> a) -> LHashMap k a -> a #

foldl1 :: (a -> a -> a) -> LHashMap k a -> a #

toList :: LHashMap k a -> [a] #

null :: LHashMap k a -> Bool #

length :: LHashMap k a -> Int #

elem :: Eq a => a -> LHashMap k a -> Bool #

maximum :: Ord a => LHashMap k a -> a #

minimum :: Ord a => LHashMap k a -> a #

sum :: Num a => LHashMap k a -> a #

product :: Num a => LHashMap k a -> a #

Foldable (K1 i c) 

Methods

fold :: Monoid m => K1 i c m -> m #

foldMap :: Monoid m => (a -> m) -> K1 i c a -> m #

foldr :: (a -> b -> b) -> b -> K1 i c a -> b #

foldr' :: (a -> b -> b) -> b -> K1 i c a -> b #

foldl :: (b -> a -> b) -> b -> K1 i c a -> b #

foldl' :: (b -> a -> b) -> b -> K1 i c a -> b #

foldr1 :: (a -> a -> a) -> K1 i c a -> a #

foldl1 :: (a -> a -> a) -> K1 i c a -> a #

toList :: K1 i c a -> [a] #

null :: K1 i c a -> Bool #

length :: K1 i c a -> Int #

elem :: Eq a => a -> K1 i c a -> Bool #

maximum :: Ord a => K1 i c a -> a #

minimum :: Ord a => K1 i c a -> a #

sum :: Num a => K1 i c a -> a #

product :: Num a => K1 i c a -> a #

(Foldable f, Foldable g) => Foldable ((:+:) f g) 

Methods

fold :: Monoid m => (f :+: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a #

toList :: (f :+: g) a -> [a] #

null :: (f :+: g) a -> Bool #

length :: (f :+: g) a -> Int #

elem :: Eq a => a -> (f :+: g) a -> Bool #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

(Foldable f, Foldable g) => Foldable ((:*:) f g) 

Methods

fold :: Monoid m => (f :*: g) m -> m #

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

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

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

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

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

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Foldable f, Foldable g) => Foldable ((:.:) f g) 

Methods

fold :: Monoid m => (f :.: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :.: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :.: g) a -> a #

toList :: (f :.: g) a -> [a] #

null :: (f :.: g) a -> Bool #

length :: (f :.: g) a -> Int #

elem :: Eq a => a -> (f :.: g) a -> Bool #

maximum :: Ord a => (f :.: g) a -> a #

minimum :: Ord a => (f :.: g) a -> a #

sum :: Num a => (f :.: g) a -> a #

product :: Num a => (f :.: g) a -> a #

Foldable (Const * m) 

Methods

fold :: Monoid m => Const * m m -> m #

foldMap :: Monoid m => (a -> m) -> Const * m a -> m #

foldr :: (a -> b -> b) -> b -> Const * m a -> b #

foldr' :: (a -> b -> b) -> b -> Const * m a -> b #

foldl :: (b -> a -> b) -> b -> Const * m a -> b #

foldl' :: (b -> a -> b) -> b -> Const * m a -> b #

foldr1 :: (a -> a -> a) -> Const * m a -> a #

foldl1 :: (a -> a -> a) -> Const * m a -> a #

toList :: Const * m a -> [a] #

null :: Const * m a -> Bool #

length :: Const * m a -> Int #

elem :: Eq a => a -> Const * m a -> Bool #

maximum :: Ord a => Const * m a -> a #

minimum :: Ord a => Const * m a -> a #

sum :: Num a => Const * m a -> a #

product :: Num a => Const * m a -> a #

Bifoldable p => Foldable (Join * p) 

Methods

fold :: Monoid m => Join * p m -> m #

foldMap :: Monoid m => (a -> m) -> Join * p a -> m #

foldr :: (a -> b -> b) -> b -> Join * p a -> b #

foldr' :: (a -> b -> b) -> b -> Join * p a -> b #

foldl :: (b -> a -> b) -> b -> Join * p a -> b #

foldl' :: (b -> a -> b) -> b -> Join * p a -> b #

foldr1 :: (a -> a -> a) -> Join * p a -> a #

foldl1 :: (a -> a -> a) -> Join * p a -> a #

toList :: Join * p a -> [a] #

null :: Join * p a -> Bool #

length :: Join * p a -> Int #

elem :: Eq a => a -> Join * p a -> Bool #

maximum :: Ord a => Join * p a -> a #

minimum :: Ord a => Join * p a -> a #

sum :: Num a => Join * p a -> a #

product :: Num a => Join * p a -> a #

Foldable f => Foldable (IdentityT * f) 

Methods

fold :: Monoid m => IdentityT * f m -> m #

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

foldr :: (a -> b -> b) -> b -> IdentityT * f a -> b #

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

foldl :: (b -> a -> b) -> b -> IdentityT * f a -> b #

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

foldr1 :: (a -> a -> a) -> IdentityT * f a -> a #

foldl1 :: (a -> a -> a) -> IdentityT * f a -> a #

toList :: IdentityT * f a -> [a] #

null :: IdentityT * f a -> Bool #

length :: IdentityT * f a -> Int #

elem :: Eq a => a -> IdentityT * f a -> Bool #

maximum :: Ord a => IdentityT * f a -> a #

minimum :: Ord a => IdentityT * f a -> a #

sum :: Num a => IdentityT * f a -> a #

product :: Num a => IdentityT * f a -> a #

Foldable f => Foldable (FreeF f a) 

Methods

fold :: Monoid m => FreeF f a m -> m #

foldMap :: Monoid m => (a -> m) -> FreeF f a a -> m #

foldr :: (a -> b -> b) -> b -> FreeF f a a -> b #

foldr' :: (a -> b -> b) -> b -> FreeF f a a -> b #

foldl :: (b -> a -> b) -> b -> FreeF f a a -> b #

foldl' :: (b -> a -> b) -> b -> FreeF f a a -> b #

foldr1 :: (a -> a -> a) -> FreeF f a a -> a #

foldl1 :: (a -> a -> a) -> FreeF f a a -> a #

toList :: FreeF f a a -> [a] #

null :: FreeF f a a -> Bool #

length :: FreeF f a a -> Int #

elem :: Eq a => a -> FreeF f a a -> Bool #

maximum :: Ord a => FreeF f a a -> a #

minimum :: Ord a => FreeF f a a -> a #

sum :: Num a => FreeF f a a -> a #

product :: Num a => FreeF f a a -> a #

(Foldable m, Foldable f) => Foldable (FreeT f m) 

Methods

fold :: Monoid m => FreeT f m m -> m #

foldMap :: Monoid m => (a -> m) -> FreeT f m a -> m #

foldr :: (a -> b -> b) -> b -> FreeT f m a -> b #

foldr' :: (a -> b -> b) -> b -> FreeT f m a -> b #

foldl :: (b -> a -> b) -> b -> FreeT f m a -> b #

foldl' :: (b -> a -> b) -> b -> FreeT f m a -> b #

foldr1 :: (a -> a -> a) -> FreeT f m a -> a #

foldl1 :: (a -> a -> a) -> FreeT f m a -> a #

toList :: FreeT f m a -> [a] #

null :: FreeT f m a -> Bool #

length :: FreeT f m a -> Int #

elem :: Eq a => a -> FreeT f m a -> Bool #

maximum :: Ord a => FreeT f m a -> a #

minimum :: Ord a => FreeT f m a -> a #

sum :: Num a => FreeT f m a -> a #

product :: Num a => FreeT f m a -> a #

Foldable f => Foldable (Backwards * f)

Derived instance.

Methods

fold :: Monoid m => Backwards * f m -> m #

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

foldr :: (a -> b -> b) -> b -> Backwards * f a -> b #

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

foldl :: (b -> a -> b) -> b -> Backwards * f a -> b #

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

foldr1 :: (a -> a -> a) -> Backwards * f a -> a #

foldl1 :: (a -> a -> a) -> Backwards * f a -> a #

toList :: Backwards * f a -> [a] #

null :: Backwards * f a -> Bool #

length :: Backwards * f a -> Int #

elem :: Eq a => a -> Backwards * f a -> Bool #

maximum :: Ord a => Backwards * f a -> a #

minimum :: Ord a => Backwards * f a -> a #

sum :: Num a => Backwards * f a -> a #

product :: Num a => Backwards * f a -> a #

Foldable f => Foldable (ErrorT e f) 

Methods

fold :: Monoid m => ErrorT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m #

foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldr1 :: (a -> a -> a) -> ErrorT e f a -> a #

foldl1 :: (a -> a -> a) -> ErrorT e f a -> a #

toList :: ErrorT e f a -> [a] #

null :: ErrorT e f a -> Bool #

length :: ErrorT e f a -> Int #

elem :: Eq a => a -> ErrorT e f a -> Bool #

maximum :: Ord a => ErrorT e f a -> a #

minimum :: Ord a => ErrorT e f a -> a #

sum :: Num a => ErrorT e f a -> a #

product :: Num a => ErrorT e f a -> a #

Foldable f => Foldable (AlongsideLeft f b) 

Methods

fold :: Monoid m => AlongsideLeft f b m -> m #

foldMap :: Monoid m => (a -> m) -> AlongsideLeft f b a -> m #

foldr :: (a -> b -> b) -> b -> AlongsideLeft f b a -> b #

foldr' :: (a -> b -> b) -> b -> AlongsideLeft f b a -> b #

foldl :: (b -> a -> b) -> b -> AlongsideLeft f b a -> b #

foldl' :: (b -> a -> b) -> b -> AlongsideLeft f b a -> b #

foldr1 :: (a -> a -> a) -> AlongsideLeft f b a -> a #

foldl1 :: (a -> a -> a) -> AlongsideLeft f b a -> a #

toList :: AlongsideLeft f b a -> [a] #

null :: AlongsideLeft f b a -> Bool #

length :: AlongsideLeft f b a -> Int #

elem :: Eq a => a -> AlongsideLeft f b a -> Bool #

maximum :: Ord a => AlongsideLeft f b a -> a #

minimum :: Ord a => AlongsideLeft f b a -> a #

sum :: Num a => AlongsideLeft f b a -> a #

product :: Num a => AlongsideLeft f b a -> a #

Foldable f => Foldable (AlongsideRight f a) 

Methods

fold :: Monoid m => AlongsideRight f a m -> m #

foldMap :: Monoid m => (a -> m) -> AlongsideRight f a a -> m #

foldr :: (a -> b -> b) -> b -> AlongsideRight f a a -> b #

foldr' :: (a -> b -> b) -> b -> AlongsideRight f a a -> b #

foldl :: (b -> a -> b) -> b -> AlongsideRight f a a -> b #

foldl' :: (b -> a -> b) -> b -> AlongsideRight f a a -> b #

foldr1 :: (a -> a -> a) -> AlongsideRight f a a -> a #

foldl1 :: (a -> a -> a) -> AlongsideRight f a a -> a #

toList :: AlongsideRight f a a -> [a] #

null :: AlongsideRight f a a -> Bool #

length :: AlongsideRight f a a -> Int #

elem :: Eq a => a -> AlongsideRight f a a -> Bool #

maximum :: Ord a => AlongsideRight f a a -> a #

minimum :: Ord a => AlongsideRight f a a -> a #

sum :: Num a => AlongsideRight f a a -> a #

product :: Num a => AlongsideRight f a a -> a #

Foldable f => Foldable (ExceptT e f) 

Methods

fold :: Monoid m => ExceptT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m #

foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldr1 :: (a -> a -> a) -> ExceptT e f a -> a #

foldl1 :: (a -> a -> a) -> ExceptT e f a -> a #

toList :: ExceptT e f a -> [a] #

null :: ExceptT e f a -> Bool #

length :: ExceptT e f a -> Int #

elem :: Eq a => a -> ExceptT e f a -> Bool #

maximum :: Ord a => ExceptT e f a -> a #

minimum :: Ord a => ExceptT e f a -> a #

sum :: Num a => ExceptT e f a -> a #

product :: Num a => ExceptT e f a -> a #

Foldable f => Foldable (WriterT w f) 

Methods

fold :: Monoid m => WriterT w f m -> m #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a #

toList :: WriterT w f a -> [a] #

null :: WriterT w f a -> Bool #

length :: WriterT w f a -> Int #

elem :: Eq a => a -> WriterT w f a -> Bool #

maximum :: Ord a => WriterT w f a -> a #

minimum :: Ord a => WriterT w f a -> a #

sum :: Num a => WriterT w f a -> a #

product :: Num a => WriterT w f a -> a #

Foldable f => Foldable (WriterT w f) 

Methods

fold :: Monoid m => WriterT w f m -> m #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a #

toList :: WriterT w f a -> [a] #

null :: WriterT w f a -> Bool #

length :: WriterT w f a -> Int #

elem :: Eq a => a -> WriterT w f a -> Bool #

maximum :: Ord a => WriterT w f a -> a #

minimum :: Ord a => WriterT w f a -> a #

sum :: Num a => WriterT w f a -> a #

product :: Num a => WriterT w f a -> a #

Foldable (Forget r a) 

Methods

fold :: Monoid m => Forget r a m -> m #

foldMap :: Monoid m => (a -> m) -> Forget r a a -> m #

foldr :: (a -> b -> b) -> b -> Forget r a a -> b #

foldr' :: (a -> b -> b) -> b -> Forget r a a -> b #

foldl :: (b -> a -> b) -> b -> Forget r a a -> b #

foldl' :: (b -> a -> b) -> b -> Forget r a a -> b #

foldr1 :: (a -> a -> a) -> Forget r a a -> a #

foldl1 :: (a -> a -> a) -> Forget r a a -> a #

toList :: Forget r a a -> [a] #

null :: Forget r a a -> Bool #

length :: Forget r a a -> Int #

elem :: Eq a => a -> Forget r a a -> Bool #

maximum :: Ord a => Forget r a a -> a #

minimum :: Ord a => Forget r a a -> a #

sum :: Num a => Forget r a a -> a #

product :: Num a => Forget r a a -> a #

Foldable (Tagged k s) 

Methods

fold :: Monoid m => Tagged k s m -> m #

foldMap :: Monoid m => (a -> m) -> Tagged k s a -> m #

foldr :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldr' :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldl :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldl' :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldr1 :: (a -> a -> a) -> Tagged k s a -> a #

foldl1 :: (a -> a -> a) -> Tagged k s a -> a #

toList :: Tagged k s a -> [a] #

null :: Tagged k s a -> Bool #

length :: Tagged k s a -> Int #

elem :: Eq a => a -> Tagged k s a -> Bool #

maximum :: Ord a => Tagged k s a -> a #

minimum :: Ord a => Tagged k s a -> a #

sum :: Num a => Tagged k s a -> a #

product :: Num a => Tagged k s a -> a #

Foldable f => Foldable (Reverse * f)

Fold from right to left.

Methods

fold :: Monoid m => Reverse * f m -> m #

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

foldr :: (a -> b -> b) -> b -> Reverse * f a -> b #

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

foldl :: (b -> a -> b) -> b -> Reverse * f a -> b #

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

foldr1 :: (a -> a -> a) -> Reverse * f a -> a #

foldl1 :: (a -> a -> a) -> Reverse * f a -> a #

toList :: Reverse * f a -> [a] #

null :: Reverse * f a -> Bool #

length :: Reverse * f a -> Int #

elem :: Eq a => a -> Reverse * f a -> Bool #

maximum :: Ord a => Reverse * f a -> a #

minimum :: Ord a => Reverse * f a -> a #

sum :: Num a => Reverse * f a -> a #

product :: Num a => Reverse * f a -> a #

Foldable (Constant * a) 

Methods

fold :: Monoid m => Constant * a m -> m #

foldMap :: Monoid m => (a -> m) -> Constant * a a -> m #

foldr :: (a -> b -> b) -> b -> Constant * a a -> b #

foldr' :: (a -> b -> b) -> b -> Constant * a a -> b #

foldl :: (b -> a -> b) -> b -> Constant * a a -> b #

foldl' :: (b -> a -> b) -> b -> Constant * a a -> b #

foldr1 :: (a -> a -> a) -> Constant * a a -> a #

foldl1 :: (a -> a -> a) -> Constant * a a -> a #

toList :: Constant * a a -> [a] #

null :: Constant * a a -> Bool #

length :: Constant * a a -> Int #

elem :: Eq a => a -> Constant * a a -> Bool #

maximum :: Ord a => Constant * a a -> a #

minimum :: Ord a => Constant * a a -> a #

sum :: Num a => Constant * a a -> a #

product :: Num a => Constant * a a -> a #

Foldable f => Foldable (M1 i c f) 

Methods

fold :: Monoid m => M1 i c f m -> m #

foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m #

foldr :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldl :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldr1 :: (a -> a -> a) -> M1 i c f a -> a #

foldl1 :: (a -> a -> a) -> M1 i c f a -> a #

toList :: M1 i c f a -> [a] #

null :: M1 i c f a -> Bool #

length :: M1 i c f a -> Int #

elem :: Eq a => a -> M1 i c f a -> Bool #

maximum :: Ord a => M1 i c f a -> a #

minimum :: Ord a => M1 i c f a -> a #

sum :: Num a => M1 i c f a -> a #

product :: Num a => M1 i c f a -> a #

(Foldable f, Foldable g) => Foldable (Sum * f g) 

Methods

fold :: Monoid m => Sum * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Sum * f g a -> m #

foldr :: (a -> b -> b) -> b -> Sum * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Sum * f g a -> b #

foldl :: (b -> a -> b) -> b -> Sum * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Sum * f g a -> b #

foldr1 :: (a -> a -> a) -> Sum * f g a -> a #

foldl1 :: (a -> a -> a) -> Sum * f g a -> a #

toList :: Sum * f g a -> [a] #

null :: Sum * f g a -> Bool #

length :: Sum * f g a -> Int #

elem :: Eq a => a -> Sum * f g a -> Bool #

maximum :: Ord a => Sum * f g a -> a #

minimum :: Ord a => Sum * f g a -> a #

sum :: Num a => Sum * f g a -> a #

product :: Num a => Sum * f g a -> a #

(Foldable f, Foldable g) => Foldable (Product * f g) 

Methods

fold :: Monoid m => Product * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Product * f g a -> m #

foldr :: (a -> b -> b) -> b -> Product * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Product * f g a -> b #

foldl :: (b -> a -> b) -> b -> Product * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Product * f g a -> b #

foldr1 :: (a -> a -> a) -> Product * f g a -> a #

foldl1 :: (a -> a -> a) -> Product * f g a -> a #

toList :: Product * f g a -> [a] #

null :: Product * f g a -> Bool #

length :: Product * f g a -> Int #

elem :: Eq a => a -> Product * f g a -> Bool #

maximum :: Ord a => Product * f g a -> a #

minimum :: Ord a => Product * f g a -> a #

sum :: Num a => Product * f g a -> a #

product :: Num a => Product * f g a -> a #

Foldable (Magma i t b) 

Methods

fold :: Monoid m => Magma i t b m -> m #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m #

foldr :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldr' :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldl :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldl' :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a #

toList :: Magma i t b a -> [a] #

null :: Magma i t b a -> Bool #

length :: Magma i t b a -> Int #

elem :: Eq a => a -> Magma i t b a -> Bool #

maximum :: Ord a => Magma i t b a -> a #

minimum :: Ord a => Magma i t b a -> a #

sum :: Num a => Magma i t b a -> a #

product :: Num a => Magma i t b a -> a #

(Foldable f, Foldable g) => Foldable (Compose * * f g) 

Methods

fold :: Monoid m => Compose * * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Compose * * f g a -> m #

foldr :: (a -> b -> b) -> b -> Compose * * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Compose * * f g a -> b #

foldl :: (b -> a -> b) -> b -> Compose * * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Compose * * f g a -> b #

foldr1 :: (a -> a -> a) -> Compose * * f g a -> a #

foldl1 :: (a -> a -> a) -> Compose * * f g a -> a #

toList :: Compose * * f g a -> [a] #

null :: Compose * * f g a -> Bool #

length :: Compose * * f g a -> Int #

elem :: Eq a => a -> Compose * * f g a -> Bool #

maximum :: Ord a => Compose * * f g a -> a #

minimum :: Ord a => Compose * * f g a -> a #

sum :: Num a => Compose * * f g a -> a #

product :: Num a => Compose * * f g a -> a #

Bifoldable p => Foldable (WrappedBifunctor * * p a) 

Methods

fold :: Monoid m => WrappedBifunctor * * p a m -> m #

foldMap :: Monoid m => (a -> m) -> WrappedBifunctor * * p a a -> m #

foldr :: (a -> b -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldr' :: (a -> b -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldl :: (b -> a -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldl' :: (b -> a -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldr1 :: (a -> a -> a) -> WrappedBifunctor * * p a a -> a #

foldl1 :: (a -> a -> a) -> WrappedBifunctor * * p a a -> a #

toList :: WrappedBifunctor * * p a a -> [a] #

null :: WrappedBifunctor * * p a a -> Bool #

length :: WrappedBifunctor * * p a a -> Int #

elem :: Eq a => a -> WrappedBifunctor * * p a a -> Bool #

maximum :: Ord a => WrappedBifunctor * * p a a -> a #

minimum :: Ord a => WrappedBifunctor * * p a a -> a #

sum :: Num a => WrappedBifunctor * * p a a -> a #

product :: Num a => WrappedBifunctor * * p a 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 #

Bifoldable p => Foldable (Flip * * p a) 

Methods

fold :: Monoid m => Flip * * p a m -> m #

foldMap :: Monoid m => (a -> m) -> Flip * * p a a -> m #

foldr :: (a -> b -> b) -> b -> Flip * * p a a -> b #

foldr' :: (a -> b -> b) -> b -> Flip * * p a a -> b #

foldl :: (b -> a -> b) -> b -> Flip * * p a a -> b #

foldl' :: (b -> a -> b) -> b -> Flip * * p a a -> b #

foldr1 :: (a -> a -> a) -> Flip * * p a a -> a #

foldl1 :: (a -> a -> a) -> Flip * * p a a -> a #

toList :: Flip * * p a a -> [a] #

null :: Flip * * p a a -> Bool #

length :: Flip * * p a a -> Int #

elem :: Eq a => a -> Flip * * p a a -> Bool #

maximum :: Ord a => Flip * * p a a -> a #

minimum :: Ord a => Flip * * p a a -> a #

sum :: Num a => Flip * * p a a -> a #

product :: Num a => Flip * * p a 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 #

(Foldable f, Bifoldable p) => Foldable (Tannen * * * f p a) 

Methods

fold :: Monoid m => Tannen * * * f p a m -> m #

foldMap :: Monoid m => (a -> m) -> Tannen * * * f p a a -> m #

foldr :: (a -> b -> b) -> b -> Tannen * * * f p a a -> b #

foldr' :: (a -> b -> b) -> b -> Tannen * * * f p a a -> b #

foldl :: (b -> a -> b) -> b -> Tannen * * * f p a a -> b #

foldl' :: (b -> a -> b) -> b -> Tannen * * * f p a a -> b #

foldr1 :: (a -> a -> a) -> Tannen * * * f p a a -> a #

foldl1 :: (a -> a -> a) -> Tannen * * * f p a a -> a #

toList :: Tannen * * * f p a a -> [a] #

null :: Tannen * * * f p a a -> Bool #

length :: Tannen * * * f p a a -> Int #

elem :: Eq a => a -> Tannen * * * f p a a -> Bool #

maximum :: Ord a => Tannen * * * f p a a -> a #

minimum :: Ord a => Tannen * * * f p a a -> a #

sum :: Num a => Tannen * * * f p a a -> a #

product :: Num a => Tannen * * * f p a a -> a #

(Bifoldable p, Foldable g) => Foldable (Biff * k * * p f g a) 

Methods

fold :: Monoid m => Biff * k * * p f g a m -> m #

foldMap :: Monoid m => (a -> m) -> Biff * k * * p f g a a -> m #

foldr :: (a -> b -> b) -> b -> Biff * k * * p f g a a -> b #

foldr' :: (a -> b -> b) -> b -> Biff * k * * p f g a a -> b #

foldl :: (b -> a -> b) -> b -> Biff * k * * p f g a a -> b #

foldl' :: (b -> a -> b) -> b -> Biff * k * * p f g a a -> b #

foldr1 :: (a -> a -> a) -> Biff * k * * p f g a a -> a #

foldl1 :: (a -> a -> a) -> Biff * k * * p f g a a -> a #

toList :: Biff * k * * p f g a a -> [a] #

null :: Biff * k * * p f g a a -> Bool #

length :: Biff * k * * p f g a a -> Int #

elem :: Eq a => a -> Biff * k * * p f g a a -> Bool #

maximum :: Ord a => Biff * k * * p f g a a -> a #

minimum :: Ord a => Biff * k * * p f g a a -> a #

sum :: Num a => Biff * k * * p f g a a -> a #

product :: Num a => Biff * k * * p f g a a -> a #

class Functor f where #

The Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:

fmap id  ==  id
fmap (f . g)  ==  fmap f . fmap g

The instances of Functor for lists, Maybe and IO satisfy these laws.

Minimal complete definition

fmap

Methods

fmap :: (a -> b) -> f a -> f b #

(<$) :: a -> f b -> f a infixl 4 #

Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

Instances

Functor [] 

Methods

fmap :: (a -> b) -> [a] -> [b] #

(<$) :: a -> [b] -> [a] #

Functor Maybe 

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

Functor IO 

Methods

fmap :: (a -> b) -> IO a -> IO b #

(<$) :: a -> IO b -> IO a #

Functor V1 

Methods

fmap :: (a -> b) -> V1 a -> V1 b #

(<$) :: a -> V1 b -> V1 a #

Functor U1 

Methods

fmap :: (a -> b) -> U1 a -> U1 b #

(<$) :: a -> U1 b -> U1 a #

Functor Par1 

Methods

fmap :: (a -> b) -> Par1 a -> Par1 b #

(<$) :: a -> Par1 b -> Par1 a #

Functor Q 

Methods

fmap :: (a -> b) -> Q a -> Q b #

(<$) :: a -> Q b -> Q a #

Functor IResult 

Methods

fmap :: (a -> b) -> IResult a -> IResult b #

(<$) :: a -> IResult b -> IResult a #

Functor Result 

Methods

fmap :: (a -> b) -> Result a -> Result b #

(<$) :: a -> Result b -> Result a #

Functor Parser 

Methods

fmap :: (a -> b) -> Parser a -> Parser b #

(<$) :: a -> Parser b -> Parser a #

Functor Id 

Methods

fmap :: (a -> b) -> Id a -> Id b #

(<$) :: a -> Id b -> Id a #

Functor P 

Methods

fmap :: (a -> b) -> P a -> P b #

(<$) :: a -> P b -> P a #

Functor Identity 

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

Functor Min 

Methods

fmap :: (a -> b) -> Min a -> Min b #

(<$) :: a -> Min b -> Min a #

Functor Max 

Methods

fmap :: (a -> b) -> Max a -> Max b #

(<$) :: a -> Max b -> Max a #

Functor First 

Methods

fmap :: (a -> b) -> First a -> First b #

(<$) :: a -> First b -> First a #

Functor Last 

Methods

fmap :: (a -> b) -> Last a -> Last b #

(<$) :: a -> Last b -> Last a #

Functor Option 

Methods

fmap :: (a -> b) -> Option a -> Option b #

(<$) :: a -> Option b -> Option a #

Functor NonEmpty 

Methods

fmap :: (a -> b) -> NonEmpty a -> NonEmpty b #

(<$) :: a -> NonEmpty b -> NonEmpty a #

Functor Complex 

Methods

fmap :: (a -> b) -> Complex a -> Complex b #

(<$) :: a -> Complex b -> Complex a #

Functor ZipList 

Methods

fmap :: (a -> b) -> ZipList a -> ZipList b #

(<$) :: a -> ZipList b -> ZipList a #

Functor Handler 

Methods

fmap :: (a -> b) -> Handler a -> Handler b #

(<$) :: a -> Handler b -> Handler a #

Functor STM 

Methods

fmap :: (a -> b) -> STM a -> STM b #

(<$) :: a -> STM b -> STM a #

Functor Dual 

Methods

fmap :: (a -> b) -> Dual a -> Dual b #

(<$) :: a -> Dual b -> Dual a #

Functor Sum 

Methods

fmap :: (a -> b) -> Sum a -> Sum b #

(<$) :: a -> Sum b -> Sum a #

Functor Product 

Methods

fmap :: (a -> b) -> Product a -> Product b #

(<$) :: a -> Product b -> Product a #

Functor First 

Methods

fmap :: (a -> b) -> First a -> First b #

(<$) :: a -> First b -> First a #

Functor Last 

Methods

fmap :: (a -> b) -> Last a -> Last b #

(<$) :: a -> Last b -> Last a #

Functor ReadPrec 

Methods

fmap :: (a -> b) -> ReadPrec a -> ReadPrec b #

(<$) :: a -> ReadPrec b -> ReadPrec a #

Functor ReadP 

Methods

fmap :: (a -> b) -> ReadP a -> ReadP b #

(<$) :: a -> ReadP b -> ReadP a #

Functor Id 

Methods

fmap :: (a -> b) -> Id a -> Id b #

(<$) :: a -> Id b -> Id a #

Functor Identifier 

Methods

fmap :: (a -> b) -> Identifier a -> Identifier b #

(<$) :: a -> Identifier b -> Identifier a #

Functor Digit 

Methods

fmap :: (a -> b) -> Digit a -> Digit b #

(<$) :: a -> Digit b -> Digit a #

Functor Node 

Methods

fmap :: (a -> b) -> Node a -> Node b #

(<$) :: a -> Node b -> Node a #

Functor Elem 

Methods

fmap :: (a -> b) -> Elem a -> Elem b #

(<$) :: a -> Elem b -> Elem a #

Functor FingerTree 

Methods

fmap :: (a -> b) -> FingerTree a -> FingerTree b #

(<$) :: a -> FingerTree b -> FingerTree a #

Functor IntMap 

Methods

fmap :: (a -> b) -> IntMap a -> IntMap b #

(<$) :: a -> IntMap b -> IntMap a #

Functor Tree 

Methods

fmap :: (a -> b) -> Tree a -> Tree b #

(<$) :: a -> Tree b -> Tree a #

Functor Seq 

Methods

fmap :: (a -> b) -> Seq a -> Seq b #

(<$) :: a -> Seq b -> Seq a #

Functor ViewL 

Methods

fmap :: (a -> b) -> ViewL a -> ViewL b #

(<$) :: a -> ViewL b -> ViewL a #

Functor ViewR 

Methods

fmap :: (a -> b) -> ViewR a -> ViewR b #

(<$) :: a -> ViewR b -> ViewR a #

Functor DList 

Methods

fmap :: (a -> b) -> DList a -> DList b #

(<$) :: a -> DList b -> DList a #

Functor Vector 

Methods

fmap :: (a -> b) -> Vector a -> Vector b #

(<$) :: a -> Vector b -> Vector a #

Functor Id 

Methods

fmap :: (a -> b) -> Id a -> Id b #

(<$) :: a -> Id b -> Id a #

Functor Box 

Methods

fmap :: (a -> b) -> Box a -> Box b #

(<$) :: a -> Box b -> Box a #

Functor ((->) r) 

Methods

fmap :: (a -> b) -> (r -> a) -> r -> b #

(<$) :: a -> (r -> b) -> r -> a #

Functor (Either a) 

Methods

fmap :: (a -> b) -> Either a a -> Either a b #

(<$) :: a -> Either a b -> Either a a #

Functor f => Functor (Rec1 f) 

Methods

fmap :: (a -> b) -> Rec1 f a -> Rec1 f b #

(<$) :: a -> Rec1 f b -> Rec1 f a #

Functor (URec Char) 

Methods

fmap :: (a -> b) -> URec Char a -> URec Char b #

(<$) :: a -> URec Char b -> URec Char a #

Functor (URec Double) 

Methods

fmap :: (a -> b) -> URec Double a -> URec Double b #

(<$) :: a -> URec Double b -> URec Double a #

Functor (URec Float) 

Methods

fmap :: (a -> b) -> URec Float a -> URec Float b #

(<$) :: a -> URec Float b -> URec Float a #

Functor (URec Int) 

Methods

fmap :: (a -> b) -> URec Int a -> URec Int b #

(<$) :: a -> URec Int b -> URec Int a #

Functor (URec Word) 

Methods

fmap :: (a -> b) -> URec Word a -> URec Word b #

(<$) :: a -> URec Word b -> URec Word a #

Functor (URec (Ptr ())) 

Methods

fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b #

(<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #

Functor ((,) a) 

Methods

fmap :: (a -> b) -> (a, a) -> (a, b) #

(<$) :: a -> (a, b) -> (a, a) #

Functor f => Functor (Co f) 

Methods

fmap :: (a -> b) -> Co f a -> Co f b #

(<$) :: a -> Co f b -> Co f a #

Functor (HashMap k) 

Methods

fmap :: (a -> b) -> HashMap k a -> HashMap k b #

(<$) :: a -> HashMap k b -> HashMap k a #

Functor (Map k) 

Methods

fmap :: (a -> b) -> Map k a -> Map k b #

(<$) :: a -> Map k b -> Map k a #

Functor (Array i) 

Methods

fmap :: (a -> b) -> Array i a -> Array i b #

(<$) :: a -> Array i b -> Array i a #

Functor (IResult i) 

Methods

fmap :: (a -> b) -> IResult i a -> IResult i b #

(<$) :: a -> IResult i b -> IResult i a #

Functor (Parser i) 

Methods

fmap :: (a -> b) -> Parser i a -> Parser i b #

(<$) :: a -> Parser i b -> Parser i a #

Functor (StateL s) 

Methods

fmap :: (a -> b) -> StateL s a -> StateL s b #

(<$) :: a -> StateL s b -> StateL s a #

Functor (StateR s) 

Methods

fmap :: (a -> b) -> StateR s a -> StateR s b #

(<$) :: a -> StateR s b -> StateR s a #

Functor (Arg a) 

Methods

fmap :: (a -> b) -> Arg a a -> Arg a b #

(<$) :: a -> Arg a b -> Arg a a #

Monad m => Functor (WrappedMonad m) 

Methods

fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b #

(<$) :: a -> WrappedMonad m b -> WrappedMonad m a #

Arrow a => Functor (ArrowMonad a) 

Methods

fmap :: (a -> b) -> ArrowMonad a a -> ArrowMonad a b #

(<$) :: a -> ArrowMonad a b -> ArrowMonad a a #

Functor (Proxy *) 

Methods

fmap :: (a -> b) -> Proxy * a -> Proxy * b #

(<$) :: a -> Proxy * b -> Proxy * a #

Functor (StateL s) 

Methods

fmap :: (a -> b) -> StateL s a -> StateL s b #

(<$) :: a -> StateL s b -> StateL s a #

Functor (StateR s) 

Methods

fmap :: (a -> b) -> StateR s a -> StateR s b #

(<$) :: a -> StateR s b -> StateR s a #

Functor (State s) 

Methods

fmap :: (a -> b) -> State s a -> State s b #

(<$) :: a -> State s b -> State s a #

Functor f => Functor (Cofree f) 

Methods

fmap :: (a -> b) -> Cofree f a -> Cofree f b #

(<$) :: a -> Cofree f b -> Cofree f a #

Functor (Yoneda f) 

Methods

fmap :: (a -> b) -> Yoneda f a -> Yoneda f b #

(<$) :: a -> Yoneda f b -> Yoneda f a #

Functor (ReifiedGetter s) 

Methods

fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a #

Functor (ReifiedFold s) 

Methods

fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(<$) :: a -> ReifiedFold s b -> ReifiedFold s a #

Functor f => Functor (Indexing f) 

Methods

fmap :: (a -> b) -> Indexing f a -> Indexing f b #

(<$) :: a -> Indexing f b -> Indexing f a #

Functor f => Functor (Indexing64 f) 

Methods

fmap :: (a -> b) -> Indexing64 f a -> Indexing64 f b #

(<$) :: a -> Indexing64 f b -> Indexing64 f a #

Functor (Level i) 

Methods

fmap :: (a -> b) -> Level i a -> Level i b #

(<$) :: a -> Level i b -> Level i a #

Functor m => Functor (ListT m) 

Methods

fmap :: (a -> b) -> ListT m a -> ListT m b #

(<$) :: a -> ListT m b -> ListT m a #

Profunctor p => Functor (Prep p) 

Methods

fmap :: (a -> b) -> Prep p a -> Prep p b #

(<$) :: a -> Prep p b -> Prep p a #

Profunctor p => Functor (Coprep p) 

Methods

fmap :: (a -> b) -> Coprep p a -> Coprep p b #

(<$) :: a -> Coprep p b -> Coprep p a #

Functor f => Functor (WrappedApplicative f) 

Methods

fmap :: (a -> b) -> WrappedApplicative f a -> WrappedApplicative f b #

(<$) :: a -> WrappedApplicative f b -> WrappedApplicative f a #

Functor f => Functor (MaybeApply f) 

Methods

fmap :: (a -> b) -> MaybeApply f a -> MaybeApply f b #

(<$) :: a -> MaybeApply f b -> MaybeApply f a #

Functor m => Functor (MaybeT m) 

Methods

fmap :: (a -> b) -> MaybeT m a -> MaybeT m b #

(<$) :: a -> MaybeT m b -> MaybeT m a #

Functor (AList k) # 

Methods

fmap :: (a -> b) -> AList k a -> AList k b #

(<$) :: a -> AList k b -> AList k a #

Functor (LHashMap k) # 

Methods

fmap :: (a -> b) -> LHashMap k a -> LHashMap k b #

(<$) :: a -> LHashMap k b -> LHashMap k a #

Functor (K1 i c) 

Methods

fmap :: (a -> b) -> K1 i c a -> K1 i c b #

(<$) :: a -> K1 i c b -> K1 i c a #

(Functor g, Functor f) => Functor ((:+:) f g) 

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

(Functor g, Functor f) => Functor ((:*:) f g) 

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #

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

(Functor g, Functor f) => Functor ((:.:) f g) 

Methods

fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b #

(<$) :: a -> (f :.: g) b -> (f :.: g) a #

Arrow a => Functor (WrappedArrow a b) 

Methods

fmap :: (a -> b) -> WrappedArrow a b a -> WrappedArrow a b b #

(<$) :: a -> WrappedArrow a b b -> WrappedArrow a b a #

Functor (Const * m) 

Methods

fmap :: (a -> b) -> Const * m a -> Const * m b #

(<$) :: a -> Const * m b -> Const * m a #

Functor f => Functor (Alt * f) 

Methods

fmap :: (a -> b) -> Alt * f a -> Alt * f b #

(<$) :: a -> Alt * f b -> Alt * f a #

Bifunctor p => Functor (Join * p) 

Methods

fmap :: (a -> b) -> Join * p a -> Join * p b #

(<$) :: a -> Join * p b -> Join * p a #

Functor w => Functor (TracedT m w) 

Methods

fmap :: (a -> b) -> TracedT m w a -> TracedT m w b #

(<$) :: a -> TracedT m w b -> TracedT m w a #

Functor (Cokleisli w a) 

Methods

fmap :: (a -> b) -> Cokleisli w a a -> Cokleisli w a b #

(<$) :: a -> Cokleisli w a b -> Cokleisli w a a #

Functor m => Functor (IdentityT * m) 

Methods

fmap :: (a -> b) -> IdentityT * m a -> IdentityT * m b #

(<$) :: a -> IdentityT * m b -> IdentityT * m a #

(Contravariant f, Contravariant g) => Functor (Compose f g) 

Methods

fmap :: (a -> b) -> Compose f g a -> Compose f g b #

(<$) :: a -> Compose f g b -> Compose f g a #

(Functor f, Functor g) => Functor (ComposeFC f g) 

Methods

fmap :: (a -> b) -> ComposeFC f g a -> ComposeFC f g b #

(<$) :: a -> ComposeFC f g b -> ComposeFC f g a #

(Functor f, Functor g) => Functor (ComposeCF f g) 

Methods

fmap :: (a -> b) -> ComposeCF f g a -> ComposeCF f g b #

(<$) :: a -> ComposeCF f g b -> ComposeCF f g a #

Functor f => Functor (FreeF f a) 

Methods

fmap :: (a -> b) -> FreeF f a a -> FreeF f a b #

(<$) :: a -> FreeF f a b -> FreeF f a a #

(Functor f, Monad m) => Functor (FreeT f m) 

Methods

fmap :: (a -> b) -> FreeT f m a -> FreeT f m b #

(<$) :: a -> FreeT f m b -> FreeT f m a #

Functor g => Functor (Curried g h) 

Methods

fmap :: (a -> b) -> Curried g h a -> Curried g h b #

(<$) :: a -> Curried g h b -> Curried g h a #

Functor (Day f g) 

Methods

fmap :: (a -> b) -> Day f g a -> Day f g b #

(<$) :: a -> Day f g b -> Day f g a #

Functor f => Functor (Backwards * f)

Derived instance.

Methods

fmap :: (a -> b) -> Backwards * f a -> Backwards * f b #

(<$) :: a -> Backwards * f b -> Backwards * f a #

Functor m => Functor (ErrorT e m) 

Methods

fmap :: (a -> b) -> ErrorT e m a -> ErrorT e m b #

(<$) :: a -> ErrorT e m b -> ErrorT e m a #

Functor (ReifiedIndexedGetter i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b #

(<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a #

Functor (ReifiedIndexedFold i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b #

(<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a #

Functor (Mafic a b) 

Methods

fmap :: (a -> b) -> Mafic a b a -> Mafic a b b #

(<$) :: a -> Mafic a b b -> Mafic a b a #

Functor (Context a b) 

Methods

fmap :: (a -> b) -> Context a b a -> Context a b b #

(<$) :: a -> Context a b b -> Context a b a #

Functor (Indexed i a) 

Methods

fmap :: (a -> b) -> Indexed i a a -> Indexed i a b #

(<$) :: a -> Indexed i a b -> Indexed i a a #

Functor f => Functor (AlongsideLeft f b) 

Methods

fmap :: (a -> b) -> AlongsideLeft f b a -> AlongsideLeft f b b #

(<$) :: a -> AlongsideLeft f b b -> AlongsideLeft f b a #

Functor f => Functor (AlongsideRight f a) 

Methods

fmap :: (a -> b) -> AlongsideRight f a a -> AlongsideRight f a b #

(<$) :: a -> AlongsideRight f a b -> AlongsideRight f a a #

Functor (Flows i b) 

Methods

fmap :: (a -> b) -> Flows i b a -> Flows i b b #

(<$) :: a -> Flows i b b -> Flows i b a #

Monad m => Functor (Focusing m s) 

Methods

fmap :: (a -> b) -> Focusing m s a -> Focusing m s b #

(<$) :: a -> Focusing m s b -> Focusing m s a #

Functor (k (May s)) => Functor (FocusingMay k s) 

Methods

fmap :: (a -> b) -> FocusingMay k s a -> FocusingMay k s b #

(<$) :: a -> FocusingMay k s b -> FocusingMay k s a #

Functor (Effect m r) 

Methods

fmap :: (a -> b) -> Effect m r a -> Effect m r b #

(<$) :: a -> Effect m r b -> Effect m r a #

Functor m => Functor (ExceptT e m) 

Methods

fmap :: (a -> b) -> ExceptT e m a -> ExceptT e m b #

(<$) :: a -> ExceptT e m b -> ExceptT e m a #

Functor m => Functor (StateT s m) 

Methods

fmap :: (a -> b) -> StateT s m a -> StateT s m b #

(<$) :: a -> StateT s m b -> StateT s m a #

Functor m => Functor (StateT s m) 

Methods

fmap :: (a -> b) -> StateT s m a -> StateT s m b #

(<$) :: a -> StateT s m b -> StateT s m a #

Functor m => Functor (WriterT w m) 

Methods

fmap :: (a -> b) -> WriterT w m a -> WriterT w m b #

(<$) :: a -> WriterT w m b -> WriterT w m a #

Functor m => Functor (WriterT w m) 

Methods

fmap :: (a -> b) -> WriterT w m a -> WriterT w m b #

(<$) :: a -> WriterT w m b -> WriterT w m a #

Profunctor p => Functor (TambaraSum p a) 

Methods

fmap :: (a -> b) -> TambaraSum p a a -> TambaraSum p a b #

(<$) :: a -> TambaraSum p a b -> TambaraSum p a a #

Functor (CotambaraSum p a) 

Methods

fmap :: (a -> b) -> CotambaraSum p a a -> CotambaraSum p a b #

(<$) :: a -> CotambaraSum p a b -> CotambaraSum p a a #

Profunctor p => Functor (Tambara p a) 

Methods

fmap :: (a -> b) -> Tambara p a a -> Tambara p a b #

(<$) :: a -> Tambara p a b -> Tambara p a a #

Functor (Cotambara p a) 

Methods

fmap :: (a -> b) -> Cotambara p a a -> Cotambara p a b #

(<$) :: a -> Cotambara p a b -> Cotambara p a a #

Functor f => Functor (Star f a) 

Methods

fmap :: (a -> b) -> Star f a a -> Star f a b #

(<$) :: a -> Star f a b -> Star f a a #

Functor (Costar f a) 

Methods

fmap :: (a -> b) -> Costar f a a -> Costar f a b #

(<$) :: a -> Costar f a b -> Costar f a a #

Functor (Forget r a) 

Methods

fmap :: (a -> b) -> Forget r a a -> Forget r a b #

(<$) :: a -> Forget r a b -> Forget r a a #

Functor (Tagged k s) 

Methods

fmap :: (a -> b) -> Tagged k s a -> Tagged k s b #

(<$) :: a -> Tagged k s b -> Tagged k s a #

Functor f => Functor (Reverse * f)

Derived instance.

Methods

fmap :: (a -> b) -> Reverse * f a -> Reverse * f b #

(<$) :: a -> Reverse * f b -> Reverse * f a #

Functor (Constant * a) 

Methods

fmap :: (a -> b) -> Constant * a a -> Constant * a b #

(<$) :: a -> Constant * a b -> Constant * a a #

Monad m => Functor (Bundle m v) 

Methods

fmap :: (a -> b) -> Bundle m v a -> Bundle m v b #

(<$) :: a -> Bundle m v b -> Bundle m v a #

Functor f => Functor (M1 i c f) 

Methods

fmap :: (a -> b) -> M1 i c f a -> M1 i c f b #

(<$) :: a -> M1 i c f b -> M1 i c f a #

(Functor f, Functor g) => Functor (Sum * f g) 

Methods

fmap :: (a -> b) -> Sum * f g a -> Sum * f g b #

(<$) :: a -> Sum * f g b -> Sum * f g a #

(Functor f, Functor g) => Functor (Product * f g) 

Methods

fmap :: (a -> b) -> Product * f g a -> Product * f g b #

(<$) :: a -> Product * f g b -> Product * f g a #

Functor (Magma i t b) 

Methods

fmap :: (a -> b) -> Magma i t b a -> Magma i t b b #

(<$) :: a -> Magma i t b b -> Magma i t b a #

Functor (Molten i a b) 

Methods

fmap :: (a -> b) -> Molten i a b a -> Molten i a b b #

(<$) :: a -> Molten i a b b -> Molten i a b a #

Functor (Bazaar p a b) 

Methods

fmap :: (a -> b) -> Bazaar p a b a -> Bazaar p a b b #

(<$) :: a -> Bazaar p a b b -> Bazaar p a b a #

Functor (Bazaar1 p a b) 

Methods

fmap :: (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #

(<$) :: a -> Bazaar1 p a b b -> Bazaar1 p a b a #

Functor (Exchange a b s) 

Methods

fmap :: (a -> b) -> Exchange a b s a -> Exchange a b s b #

(<$) :: a -> Exchange a b s b -> Exchange a b s a #

Functor (Pretext p a b) 

Methods

fmap :: (a -> b) -> Pretext p a b a -> Pretext p a b b #

(<$) :: a -> Pretext p a b b -> Pretext p a b a #

Monad m => Functor (FocusingWith w m s) 

Methods

fmap :: (a -> b) -> FocusingWith w m s a -> FocusingWith w m s b #

(<$) :: a -> FocusingWith w m s b -> FocusingWith w m s a #

Functor (k (s, w)) => Functor (FocusingPlus w k s) 

Methods

fmap :: (a -> b) -> FocusingPlus w k s a -> FocusingPlus w k s b #

(<$) :: a -> FocusingPlus w k s b -> FocusingPlus w k s a #

Functor (k (f s)) => Functor (FocusingOn f k s) 

Methods

fmap :: (a -> b) -> FocusingOn f k s a -> FocusingOn f k s b #

(<$) :: a -> FocusingOn f k s b -> FocusingOn f k s a #

Functor (k (Err e s)) => Functor (FocusingErr e k s) 

Methods

fmap :: (a -> b) -> FocusingErr e k s a -> FocusingErr e k s b #

(<$) :: a -> FocusingErr e k s b -> FocusingErr e k s a #

Functor (ContT k r m) 

Methods

fmap :: (a -> b) -> ContT k r m a -> ContT k r m b #

(<$) :: a -> ContT k r m b -> ContT k r m a #

Functor m => Functor (ReaderT * r m) 

Methods

fmap :: (a -> b) -> ReaderT * r m a -> ReaderT * r m b #

(<$) :: a -> ReaderT * r m b -> ReaderT * r m a #

(Functor f, Functor g) => Functor (Compose * * f g) 

Methods

fmap :: (a -> b) -> Compose * * f g a -> Compose * * f g b #

(<$) :: a -> Compose * * f g b -> Compose * * f g a #

Bifunctor p => Functor (WrappedBifunctor * * p a) 

Methods

fmap :: (a -> b) -> WrappedBifunctor * * p a a -> WrappedBifunctor * * p a b #

(<$) :: a -> WrappedBifunctor * * p a b -> WrappedBifunctor * * p a a #

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 #

Bifunctor p => Functor (Flip * * p a) 

Methods

fmap :: (a -> b) -> Flip * * p a a -> Flip * * p a b #

(<$) :: a -> Flip * * p a b -> Flip * * p a a #

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 #

Functor (TakingWhile p f a b) 

Methods

fmap :: (a -> b) -> TakingWhile p f a b a -> TakingWhile p f a b b #

(<$) :: a -> TakingWhile p f a b b -> TakingWhile p f a b a #

Functor (BazaarT p g a b) 

Methods

fmap :: (a -> b) -> BazaarT p g a b a -> BazaarT p g a b b #

(<$) :: a -> BazaarT p g a b b -> BazaarT p g a b a #

Functor (BazaarT1 p g a b) 

Methods

fmap :: (a -> b) -> BazaarT1 p g a b a -> BazaarT1 p g a b b #

(<$) :: a -> BazaarT1 p g a b b -> BazaarT1 p g a b a #

Functor (PretextT p g a b) 

Methods

fmap :: (a -> b) -> PretextT p g a b a -> PretextT p g a b b #

(<$) :: a -> PretextT p g a b b -> PretextT p g a b a #

Functor (k (Freed f m s)) => Functor (FocusingFree f m k s) 

Methods

fmap :: (a -> b) -> FocusingFree f m k s a -> FocusingFree f m k s b #

(<$) :: a -> FocusingFree f m k s b -> FocusingFree f m k s a #

Functor (EffectRWS w st m s) 

Methods

fmap :: (a -> b) -> EffectRWS w st m s a -> EffectRWS w st m s b #

(<$) :: a -> EffectRWS w st m s b -> EffectRWS w st m s a #

Functor m => Functor (RWST r w s m) 

Methods

fmap :: (a -> b) -> RWST r w s m a -> RWST r w s m b #

(<$) :: a -> RWST r w s m b -> RWST r w s m a #

Functor m => Functor (RWST r w s m) 

Methods

fmap :: (a -> b) -> RWST r w s m a -> RWST r w s m b #

(<$) :: a -> RWST r w s m b -> RWST r w s m a #

Reifies k s (ReifiedApplicative f) => Functor (ReflectedApplicative k * f s) 

Methods

fmap :: (a -> b) -> ReflectedApplicative k * f s a -> ReflectedApplicative k * f s b #

(<$) :: a -> ReflectedApplicative k * f s b -> ReflectedApplicative k * f s a #

(Functor f, Bifunctor p) => Functor (Tannen * * * f p a) 

Methods

fmap :: (a -> b) -> Tannen * * * f p a a -> Tannen * * * f p a b #

(<$) :: a -> Tannen * * * f p a b -> Tannen * * * f p a a #

(Bifunctor p, Functor g) => Functor (Biff * k * * p f g a) 

Methods

fmap :: (a -> b) -> Biff * k * * p f g a a -> Biff * k * * p f g a b #

(<$) :: a -> Biff * k * * p f g a b -> Biff * k * * p f g a a #

class GPlated a g #

Minimal complete definition

gplate'

Instances

GPlated a V1 

Methods

gplate' :: Applicative f => (a -> f a) -> V1 p -> f (V1 p)

GPlated a U1 

Methods

gplate' :: Applicative f => (a -> f a) -> U1 p -> f (U1 p)

GPlated a (K1 i a) 

Methods

gplate' :: Applicative f => (a -> f a) -> K1 i a p -> f (K1 i a p)

GPlated a (K1 i b) 

Methods

gplate' :: Applicative f => (a -> f a) -> K1 i b p -> f (K1 i b p)

(GPlated a f, GPlated a g) => GPlated a ((:+:) f g) 

Methods

gplate' :: Applicative f => (a -> f a) -> (f :+: g) p -> f ((f :+: g) p)

(GPlated a f, GPlated a g) => GPlated a ((:*:) f g) 

Methods

gplate' :: Applicative f => (a -> f a) -> (f :*: g) p -> f ((f :*: g) p)

GPlated a f => GPlated a (M1 i c f) 

Methods

gplate' :: Applicative f => (a -> f a) -> M1 i c f p -> f (M1 i c f p)

type Getter s a = forall f. (Contravariant f, Functor f) => (a -> f a) -> s -> f s #

A Getter describes how to retrieve a single value in a way that can be composed with other LensLike constructions.

Unlike a Lens a Getter is read-only. Since a Getter cannot be used to write back there are no Lens laws that can be applied to it. In fact, it is isomorphic to an arbitrary function from (s -> a).

Moreover, a Getter can be used directly as a Fold, since it just ignores the Applicative.

type Getting r s a = (a -> Const * r a) -> s -> Const * r s #

When you see this in a type signature it indicates that you can pass the function a Lens, Getter, Traversal, Fold, Prism, Iso, or one of the indexed variants, and it will just "do the right thing".

Most Getter combinators are able to be used with both a Getter or a Fold in limited situations, to do so, they need to be monomorphic in what we are going to extract with Const. To be compatible with Lens, Traversal and Iso we also restricted choices of the irrelevant t and b parameters.

If a function accepts a Getting r s a, then when r is a Monoid, then you can pass a Fold (or Traversal), otherwise you can only pass this a Getter or Lens.

data Identical k k1 a b s t :: forall k k1. k1 -> k -> k1 -> k -> * where #

Provides witness that (s ~ a, b ~ t) holds.

Constructors

Identical :: Identical k k1 a b a b 

data Identical k k1 a b s t :: forall k k1. k1 -> k -> k1 -> k -> * where #

Provides witness that (s ~ a, b ~ t) holds.

Constructors

Identical :: Identical k k1 a b a b 

newtype Identity a :: * -> * #

Identity functor and monad. (a non-strict monad)

Since: 4.8.0.0

Constructors

Identity 

Fields

Instances

Monad Identity 

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

fail :: String -> Identity a #

Functor Identity 

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

MonadFix Identity 

Methods

mfix :: (a -> Identity a) -> Identity a #

Applicative Identity 

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Foldable Identity 

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Traversable Identity 

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Generic1 Identity 

Associated Types

type Rep1 (Identity :: * -> *) :: * -> * #

Methods

from1 :: Identity a -> Rep1 Identity a #

to1 :: Rep1 Identity a -> Identity a #

Representable Identity 

Associated Types

type Rep (Identity :: * -> *) :: * #

Methods

tabulate :: (Rep Identity -> a) -> Identity a #

index :: Identity a -> Rep Identity -> a #

Eq1 Identity 

Methods

liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool #

Ord1 Identity 

Methods

liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering #

Read1 Identity 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] #

Show1 Identity 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS #

MonadZip Identity 

Methods

mzip :: Identity a -> Identity b -> Identity (a, b) #

mzipWith :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

munzip :: Identity (a, b) -> (Identity a, Identity b) #

Comonad Identity 

Methods

extract :: Identity a -> a #

duplicate :: Identity a -> Identity (Identity a) #

extend :: (Identity a -> b) -> Identity a -> Identity b #

ComonadApply Identity 

Methods

(<@>) :: Identity (a -> b) -> Identity a -> Identity b #

(@>) :: Identity a -> Identity b -> Identity b #

(<@) :: Identity a -> Identity b -> Identity a #

Hashable1 Identity 

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Identity a -> Int #

Settable Identity

So you can pass our Setter into combinators from other lens libraries.

Methods

untainted :: Identity a -> a #

untaintedDot :: Profunctor p => p a (Identity b) -> p a b #

taintedDot :: Profunctor p => p a b -> p a (Identity b) #

Traversable1 Identity 

Methods

traverse1 :: Apply f => (a -> f b) -> Identity a -> f (Identity b) #

sequence1 :: Apply f => Identity (f b) -> f (Identity b) #

Apply Identity 

Methods

(<.>) :: Identity (a -> b) -> Identity a -> Identity b #

(.>) :: Identity a -> Identity b -> Identity b #

(<.) :: Identity a -> Identity b -> Identity a #

Bind Identity 

Methods

(>>-) :: Identity a -> (a -> Identity b) -> Identity b #

join :: Identity (Identity a) -> Identity a #

FunctorWithIndex () Identity 

Methods

imap :: (() -> a -> b) -> Identity a -> Identity b #

imapped :: (Indexable () p, Settable f) => p a (f b) -> Identity a -> f (Identity b) #

FoldableWithIndex () Identity 

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m #

ifolded :: (Indexable () p, Contravariant f, Applicative f) => p a (f a) -> Identity a -> f (Identity a) #

ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #

TraversableWithIndex () Identity 

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #

itraversed :: (Indexable () p, Applicative f) => p a (f b) -> Identity a -> f (Identity b) #

Sieve ReifiedGetter Identity 

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

Cosieve ReifiedGetter Identity 

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

Bounded a => Bounded (Identity a) 
Enum a => Enum (Identity a) 
Eq a => Eq (Identity a) 

Methods

(==) :: Identity a -> Identity a -> Bool #

(/=) :: Identity a -> Identity a -> Bool #

Floating a => Floating (Identity a) 
Fractional a => Fractional (Identity a) 
Integral a => Integral (Identity a) 
Data a => Data (Identity a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) #

toConstr :: Identity a -> Constr #

dataTypeOf :: Identity a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) #

gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

Num a => Num (Identity a) 
Ord a => Ord (Identity a) 

Methods

compare :: Identity a -> Identity a -> Ordering #

(<) :: Identity a -> Identity a -> Bool #

(<=) :: Identity a -> Identity a -> Bool #

(>) :: Identity a -> Identity a -> Bool #

(>=) :: Identity a -> Identity a -> Bool #

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Read a => Read (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Real a => Real (Identity a) 

Methods

toRational :: Identity a -> Rational #

RealFloat a => RealFloat (Identity a) 
RealFrac a => RealFrac (Identity a) 

Methods

properFraction :: Integral b => Identity a -> (b, Identity a) #

truncate :: Integral b => Identity a -> b #

round :: Integral b => Identity a -> b #

ceiling :: Integral b => Identity a -> b #

floor :: Integral b => Identity a -> b #

Show a => Show (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Methods

showsPrec :: Int -> Identity a -> ShowS #

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Ix a => Ix (Identity a) 
IsString a => IsString (Identity a) 

Methods

fromString :: String -> Identity a #

Generic (Identity a) 

Associated Types

type Rep (Identity a) :: * -> * #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Semigroup a => Semigroup (Identity a) 

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Monoid a => Monoid (Identity a) 

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Storable a => Storable (Identity a) 

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Bits a => Bits (Identity a) 
FiniteBits a => FiniteBits (Identity a) 
NFData a => NFData (Identity a)

Since: 1.4.0.0

Methods

rnf :: Identity a -> () #

Hashable a => Hashable (Identity a) 

Methods

hashWithSalt :: Int -> Identity a -> Int #

hash :: Identity a -> Int #

Ixed (Identity a) 

Methods

ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) #

Wrapped (Identity a) 

Associated Types

type Unwrapped (Identity a) :: * #

(~) * t (Identity b) => Rewrapped (Identity a) t 
Each (Identity a) (Identity b) a b
each :: Traversal (Identity a) (Identity b) a b

Methods

each :: Traversal (Identity a) (Identity b) a b #

Field1 (Identity a) (Identity b) a b 

Methods

_1 :: Lens (Identity a) (Identity b) a b #

type Rep1 Identity 
type Rep1 Identity = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just Symbol "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep Identity 
type Rep Identity = ()
type Rep (Identity a) 
type Rep (Identity a) = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just Symbol "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Index (Identity a) 
type Index (Identity a) = ()
type IxValue (Identity a) 
type IxValue (Identity a) = a
type Unwrapped (Identity a) 
type Unwrapped (Identity a) = a

type family Index s :: * #

Instances

type Index ByteString 
type Index ByteString 
type Index Text 
type Index Text = Int
type Index Text 
type Index IntSet 
type Index [a] 
type Index [a] = Int
type Index (Maybe a) 
type Index (Maybe a) = ()
type Index (Identity a) 
type Index (Identity a) = ()
type Index (NonEmpty a) 
type Index (NonEmpty a) = Int
type Index (Complex a) 
type Index (Complex a) = Int
type Index (IntMap a) 
type Index (IntMap a) = Int
type Index (Tree a) 
type Index (Tree a) = [Int]
type Index (Seq a) 
type Index (Seq a) = Int
type Index (Set a) 
type Index (Set a) = a
type Index (Vector a) 
type Index (Vector a) = Int
type Index (Vector a) 
type Index (Vector a) = Int
type Index (Vector a) 
type Index (Vector a) = Int
type Index (Vector a) 
type Index (Vector a) = Int
type Index (HashSet a) 
type Index (HashSet a) = a
type Index (e -> a) 
type Index (e -> a) = e
type Index (a, b) 
type Index (a, b) = Int
type Index (HashMap k a) 
type Index (HashMap k a) = k
type Index (Map k a) 
type Index (Map k a) = k
type Index (UArray i e) 
type Index (UArray i e) = i
type Index (Array i e) 
type Index (Array i e) = i
type Index (a, b, c) 
type Index (a, b, c) = Int
type Index (a, b, c, d) 
type Index (a, b, c, d) = Int
type Index (a, b, c, d, e) 
type Index (a, b, c, d, e) = Int
type Index (a, b, c, d, e, f) 
type Index (a, b, c, d, e, f) = Int
type Index (a, b, c, d, e, f, g) 
type Index (a, b, c, d, e, f, g) = Int
type Index (a, b, c, d, e, f, g, h) 
type Index (a, b, c, d, e, f, g, h) = Int
type Index (a, b, c, d, e, f, g, h, i) 
type Index (a, b, c, d, e, f, g, h, i) = Int

type IndexPreservingFold s a = forall p f. (Conjoined p, Contravariant f, Applicative f) => p a (f a) -> p s (f s) #

An IndexPreservingFold can be used as a Fold, but when composed with an IndexedTraversal, IndexedFold, or IndexedLens yields an IndexedFold respectively.

type IndexPreservingFold1 s a = forall p f. (Conjoined p, Contravariant f, Apply f) => p a (f a) -> p s (f s) #

type IndexPreservingGetter s a = forall p f. (Conjoined p, Contravariant f, Functor f) => p a (f a) -> p s (f s) #

An IndexPreservingGetter can be used as a Getter, but when composed with an IndexedTraversal, IndexedFold, or IndexedLens yields an IndexedFold, IndexedFold or IndexedGetter respectively.

type IndexPreservingLens s t a b = forall p f. (Conjoined p, Functor f) => p a (f b) -> p s (f t) #

An IndexPreservingLens leaves any index it is composed with alone.

type IndexPreservingSetter s t a b = forall p f. (Conjoined p, Settable f) => p a (f b) -> p s (f t) #

An IndexPreservingSetter can be composed with a IndexedSetter, IndexedTraversal or IndexedLens and leaves the index intact, yielding an IndexedSetter.

type IndexPreservingSetter' s a = IndexPreservingSetter s s a a #

type IndexedPreservingSetter' i = Simple IndexedPreservingSetter

type IndexPreservingTraversal s t a b = forall p f. (Conjoined p, Applicative f) => p a (f b) -> p s (f t) #

An IndexPreservingLens leaves any index it is composed with alone.

type IndexPreservingTraversal1 s t a b = forall p f. (Conjoined p, Apply f) => p a (f b) -> p s (f t) #

class (Choice p, Corepresentable p, Comonad (Corep p), Traversable (Corep p), Strong p, Representable p, Monad (Rep p), MonadFix (Rep p), Distributive (Rep p), Costrong p, ArrowLoop p, ArrowApply p, ArrowChoice p, Closed p) => Conjoined p where #

This is a Profunctor that is both Corepresentable by f and Representable by g such that f is left adjoint to g. From this you can derive a lot of structure due to the preservation of limits and colimits.

Methods

distrib :: Functor f => p a b -> p (f a) (f b) #

Conjoined is strong enough to let us distribute every Conjoined Profunctor over every Haskell Functor. This is effectively a generalization of fmap.

conjoined :: ((~) (* -> * -> *) p (->) -> q (a -> b) r) -> q (p a b) r -> q (p a b) r #

This permits us to make a decision at an outermost point about whether or not we use an index.

Ideally any use of this function should be done in such a way so that you compute the same answer, but this cannot be enforced at the type level.

Instances

Conjoined (->) 

Methods

distrib :: Functor f => (a -> b) -> f a -> f b #

conjoined :: (((* -> * -> *) ~ (->)) (->) -> q (a -> b) r) -> q (a -> b) r -> q (a -> b) r #

Conjoined ReifiedGetter 

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) #

conjoined :: (((* -> * -> *) ~ ReifiedGetter) (->) -> q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r #

Conjoined (Indexed i) 

Methods

distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) #

conjoined :: (((* -> * -> *) ~ Indexed i) (->) -> q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r #

newtype Indexed i a b :: * -> * -> * -> * #

A function with access to a index. This constructor may be useful when you need to store an Indexable in a container to avoid ImpredicativeTypes.

index :: Indexed i a b -> i -> a -> b

Constructors

Indexed 

Fields

Instances

(~) * i j => Indexable i (Indexed j) 

Methods

indexed :: Indexed j a b -> i -> a -> b #

Arrow (Indexed i) 

Methods

arr :: (b -> c) -> Indexed i b c #

first :: Indexed i b c -> Indexed i (b, d) (c, d) #

second :: Indexed i b c -> Indexed i (d, b) (d, c) #

(***) :: Indexed i b c -> Indexed i b' c' -> Indexed i (b, b') (c, c') #

(&&&) :: Indexed i b c -> Indexed i b c' -> Indexed i b (c, c') #

ArrowChoice (Indexed i) 

Methods

left :: Indexed i b c -> Indexed i (Either b d) (Either c d) #

right :: Indexed i b c -> Indexed i (Either d b) (Either d c) #

(+++) :: Indexed i b c -> Indexed i b' c' -> Indexed i (Either b b') (Either c c') #

(|||) :: Indexed i b d -> Indexed i c d -> Indexed i (Either b c) d #

ArrowApply (Indexed i) 

Methods

app :: Indexed i (Indexed i b c, b) c #

ArrowLoop (Indexed i) 

Methods

loop :: Indexed i (b, d) (c, d) -> Indexed i b c #

Representable (Indexed i) 

Associated Types

type Rep (Indexed i :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (Indexed i) c) -> Indexed i d c #

Corepresentable (Indexed i) 

Associated Types

type Corep (Indexed i :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep (Indexed i) d -> c) -> Indexed i d c #

Conjoined (Indexed i) 

Methods

distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) #

conjoined :: (((* -> * -> *) ~ Indexed i) (->) -> q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r #

Profunctor (Indexed i) 

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c #

(#.) :: Coercible * c b => (b -> c) -> Indexed i a b -> Indexed i a c #

(.#) :: Coercible * b a => Indexed i b c -> (a -> b) -> Indexed i a c #

Choice (Indexed i) 

Methods

left' :: Indexed i a b -> Indexed i (Either a c) (Either b c) #

right' :: Indexed i a b -> Indexed i (Either c a) (Either c b) #

Closed (Indexed i) 

Methods

closed :: Indexed i a b -> Indexed i (x -> a) (x -> b) #

Strong (Indexed i) 

Methods

first' :: Indexed i a b -> Indexed i (a, c) (b, c) #

second' :: Indexed i a b -> Indexed i (c, a) (c, b) #

Costrong (Indexed i) 

Methods

unfirst :: Indexed i (a, d) (b, d) -> Indexed i a b #

unsecond :: Indexed i (d, a) (d, b) -> Indexed i a b #

Bizarre (Indexed Int) Mafic 

Methods

bazaar :: Applicative f => Indexed Int a (f b) -> Mafic a b t -> f t #

Category * (Indexed i) 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Bizarre (Indexed i) (Molten i) 

Methods

bazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t #

Sellable (Indexed i) (Molten i) 

Methods

sell :: Indexed i a (Molten i a b b) #

Sieve (Indexed i) ((->) i) 

Methods

sieve :: Indexed i a b -> a -> i -> b #

Cosieve (Indexed i) ((,) i) 

Methods

cosieve :: Indexed i a b -> (i, a) -> b #

Monad (Indexed i a) 

Methods

(>>=) :: Indexed i a a -> (a -> Indexed i a b) -> Indexed i a b #

(>>) :: Indexed i a a -> Indexed i a b -> Indexed i a b #

return :: a -> Indexed i a a #

fail :: String -> Indexed i a a #

Functor (Indexed i a) 

Methods

fmap :: (a -> b) -> Indexed i a a -> Indexed i a b #

(<$) :: a -> Indexed i a b -> Indexed i a a #

MonadFix (Indexed i a) 

Methods

mfix :: (a -> Indexed i a a) -> Indexed i a a #

Applicative (Indexed i a) 

Methods

pure :: a -> Indexed i a a #

(<*>) :: Indexed i a (a -> b) -> Indexed i a a -> Indexed i a b #

(*>) :: Indexed i a a -> Indexed i a b -> Indexed i a b #

(<*) :: Indexed i a a -> Indexed i a b -> Indexed i a a #

Apply (Indexed i a) 

Methods

(<.>) :: Indexed i a (a -> b) -> Indexed i a a -> Indexed i a b #

(.>) :: Indexed i a a -> Indexed i a b -> Indexed i a b #

(<.) :: Indexed i a a -> Indexed i a b -> Indexed i a a #

Bind (Indexed i a) 

Methods

(>>-) :: Indexed i a a -> (a -> Indexed i a b) -> Indexed i a b #

join :: Indexed i a (Indexed i a a) -> Indexed i a a #

type Rep (Indexed i) 
type Rep (Indexed i) = (->) i
type Corep (Indexed i) 
type Corep (Indexed i) = (,) i

type IndexedFold i s a = forall p f. (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> s -> f s #

Every IndexedFold is a valid Fold and can be used for Getting.

type IndexedFold1 i s a = forall p f. (Indexable i p, Contravariant f, Apply f) => p a (f a) -> s -> f s #

type IndexedGetter i s a = forall p f. (Indexable i p, Contravariant f, Functor f) => p a (f a) -> s -> f s #

Every IndexedGetter is a valid IndexedFold and can be used for Getting like a Getter.

type IndexedGetting i m s a = Indexed i a (Const * m a) -> s -> Const * m s #

Used to consume an IndexedFold.

type IndexedLens i s t a b = forall f p. (Indexable i p, Functor f) => p a (f b) -> s -> f t #

Every IndexedLens is a valid Lens and a valid IndexedTraversal.

type IndexedLens' i s a = IndexedLens i s s a a #

type IndexedLensLike k i f s t a b = forall p. Indexable i p => p a (f b) -> s -> f t #

Convenient alias for constructing indexed lenses and their ilk.

type IndexedLensLike' i f s a = IndexedLensLike * i f s s a a #

Convenient alias for constructing simple indexed lenses and their ilk.

type IndexedSetter i s t a b = forall f p. (Indexable i p, Settable f) => p a (f b) -> s -> f t #

Every IndexedSetter is a valid Setter.

The Setter laws are still required to hold.

type IndexedSetter' i s a = IndexedSetter i s s a a #

type IndexedTraversal i s t a b = forall p f. (Indexable i p, Applicative f) => p a (f b) -> s -> f t #

Every IndexedTraversal is a valid Traversal or IndexedFold.

The Indexed constraint is used to allow an IndexedTraversal to be used directly as a Traversal.

The Traversal laws are still required to hold.

In addition, the index i should satisfy the requirement that it stays unchanged even when modifying the value a, otherwise traversals like indices break the Traversal laws.

type IndexedTraversal1 i s t a b = forall p f. (Indexable i p, Apply f) => p a (f b) -> s -> f t #

type IndexedTraversal1' i s a = IndexedTraversal1 i s s a a #

type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t) #

Isomorphism families can be composed with another Lens using (.) and id.

Note: Composition with an Iso is index- and measure- preserving.

type Iso' s a = Iso s s a a #

type Iso' = Simple Iso

type family IxValue m :: * #

This provides a common notion of a value at an index that is shared by both Ixed and At.

Instances

type IxValue ByteString 
type IxValue ByteString 
type IxValue Text 
type IxValue Text 
type IxValue IntSet 
type IxValue IntSet = ()
type IxValue [a] 
type IxValue [a] = a
type IxValue (Maybe a) 
type IxValue (Maybe a) = a
type IxValue (Identity a) 
type IxValue (Identity a) = a
type IxValue (NonEmpty a) 
type IxValue (NonEmpty a) = a
type IxValue (IntMap a) 
type IxValue (IntMap a) = a
type IxValue (Tree a) 
type IxValue (Tree a) = a
type IxValue (Seq a) 
type IxValue (Seq a) = a
type IxValue (Set k) 
type IxValue (Set k) = ()
type IxValue (Vector a) 
type IxValue (Vector a) = a
type IxValue (Vector a) 
type IxValue (Vector a) = a
type IxValue (Vector a) 
type IxValue (Vector a) = a
type IxValue (Vector a) 
type IxValue (Vector a) = a
type IxValue (HashSet k) 
type IxValue (HashSet k) = ()
type IxValue (e -> a) 
type IxValue (e -> a) = a
type IxValue (a, a2) 
type IxValue (a, a2) = a
type IxValue (HashMap k a) 
type IxValue (HashMap k a) = a
type IxValue (Map k a) 
type IxValue (Map k a) = a
type IxValue (UArray i e) 
type IxValue (UArray i e) = e
type IxValue (Array i e) 
type IxValue (Array i e) = e
type IxValue (a, a2, a3) 
type IxValue (a, a2, a3) = a
type IxValue (a, a2, a3, a4) 
type IxValue (a, a2, a3, a4) = a
type IxValue (a, a2, a3, a4, a5) 
type IxValue (a, a2, a3, a4, a5) = a
type IxValue (a, a2, a3, a4, a5, a6) 
type IxValue (a, a2, a3, a4, a5, a6) = a
type IxValue (a, a2, a3, a4, a5, a6, a7) 
type IxValue (a, a2, a3, a4, a5, a6, a7) = a
type IxValue (a, a2, a3, a4, a5, a6, a7, a8) 
type IxValue (a, a2, a3, a4, a5, a6, a7, a8) = a
type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9) 
type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9) = a

class Ixed m where #

This simple Traversal lets you traverse the value at a given key in a Map or element at an ordinal position in a list or Seq.

Methods

ix :: Index m -> Traversal' m (IxValue m) #

This simple Traversal lets you traverse the value at a given key in a Map or element at an ordinal position in a list or Seq.

NB: Setting the value of this Traversal will only set the value in at if it is already present.

If you want to be able to insert missing values, you want at.

>>> Seq.fromList [a,b,c,d] & ix 2 %~ f
fromList [a,b,f c,d]
>>> Seq.fromList [a,b,c,d] & ix 2 .~ e
fromList [a,b,e,d]
>>> Seq.fromList [a,b,c,d] ^? ix 2
Just c
>>> Seq.fromList [] ^? ix 2
Nothing

Instances

Ixed ByteString 
Ixed ByteString 
Ixed Text 
Ixed Text 
Ixed IntSet 
Ixed [a] 

Methods

ix :: Index [a] -> Traversal' [a] (IxValue [a]) #

Ixed (Maybe a) 

Methods

ix :: Index (Maybe a) -> Traversal' (Maybe a) (IxValue (Maybe a)) #

Ixed (Identity a) 

Methods

ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) #

Ixed (NonEmpty a) 

Methods

ix :: Index (NonEmpty a) -> Traversal' (NonEmpty a) (IxValue (NonEmpty a)) #

Ixed (IntMap a) 

Methods

ix :: Index (IntMap a) -> Traversal' (IntMap a) (IxValue (IntMap a)) #

Ixed (Tree a) 

Methods

ix :: Index (Tree a) -> Traversal' (Tree a) (IxValue (Tree a)) #

Ixed (Seq a) 

Methods

ix :: Index (Seq a) -> Traversal' (Seq a) (IxValue (Seq a)) #

Ord k => Ixed (Set k) 

Methods

ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) #

Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Prim a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Storable a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Unbox a => Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

(Eq k, Hashable k) => Ixed (HashSet k) 

Methods

ix :: Index (HashSet k) -> Traversal' (HashSet k) (IxValue (HashSet k)) #

Eq e => Ixed (e -> a) 

Methods

ix :: Index (e -> a) -> Traversal' (e -> a) (IxValue (e -> a)) #

(~) * a a2 => Ixed (a, a2) 

Methods

ix :: Index (a, a2) -> Traversal' (a, a2) (IxValue (a, a2)) #

(Eq k, Hashable k) => Ixed (HashMap k a) 

Methods

ix :: Index (HashMap k a) -> Traversal' (HashMap k a) (IxValue (HashMap k a)) #

Ord k => Ixed (Map k a) 

Methods

ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) #

(IArray UArray e, Ix i) => Ixed (UArray i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr

Methods

ix :: Index (UArray i e) -> Traversal' (UArray i e) (IxValue (UArray i e)) #

Ix i => Ixed (Array i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr

Methods

ix :: Index (Array i e) -> Traversal' (Array i e) (IxValue (Array i e)) #

((~) * a a2, (~) * a a3) => Ixed (a, a2, a3) 

Methods

ix :: Index (a, a2, a3) -> Traversal' (a, a2, a3) (IxValue (a, a2, a3)) #

((~) * a a2, (~) * a a3, (~) * a a4) => Ixed (a, a2, a3, a4) 

Methods

ix :: Index (a, a2, a3, a4) -> Traversal' (a, a2, a3, a4) (IxValue (a, a2, a3, a4)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5) => Ixed (a, a2, a3, a4, a5) 

Methods

ix :: Index (a, a2, a3, a4, a5) -> Traversal' (a, a2, a3, a4, a5) (IxValue (a, a2, a3, a4, a5)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6) => Ixed (a, a2, a3, a4, a5, a6) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6) -> Traversal' (a, a2, a3, a4, a5, a6) (IxValue (a, a2, a3, a4, a5, a6)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7) => Ixed (a, a2, a3, a4, a5, a6, a7) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7) -> Traversal' (a, a2, a3, a4, a5, a6, a7) (IxValue (a, a2, a3, a4, a5, a6, a7)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8) => Ixed (a, a2, a3, a4, a5, a6, a7, a8) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8) (IxValue (a, a2, a3, a4, a5, a6, a7, a8)) #

((~) * a a2, (~) * a a3, (~) * a a4, (~) * a a5, (~) * a a6, (~) * a a7, (~) * a a8, (~) * a a9) => Ixed (a, a2, a3, a4, a5, a6, a7, a8, a9) 

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8, a9) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8, a9) (IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)) #

data Leftmost a :: * -> * #

Used for preview.

Instances

Semigroup (Leftmost a) 

Methods

(<>) :: Leftmost a -> Leftmost a -> Leftmost a #

sconcat :: NonEmpty (Leftmost a) -> Leftmost a #

stimes :: Integral b => b -> Leftmost a -> Leftmost a #

Monoid (Leftmost a) 

Methods

mempty :: Leftmost a #

mappend :: Leftmost a -> Leftmost a -> Leftmost a #

mconcat :: [Leftmost a] -> Leftmost a #

type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t #

A Lens is actually a lens family as described in http://comonad.com/reader/2012/mirrored-lenses/.

With great power comes great responsibility and a Lens is subject to the three common sense Lens laws:

1) You get back what you put in:

view l (set l v s)  ≡ v

2) Putting back what you got doesn't change anything:

set l (view l s) s  ≡ s

3) Setting twice is the same as setting once:

set l v' (set l v s) ≡ set l v' s

These laws are strong enough that the 4 type parameters of a Lens cannot vary fully independently. For more on how they interact, read the "Why is it a Lens Family?" section of http://comonad.com/reader/2012/mirrored-lenses/.

There are some emergent properties of these laws:

1) set l s must be injective for every s This is a consequence of law #1

2) set l must be surjective, because of law #2, which indicates that it is possible to obtain any v from some s such that set s v = s

3) Given just the first two laws you can prove a weaker form of law #3 where the values v that you are setting match:

set l v (set l v s) ≡ set l v s

Every Lens can be used directly as a Setter or Traversal.

You can also use a Lens for Getting as if it were a Fold or Getter.

Since every Lens is a valid Traversal, the Traversal laws are required of any Lens you create:

l purepure
fmap (l f) . l g ≡ getCompose . l (Compose . fmap f . g)
type Lens s t a b = forall f. Functor f => LensLike f s t a b

type Lens' s a = Lens s s a a #

type Lens' = Simple Lens

type LensLike k f s t a b = (a -> f b) -> s -> f t #

Many combinators that accept a Lens can also accept a Traversal in limited situations.

They do so by specializing the type of Functor that they require of the caller.

If a function accepts a LensLike f s t a b for some Functor f, then they may be passed a Lens.

Further, if f is an Applicative, they may also be passed a Traversal.

type LensLike' f s a = LensLike * f s s a a #

type LensLike' f = Simple (LensLike f)

data LensRules :: * #

Rules to construct lenses for data fields.

data Level i a :: * -> * -> * #

This data type represents a path-compressed copy of one level of a source data structure. We can safely use path-compression because we know the depth of the tree.

Path compression is performed by viewing a Level as a PATRICIA trie of the paths into the structure to leaves at a given depth, similar in many ways to a IntMap, but unlike a regular PATRICIA trie we do not need to store the mask bits merely the depth of the fork.

One invariant of this structure is that underneath a Two node you will not find any Zero nodes, so Zero can only occur at the root.

Instances

FunctorWithIndex i (Level i) 

Methods

imap :: (i -> a -> b) -> Level i a -> Level i b #

imapped :: (Indexable i p, Settable f) => p a (f b) -> Level i a -> f (Level i b) #

FoldableWithIndex i (Level i) 

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Level i a -> m #

ifolded :: (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> Level i a -> f (Level i a) #

ifoldr :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Level i a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Level i a -> b #

TraversableWithIndex i (Level i) 

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Level i a -> f (Level i b) #

itraversed :: (Indexable i p, Applicative f) => p a (f b) -> Level i a -> f (Level i b) #

Functor (Level i) 

Methods

fmap :: (a -> b) -> Level i a -> Level i b #

(<$) :: a -> Level i b -> Level i a #

Foldable (Level i) 

Methods

fold :: Monoid m => Level i m -> m #

foldMap :: Monoid m => (a -> m) -> Level i a -> m #

foldr :: (a -> b -> b) -> b -> Level i a -> b #

foldr' :: (a -> b -> b) -> b -> Level i a -> b #

foldl :: (b -> a -> b) -> b -> Level i a -> b #

foldl' :: (b -> a -> b) -> b -> Level i a -> b #

foldr1 :: (a -> a -> a) -> Level i a -> a #

foldl1 :: (a -> a -> a) -> Level i a -> a #

toList :: Level i a -> [a] #

null :: Level i a -> Bool #

length :: Level i a -> Int #

elem :: Eq a => a -> Level i a -> Bool #

maximum :: Ord a => Level i a -> a #

minimum :: Ord a => Level i a -> a #

sum :: Num a => Level i a -> a #

product :: Num a => Level i a -> a #

Traversable (Level i) 

Methods

traverse :: Applicative f => (a -> f b) -> Level i a -> f (Level i b) #

sequenceA :: Applicative f => Level i (f a) -> f (Level i a) #

mapM :: Monad m => (a -> m b) -> Level i a -> m (Level i b) #

sequence :: Monad m => Level i (m a) -> m (Level i a) #

(Eq a, Eq i) => Eq (Level i a) 

Methods

(==) :: Level i a -> Level i a -> Bool #

(/=) :: Level i a -> Level i a -> Bool #

(Ord a, Ord i) => Ord (Level i a) 

Methods

compare :: Level i a -> Level i a -> Ordering #

(<) :: Level i a -> Level i a -> Bool #

(<=) :: Level i a -> Level i a -> Bool #

(>) :: Level i a -> Level i a -> Bool #

(>=) :: Level i a -> Level i a -> Bool #

max :: Level i a -> Level i a -> Level i a #

min :: Level i a -> Level i a -> Level i a #

(Read a, Read i) => Read (Level i a) 
(Show a, Show i) => Show (Level i a) 

Methods

showsPrec :: Int -> Level i a -> ShowS #

show :: Level i a -> String #

showList :: [Level i a] -> ShowS #

data Magma i t b a :: * -> * -> * -> * -> * #

This provides a way to peek at the internal structure of a Traversal or IndexedTraversal

Instances

FunctorWithIndex i (Magma i t b) 

Methods

imap :: (i -> a -> b) -> Magma i t b a -> Magma i t b b #

imapped :: (Indexable i p, Settable f) => p a (f b) -> Magma i t b a -> f (Magma i t b b) #

FoldableWithIndex i (Magma i t b) 

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifolded :: (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> Magma i t b a -> f (Magma i t b a) #

ifoldr :: (i -> a -> b -> b) -> b -> Magma i t b a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Magma i t b a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Magma i t b a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Magma i t b a -> b #

TraversableWithIndex i (Magma i t b) 

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Magma i t b a -> f (Magma i t b b) #

itraversed :: (Indexable i p, Applicative f) => p a (f b) -> Magma i t b a -> f (Magma i t b b) #

Functor (Magma i t b) 

Methods

fmap :: (a -> b) -> Magma i t b a -> Magma i t b b #

(<$) :: a -> Magma i t b b -> Magma i t b a #

Foldable (Magma i t b) 

Methods

fold :: Monoid m => Magma i t b m -> m #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m #

foldr :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldr' :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldl :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldl' :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a #

toList :: Magma i t b a -> [a] #

null :: Magma i t b a -> Bool #

length :: Magma i t b a -> Int #

elem :: Eq a => a -> Magma i t b a -> Bool #

maximum :: Ord a => Magma i t b a -> a #

minimum :: Ord a => Magma i t b a -> a #

sum :: Num a => Magma i t b a -> a #

product :: Num a => Magma i t b a -> a #

Traversable (Magma i t b) 

Methods

traverse :: Applicative f => (a -> f b) -> Magma i t b a -> f (Magma i t b b) #

sequenceA :: Applicative f => Magma i t b (f a) -> f (Magma i t b a) #

mapM :: Monad m => (a -> m b) -> Magma i t b a -> m (Magma i t b b) #

sequence :: Monad m => Magma i t b (m a) -> m (Magma i t b a) #

(Show i, Show a) => Show (Magma i t b a) 

Methods

showsPrec :: Int -> Magma i t b a -> ShowS #

show :: Magma i t b a -> String #

showList :: [Magma i t b a] -> ShowS #

type family Magnified (m :: * -> *) :: * -> * -> * #

This type family is used by Magnify to describe the common effect type.

Instances

type Magnified ((->) b) 
type Magnified ((->) b) = Const *
type Magnified (IdentityT * m) 
type Magnified (ReaderT * b m) 
type Magnified (ReaderT * b m) = Effect m
type Magnified (RWST a w s m) 
type Magnified (RWST a w s m) = EffectRWS w s m
type Magnified (RWST a w s m) 
type Magnified (RWST a w s m) = EffectRWS w s m

type Optic k k1 k2 p f s t a b = p a (f b) -> p s (f t) #

A valid Optic l should satisfy the laws:

l purepure
l (Procompose f g) = Procompose (l f) (l g)

This gives rise to the laws for Equality, Iso, Prism, Lens, Traversal, Traversal1, Setter, Fold, Fold1, and Getter as well along with their index-preserving variants.

type LensLike f s t a b = Optic (->) f s t a b

type Optic' k k1 p f s a = Optic k1 k k1 p f s s a a #

type Optic' p f s a = Simple (Optic p f) s a

type Optical k k1 k2 k3 p q f s t a b = p a (f b) -> q s (f t) #

type LensLike f s t a b = Optical (->) (->) f s t a b
type Over p f s t a b = Optical p (->) f s t a b
type Optic p f s t a b = Optical p p f s t a b

type Optical' k k1 p q f s a = Optical k1 k1 k k1 p q f s s a a #

type Optical' p q f s a = Simple (Optical p q f) s a

type Over k k1 p f s t a b = p a (f b) -> s -> f t #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

type Over' p f s a = Over * * p f s s a a #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

type Over' p f = Simple (Over p f)

class Plated a where #

A Plated type is one where we know how to extract its immediate self-similar children.

Example 1:

import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (uniplate)
data Expr
  = Val Int
  | Neg Expr
  | Add Expr Expr
  deriving (Eq,Ord,Show,Read,Data,Typeable)
instance Plated Expr where
  plate f (Neg e) = Neg <$> f e
  plate f (Add a b) = Add <$> f a <*> f b
  plate _ a = pure a

or

instance Plated Expr where
  plate = uniplate

Example 2:

import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (uniplate)
data Tree a
  = Bin (Tree a) (Tree a)
  | Tip a
  deriving (Eq,Ord,Show,Read,Data,Typeable)
instance Plated (Tree a) where
  plate f (Bin l r) = Bin <$> f l <*> f r
  plate _ t = pure t

or

instance Data a => Plated (Tree a) where
  plate = uniplate

Note the big distinction between these two implementations.

The former will only treat children directly in this tree as descendents, the latter will treat trees contained in the values under the tips also as descendants!

When in doubt, pick a Traversal and just use the various ...Of combinators rather than pollute Plated with orphan instances!

If you want to find something unplated and non-recursive with biplate use the ...OnOf variant with ignored, though those usecases are much better served in most cases by using the existing Lens combinators! e.g.

toListOf biplateuniverseOnOf biplate ignored

This same ability to explicitly pass the Traversal in question is why there is no analogue to uniplate's Biplate.

Moreover, since we can allow custom traversals, we implement reasonable defaults for polymorphic data types, that only traverse into themselves, and not their polymorphic arguments.

Methods

plate :: Traversal' a a #

Traversal of the immediate children of this structure.

If you're using GHC 7.2 or newer and your type has a Data instance, plate will default to uniplate and you can choose to not override it with your own definition.

Instances

Plated Exp 
Plated Pat 
Plated Type 
Plated Dec 
Plated Con 
Plated Stmt 
Plated [a] 

Methods

plate :: Traversal' [a] [a] #

Plated (Tree a) 

Methods

plate :: Traversal' (Tree a) (Tree a) #

Traversable f => Plated (Cofree f a) 

Methods

plate :: Traversal' (Cofree f a) (Cofree f a) #

Traversable f => Plated (F f a) 

Methods

plate :: Traversal' (F f a) (F f a) #

Traversable f => Plated (Free f a) 

Methods

plate :: Traversal' (Free f a) (Free f a) #

(Traversable f, Traversable w) => Plated (CofreeT f w a) 

Methods

plate :: Traversal' (CofreeT f w a) (CofreeT f w a) #

(Traversable f, Traversable m) => Plated (FreeT f m a) 

Methods

plate :: Traversal' (FreeT f m a) (FreeT f m a) #

type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s (f t) #

A Prism l is a Traversal that can also be turned around with re to obtain a Getter in the opposite direction.

There are two laws that a Prism should satisfy:

First, if I re or review a value with a Prism and then preview or use (^?), I will get it back:

preview l (review l b) ≡ Just b

Second, if you can extract a value a using a Prism l from a value s, then the value s is completely described by l and a:

If preview l s ≡ Just a then review l a ≡ s

These two laws imply that the Traversal laws hold for every Prism and that we traverse at most 1 element:

lengthOf l x <= 1

It may help to think of this as a Iso that can be partial in one direction.

Every Prism is a valid Traversal.

Every Iso is a valid Prism.

For example, you might have a Prism' Integer Natural allows you to always go from a Natural to an Integer, and provide you with tools to check if an Integer is a Natural and/or to edit one if it is.

nat :: Prism' Integer Natural
nat = prism toInteger $ \ i ->
   if i < 0
   then Left i
   else Right (fromInteger i)

Now we can ask if an Integer is a Natural.

>>> 5^?nat
Just 5
>>> (-5)^?nat
Nothing

We can update the ones that are:

>>> (-3,4) & both.nat *~ 2
(-3,8)

And we can then convert from a Natural to an Integer.

>>> 5 ^. re nat -- :: Natural
5

Similarly we can use a Prism to traverse the Left half of an Either:

>>> Left "hello" & _Left %~ length
Left 5

or to construct an Either:

>>> 5^.re _Left
Left 5

such that if you query it with the Prism, you will get your original input back.

>>> 5^.re _Left ^? _Left
Just 5

Another interesting way to think of a Prism is as the categorical dual of a Lens -- a co-Lens, so to speak. This is what permits the construction of outside.

Note: Composition with a Prism is index-preserving.

type Prism' s a = Prism s s a a #

class Profunctor p where #

Formally, the class Profunctor represents a profunctor from Hask -> Hask.

Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.

You can define a Profunctor by either defining dimap or by defining both lmap and rmap.

If you supply dimap, you should ensure that:

dimap id idid

If you supply lmap and rmap, ensure:

lmap idid
rmap idid

If you supply both, you should also ensure:

dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

dimap (f . g) (h . i) ≡ dimap g h . dimap f i
lmap (f . g) ≡ lmap g . lmap f
rmap (f . g) ≡ rmap f . rmap g

Minimal complete definition

dimap | lmap, rmap

Methods

dimap :: (a -> b) -> (c -> d) -> p b c -> p a d #

Map over both arguments at the same time.

dimap f g ≡ lmap f . rmap g

lmap :: (a -> b) -> p b c -> p a c #

Map the first argument contravariantly.

lmap f ≡ dimap f id

rmap :: (b -> c) -> p a b -> p a c #

Map the second argument covariantly.

rmapdimap id

Instances

Profunctor (->) 

Methods

dimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d #

lmap :: (a -> b) -> (b -> c) -> a -> c #

rmap :: (b -> c) -> (a -> b) -> a -> c #

(#.) :: Coercible * c b => (b -> c) -> (a -> b) -> a -> c #

(.#) :: Coercible * b a => (b -> c) -> (a -> b) -> a -> c #

Profunctor ReifiedGetter 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible * b a => ReifiedGetter b c -> (a -> b) -> ReifiedGetter a c #

Profunctor ReifiedFold 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible * b a => ReifiedFold b c -> (a -> b) -> ReifiedFold a c #

Monad m => Profunctor (Kleisli m) 

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c #

(#.) :: Coercible * c b => (b -> c) -> Kleisli m a b -> Kleisli m a c #

(.#) :: Coercible * b a => Kleisli m b c -> (a -> b) -> Kleisli m a c #

Functor w => Profunctor (Cokleisli w) 

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d #

lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c #

rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

(#.) :: Coercible * c b => (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

(.#) :: Coercible * b a => Cokleisli w b c -> (a -> b) -> Cokleisli w a c #

Profunctor (ReifiedIndexedGetter i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible * b a => ReifiedIndexedGetter i b c -> (a -> b) -> ReifiedIndexedGetter i a c #

Profunctor (ReifiedIndexedFold i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible * b a => ReifiedIndexedFold i b c -> (a -> b) -> ReifiedIndexedFold i a c #

Profunctor (Indexed i) 

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c #

(#.) :: Coercible * c b => (b -> c) -> Indexed i a b -> Indexed i a c #

(.#) :: Coercible * b a => Indexed i b c -> (a -> b) -> Indexed i a c #

Profunctor p => Profunctor (TambaraSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d #

lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c #

rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c #

(#.) :: Coercible * c b => (b -> c) -> TambaraSum p a b -> TambaraSum p a c #

(.#) :: Coercible * b a => TambaraSum p b c -> (a -> b) -> TambaraSum p a c #

Profunctor (PastroSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d #

lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c #

rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c #

(#.) :: Coercible * c b => (b -> c) -> PastroSum p a b -> PastroSum p a c #

(.#) :: Coercible * b a => PastroSum p b c -> (a -> b) -> PastroSum p a c #

Profunctor (CotambaraSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d #

lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c #

rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c #

(#.) :: Coercible * c b => (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c #

(.#) :: Coercible * b a => CotambaraSum p b c -> (a -> b) -> CotambaraSum p a c #

Profunctor (CopastroSum p) 

Methods

dimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d #

lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c #

rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c #

(#.) :: Coercible * c b => (b -> c) -> CopastroSum p a b -> CopastroSum p a c #

(.#) :: Coercible * b a => CopastroSum p b c -> (a -> b) -> CopastroSum p a c #

Profunctor p => Profunctor (Tambara p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d #

lmap :: (a -> b) -> Tambara p b c -> Tambara p a c #

rmap :: (b -> c) -> Tambara p a b -> Tambara p a c #

(#.) :: Coercible * c b => (b -> c) -> Tambara p a b -> Tambara p a c #

(.#) :: Coercible * b a => Tambara p b c -> (a -> b) -> Tambara p a c #

Profunctor (Pastro p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d #

lmap :: (a -> b) -> Pastro p b c -> Pastro p a c #

rmap :: (b -> c) -> Pastro p a b -> Pastro p a c #

(#.) :: Coercible * c b => (b -> c) -> Pastro p a b -> Pastro p a c #

(.#) :: Coercible * b a => Pastro p b c -> (a -> b) -> Pastro p a c #

Profunctor (Cotambara p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d #

lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c #

rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c #

(#.) :: Coercible * c b => (b -> c) -> Cotambara p a b -> Cotambara p a c #

(.#) :: Coercible * b a => Cotambara p b c -> (a -> b) -> Cotambara p a c #

Profunctor (Copastro p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d #

lmap :: (a -> b) -> Copastro p b c -> Copastro p a c #

rmap :: (b -> c) -> Copastro p a b -> Copastro p a c #

(#.) :: Coercible * c b => (b -> c) -> Copastro p a b -> Copastro p a c #

(.#) :: Coercible * b a => Copastro p b c -> (a -> b) -> Copastro p a c #

Functor f => Profunctor (Star f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

(#.) :: Coercible * c b => (b -> c) -> Star f a b -> Star f a c #

(.#) :: Coercible * b a => Star f b c -> (a -> b) -> Star f a c #

Functor f => Profunctor (Costar f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

(#.) :: Coercible * c b => (b -> c) -> Costar f a b -> Costar f a c #

(.#) :: Coercible * b a => Costar f b c -> (a -> b) -> Costar f a c #

Arrow p => Profunctor (WrappedArrow p) 

Methods

dimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d #

lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c #

rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c #

(#.) :: Coercible * c b => (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c #

(.#) :: Coercible * b a => WrappedArrow p b c -> (a -> b) -> WrappedArrow p a c #

Profunctor (Forget r) 

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d #

lmap :: (a -> b) -> Forget r b c -> Forget r a c #

rmap :: (b -> c) -> Forget r a b -> Forget r a c #

(#.) :: Coercible * c b => (b -> c) -> Forget r a b -> Forget r a c #

(.#) :: Coercible * b a => Forget r b c -> (a -> b) -> Forget r a c #

Profunctor (Tagged *) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged * b c -> Tagged * a d #

lmap :: (a -> b) -> Tagged * b c -> Tagged * a c #

rmap :: (b -> c) -> Tagged * a b -> Tagged * a c #

(#.) :: Coercible * c b => (b -> c) -> Tagged * a b -> Tagged * a c #

(.#) :: Coercible * b a => Tagged * b c -> (a -> b) -> Tagged * a c #

Profunctor (Exchange a b) 

Methods

dimap :: (a -> b) -> (c -> d) -> Exchange a b b c -> Exchange a b a d #

lmap :: (a -> b) -> Exchange a b b c -> Exchange a b a c #

rmap :: (b -> c) -> Exchange a b a b -> Exchange a b a c #

(#.) :: Coercible * c b => (b -> c) -> Exchange a b a b -> Exchange a b a c #

(.#) :: Coercible * b a => Exchange a b b c -> (a -> b) -> Exchange a b a c #

Functor f => Profunctor (Joker * * f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Joker * * f b c -> Joker * * f a d #

lmap :: (a -> b) -> Joker * * f b c -> Joker * * f a c #

rmap :: (b -> c) -> Joker * * f a b -> Joker * * f a c #

(#.) :: Coercible * c b => (b -> c) -> Joker * * f a b -> Joker * * f a c #

(.#) :: Coercible * b a => Joker * * f b c -> (a -> b) -> Joker * * f a c #

Contravariant f => Profunctor (Clown * * f) 

Methods

dimap :: (a -> b) -> (c -> d) -> Clown * * f b c -> Clown * * f a d #

lmap :: (a -> b) -> Clown * * f b c -> Clown * * f a c #

rmap :: (b -> c) -> Clown * * f a b -> Clown * * f a c #

(#.) :: Coercible * c b => (b -> c) -> Clown * * f a b -> Clown * * f a c #

(.#) :: Coercible * b a => Clown * * f b c -> (a -> b) -> Clown * * f a c #

(Profunctor p, Profunctor q) => Profunctor (Product * * p q) 

Methods

dimap :: (a -> b) -> (c -> d) -> Product * * p q b c -> Product * * p q a d #

lmap :: (a -> b) -> Product * * p q b c -> Product * * p q a c #

rmap :: (b -> c) -> Product * * p q a b -> Product * * p q a c #

(#.) :: Coercible * c b => (b -> c) -> Product * * p q a b -> Product * * p q a c #

(.#) :: Coercible * b a => Product * * p q b c -> (a -> b) -> Product * * p q a c #

(Functor f, Profunctor p) => Profunctor (Tannen * * * f p) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tannen * * * f p b c -> Tannen * * * f p a d #

lmap :: (a -> b) -> Tannen * * * f p b c -> Tannen * * * f p a c #

rmap :: (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(#.) :: Coercible * c b => (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(.#) :: Coercible * b a => Tannen * * * f p b c -> (a -> b) -> Tannen * * * f p a c #

(Profunctor p, Functor f, Functor g) => Profunctor (Biff * * * * p f g) 

Methods

dimap :: (a -> b) -> (c -> d) -> Biff * * * * p f g b c -> Biff * * * * p f g a d #

lmap :: (a -> b) -> Biff * * * * p f g b c -> Biff * * * * p f g a c #

rmap :: (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

(#.) :: Coercible * c b => (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

(.#) :: Coercible * b a => Biff * * * * p f g b c -> (a -> b) -> Biff * * * * p f g a c #

newtype ReifiedFold s a :: * -> * -> * #

Reify a Fold so it can be stored safely in a container.

This can also be useful for creatively combining folds as ReifiedFold s is isomorphic to ReaderT s [] and provides similar instances.

>>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]

Constructors

Fold 

Fields

Instances

Arrow ReifiedFold 

Methods

arr :: (b -> c) -> ReifiedFold b c #

first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) #

second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) #

(***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') #

(&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') #

ArrowChoice ReifiedFold 

Methods

left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) #

right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) #

(+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') #

(|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d #

ArrowApply ReifiedFold 

Methods

app :: ReifiedFold (ReifiedFold b c, b) c #

Representable ReifiedFold 

Associated Types

type Rep (ReifiedFold :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c #

Profunctor ReifiedFold 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible * b a => ReifiedFold b c -> (a -> b) -> ReifiedFold a c #

Choice ReifiedFold 

Methods

left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) #

right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) #

Strong ReifiedFold 

Methods

first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) #

second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) #

Sieve ReifiedFold [] 

Methods

sieve :: ReifiedFold a b -> a -> [b] #

MonadReader s (ReifiedFold s) 

Methods

ask :: ReifiedFold s s #

local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a #

reader :: (s -> a) -> ReifiedFold s a #

Monad (ReifiedFold s) 

Methods

(>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

(>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

return :: a -> ReifiedFold s a #

fail :: String -> ReifiedFold s a #

Functor (ReifiedFold s) 

Methods

fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(<$) :: a -> ReifiedFold s b -> ReifiedFold s a #

Applicative (ReifiedFold s) 

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Alternative (ReifiedFold s) 

Methods

empty :: ReifiedFold s a #

(<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

some :: ReifiedFold s a -> ReifiedFold s [a] #

many :: ReifiedFold s a -> ReifiedFold s [a] #

MonadPlus (ReifiedFold s) 

Methods

mzero :: ReifiedFold s a #

mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

Plus (ReifiedFold s) 

Methods

zero :: ReifiedFold s a #

Alt (ReifiedFold s) 
Apply (ReifiedFold s) 

Methods

(<.>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(.>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<.) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Bind (ReifiedFold s) 

Methods

(>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a #

Category * ReifiedFold 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Semigroup (ReifiedFold s a) 

Methods

(<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a #

stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a #

Monoid (ReifiedFold s a) 

Methods

mempty :: ReifiedFold s a #

mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

mconcat :: [ReifiedFold s a] -> ReifiedFold s a #

type Rep ReifiedFold 
type Rep ReifiedFold = []

newtype ReifiedFold s a :: * -> * -> * #

Reify a Fold so it can be stored safely in a container.

This can also be useful for creatively combining folds as ReifiedFold s is isomorphic to ReaderT s [] and provides similar instances.

>>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]

Constructors

Fold 

Fields

Instances

Arrow ReifiedFold 

Methods

arr :: (b -> c) -> ReifiedFold b c #

first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) #

second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) #

(***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') #

(&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') #

ArrowChoice ReifiedFold 

Methods

left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) #

right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) #

(+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') #

(|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d #

ArrowApply ReifiedFold 

Methods

app :: ReifiedFold (ReifiedFold b c, b) c #

Representable ReifiedFold 

Associated Types

type Rep (ReifiedFold :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c #

Profunctor ReifiedFold 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible * b a => ReifiedFold b c -> (a -> b) -> ReifiedFold a c #

Choice ReifiedFold 

Methods

left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) #

right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) #

Strong ReifiedFold 

Methods

first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) #

second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) #

Sieve ReifiedFold [] 

Methods

sieve :: ReifiedFold a b -> a -> [b] #

MonadReader s (ReifiedFold s) 

Methods

ask :: ReifiedFold s s #

local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a #

reader :: (s -> a) -> ReifiedFold s a #

Monad (ReifiedFold s) 

Methods

(>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

(>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

return :: a -> ReifiedFold s a #

fail :: String -> ReifiedFold s a #

Functor (ReifiedFold s) 

Methods

fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(<$) :: a -> ReifiedFold s b -> ReifiedFold s a #

Applicative (ReifiedFold s) 

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Alternative (ReifiedFold s) 

Methods

empty :: ReifiedFold s a #

(<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

some :: ReifiedFold s a -> ReifiedFold s [a] #

many :: ReifiedFold s a -> ReifiedFold s [a] #

MonadPlus (ReifiedFold s) 

Methods

mzero :: ReifiedFold s a #

mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

Plus (ReifiedFold s) 

Methods

zero :: ReifiedFold s a #

Alt (ReifiedFold s) 
Apply (ReifiedFold s) 

Methods

(<.>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(.>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<.) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Bind (ReifiedFold s) 

Methods

(>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a #

Category * ReifiedFold 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Semigroup (ReifiedFold s a) 

Methods

(<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a #

stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a #

Monoid (ReifiedFold s a) 

Methods

mempty :: ReifiedFold s a #

mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

mconcat :: [ReifiedFold s a] -> ReifiedFold s a #

type Rep ReifiedFold 
type Rep ReifiedFold = []

newtype ReifiedGetter s a :: * -> * -> * #

Reify a Getter so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as ReifiedGetter is isomorphic to '(->)' and provides similar instances.

>>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
("world",5)

Constructors

Getter 

Fields

Instances

Arrow ReifiedGetter 

Methods

arr :: (b -> c) -> ReifiedGetter b c #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') #

ArrowChoice ReifiedGetter 

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d #

ArrowApply ReifiedGetter 

Methods

app :: ReifiedGetter (ReifiedGetter b c, b) c #

ArrowLoop ReifiedGetter 

Methods

loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c #

Representable ReifiedGetter 

Associated Types

type Rep (ReifiedGetter :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep ReifiedGetter c) -> ReifiedGetter d c #

Corepresentable ReifiedGetter 

Associated Types

type Corep (ReifiedGetter :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep ReifiedGetter d -> c) -> ReifiedGetter d c #

Conjoined ReifiedGetter 

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) #

conjoined :: (((* -> * -> *) ~ ReifiedGetter) (->) -> q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r #

Profunctor ReifiedGetter 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible * b a => ReifiedGetter b c -> (a -> b) -> ReifiedGetter a c #

Choice ReifiedGetter 

Methods

left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) #

right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) #

Closed ReifiedGetter 

Methods

closed :: ReifiedGetter a b -> ReifiedGetter (x -> a) (x -> b) #

Strong ReifiedGetter 

Methods

first' :: ReifiedGetter a b -> ReifiedGetter (a, c) (b, c) #

second' :: ReifiedGetter a b -> ReifiedGetter (c, a) (c, b) #

Costrong ReifiedGetter 

Methods

unfirst :: ReifiedGetter (a, d) (b, d) -> ReifiedGetter a b #

unsecond :: ReifiedGetter (d, a) (d, b) -> ReifiedGetter a b #

Sieve ReifiedGetter Identity 

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

Cosieve ReifiedGetter Identity 

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

MonadReader s (ReifiedGetter s) 

Methods

ask :: ReifiedGetter s s #

local :: (s -> s) -> ReifiedGetter s a -> ReifiedGetter s a #

reader :: (s -> a) -> ReifiedGetter s a #

Monad (ReifiedGetter s) 

Methods

(>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

(>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

return :: a -> ReifiedGetter s a #

fail :: String -> ReifiedGetter s a #

Functor (ReifiedGetter s) 

Methods

fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a #

Applicative (ReifiedGetter s) 

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Distributive (ReifiedGetter s) 

Methods

distribute :: Functor f => f (ReifiedGetter s a) -> ReifiedGetter s (f a) #

collect :: Functor f => (a -> ReifiedGetter s b) -> f a -> ReifiedGetter s (f b) #

distributeM :: Monad m => m (ReifiedGetter s a) -> ReifiedGetter s (m a) #

collectM :: Monad m => (a -> ReifiedGetter s b) -> m a -> ReifiedGetter s (m b) #

Monoid s => Comonad (ReifiedGetter s) 
Monoid s => ComonadApply (ReifiedGetter s) 

Methods

(<@>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(@>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<@) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Apply (ReifiedGetter s) 

Methods

(<.>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(.>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<.) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Bind (ReifiedGetter s) 

Methods

(>>-) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

join :: ReifiedGetter s (ReifiedGetter s a) -> ReifiedGetter s a #

Semigroup s => Extend (ReifiedGetter s) 
Category * ReifiedGetter 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

type Rep ReifiedGetter 
type Corep ReifiedGetter 

newtype ReifiedGetter s a :: * -> * -> * #

Reify a Getter so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as ReifiedGetter is isomorphic to '(->)' and provides similar instances.

>>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
("world",5)

Constructors

Getter 

Fields

Instances

Arrow ReifiedGetter 

Methods

arr :: (b -> c) -> ReifiedGetter b c #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') #

ArrowChoice ReifiedGetter 

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d #

ArrowApply ReifiedGetter 

Methods

app :: ReifiedGetter (ReifiedGetter b c, b) c #

ArrowLoop ReifiedGetter 

Methods

loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c #

Representable ReifiedGetter 

Associated Types

type Rep (ReifiedGetter :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep ReifiedGetter c) -> ReifiedGetter d c #

Corepresentable ReifiedGetter 

Associated Types

type Corep (ReifiedGetter :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep ReifiedGetter d -> c) -> ReifiedGetter d c #

Conjoined ReifiedGetter 

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) #

conjoined :: (((* -> * -> *) ~ ReifiedGetter) (->) -> q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r #

Profunctor ReifiedGetter 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible * b a => ReifiedGetter b c -> (a -> b) -> ReifiedGetter a c #

Choice ReifiedGetter 

Methods

left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) #

right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) #

Closed ReifiedGetter 

Methods

closed :: ReifiedGetter a b -> ReifiedGetter (x -> a) (x -> b) #

Strong ReifiedGetter 

Methods

first' :: ReifiedGetter a b -> ReifiedGetter (a, c) (b, c) #

second' :: ReifiedGetter a b -> ReifiedGetter (c, a) (c, b) #

Costrong ReifiedGetter 

Methods

unfirst :: ReifiedGetter (a, d) (b, d) -> ReifiedGetter a b #

unsecond :: ReifiedGetter (d, a) (d, b) -> ReifiedGetter a b #

Sieve ReifiedGetter Identity 

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

Cosieve ReifiedGetter Identity 

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

MonadReader s (ReifiedGetter s) 

Methods

ask :: ReifiedGetter s s #

local :: (s -> s) -> ReifiedGetter s a -> ReifiedGetter s a #

reader :: (s -> a) -> ReifiedGetter s a #

Monad (ReifiedGetter s) 

Methods

(>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

(>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

return :: a -> ReifiedGetter s a #

fail :: String -> ReifiedGetter s a #

Functor (ReifiedGetter s) 

Methods

fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a #

Applicative (ReifiedGetter s) 

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Distributive (ReifiedGetter s) 

Methods

distribute :: Functor f => f (ReifiedGetter s a) -> ReifiedGetter s (f a) #

collect :: Functor f => (a -> ReifiedGetter s b) -> f a -> ReifiedGetter s (f b) #

distributeM :: Monad m => m (ReifiedGetter s a) -> ReifiedGetter s (m a) #

collectM :: Monad m => (a -> ReifiedGetter s b) -> m a -> ReifiedGetter s (m b) #

Monoid s => Comonad (ReifiedGetter s) 
Monoid s => ComonadApply (ReifiedGetter s) 

Methods

(<@>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(@>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<@) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Apply (ReifiedGetter s) 

Methods

(<.>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(.>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<.) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Bind (ReifiedGetter s) 

Methods

(>>-) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

join :: ReifiedGetter s (ReifiedGetter s a) -> ReifiedGetter s a #

Semigroup s => Extend (ReifiedGetter s) 
Category * ReifiedGetter 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

type Rep ReifiedGetter 
type Corep ReifiedGetter 

newtype ReifiedIndexedFold i s a :: * -> * -> * -> * #

Constructors

IndexedFold 

Fields

Instances

Representable (ReifiedIndexedFold i) 

Associated Types

type Rep (ReifiedIndexedFold i :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c #

Profunctor (ReifiedIndexedFold i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible * b a => ReifiedIndexedFold i b c -> (a -> b) -> ReifiedIndexedFold i a c #

Strong (ReifiedIndexedFold i) 

Methods

first' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (a, c) (b, c) #

second' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (c, a) (c, b) #

Sieve (ReifiedIndexedFold i) (Compose * * [] ((,) i)) 

Methods

sieve :: ReifiedIndexedFold i a b -> a -> Compose * * [] ((,) i) b #

Functor (ReifiedIndexedFold i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b #

(<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a #

Plus (ReifiedIndexedFold i s) 

Methods

zero :: ReifiedIndexedFold i s a #

Alt (ReifiedIndexedFold i s) 
Semigroup (ReifiedIndexedFold i s a) 
Monoid (ReifiedIndexedFold i s a) 
type Rep (ReifiedIndexedFold i) 
type Rep (ReifiedIndexedFold i) = Compose * * [] ((,) i)

newtype ReifiedIndexedFold i s a :: * -> * -> * -> * #

Constructors

IndexedFold 

Fields

Instances

Representable (ReifiedIndexedFold i) 

Associated Types

type Rep (ReifiedIndexedFold i :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c #

Profunctor (ReifiedIndexedFold i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible * b a => ReifiedIndexedFold i b c -> (a -> b) -> ReifiedIndexedFold i a c #

Strong (ReifiedIndexedFold i) 

Methods

first' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (a, c) (b, c) #

second' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (c, a) (c, b) #

Sieve (ReifiedIndexedFold i) (Compose * * [] ((,) i)) 

Methods

sieve :: ReifiedIndexedFold i a b -> a -> Compose * * [] ((,) i) b #

Functor (ReifiedIndexedFold i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b #

(<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a #

Plus (ReifiedIndexedFold i s) 

Methods

zero :: ReifiedIndexedFold i s a #

Alt (ReifiedIndexedFold i s) 
Semigroup (ReifiedIndexedFold i s a) 
Monoid (ReifiedIndexedFold i s a) 
type Rep (ReifiedIndexedFold i) 
type Rep (ReifiedIndexedFold i) = Compose * * [] ((,) i)

newtype ReifiedIndexedGetter i s a :: * -> * -> * -> * #

Reify an IndexedGetter so it can be stored safely in a container.

Constructors

IndexedGetter 

Instances

Representable (ReifiedIndexedGetter i) 

Associated Types

type Rep (ReifiedIndexedGetter i :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c #

Profunctor (ReifiedIndexedGetter i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible * b a => ReifiedIndexedGetter i b c -> (a -> b) -> ReifiedIndexedGetter i a c #

Strong (ReifiedIndexedGetter i) 

Methods

first' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (a, c) (b, c) #

second' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (c, a) (c, b) #

Sieve (ReifiedIndexedGetter i) ((,) i) 

Methods

sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) #

Functor (ReifiedIndexedGetter i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b #

(<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a #

Semigroup i => Apply (ReifiedIndexedGetter i s) 
type Rep (ReifiedIndexedGetter i) 

newtype ReifiedIndexedGetter i s a :: * -> * -> * -> * #

Reify an IndexedGetter so it can be stored safely in a container.

Constructors

IndexedGetter 

Instances

Representable (ReifiedIndexedGetter i) 

Associated Types

type Rep (ReifiedIndexedGetter i :: * -> * -> *) :: * -> * #

Methods

tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c #

Profunctor (ReifiedIndexedGetter i) 

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible * c b => (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible * b a => ReifiedIndexedGetter i b c -> (a -> b) -> ReifiedIndexedGetter i a c #

Strong (ReifiedIndexedGetter i) 

Methods

first' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (a, c) (b, c) #

second' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (c, a) (c, b) #

Sieve (ReifiedIndexedGetter i) ((,) i) 

Methods

sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) #

Functor (ReifiedIndexedGetter i s) 

Methods

fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b #

(<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a #

Semigroup i => Apply (ReifiedIndexedGetter i s) 
type Rep (ReifiedIndexedGetter i) 

newtype ReifiedIndexedLens i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedLens so it can be stored safely in a container.

Constructors

IndexedLens 

Fields

newtype ReifiedIndexedLens i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedLens so it can be stored safely in a container.

Constructors

IndexedLens 

Fields

newtype ReifiedIndexedSetter i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedSetter so it can be stored safely in a container.

Constructors

IndexedSetter 

Fields

newtype ReifiedIndexedSetter i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedSetter so it can be stored safely in a container.

Constructors

IndexedSetter 

Fields

newtype ReifiedIndexedTraversal i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedTraversal so it can be stored safely in a container.

Constructors

IndexedTraversal 

newtype ReifiedIndexedTraversal i s t a b :: * -> * -> * -> * -> * -> * #

Reify an IndexedTraversal so it can be stored safely in a container.

Constructors

IndexedTraversal 

newtype ReifiedIso s t a b :: * -> * -> * -> * -> * #

Reify an Iso so it can be stored safely in a container.

Constructors

Iso 

Fields

newtype ReifiedIso s t a b :: * -> * -> * -> * -> * #

Reify an Iso so it can be stored safely in a container.

Constructors

Iso 

Fields

newtype ReifiedLens s t a b :: * -> * -> * -> * -> * #

Reify a Lens so it can be stored safely in a container.

Constructors

Lens 

Fields

newtype ReifiedLens s t a b :: * -> * -> * -> * -> * #

Reify a Lens so it can be stored safely in a container.

Constructors

Lens 

Fields

newtype ReifiedPrism s t a b :: * -> * -> * -> * -> * #

Reify a Prism so it can be stored safely in a container.

Constructors

Prism 

Fields

newtype ReifiedPrism s t a b :: * -> * -> * -> * -> * #

Reify a Prism so it can be stored safely in a container.

Constructors

Prism 

Fields

newtype ReifiedSetter s t a b :: * -> * -> * -> * -> * #

Reify a Setter so it can be stored safely in a container.

Constructors

Setter 

Fields

newtype ReifiedSetter s t a b :: * -> * -> * -> * -> * #

Reify a Setter so it can be stored safely in a container.

Constructors

Setter 

Fields

newtype ReifiedTraversal s t a b :: * -> * -> * -> * -> * #

A form of Traversal that can be stored monomorphically in a container.

Constructors

Traversal 

Fields

newtype ReifiedTraversal s t a b :: * -> * -> * -> * -> * #

A form of Traversal that can be stored monomorphically in a container.

Constructors

Traversal 

Fields

class Reversing t where #

This class provides a generalized notion of list reversal extended to other containers.

Minimal complete definition

reversing

Methods

reversing :: t -> t #

Instances

Reversing ByteString 
Reversing ByteString 
Reversing Text 

Methods

reversing :: Text -> Text #

Reversing Text 

Methods

reversing :: Text -> Text #

Reversing [a] 

Methods

reversing :: [a] -> [a] #

Reversing (NonEmpty a) 

Methods

reversing :: NonEmpty a -> NonEmpty a #

Reversing (Seq a) 

Methods

reversing :: Seq a -> Seq a #

Reversing (Vector a) 

Methods

reversing :: Vector a -> Vector a #

Prim a => Reversing (Vector a) 

Methods

reversing :: Vector a -> Vector a #

Storable a => Reversing (Vector a) 

Methods

reversing :: Vector a -> Vector a #

Unbox a => Reversing (Vector a) 

Methods

reversing :: Vector a -> Vector a #

type Review t b = forall p f. (Choice p, Bifunctor p, Settable f) => Optic' * * p f t b #

This is a limited form of a Prism that can only be used for re operations.

Like with a Getter, there are no laws to state for a Review.

You can generate a Review by using unto. You can also use any Prism or Iso directly as a Review.

class Wrapped s where #

Wrapped provides isomorphisms to wrap and unwrap newtypes or data types with one constructor.

Associated Types

type Unwrapped s :: * #

Methods

_Wrapped' :: Iso' s (Unwrapped s) #

An isomorphism between s and a.

Instances

Wrapped PatternMatchFail 
Wrapped RecSelError 

Associated Types

type Unwrapped RecSelError :: * #

Wrapped RecConError 

Associated Types

type Unwrapped RecConError :: * #

Wrapped RecUpdError 

Associated Types

type Unwrapped RecUpdError :: * #

Wrapped NoMethodError 
Wrapped AssertionFailed 
Wrapped All 

Associated Types

type Unwrapped All :: * #

Wrapped Any 

Associated Types

type Unwrapped Any :: * #

Wrapped ErrorCall 

Associated Types

type Unwrapped ErrorCall :: * #

Wrapped IntSet 

Associated Types

type Unwrapped IntSet :: * #

Wrapped (Identity a) 

Associated Types

type Unwrapped (Identity a) :: * #

Wrapped (Min a) 

Associated Types

type Unwrapped (Min a) :: * #

Methods

_Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) #

Wrapped (Max a) 

Associated Types

type Unwrapped (Max a) :: * #

Methods

_Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (WrappedMonoid a) 

Associated Types

type Unwrapped (WrappedMonoid a) :: * #

Wrapped (Option a) 

Associated Types

type Unwrapped (Option a) :: * #

Methods

_Wrapped' :: Iso' (Option a) (Unwrapped (Option a)) #

Wrapped (NonEmpty a) 

Associated Types

type Unwrapped (NonEmpty a) :: * #

Wrapped (ZipList a) 

Associated Types

type Unwrapped (ZipList a) :: * #

Methods

_Wrapped' :: Iso' (ZipList a) (Unwrapped (ZipList a)) #

Wrapped (Dual a) 

Associated Types

type Unwrapped (Dual a) :: * #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

Wrapped (Endo a) 

Associated Types

type Unwrapped (Endo a) :: * #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

Wrapped (Sum a) 

Associated Types

type Unwrapped (Sum a) :: * #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

Wrapped (Product a) 

Associated Types

type Unwrapped (Product a) :: * #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (Down a) 

Associated Types

type Unwrapped (Down a) :: * #

Methods

_Wrapped' :: Iso' (Down a) (Unwrapped (Down a)) #

Wrapped (IntMap a) 

Associated Types

type Unwrapped (IntMap a) :: * #

Methods

_Wrapped' :: Iso' (IntMap a) (Unwrapped (IntMap a)) #

Wrapped (Seq a) 

Associated Types

type Unwrapped (Seq a) :: * #

Methods

_Wrapped' :: Iso' (Seq a) (Unwrapped (Seq a)) #

Ord a => Wrapped (Set a) 

Associated Types

type Unwrapped (Set a) :: * #

Methods

_Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) #

Wrapped (Predicate a) 

Associated Types

type Unwrapped (Predicate a) :: * #

Wrapped (Comparison a) 

Associated Types

type Unwrapped (Comparison a) :: * #

Wrapped (Equivalence a) 

Associated Types

type Unwrapped (Equivalence a) :: * #

Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Prim a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Storable a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Unbox a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

(Hashable a, Eq a) => Wrapped (HashSet a) 

Associated Types

type Unwrapped (HashSet a) :: * #

Methods

_Wrapped' :: Iso' (HashSet a) (Unwrapped (HashSet a)) #

Wrapped (Op a b) 

Associated Types

type Unwrapped (Op a b) :: * #

Methods

_Wrapped' :: Iso' (Op a b) (Unwrapped (Op a b)) #

(Hashable k, Eq k) => Wrapped (HashMap k a) 

Associated Types

type Unwrapped (HashMap k a) :: * #

Methods

_Wrapped' :: Iso' (HashMap k a) (Unwrapped (HashMap k a)) #

Ord k => Wrapped (Map k a) 

Associated Types

type Unwrapped (Map k a) :: * #

Methods

_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) #

Wrapped (WrappedMonad m a) 

Associated Types

type Unwrapped (WrappedMonad m a) :: * #

Wrapped (ArrowMonad m a) 

Associated Types

type Unwrapped (ArrowMonad m a) :: * #

Methods

_Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) #

Wrapped (ListT m a) 

Associated Types

type Unwrapped (ListT m a) :: * #

Methods

_Wrapped' :: Iso' (ListT m a) (Unwrapped (ListT m a)) #

Wrapped (MaybeT m a) 

Associated Types

type Unwrapped (MaybeT m a) :: * #

Methods

_Wrapped' :: Iso' (MaybeT m a) (Unwrapped (MaybeT m a)) #

Wrapped (WrappedArrow a b c) 

Associated Types

type Unwrapped (WrappedArrow a b c) :: * #

Methods

_Wrapped' :: Iso' (WrappedArrow a b c) (Unwrapped (WrappedArrow a b c)) #

Wrapped (Kleisli m a b) 

Associated Types

type Unwrapped (Kleisli m a b) :: * #

Methods

_Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) #

Wrapped (Const k a x) 

Associated Types

type Unwrapped (Const k a x) :: * #

Methods

_Wrapped' :: Iso' (Const k a x) (Unwrapped (Const k a x)) #

Wrapped (Alt k f a) 

Associated Types

type Unwrapped (Alt k f a) :: * #

Methods

_Wrapped' :: Iso' (Alt k f a) (Unwrapped (Alt k f a)) #

Wrapped (TracedT m w a) 

Associated Types

type Unwrapped (TracedT m w a) :: * #

Methods

_Wrapped' :: Iso' (TracedT m w a) (Unwrapped (TracedT m w a)) #

Wrapped (IdentityT k m a) 

Associated Types

type Unwrapped (IdentityT k m a) :: * #

Methods

_Wrapped' :: Iso' (IdentityT k m a) (Unwrapped (IdentityT k m a)) #

Wrapped (Compose f g a) 

Associated Types

type Unwrapped (Compose f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) #

Wrapped (ComposeFC f g a) 

Associated Types

type Unwrapped (ComposeFC f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeFC f g a) (Unwrapped (ComposeFC f g a)) #

Wrapped (ComposeCF f g a) 

Associated Types

type Unwrapped (ComposeCF f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeCF f g a) (Unwrapped (ComposeCF f g a)) #

Wrapped (Backwards k f a) 

Associated Types

type Unwrapped (Backwards k f a) :: * #

Methods

_Wrapped' :: Iso' (Backwards k f a) (Unwrapped (Backwards k f a)) #

Wrapped (ErrorT e m a) 

Associated Types

type Unwrapped (ErrorT e m a) :: * #

Methods

_Wrapped' :: Iso' (ErrorT e m a) (Unwrapped (ErrorT e m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (Tagged k s a) 

Associated Types

type Unwrapped (Tagged k s a) :: * #

Methods

_Wrapped' :: Iso' (Tagged k s a) (Unwrapped (Tagged k s a)) #

Wrapped (Reverse k f a) 

Associated Types

type Unwrapped (Reverse k f a) :: * #

Methods

_Wrapped' :: Iso' (Reverse k f a) (Unwrapped (Reverse k f a)) #

Wrapped (Constant k a b) 

Associated Types

type Unwrapped (Constant k a b) :: * #

Methods

_Wrapped' :: Iso' (Constant k a b) (Unwrapped (Constant k a b)) #

Wrapped (ContT k r m a) 

Associated Types

type Unwrapped (ContT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ContT k r m a) (Unwrapped (ContT k r m a)) #

Wrapped (ReaderT k r m a) 

Associated Types

type Unwrapped (ReaderT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ReaderT k r m a) (Unwrapped (ReaderT k r m a)) #

Wrapped (Compose k k1 f g a) 

Associated Types

type Unwrapped (Compose k k1 f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose k k1 f g a) (Unwrapped (Compose k k1 f g a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

data Rightmost a :: * -> * #

Used for lastOf.

data Sequenced a m :: * -> (* -> *) -> * #

Used internally by mapM_ and the like.

The argument a of the result should not be used!

Instances

Apply m => Semigroup (Sequenced a m) 

Methods

(<>) :: Sequenced a m -> Sequenced a m -> Sequenced a m #

sconcat :: NonEmpty (Sequenced a m) -> Sequenced a m #

stimes :: Integral b => b -> Sequenced a m -> Sequenced a m #

Monad m => Monoid (Sequenced a m) 

Methods

mempty :: Sequenced a m #

mappend :: Sequenced a m -> Sequenced a m -> Sequenced a m #

mconcat :: [Sequenced a m] -> Sequenced a m #

data Sequenced a m :: * -> (* -> *) -> * #

Used internally by mapM_ and the like.

The argument a of the result should not be used!

Instances

Apply m => Semigroup (Sequenced a m) 

Methods

(<>) :: Sequenced a m -> Sequenced a m -> Sequenced a m #

sconcat :: NonEmpty (Sequenced a m) -> Sequenced a m #

stimes :: Integral b => b -> Sequenced a m -> Sequenced a m #

Monad m => Monoid (Sequenced a m) 

Methods

mempty :: Sequenced a m #

mappend :: Sequenced a m -> Sequenced a m -> Sequenced a m #

mconcat :: [Sequenced a m] -> Sequenced a m #

type Setter s t a b = forall f. Settable f => (a -> f b) -> s -> f t #

The only LensLike law that can apply to a Setter l is that

set l y (set l x a) ≡ set l y a

You can't view a Setter in general, so the other two laws are irrelevant.

However, two Functor laws apply to a Setter:

over l idid
over l f . over l g ≡ over l (f . g)

These can be stated more directly:

l purepure
l f . untainted . l g ≡ l (f . untainted . g)

You can compose a Setter with a Lens or a Traversal using (.) from the Prelude and the result is always only a Setter and nothing more.

>>> over traverse f [a,b,c,d]
[f a,f b,f c,f d]
>>> over _1 f (a,b)
(f a,b)
>>> over (traverse._1) f [(a,b),(c,d)]
[(f a,b),(f c,d)]
>>> over both f (a,b)
(f a,f b)
>>> over (traverse.both) f [(a,b),(c,d)]
[(f a,f b),(f c,f d)]

type Setter' s a = Setter s s a a #

A Setter' is just a Setter that doesn't change the types.

These are particularly common when talking about monomorphic containers. e.g.

sets Data.Text.map :: Setter' Text Char
type Setter' = Setter'

type Setting p s t a b = p a (Identity b) -> s -> Identity t #

This is a convenient alias when defining highly polymorphic code that takes both ASetter and AnIndexedSetter as appropriate. If a function takes this it is expecting one of those two things based on context.

type Setting' p s a = Setting p s s a a #

This is a convenient alias when defining highly polymorphic code that takes both ASetter' and AnIndexedSetter' as appropriate. If a function takes this it is expecting one of those two things based on context.

type Simple k k1 k2 f s a = f s s a a #

A Simple Lens, Simple Traversal, ... can be used instead of a Lens,Traversal, ... whenever the type variables don't change upon setting a value.

_imagPart :: Simple Lens (Complex a) a
traversed :: Simple (IndexedTraversal Int) [a] a

Note: To use this alias in your own code with LensLike f or Setter, you may have to turn on LiberalTypeSynonyms.

This is commonly abbreviated as a "prime" marker, e.g. Lens' = Simple Lens.

class Snoc s t a b | s -> a, t -> b, s b -> t, t a -> s where #

This class provides a way to attach or detach elements on the right side of a structure in a flexible manner.

Methods

_Snoc :: Prism s t (s, a) (t, b) #

_Snoc :: Prism [a] [b] ([a], a) ([b], b)
_Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b)
_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b)
_Snoc :: Prism' String (String, Char)
_Snoc :: Prism' Text (Text, Char)
_Snoc :: Prism' ByteString (ByteString, Word8)

Instances

Snoc ByteString ByteString Word8 Word8 
Snoc ByteString ByteString Word8 Word8 
Snoc Text Text Char Char 

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Snoc Text Text Char Char 

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Snoc [a] [b] a b 

Methods

_Snoc :: Prism [a] [b] ([a], a) ([b], b) #

Snoc (Seq a) (Seq b) a b 

Methods

_Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b) #

Snoc (Vector a) (Vector b) a b 

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

(Prim a, Prim b) => Snoc (Vector a) (Vector b) a b 

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

(Storable a, Storable b) => Snoc (Vector a) (Vector b) a b 

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

(Unbox a, Unbox b) => Snoc (Vector a) (Vector b) a b 

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

class Strict lazy strict | lazy -> strict, strict -> lazy where #

Ad hoc conversion between "strict" and "lazy" versions of a structure, such as Text or ByteString.

Minimal complete definition

strict

Methods

strict :: Iso' lazy strict #

Instances

Strict ByteString ByteString 
Strict Text Text 

Methods

strict :: Iso' Text Text #

Strict (StateT s m a) (StateT s m a) 

Methods

strict :: Iso' (StateT s m a) (StateT s m a) #

Strict (WriterT w m a) (WriterT w m a) 

Methods

strict :: Iso' (WriterT w m a) (WriterT w m a) #

Strict (RWST r w s m a) (RWST r w s m a) 

Methods

strict :: Iso' (RWST r w s m a) (RWST r w s m a) #

class Strict lazy strict | lazy -> strict, strict -> lazy where #

Ad hoc conversion between "strict" and "lazy" versions of a structure, such as Text or ByteString.

Minimal complete definition

strict

Methods

strict :: Iso' lazy strict #

Instances

Strict ByteString ByteString 
Strict Text Text 

Methods

strict :: Iso' Text Text #

Strict (StateT s m a) (StateT s m a) 

Methods

strict :: Iso' (StateT s m a) (StateT s m a) #

Strict (WriterT w m a) (WriterT w m a) 

Methods

strict :: Iso' (WriterT w m a) (WriterT w m a) #

Strict (RWST r w s m a) (RWST r w s m a) 

Methods

strict :: Iso' (RWST r w s m a) (RWST r w s m a) #

class Bifunctor p => Swapped p #

This class provides for symmetric bifunctors.

Minimal complete definition

swapped

Instances

Swapped Either 

Methods

swapped :: (Profunctor p, Functor f) => p (Either b a) (f (Either d c)) -> p (Either a b) (f (Either c d)) #

Swapped (,) 

Methods

swapped :: (Profunctor p, Functor f) => p (b, a) (f (d, c)) -> p (a, b) (f (c, d)) #

class Bifunctor p where #

Formally, the class Bifunctor represents a bifunctor from Hask -> Hask.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

You can define a Bifunctor by either defining bimap or by defining both first and second.

If you supply bimap, you should ensure that:

bimap id idid

If you supply first and second, ensure:

first idid
second idid

If you supply both, you should also ensure:

bimap f g ≡ first f . second g

These ensure by parametricity:

bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
first  (f . g) ≡ first  f . first  g
second (f . g) ≡ second f . second g

Since: 4.8.0.0

Minimal complete definition

bimap | first, second

Methods

bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #

Map over both arguments at the same time.

bimap f g ≡ first f . second g

Instances

Bifunctor Either 

Methods

bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d #

first :: (a -> b) -> Either a c -> Either b c #

second :: (b -> c) -> Either a b -> Either a c #

Bifunctor (,) 

Methods

bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) #

first :: (a -> b) -> (a, c) -> (b, c) #

second :: (b -> c) -> (a, b) -> (a, c) #

Bifunctor Arg 

Methods

bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d #

first :: (a -> b) -> Arg a c -> Arg b c #

second :: (b -> c) -> Arg a b -> Arg a c #

Bifunctor (K1 i) 

Methods

bimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d #

first :: (a -> b) -> K1 i a c -> K1 i b c #

second :: (b -> c) -> K1 i a b -> K1 i a c #

Bifunctor ((,,) x1) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) #

first :: (a -> b) -> (x1, a, c) -> (x1, b, c) #

second :: (b -> c) -> (x1, a, b) -> (x1, a, c) #

Bifunctor (Const *) 

Methods

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

first :: (a -> b) -> Const * a c -> Const * b c #

second :: (b -> c) -> Const * a b -> Const * a c #

Functor f => Bifunctor (FreeF f) 

Methods

bimap :: (a -> b) -> (c -> d) -> FreeF f a c -> FreeF f b d #

first :: (a -> b) -> FreeF f a c -> FreeF f b c #

second :: (b -> c) -> FreeF f a b -> FreeF f a c #

Functor f => Bifunctor (AlongsideLeft f) 

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideLeft f a c -> AlongsideLeft f b d #

first :: (a -> b) -> AlongsideLeft f a c -> AlongsideLeft f b c #

second :: (b -> c) -> AlongsideLeft f a b -> AlongsideLeft f a c #

Functor f => Bifunctor (AlongsideRight f) 

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideRight f a c -> AlongsideRight f b d #

first :: (a -> b) -> AlongsideRight f a c -> AlongsideRight f b c #

second :: (b -> c) -> AlongsideRight f a b -> AlongsideRight f a c #

Bifunctor (Tagged *) 

Methods

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

first :: (a -> b) -> Tagged * a c -> Tagged * b c #

second :: (b -> c) -> Tagged * a b -> Tagged * a c #

Bifunctor (Constant *) 

Methods

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

first :: (a -> b) -> Constant * a c -> Constant * b c #

second :: (b -> c) -> Constant * a b -> Constant * a c #

Bifunctor ((,,,) x1 x2) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) #

first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) #

second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) #

Bifunctor ((,,,,) x1 x2 x3) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) #

first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) #

second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) #

Bifunctor p => Bifunctor (WrappedBifunctor * * p) 

Methods

bimap :: (a -> b) -> (c -> d) -> WrappedBifunctor * * p a c -> WrappedBifunctor * * p b d #

first :: (a -> b) -> WrappedBifunctor * * p a c -> WrappedBifunctor * * p b c #

second :: (b -> c) -> WrappedBifunctor * * p a b -> WrappedBifunctor * * p a c #

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 #

Bifunctor p => Bifunctor (Flip * * p) 

Methods

bimap :: (a -> b) -> (c -> d) -> Flip * * p a c -> Flip * * p b d #

first :: (a -> b) -> Flip * * p a c -> Flip * * p b c #

second :: (b -> c) -> Flip * * p a b -> Flip * * p a c #

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 #

Bifunctor ((,,,,,) x1 x2 x3 x4) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) #

(Bifunctor f, Bifunctor g) => Bifunctor (Product * * f g) 

Methods

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

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

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

(Bifunctor p, Bifunctor q) => Bifunctor (Sum * * p q) 

Methods

bimap :: (a -> b) -> (c -> d) -> Sum * * p q a c -> Sum * * p q b d #

first :: (a -> b) -> Sum * * p q a c -> Sum * * p q b c #

second :: (b -> c) -> Sum * * p q a b -> Sum * * p q a c #

Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) 

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) #

(Functor f, Bifunctor p) => Bifunctor (Tannen * * * f p) 

Methods

bimap :: (a -> b) -> (c -> d) -> Tannen * * * f p a c -> Tannen * * * f p b d #

first :: (a -> b) -> Tannen * * * f p a c -> Tannen * * * f p b c #

second :: (b -> c) -> Tannen * * * f p a b -> Tannen * * * f p a c #

(Bifunctor p, Functor f, Functor g) => Bifunctor (Biff * * * * p f g) 

Methods

bimap :: (a -> b) -> (c -> d) -> Biff * * * * p f g a c -> Biff * * * * p f g b d #

first :: (a -> b) -> Biff * * * * p f g a c -> Biff * * * * p f g b c #

second :: (b -> c) -> Biff * * * * p f g a b -> Biff * * * * p f g a c #

type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t #

A Traversal can be used directly as a Setter or a Fold (but not as a Lens) and provides the ability to both read and update multiple fields, subject to some relatively weak Traversal laws.

These have also been known as multilenses, but they have the signature and spirit of

traverse :: Traversable f => Traversal (f a) (f b) a b

and the more evocative name suggests their application.

Most of the time the Traversal you will want to use is just traverse, but you can also pass any Lens or Iso as a Traversal, and composition of a Traversal (or Lens or Iso) with a Traversal (or Lens or Iso) using (.) forms a valid Traversal.

The laws for a Traversal t follow from the laws for Traversable as stated in "The Essence of the Iterator Pattern".

t purepure
fmap (t f) . t g ≡ getCompose . t (Compose . fmap f . g)

One consequence of this requirement is that a Traversal needs to leave the same number of elements as a candidate for subsequent Traversal that it started with. Another testament to the strength of these laws is that the caveat expressed in section 5.5 of the "Essence of the Iterator Pattern" about exotic Traversable instances that traverse the same entry multiple times was actually already ruled out by the second law in that same paper!

type Traversal' s a = Traversal s s a a #

type Traversal1 s t a b = forall f. Apply f => (a -> f b) -> s -> f t #

type Traversal1' s a = Traversal1 s s a a #

class Eq a => Ord a where #

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Minimal complete definition

compare | (<=)

Methods

compare :: a -> a -> Ordering #

(<) :: a -> a -> Bool infix 4 #

(<=) :: a -> a -> Bool infix 4 #

(>) :: a -> a -> Bool infix 4 #

(>=) :: a -> a -> Bool infix 4 #

max :: a -> a -> a #

min :: a -> a -> a #

Instances

Ord Bool 

Methods

compare :: Bool -> Bool -> Ordering #

(<) :: Bool -> Bool -> Bool #

(<=) :: Bool -> Bool -> Bool #

(>) :: Bool -> Bool -> Bool #

(>=) :: Bool -> Bool -> Bool #

max :: Bool -> Bool -> Bool #

min :: Bool -> Bool -> Bool #

Ord Char 

Methods

compare :: Char -> Char -> Ordering #

(<) :: Char -> Char -> Bool #

(<=) :: Char -> Char -> Bool #

(>) :: Char -> Char -> Bool #

(>=) :: Char -> Char -> Bool #

max :: Char -> Char -> Char #

min :: Char -> Char -> Char #

Ord Double 
Ord Float 

Methods

compare :: Float -> Float -> Ordering #

(<) :: Float -> Float -> Bool #

(<=) :: Float -> Float -> Bool #

(>) :: Float -> Float -> Bool #

(>=) :: Float -> Float -> Bool #

max :: Float -> Float -> Float #

min :: Float -> Float -> Float #

Ord Int 

Methods

compare :: Int -> Int -> Ordering #

(<) :: Int -> Int -> Bool #

(<=) :: Int -> Int -> Bool #

(>) :: Int -> Int -> Bool #

(>=) :: Int -> Int -> Bool #

max :: Int -> Int -> Int #

min :: Int -> Int -> Int #

Ord Int8 

Methods

compare :: Int8 -> Int8 -> Ordering #

(<) :: Int8 -> Int8 -> Bool #

(<=) :: Int8 -> Int8 -> Bool #

(>) :: Int8 -> Int8 -> Bool #

(>=) :: Int8 -> Int8 -> Bool #

max :: Int8 -> Int8 -> Int8 #

min :: Int8 -> Int8 -> Int8 #

Ord Int16 

Methods

compare :: Int16 -> Int16 -> Ordering #

(<) :: Int16 -> Int16 -> Bool #

(<=) :: Int16 -> Int16 -> Bool #

(>) :: Int16 -> Int16 -> Bool #

(>=) :: Int16 -> Int16 -> Bool #

max :: Int16 -> Int16 -> Int16 #

min :: Int16 -> Int16 -> Int16 #

Ord Int32 

Methods

compare :: Int32 -> Int32 -> Ordering #

(<) :: Int32 -> Int32 -> Bool #

(<=) :: Int32 -> Int32 -> Bool #

(>) :: Int32 -> Int32 -> Bool #

(>=) :: Int32 -> Int32 -> Bool #

max :: Int32 -> Int32 -> Int32 #

min :: Int32 -> Int32 -> Int32 #

Ord Int64 

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Ord Integer 
Ord Ordering 
Ord Word 

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Ord Word8 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Ord Word16 
Ord Word32 
Ord Word64 
Ord TypeRep 
Ord Exp 

Methods

compare :: Exp -> Exp -> Ordering #

(<) :: Exp -> Exp -> Bool #

(<=) :: Exp -> Exp -> Bool #

(>) :: Exp -> Exp -> Bool #

(>=) :: Exp -> Exp -> Bool #

max :: Exp -> Exp -> Exp #

min :: Exp -> Exp -> Exp #

Ord Match 

Methods

compare :: Match -> Match -> Ordering #

(<) :: Match -> Match -> Bool #

(<=) :: Match -> Match -> Bool #

(>) :: Match -> Match -> Bool #

(>=) :: Match -> Match -> Bool #

max :: Match -> Match -> Match #

min :: Match -> Match -> Match #

Ord Clause 
Ord Pat 

Methods

compare :: Pat -> Pat -> Ordering #

(<) :: Pat -> Pat -> Bool #

(<=) :: Pat -> Pat -> Bool #

(>) :: Pat -> Pat -> Bool #

(>=) :: Pat -> Pat -> Bool #

max :: Pat -> Pat -> Pat #

min :: Pat -> Pat -> Pat #

Ord Type 

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Ord Dec 

Methods

compare :: Dec -> Dec -> Ordering #

(<) :: Dec -> Dec -> Bool #

(<=) :: Dec -> Dec -> Bool #

(>) :: Dec -> Dec -> Bool #

(>=) :: Dec -> Dec -> Bool #

max :: Dec -> Dec -> Dec #

min :: Dec -> Dec -> Dec #

Ord Name 

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Ord FunDep 
Ord TyVarBndr 
Ord InjectivityAnn 
Ord Overlap 
Ord () 

Methods

compare :: () -> () -> Ordering #

(<) :: () -> () -> Bool #

(<=) :: () -> () -> Bool #

(>) :: () -> () -> Bool #

(>=) :: () -> () -> Bool #

max :: () -> () -> () #

min :: () -> () -> () #

Ord TyCon 

Methods

compare :: TyCon -> TyCon -> Ordering #

(<) :: TyCon -> TyCon -> Bool #

(<=) :: TyCon -> TyCon -> Bool #

(>) :: TyCon -> TyCon -> Bool #

(>=) :: TyCon -> TyCon -> Bool #

max :: TyCon -> TyCon -> TyCon #

min :: TyCon -> TyCon -> TyCon #

Ord Con 

Methods

compare :: Con -> Con -> Ordering #

(<) :: Con -> Con -> Bool #

(<=) :: Con -> Con -> Bool #

(>) :: Con -> Con -> Bool #

(>=) :: Con -> Con -> Bool #

max :: Con -> Con -> Con #

min :: Con -> Con -> Con #

Ord ByteString 
Ord Scientific 
Ord ByteString 
Ord UTCTime 
Ord Encoding 
Ord DotNetTime 
Ord Pos 

Methods

compare :: Pos -> Pos -> Ordering #

(<) :: Pos -> Pos -> Bool #

(<=) :: Pos -> Pos -> Bool #

(>) :: Pos -> Pos -> Bool #

(>=) :: Pos -> Pos -> Bool #

max :: Pos -> Pos -> Pos #

min :: Pos -> Pos -> Pos #

Ord BigNat 
Ord Natural 
Ord Void 

Methods

compare :: Void -> Void -> Ordering #

(<) :: Void -> Void -> Bool #

(<=) :: Void -> Void -> Bool #

(>) :: Void -> Void -> Bool #

(>=) :: Void -> Void -> Bool #

max :: Void -> Void -> Void #

min :: Void -> Void -> Void #

Ord Version 
Ord Unique 
Ord ThreadId 
Ord BlockReason 
Ord ThreadStatus 
Ord AsyncException 
Ord ArrayException 
Ord ExitCode 
Ord BufferMode 
Ord Newline 
Ord NewlineMode 
Ord WordPtr 
Ord IntPtr 
Ord CChar 

Methods

compare :: CChar -> CChar -> Ordering #

(<) :: CChar -> CChar -> Bool #

(<=) :: CChar -> CChar -> Bool #

(>) :: CChar -> CChar -> Bool #

(>=) :: CChar -> CChar -> Bool #

max :: CChar -> CChar -> CChar #

min :: CChar -> CChar -> CChar #

Ord CSChar 
Ord CUChar 
Ord CShort 
Ord CUShort 
Ord CInt 

Methods

compare :: CInt -> CInt -> Ordering #

(<) :: CInt -> CInt -> Bool #

(<=) :: CInt -> CInt -> Bool #

(>) :: CInt -> CInt -> Bool #

(>=) :: CInt -> CInt -> Bool #

max :: CInt -> CInt -> CInt #

min :: CInt -> CInt -> CInt #

Ord CUInt 

Methods

compare :: CUInt -> CUInt -> Ordering #

(<) :: CUInt -> CUInt -> Bool #

(<=) :: CUInt -> CUInt -> Bool #

(>) :: CUInt -> CUInt -> Bool #

(>=) :: CUInt -> CUInt -> Bool #

max :: CUInt -> CUInt -> CUInt #

min :: CUInt -> CUInt -> CUInt #

Ord CLong 

Methods

compare :: CLong -> CLong -> Ordering #

(<) :: CLong -> CLong -> Bool #

(<=) :: CLong -> CLong -> Bool #

(>) :: CLong -> CLong -> Bool #

(>=) :: CLong -> CLong -> Bool #

max :: CLong -> CLong -> CLong #

min :: CLong -> CLong -> CLong #

Ord CULong 
Ord CLLong 
Ord CULLong 
Ord CFloat 
Ord CDouble 
Ord CPtrdiff 
Ord CSize 

Methods

compare :: CSize -> CSize -> Ordering #

(<) :: CSize -> CSize -> Bool #

(<=) :: CSize -> CSize -> Bool #

(>) :: CSize -> CSize -> Bool #

(>=) :: CSize -> CSize -> Bool #

max :: CSize -> CSize -> CSize #

min :: CSize -> CSize -> CSize #

Ord CWchar 
Ord CSigAtomic 
Ord CClock 
Ord CTime 

Methods

compare :: CTime -> CTime -> Ordering #

(<) :: CTime -> CTime -> Bool #

(<=) :: CTime -> CTime -> Bool #

(>) :: CTime -> CTime -> Bool #

(>=) :: CTime -> CTime -> Bool #

max :: CTime -> CTime -> CTime #

min :: CTime -> CTime -> CTime #

Ord CUSeconds 
Ord CSUSeconds 
Ord CIntPtr 
Ord CUIntPtr 
Ord CIntMax 
Ord CUIntMax 
Ord All 

Methods

compare :: All -> All -> Ordering #

(<) :: All -> All -> Bool #

(<=) :: All -> All -> Bool #

(>) :: All -> All -> Bool #

(>=) :: All -> All -> Bool #

max :: All -> All -> All #

min :: All -> All -> All #

Ord Any 

Methods

compare :: Any -> Any -> Ordering #

(<) :: Any -> Any -> Bool #

(<=) :: Any -> Any -> Bool #

(>) :: Any -> Any -> Bool #

(>=) :: Any -> Any -> Bool #

max :: Any -> Any -> Any #

min :: Any -> Any -> Any #

Ord Fixity 
Ord Associativity 
Ord SourceUnpackedness 
Ord SourceStrictness 
Ord DecidedStrictness 
Ord ErrorCall 
Ord ArithException 
Ord Fingerprint 
Ord GeneralCategory 
Ord ShortByteString 
Ord IntSet 
Ord DirectoryType 

Methods

compare :: DirectoryType -> DirectoryType -> Ordering #

(<) :: DirectoryType -> DirectoryType -> Bool #

(<=) :: DirectoryType -> DirectoryType -> Bool #

(>) :: DirectoryType -> DirectoryType -> Bool #

(>=) :: DirectoryType -> DirectoryType -> Bool #

max :: DirectoryType -> DirectoryType -> DirectoryType #

min :: DirectoryType -> DirectoryType -> DirectoryType #

Ord Permissions 
Ord XdgDirectory 
Ord DefName 
Ord ModName 
Ord PkgName 
Ord Module 
Ord OccName 
Ord NameFlavour 
Ord NameSpace 
Ord Loc 

Methods

compare :: Loc -> Loc -> Ordering #

(<) :: Loc -> Loc -> Bool #

(<=) :: Loc -> Loc -> Bool #

(>) :: Loc -> Loc -> Bool #

(>=) :: Loc -> Loc -> Bool #

max :: Loc -> Loc -> Loc #

min :: Loc -> Loc -> Loc #

Ord Info 

Methods

compare :: Info -> Info -> Ordering #

(<) :: Info -> Info -> Bool #

(<=) :: Info -> Info -> Bool #

(>) :: Info -> Info -> Bool #

(>=) :: Info -> Info -> Bool #

max :: Info -> Info -> Info #

min :: Info -> Info -> Info #

Ord ModuleInfo 
Ord Fixity 
Ord FixityDirection 
Ord Lit 

Methods

compare :: Lit -> Lit -> Ordering #

(<) :: Lit -> Lit -> Bool #

(<=) :: Lit -> Lit -> Bool #

(>) :: Lit -> Lit -> Bool #

(>=) :: Lit -> Lit -> Bool #

max :: Lit -> Lit -> Lit #

min :: Lit -> Lit -> Lit #

Ord Body 

Methods

compare :: Body -> Body -> Ordering #

(<) :: Body -> Body -> Bool #

(<=) :: Body -> Body -> Bool #

(>) :: Body -> Body -> Bool #

(>=) :: Body -> Body -> Bool #

max :: Body -> Body -> Body #

min :: Body -> Body -> Body #

Ord Guard 

Methods

compare :: Guard -> Guard -> Ordering #

(<) :: Guard -> Guard -> Bool #

(<=) :: Guard -> Guard -> Bool #

(>) :: Guard -> Guard -> Bool #

(>=) :: Guard -> Guard -> Bool #

max :: Guard -> Guard -> Guard #

min :: Guard -> Guard -> Guard #

Ord Stmt 

Methods

compare :: Stmt -> Stmt -> Ordering #

(<) :: Stmt -> Stmt -> Bool #

(<=) :: Stmt -> Stmt -> Bool #

(>) :: Stmt -> Stmt -> Bool #

(>=) :: Stmt -> Stmt -> Bool #

max :: Stmt -> Stmt -> Stmt #

min :: Stmt -> Stmt -> Stmt #

Ord Range 

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

Ord TypeFamilyHead 
Ord TySynEqn 
Ord FamFlavour 
Ord Foreign 
Ord Callconv 
Ord Safety 
Ord Pragma 
Ord Inline 
Ord RuleMatch 
Ord Phases 
Ord RuleBndr 
Ord AnnTarget 
Ord SourceUnpackedness 
Ord SourceStrictness 
Ord DecidedStrictness 
Ord Bang 

Methods

compare :: Bang -> Bang -> Ordering #

(<) :: Bang -> Bang -> Bool #

(<=) :: Bang -> Bang -> Bool #

(>) :: Bang -> Bang -> Bool #

(>=) :: Bang -> Bang -> Bool #

max :: Bang -> Bang -> Bang #

min :: Bang -> Bang -> Bang #

Ord FamilyResultSig 
Ord TyLit 

Methods

compare :: TyLit -> TyLit -> Ordering #

(<) :: TyLit -> TyLit -> Bool #

(<=) :: TyLit -> TyLit -> Bool #

(>) :: TyLit -> TyLit -> Bool #

(>=) :: TyLit -> TyLit -> Bool #

max :: TyLit -> TyLit -> TyLit #

min :: TyLit -> TyLit -> TyLit #

Ord Role 

Methods

compare :: Role -> Role -> Ordering #

(<) :: Role -> Role -> Bool #

(<=) :: Role -> Role -> Bool #

(>) :: Role -> Role -> Bool #

(>=) :: Role -> Role -> Bool #

max :: Role -> Role -> Role #

min :: Role -> Role -> Role #

Ord AnnLookup 
Ord LocalTime 
Ord TimeOfDay 
Ord TimeLocale 
Ord TimeZone 
Ord NominalDiffTime 
Ord Day 

Methods

compare :: Day -> Day -> Ordering #

(<) :: Day -> Day -> Bool #

(<=) :: Day -> Day -> Bool #

(>) :: Day -> Day -> Bool #

(>=) :: Day -> Day -> Bool #

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

Ord UniversalTime 
Ord DiffTime 
Ord a => Ord [a] 

Methods

compare :: [a] -> [a] -> Ordering #

(<) :: [a] -> [a] -> Bool #

(<=) :: [a] -> [a] -> Bool #

(>) :: [a] -> [a] -> Bool #

(>=) :: [a] -> [a] -> Bool #

max :: [a] -> [a] -> [a] #

min :: [a] -> [a] -> [a] #

Ord a => Ord (Maybe a) 

Methods

compare :: Maybe a -> Maybe a -> Ordering #

(<) :: Maybe a -> Maybe a -> Bool #

(<=) :: Maybe a -> Maybe a -> Bool #

(>) :: Maybe a -> Maybe a -> Bool #

(>=) :: Maybe a -> Maybe a -> Bool #

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Integral a => Ord (Ratio a) 

Methods

compare :: Ratio a -> Ratio a -> Ordering #

(<) :: Ratio a -> Ratio a -> Bool #

(<=) :: Ratio a -> Ratio a -> Bool #

(>) :: Ratio a -> Ratio a -> Bool #

(>=) :: Ratio a -> Ratio a -> Bool #

max :: Ratio a -> Ratio a -> Ratio a #

min :: Ratio a -> Ratio a -> Ratio a #

Ord (Ptr a) 

Methods

compare :: Ptr a -> Ptr a -> Ordering #

(<) :: Ptr a -> Ptr a -> Bool #

(<=) :: Ptr a -> Ptr a -> Bool #

(>) :: Ptr a -> Ptr a -> Bool #

(>=) :: Ptr a -> Ptr a -> Bool #

max :: Ptr a -> Ptr a -> Ptr a #

min :: Ptr a -> Ptr a -> Ptr a #

Ord (FunPtr a) 

Methods

compare :: FunPtr a -> FunPtr a -> Ordering #

(<) :: FunPtr a -> FunPtr a -> Bool #

(<=) :: FunPtr a -> FunPtr a -> Bool #

(>) :: FunPtr a -> FunPtr a -> Bool #

(>=) :: FunPtr a -> FunPtr a -> Bool #

max :: FunPtr a -> FunPtr a -> FunPtr a #

min :: FunPtr a -> FunPtr a -> FunPtr a #

Ord (V1 p) 

Methods

compare :: V1 p -> V1 p -> Ordering #

(<) :: V1 p -> V1 p -> Bool #

(<=) :: V1 p -> V1 p -> Bool #

(>) :: V1 p -> V1 p -> Bool #

(>=) :: V1 p -> V1 p -> Bool #

max :: V1 p -> V1 p -> V1 p #

min :: V1 p -> V1 p -> V1 p #

Ord (U1 p) 

Methods

compare :: U1 p -> U1 p -> Ordering #

(<) :: U1 p -> U1 p -> Bool #

(<=) :: U1 p -> U1 p -> Bool #

(>) :: U1 p -> U1 p -> Bool #

(>=) :: U1 p -> U1 p -> Bool #

max :: U1 p -> U1 p -> U1 p #

min :: U1 p -> U1 p -> U1 p #

Ord p => Ord (Par1 p) 

Methods

compare :: Par1 p -> Par1 p -> Ordering #

(<) :: Par1 p -> Par1 p -> Bool #

(<=) :: Par1 p -> Par1 p -> Bool #

(>) :: Par1 p -> Par1 p -> Bool #

(>=) :: Par1 p -> Par1 p -> Bool #

max :: Par1 p -> Par1 p -> Par1 p #

min :: Par1 p -> Par1 p -> Par1 p #

Ord (ForeignPtr a) 
Ord a => Ord (Identity a) 

Methods

compare :: Identity a -> Identity a -> Ordering #

(<) :: Identity a -> Identity a -> Bool #

(<=) :: Identity a -> Identity a -> Bool #

(>) :: Identity a -> Identity a -> Bool #

(>=) :: Identity a -> Identity a -> Bool #

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Ord a => Ord (Min a) 

Methods

compare :: Min a -> Min a -> Ordering #

(<) :: Min a -> Min a -> Bool #

(<=) :: Min a -> Min a -> Bool #

(>) :: Min a -> Min a -> Bool #

(>=) :: Min a -> Min a -> Bool #

max :: Min a -> Min a -> Min a #

min :: Min a -> Min a -> Min a #

Ord a => Ord (Max a) 

Methods

compare :: Max a -> Max a -> Ordering #

(<) :: Max a -> Max a -> Bool #

(<=) :: Max a -> Max a -> Bool #

(>) :: Max a -> Max a -> Bool #

(>=) :: Max a -> Max a -> Bool #

max :: Max a -> Max a -> Max a #

min :: Max a -> Max a -> Max a #

Ord a => Ord (First a) 

Methods

compare :: First a -> First a -> Ordering #

(<) :: First a -> First a -> Bool #

(<=) :: First a -> First a -> Bool #

(>) :: First a -> First a -> Bool #

(>=) :: First a -> First a -> Bool #

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord a => Ord (Last a) 

Methods

compare :: Last a -> Last a -> Ordering #

(<) :: Last a -> Last a -> Bool #

(<=) :: Last a -> Last a -> Bool #

(>) :: Last a -> Last a -> Bool #

(>=) :: Last a -> Last a -> Bool #

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord m => Ord (WrappedMonoid m) 
Ord a => Ord (Option a) 

Methods

compare :: Option a -> Option a -> Ordering #

(<) :: Option a -> Option a -> Bool #

(<=) :: Option a -> Option a -> Bool #

(>) :: Option a -> Option a -> Bool #

(>=) :: Option a -> Option a -> Bool #

max :: Option a -> Option a -> Option a #

min :: Option a -> Option a -> Option a #

Ord a => Ord (NonEmpty a) 

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Ord (Fixed a) 

Methods

compare :: Fixed a -> Fixed a -> Ordering #

(<) :: Fixed a -> Fixed a -> Bool #

(<=) :: Fixed a -> Fixed a -> Bool #

(>) :: Fixed a -> Fixed a -> Bool #

(>=) :: Fixed a -> Fixed a -> Bool #

max :: Fixed a -> Fixed a -> Fixed a #

min :: Fixed a -> Fixed a -> Fixed a #

Ord a => Ord (ZipList a) 

Methods

compare :: ZipList a -> ZipList a -> Ordering #

(<) :: ZipList a -> ZipList a -> Bool #

(<=) :: ZipList a -> ZipList a -> Bool #

(>) :: ZipList a -> ZipList a -> Bool #

(>=) :: ZipList a -> ZipList a -> Bool #

max :: ZipList a -> ZipList a -> ZipList a #

min :: ZipList a -> ZipList a -> ZipList a #

Ord a => Ord (Dual a) 

Methods

compare :: Dual a -> Dual a -> Ordering #

(<) :: Dual a -> Dual a -> Bool #

(<=) :: Dual a -> Dual a -> Bool #

(>) :: Dual a -> Dual a -> Bool #

(>=) :: Dual a -> Dual a -> Bool #

max :: Dual a -> Dual a -> Dual a #

min :: Dual a -> Dual a -> Dual a #

Ord a => Ord (Sum a) 

Methods

compare :: Sum a -> Sum a -> Ordering #

(<) :: Sum a -> Sum a -> Bool #

(<=) :: Sum a -> Sum a -> Bool #

(>) :: Sum a -> Sum a -> Bool #

(>=) :: Sum a -> Sum a -> Bool #

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Ord a => Ord (Product a) 

Methods

compare :: Product a -> Product a -> Ordering #

(<) :: Product a -> Product a -> Bool #

(<=) :: Product a -> Product a -> Bool #

(>) :: Product a -> Product a -> Bool #

(>=) :: Product a -> Product a -> Bool #

max :: Product a -> Product a -> Product a #

min :: Product a -> Product a -> Product a #

Ord a => Ord (First a) 

Methods

compare :: First a -> First a -> Ordering #

(<) :: First a -> First a -> Bool #

(<=) :: First a -> First a -> Bool #

(>) :: First a -> First a -> Bool #

(>=) :: First a -> First a -> Bool #

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord a => Ord (Last a) 

Methods

compare :: Last a -> Last a -> Ordering #

(<) :: Last a -> Last a -> Bool #

(<=) :: Last a -> Last a -> Bool #

(>) :: Last a -> Last a -> Bool #

(>=) :: Last a -> Last a -> Bool #

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord a => Ord (Down a) 

Methods

compare :: Down a -> Down a -> Ordering #

(<) :: Down a -> Down a -> Bool #

(<=) :: Down a -> Down a -> Bool #

(>) :: Down a -> Down a -> Bool #

(>=) :: Down a -> Down a -> Bool #

max :: Down a -> Down a -> Down a #

min :: Down a -> Down a -> Down a #

Ord a => Ord (IntMap a) 

Methods

compare :: IntMap a -> IntMap a -> Ordering #

(<) :: IntMap a -> IntMap a -> Bool #

(<=) :: IntMap a -> IntMap a -> Bool #

(>) :: IntMap a -> IntMap a -> Bool #

(>=) :: IntMap a -> IntMap a -> Bool #

max :: IntMap a -> IntMap a -> IntMap a #

min :: IntMap a -> IntMap a -> IntMap a #

Ord a => Ord (Seq a) 

Methods

compare :: Seq a -> Seq a -> Ordering #

(<) :: Seq a -> Seq a -> Bool #

(<=) :: Seq a -> Seq a -> Bool #

(>) :: Seq a -> Seq a -> Bool #

(>=) :: Seq a -> Seq a -> Bool #

max :: Seq a -> Seq a -> Seq a #

min :: Seq a -> Seq a -> Seq a #

Ord a => Ord (ViewL a) 

Methods

compare :: ViewL a -> ViewL a -> Ordering #

(<) :: ViewL a -> ViewL a -> Bool #

(<=) :: ViewL a -> ViewL a -> Bool #

(>) :: ViewL a -> ViewL a -> Bool #

(>=) :: ViewL a -> ViewL a -> Bool #

max :: ViewL a -> ViewL a -> ViewL a #

min :: ViewL a -> ViewL a -> ViewL a #

Ord a => Ord (ViewR a) 

Methods

compare :: ViewR a -> ViewR a -> Ordering #

(<) :: ViewR a -> ViewR a -> Bool #

(<=) :: ViewR a -> ViewR a -> Bool #

(>) :: ViewR a -> ViewR a -> Bool #

(>=) :: ViewR a -> ViewR a -> Bool #

max :: ViewR a -> ViewR a -> ViewR a #

min :: ViewR a -> ViewR a -> ViewR a #

Ord a => Ord (Set a) 

Methods

compare :: Set a -> Set a -> Ordering #

(<) :: Set a -> Set a -> Bool #

(<=) :: Set a -> Set a -> Bool #

(>) :: Set a -> Set a -> Bool #

(>=) :: Set a -> Set a -> Bool #

max :: Set a -> Set a -> Set a #

min :: Set a -> Set a -> Set a #

Ord a => Ord (DList a) 

Methods

compare :: DList a -> DList a -> Ordering #

(<) :: DList a -> DList a -> Bool #

(<=) :: DList a -> DList a -> Bool #

(>) :: DList a -> DList a -> Bool #

(>=) :: DList a -> DList a -> Bool #

max :: DList a -> DList a -> DList a #

min :: DList a -> DList a -> DList a #

Ord a => Ord (Hashed a) 

Methods

compare :: Hashed a -> Hashed a -> Ordering #

(<) :: Hashed a -> Hashed a -> Bool #

(<=) :: Hashed a -> Hashed a -> Bool #

(>) :: Hashed a -> Hashed a -> Bool #

(>=) :: Hashed a -> Hashed a -> Bool #

max :: Hashed a -> Hashed a -> Hashed a #

min :: Hashed a -> Hashed a -> Hashed a #

Ord a => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Prim a, Ord a) => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Storable a, Ord a) => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Ord b, Ord a) => Ord (Either a b) 

Methods

compare :: Either a b -> Either a b -> Ordering #

(<) :: Either a b -> Either a b -> Bool #

(<=) :: Either a b -> Either a b -> Bool #

(>) :: Either a b -> Either a b -> Bool #

(>=) :: Either a b -> Either a b -> Bool #

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

Ord (f p) => Ord (Rec1 f p) 

Methods

compare :: Rec1 f p -> Rec1 f p -> Ordering #

(<) :: Rec1 f p -> Rec1 f p -> Bool #

(<=) :: Rec1 f p -> Rec1 f p -> Bool #

(>) :: Rec1 f p -> Rec1 f p -> Bool #

(>=) :: Rec1 f p -> Rec1 f p -> Bool #

max :: Rec1 f p -> Rec1 f p -> Rec1 f p #

min :: Rec1 f p -> Rec1 f p -> Rec1 f p #

Ord (URec Char p) 

Methods

compare :: URec Char p -> URec Char p -> Ordering #

(<) :: URec Char p -> URec Char p -> Bool #

(<=) :: URec Char p -> URec Char p -> Bool #

(>) :: URec Char p -> URec Char p -> Bool #

(>=) :: URec Char p -> URec Char p -> Bool #

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

Ord (URec Double p) 

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

Ord (URec Float p) 

Methods

compare :: URec Float p -> URec Float p -> Ordering #

(<) :: URec Float p -> URec Float p -> Bool #

(<=) :: URec Float p -> URec Float p -> Bool #

(>) :: URec Float p -> URec Float p -> Bool #

(>=) :: URec Float p -> URec Float p -> Bool #

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

Ord (URec Int p) 

Methods

compare :: URec Int p -> URec Int p -> Ordering #

(<) :: URec Int p -> URec Int p -> Bool #

(<=) :: URec Int p -> URec Int p -> Bool #

(>) :: URec Int p -> URec Int p -> Bool #

(>=) :: URec Int p -> URec Int p -> Bool #

max :: URec Int p -> URec Int p -> URec Int p #

min :: URec Int p -> URec Int p -> URec Int p #

Ord (URec Word p) 

Methods

compare :: URec Word p -> URec Word p -> Ordering #

(<) :: URec Word p -> URec Word p -> Bool #

(<=) :: URec Word p -> URec Word p -> Bool #

(>) :: URec Word p -> URec Word p -> Bool #

(>=) :: URec Word p -> URec Word p -> Bool #

max :: URec Word p -> URec Word p -> URec Word p #

min :: URec Word p -> URec Word p -> URec Word p #

Ord (URec (Ptr ()) p) 

Methods

compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering #

(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

(Ord a, Ord b) => Ord (a, b) 

Methods

compare :: (a, b) -> (a, b) -> Ordering #

(<) :: (a, b) -> (a, b) -> Bool #

(<=) :: (a, b) -> (a, b) -> Bool #

(>) :: (a, b) -> (a, b) -> Bool #

(>=) :: (a, b) -> (a, b) -> Bool #

max :: (a, b) -> (a, b) -> (a, b) #

min :: (a, b) -> (a, b) -> (a, b) #

(Ord k, Ord v) => Ord (Map k v) 

Methods

compare :: Map k v -> Map k v -> Ordering #

(<) :: Map k v -> Map k v -> Bool #

(<=) :: Map k v -> Map k v -> Bool #

(>) :: Map k v -> Map k v -> Bool #

(>=) :: Map k v -> Map k v -> Bool #

max :: Map k v -> Map k v -> Map k v #

min :: Map k v -> Map k v -> Map k v #

(Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e) 

Methods

compare :: UArray ix e -> UArray ix e -> Ordering #

(<) :: UArray ix e -> UArray ix e -> Bool #

(<=) :: UArray ix e -> UArray ix e -> Bool #

(>) :: UArray ix e -> UArray ix e -> Bool #

(>=) :: UArray ix e -> UArray ix e -> Bool #

max :: UArray ix e -> UArray ix e -> UArray ix e #

min :: UArray ix e -> UArray ix e -> UArray ix e #

(Ix i, Ord e) => Ord (Array i e) 

Methods

compare :: Array i e -> Array i e -> Ordering #

(<) :: Array i e -> Array i e -> Bool #

(<=) :: Array i e -> Array i e -> Bool #

(>) :: Array i e -> Array i e -> Bool #

(>=) :: Array i e -> Array i e -> Bool #

max :: Array i e -> Array i e -> Array i e #

min :: Array i e -> Array i e -> Array i e #

Ord a => Ord (Arg a b) 

Methods

compare :: Arg a b -> Arg a b -> Ordering #

(<) :: Arg a b -> Arg a b -> Bool #

(<=) :: Arg a b -> Arg a b -> Bool #

(>) :: Arg a b -> Arg a b -> Bool #

(>=) :: Arg a b -> Arg a b -> Bool #

max :: Arg a b -> Arg a b -> Arg a b #

min :: Arg a b -> Arg a b -> Arg a b #

Ord (Proxy k s) 

Methods

compare :: Proxy k s -> Proxy k s -> Ordering #

(<) :: Proxy k s -> Proxy k s -> Bool #

(<=) :: Proxy k s -> Proxy k s -> Bool #

(>) :: Proxy k s -> Proxy k s -> Bool #

(>=) :: Proxy k s -> Proxy k s -> Bool #

max :: Proxy k s -> Proxy k s -> Proxy k s #

min :: Proxy k s -> Proxy k s -> Proxy k s #

(Ord (f (Cofree f a)), Ord a) => Ord (Cofree f a) 

Methods

compare :: Cofree f a -> Cofree f a -> Ordering #

(<) :: Cofree f a -> Cofree f a -> Bool #

(<=) :: Cofree f a -> Cofree f a -> Bool #

(>) :: Cofree f a -> Cofree f a -> Bool #

(>=) :: Cofree f a -> Cofree f a -> Bool #

max :: Cofree f a -> Cofree f a -> Cofree f a #

min :: Cofree f a -> Cofree f a -> Cofree f a #

Ord (f a) => Ord (Yoneda f a) 

Methods

compare :: Yoneda f a -> Yoneda f a -> Ordering #

(<) :: Yoneda f a -> Yoneda f a -> Bool #

(<=) :: Yoneda f a -> Yoneda f a -> Bool #

(>) :: Yoneda f a -> Yoneda f a -> Bool #

(>=) :: Yoneda f a -> Yoneda f a -> Bool #

max :: Yoneda f a -> Yoneda f a -> Yoneda f a #

min :: Yoneda f a -> Yoneda f a -> Yoneda f a #

(Ord a, Ord i) => Ord (Level i a) 

Methods

compare :: Level i a -> Level i a -> Ordering #

(<) :: Level i a -> Level i a -> Bool #

(<=) :: Level i a -> Level i a -> Bool #

(>) :: Level i a -> Level i a -> Bool #

(>=) :: Level i a -> Level i a -> Bool #

max :: Level i a -> Level i a -> Level i a #

min :: Level i a -> Level i a -> Level i a #

(Ord1 m, Ord a) => Ord (ListT m a) 

Methods

compare :: ListT m a -> ListT m a -> Ordering #

(<) :: ListT m a -> ListT m a -> Bool #

(<=) :: ListT m a -> ListT m a -> Bool #

(>) :: ListT m a -> ListT m a -> Bool #

(>=) :: ListT m a -> ListT m a -> Bool #

max :: ListT m a -> ListT m a -> ListT m a #

min :: ListT m a -> ListT m a -> ListT m a #

(Ord1 m, Ord a) => Ord (MaybeT m a) 

Methods

compare :: MaybeT m a -> MaybeT m a -> Ordering #

(<) :: MaybeT m a -> MaybeT m a -> Bool #

(<=) :: MaybeT m a -> MaybeT m a -> Bool #

(>) :: MaybeT m a -> MaybeT m a -> Bool #

(>=) :: MaybeT m a -> MaybeT m a -> Bool #

max :: MaybeT m a -> MaybeT m a -> MaybeT m a #

min :: MaybeT m a -> MaybeT m a -> MaybeT m a #

(Ord v, Ord k) => Ord (AList k v) # 

Methods

compare :: AList k v -> AList k v -> Ordering #

(<) :: AList k v -> AList k v -> Bool #

(<=) :: AList k v -> AList k v -> Bool #

(>) :: AList k v -> AList k v -> Bool #

(>=) :: AList k v -> AList k v -> Bool #

max :: AList k v -> AList k v -> AList k v #

min :: AList k v -> AList k v -> AList k v #

Ord c => Ord (K1 i c p) 

Methods

compare :: K1 i c p -> K1 i c p -> Ordering #

(<) :: K1 i c p -> K1 i c p -> Bool #

(<=) :: K1 i c p -> K1 i c p -> Bool #

(>) :: K1 i c p -> K1 i c p -> Bool #

(>=) :: K1 i c p -> K1 i c p -> Bool #

max :: K1 i c p -> K1 i c p -> K1 i c p #

min :: K1 i c p -> K1 i c p -> K1 i c p #

(Ord (g p), Ord (f p)) => Ord ((:+:) f g p) 

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

(Ord (g p), Ord (f p)) => Ord ((:*:) f g p) 

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

Ord (f (g p)) => Ord ((:.:) f g p) 

Methods

compare :: (f :.: g) p -> (f :.: g) p -> Ordering #

(<) :: (f :.: g) p -> (f :.: g) p -> Bool #

(<=) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>=) :: (f :.: g) p -> (f :.: g) p -> Bool #

max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

(Ord a, Ord b, Ord c) => Ord (a, b, c) 

Methods

compare :: (a, b, c) -> (a, b, c) -> Ordering #

(<) :: (a, b, c) -> (a, b, c) -> Bool #

(<=) :: (a, b, c) -> (a, b, c) -> Bool #

(>) :: (a, b, c) -> (a, b, c) -> Bool #

(>=) :: (a, b, c) -> (a, b, c) -> Bool #

max :: (a, b, c) -> (a, b, c) -> (a, b, c) #

min :: (a, b, c) -> (a, b, c) -> (a, b, c) #

Ord a => Ord (Const k a b) 

Methods

compare :: Const k a b -> Const k a b -> Ordering #

(<) :: Const k a b -> Const k a b -> Bool #

(<=) :: Const k a b -> Const k a b -> Bool #

(>) :: Const k a b -> Const k a b -> Bool #

(>=) :: Const k a b -> Const k a b -> Bool #

max :: Const k a b -> Const k a b -> Const k a b #

min :: Const k a b -> Const k a b -> Const k a b #

Ord (f a) => Ord (Alt k f a) 

Methods

compare :: Alt k f a -> Alt k f a -> Ordering #

(<) :: Alt k f a -> Alt k f a -> Bool #

(<=) :: Alt k f a -> Alt k f a -> Bool #

(>) :: Alt k f a -> Alt k f a -> Bool #

(>=) :: Alt k f a -> Alt k f a -> Bool #

max :: Alt k f a -> Alt k f a -> Alt k f a #

min :: Alt k f a -> Alt k f a -> Alt k f a #

Ord (Coercion k a b) 

Methods

compare :: Coercion k a b -> Coercion k a b -> Ordering #

(<) :: Coercion k a b -> Coercion k a b -> Bool #

(<=) :: Coercion k a b -> Coercion k a b -> Bool #

(>) :: Coercion k a b -> Coercion k a b -> Bool #

(>=) :: Coercion k a b -> Coercion k a b -> Bool #

max :: Coercion k a b -> Coercion k a b -> Coercion k a b #

min :: Coercion k a b -> Coercion k a b -> Coercion k a b #

Ord ((:~:) k a b) 

Methods

compare :: (k :~: a) b -> (k :~: a) b -> Ordering #

(<) :: (k :~: a) b -> (k :~: a) b -> Bool #

(<=) :: (k :~: a) b -> (k :~: a) b -> Bool #

(>) :: (k :~: a) b -> (k :~: a) b -> Bool #

(>=) :: (k :~: a) b -> (k :~: a) b -> Bool #

max :: (k :~: a) b -> (k :~: a) b -> (k :~: a) b #

min :: (k :~: a) b -> (k :~: a) b -> (k :~: a) b #

Ord (p a a) => Ord (Join k p a) 

Methods

compare :: Join k p a -> Join k p a -> Ordering #

(<) :: Join k p a -> Join k p a -> Bool #

(<=) :: Join k p a -> Join k p a -> Bool #

(>) :: Join k p a -> Join k p a -> Bool #

(>=) :: Join k p a -> Join k p a -> Bool #

max :: Join k p a -> Join k p a -> Join k p a #

min :: Join k p a -> Join k p a -> Join k p a #

(Ord1 f, Ord a) => Ord (IdentityT * f a) 

Methods

compare :: IdentityT * f a -> IdentityT * f a -> Ordering #

(<) :: IdentityT * f a -> IdentityT * f a -> Bool #

(<=) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>=) :: IdentityT * f a -> IdentityT * f a -> Bool #

max :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

min :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

(Ord (f b), Ord a) => Ord (FreeF f a b) 

Methods

compare :: FreeF f a b -> FreeF f a b -> Ordering #

(<) :: FreeF f a b -> FreeF f a b -> Bool #

(<=) :: FreeF f a b -> FreeF f a b -> Bool #

(>) :: FreeF f a b -> FreeF f a b -> Bool #

(>=) :: FreeF f a b -> FreeF f a b -> Bool #

max :: FreeF f a b -> FreeF f a b -> FreeF f a b #

min :: FreeF f a b -> FreeF f a b -> FreeF f a b #

Ord (m (FreeF f a (FreeT f m a))) => Ord (FreeT f m a) 

Methods

compare :: FreeT f m a -> FreeT f m a -> Ordering #

(<) :: FreeT f m a -> FreeT f m a -> Bool #

(<=) :: FreeT f m a -> FreeT f m a -> Bool #

(>) :: FreeT f m a -> FreeT f m a -> Bool #

(>=) :: FreeT f m a -> FreeT f m a -> Bool #

max :: FreeT f m a -> FreeT f m a -> FreeT f m a #

min :: FreeT f m a -> FreeT f m a -> FreeT f m a #

(Ord1 f, Ord a) => Ord (Backwards * f a) 

Methods

compare :: Backwards * f a -> Backwards * f a -> Ordering #

(<) :: Backwards * f a -> Backwards * f a -> Bool #

(<=) :: Backwards * f a -> Backwards * f a -> Bool #

(>) :: Backwards * f a -> Backwards * f a -> Bool #

(>=) :: Backwards * f a -> Backwards * f a -> Bool #

max :: Backwards * f a -> Backwards * f a -> Backwards * f a #

min :: Backwards * f a -> Backwards * f a -> Backwards * f a #

(Ord e, Ord1 m, Ord a) => Ord (ErrorT e m a) 

Methods

compare :: ErrorT e m a -> ErrorT e m a -> Ordering #

(<) :: ErrorT e m a -> ErrorT e m a -> Bool #

(<=) :: ErrorT e m a -> ErrorT e m a -> Bool #

(>) :: ErrorT e m a -> ErrorT e m a -> Bool #

(>=) :: ErrorT e m a -> ErrorT e m a -> Bool #

max :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #

min :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #

(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) 

Methods

compare :: ExceptT e m a -> ExceptT e m a -> Ordering #

(<) :: ExceptT e m a -> ExceptT e m a -> Bool #

(<=) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>=) :: ExceptT e m a -> ExceptT e m a -> Bool #

max :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

min :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) 

Methods

compare :: WriterT w m a -> WriterT w m a -> Ordering #

(<) :: WriterT w m a -> WriterT w m a -> Bool #

(<=) :: WriterT w m a -> WriterT w m a -> Bool #

(>) :: WriterT w m a -> WriterT w m a -> Bool #

(>=) :: WriterT w m a -> WriterT w m a -> Bool #

max :: WriterT w m a -> WriterT w m a -> WriterT w m a #

min :: WriterT w m a -> WriterT w m a -> WriterT w m a #

(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) 

Methods

compare :: WriterT w m a -> WriterT w m a -> Ordering #

(<) :: WriterT w m a -> WriterT w m a -> Bool #

(<=) :: WriterT w m a -> WriterT w m a -> Bool #

(>) :: WriterT w m a -> WriterT w m a -> Bool #

(>=) :: WriterT w m a -> WriterT w m a -> Bool #

max :: WriterT w m a -> WriterT w m a -> WriterT w m a #

min :: WriterT w m a -> WriterT w m a -> WriterT w m a #

Ord b => Ord (Tagged k s b) 

Methods

compare :: Tagged k s b -> Tagged k s b -> Ordering #

(<) :: Tagged k s b -> Tagged k s b -> Bool #

(<=) :: Tagged k s b -> Tagged k s b -> Bool #

(>) :: Tagged k s b -> Tagged k s b -> Bool #

(>=) :: Tagged k s b -> Tagged k s b -> Bool #

max :: Tagged k s b -> Tagged k s b -> Tagged k s b #

min :: Tagged k s b -> Tagged k s b -> Tagged k s b #

(Ord1 f, Ord a) => Ord (Reverse * f a) 

Methods

compare :: Reverse * f a -> Reverse * f a -> Ordering #

(<) :: Reverse * f a -> Reverse * f a -> Bool #

(<=) :: Reverse * f a -> Reverse * f a -> Bool #

(>) :: Reverse * f a -> Reverse * f a -> Bool #

(>=) :: Reverse * f a -> Reverse * f a -> Bool #

max :: Reverse * f a -> Reverse * f a -> Reverse * f a #

min :: Reverse * f a -> Reverse * f a -> Reverse * f a #

Ord a => Ord (Constant k a b) 

Methods

compare :: Constant k a b -> Constant k a b -> Ordering #

(<) :: Constant k a b -> Constant k a b -> Bool #

(<=) :: Constant k a b -> Constant k a b -> Bool #

(>) :: Constant k a b -> Constant k a b -> Bool #

(>=) :: Constant k a b -> Constant k a b -> Bool #

max :: Constant k a b -> Constant k a b -> Constant k a b #

min :: Constant k a b -> Constant k a b -> Constant k a b #

Ord (f p) => Ord (M1 i c f p) 

Methods

compare :: M1 i c f p -> M1 i c f p -> Ordering #

(<) :: M1 i c f p -> M1 i c f p -> Bool #

(<=) :: M1 i c f p -> M1 i c f p -> Bool #

(>) :: M1 i c f p -> M1 i c f p -> Bool #

(>=) :: M1 i c f p -> M1 i c f p -> Bool #

max :: M1 i c f p -> M1 i c f p -> M1 i c f p #

min :: M1 i c f p -> M1 i c f p -> M1 i c f p #

(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) 

Methods

compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering #

(<) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(>) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

(Ord1 f, Ord1 g, Ord a) => Ord (Sum * f g a) 

Methods

compare :: Sum * f g a -> Sum * f g a -> Ordering #

(<) :: Sum * f g a -> Sum * f g a -> Bool #

(<=) :: Sum * f g a -> Sum * f g a -> Bool #

(>) :: Sum * f g a -> Sum * f g a -> Bool #

(>=) :: Sum * f g a -> Sum * f g a -> Bool #

max :: Sum * f g a -> Sum * f g a -> Sum * f g a #

min :: Sum * f g a -> Sum * f g a -> Sum * f g a #

(Ord1 f, Ord1 g, Ord a) => Ord (Product * f g a) 

Methods

compare :: Product * f g a -> Product * f g a -> Ordering #

(<) :: Product * f g a -> Product * f g a -> Bool #

(<=) :: Product * f g a -> Product * f g a -> Bool #

(>) :: Product * f g a -> Product * f g a -> Bool #

(>=) :: Product * f g a -> Product * f g a -> Bool #

max :: Product * f g a -> Product * f g a -> Product * f g a #

min :: Product * f g a -> Product * f g a -> Product * f g a #

(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) 

Methods

compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering #

(<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

(Ord1 f, Ord1 g, Ord a) => Ord (Compose * * f g a) 

Methods

compare :: Compose * * f g a -> Compose * * f g a -> Ordering #

(<) :: Compose * * f g a -> Compose * * f g a -> Bool #

(<=) :: Compose * * f g a -> Compose * * f g a -> Bool #

(>) :: Compose * * f g a -> Compose * * f g a -> Bool #

(>=) :: Compose * * f g a -> Compose * * f g a -> Bool #

max :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #

min :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #

Ord (p a b) => Ord (WrappedBifunctor k1 k p a b) 

Methods

compare :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Ordering #

(<) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(<=) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(>) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(>=) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

max :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b #

min :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b #

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 #

Ord (p b a) => Ord (Flip k k1 p a b) 

Methods

compare :: Flip k k1 p a b -> Flip k k1 p a b -> Ordering #

(<) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(<=) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(>) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(>=) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

max :: Flip k k1 p a b -> Flip k k1 p a b -> Flip k k1 p a b #

min :: Flip k k1 p a b -> Flip k k1 p a b -> Flip k k1 p a b #

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 #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) 

Methods

compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering #

(<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

(Ord (g a b), Ord (f a b)) => Ord (Product k1 k f g a b) 

Methods

compare :: Product k1 k f g a b -> Product k1 k f g a b -> Ordering #

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

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

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

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

max :: Product k1 k f g a b -> Product k1 k f g a b -> Product k1 k f g a b #

min :: Product k1 k f g a b -> Product k1 k f g a b -> Product k1 k f g a b #

(Ord (q a b), Ord (p a b)) => Ord (Sum k1 k p q a b) 

Methods

compare :: Sum k1 k p q a b -> Sum k1 k p q a b -> Ordering #

(<) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(<=) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(>) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(>=) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

max :: Sum k1 k p q a b -> Sum k1 k p q a b -> Sum k1 k p q a b #

min :: Sum k1 k p q a b -> Sum k1 k p q a b -> Sum k1 k p q a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) 

Methods

compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering #

(<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

Ord (f (p a b)) => Ord (Tannen k2 k1 k f p a b) 

Methods

compare :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Ordering #

(<) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(<=) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(>) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(>=) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

max :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b #

min :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) 

Methods

compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) 

Methods

compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

Ord (p (f a) (g b)) => Ord (Biff k3 k2 k1 k p f g a b) 

Methods

compare :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Ordering #

(<) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(<=) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(>) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(>=) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

max :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b #

min :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Eq a => Ord a where #

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Minimal complete definition

compare | (<=)

Methods

compare :: a -> a -> Ordering #

(<) :: a -> a -> Bool infix 4 #

(<=) :: a -> a -> Bool infix 4 #

(>) :: a -> a -> Bool infix 4 #

(>=) :: a -> a -> Bool infix 4 #

max :: a -> a -> a #

min :: a -> a -> a #

Instances

Ord Bool 

Methods

compare :: Bool -> Bool -> Ordering #

(<) :: Bool -> Bool -> Bool #

(<=) :: Bool -> Bool -> Bool #

(>) :: Bool -> Bool -> Bool #

(>=) :: Bool -> Bool -> Bool #

max :: Bool -> Bool -> Bool #

min :: Bool -> Bool -> Bool #

Ord Char 

Methods

compare :: Char -> Char -> Ordering #

(<) :: Char -> Char -> Bool #

(<=) :: Char -> Char -> Bool #

(>) :: Char -> Char -> Bool #

(>=) :: Char -> Char -> Bool #

max :: Char -> Char -> Char #

min :: Char -> Char -> Char #

Ord Double 
Ord Float 

Methods

compare :: Float -> Float -> Ordering #

(<) :: Float -> Float -> Bool #

(<=) :: Float -> Float -> Bool #

(>) :: Float -> Float -> Bool #

(>=) :: Float -> Float -> Bool #

max :: Float -> Float -> Float #

min :: Float -> Float -> Float #

Ord Int 

Methods

compare :: Int -> Int -> Ordering #

(<) :: Int -> Int -> Bool #

(<=) :: Int -> Int -> Bool #

(>) :: Int -> Int -> Bool #

(>=) :: Int -> Int -> Bool #

max :: Int -> Int -> Int #

min :: Int -> Int -> Int #

Ord Int8 

Methods

compare :: Int8 -> Int8 -> Ordering #

(<) :: Int8 -> Int8 -> Bool #

(<=) :: Int8 -> Int8 -> Bool #

(>) :: Int8 -> Int8 -> Bool #

(>=) :: Int8 -> Int8 -> Bool #

max :: Int8 -> Int8 -> Int8 #

min :: Int8 -> Int8 -> Int8 #

Ord Int16 

Methods

compare :: Int16 -> Int16 -> Ordering #

(<) :: Int16 -> Int16 -> Bool #

(<=) :: Int16 -> Int16 -> Bool #

(>) :: Int16 -> Int16 -> Bool #

(>=) :: Int16 -> Int16 -> Bool #

max :: Int16 -> Int16 -> Int16 #

min :: Int16 -> Int16 -> Int16 #

Ord Int32 

Methods

compare :: Int32 -> Int32 -> Ordering #

(<) :: Int32 -> Int32 -> Bool #

(<=) :: Int32 -> Int32 -> Bool #

(>) :: Int32 -> Int32 -> Bool #

(>=) :: Int32 -> Int32 -> Bool #

max :: Int32 -> Int32 -> Int32 #

min :: Int32 -> Int32 -> Int32 #

Ord Int64 

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Ord Integer 
Ord Ordering 
Ord Word 

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Ord Word8 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Ord Word16 
Ord Word32 
Ord Word64 
Ord TypeRep 
Ord Exp 

Methods

compare :: Exp -> Exp -> Ordering #

(<) :: Exp -> Exp -> Bool #

(<=) :: Exp -> Exp -> Bool #

(>) :: Exp -> Exp -> Bool #

(>=) :: Exp -> Exp -> Bool #

max :: Exp -> Exp -> Exp #

min :: Exp -> Exp -> Exp #

Ord Match 

Methods

compare :: Match -> Match -> Ordering #

(<) :: Match -> Match -> Bool #

(<=) :: Match -> Match -> Bool #

(>) :: Match -> Match -> Bool #

(>=) :: Match -> Match -> Bool #

max :: Match -> Match -> Match #

min :: Match -> Match -> Match #

Ord Clause 
Ord Pat 

Methods

compare :: Pat -> Pat -> Ordering #

(<) :: Pat -> Pat -> Bool #

(<=) :: Pat -> Pat -> Bool #

(>) :: Pat -> Pat -> Bool #

(>=) :: Pat -> Pat -> Bool #

max :: Pat -> Pat -> Pat #

min :: Pat -> Pat -> Pat #

Ord Type 

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Ord Dec 

Methods

compare :: Dec -> Dec -> Ordering #

(<) :: Dec -> Dec -> Bool #

(<=) :: Dec -> Dec -> Bool #

(>) :: Dec -> Dec -> Bool #

(>=) :: Dec -> Dec -> Bool #

max :: Dec -> Dec -> Dec #

min :: Dec -> Dec -> Dec #

Ord Name 

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Ord FunDep 
Ord TyVarBndr 
Ord InjectivityAnn 
Ord Overlap 
Ord () 

Methods

compare :: () -> () -> Ordering #

(<) :: () -> () -> Bool #

(<=) :: () -> () -> Bool #

(>) :: () -> () -> Bool #

(>=) :: () -> () -> Bool #

max :: () -> () -> () #

min :: () -> () -> () #

Ord TyCon 

Methods

compare :: TyCon -> TyCon -> Ordering #

(<) :: TyCon -> TyCon -> Bool #

(<=) :: TyCon -> TyCon -> Bool #

(>) :: TyCon -> TyCon -> Bool #

(>=) :: TyCon -> TyCon -> Bool #

max :: TyCon -> TyCon -> TyCon #

min :: TyCon -> TyCon -> TyCon #

Ord Con 

Methods

compare :: Con -> Con -> Ordering #

(<) :: Con -> Con -> Bool #

(<=) :: Con -> Con -> Bool #

(>) :: Con -> Con -> Bool #

(>=) :: Con -> Con -> Bool #

max :: Con -> Con -> Con #

min :: Con -> Con -> Con #

Ord ByteString 
Ord Scientific 
Ord ByteString 
Ord UTCTime 
Ord Encoding 
Ord DotNetTime 
Ord Pos 

Methods

compare :: Pos -> Pos -> Ordering #

(<) :: Pos -> Pos -> Bool #

(<=) :: Pos -> Pos -> Bool #

(>) :: Pos -> Pos -> Bool #

(>=) :: Pos -> Pos -> Bool #

max :: Pos -> Pos -> Pos #

min :: Pos -> Pos -> Pos #

Ord BigNat 
Ord Natural 
Ord Void 

Methods

compare :: Void -> Void -> Ordering #

(<) :: Void -> Void -> Bool #

(<=) :: Void -> Void -> Bool #

(>) :: Void -> Void -> Bool #

(>=) :: Void -> Void -> Bool #

max :: Void -> Void -> Void #

min :: Void -> Void -> Void #

Ord Version 
Ord Unique 
Ord ThreadId 
Ord BlockReason 
Ord ThreadStatus 
Ord AsyncException 
Ord ArrayException 
Ord ExitCode 
Ord BufferMode 
Ord Newline 
Ord NewlineMode 
Ord WordPtr 
Ord IntPtr 
Ord CChar 

Methods

compare :: CChar -> CChar -> Ordering #

(<) :: CChar -> CChar -> Bool #

(<=) :: CChar -> CChar -> Bool #

(>) :: CChar -> CChar -> Bool #

(>=) :: CChar -> CChar -> Bool #

max :: CChar -> CChar -> CChar #

min :: CChar -> CChar -> CChar #

Ord CSChar 
Ord CUChar 
Ord CShort 
Ord CUShort 
Ord CInt 

Methods

compare :: CInt -> CInt -> Ordering #

(<) :: CInt -> CInt -> Bool #

(<=) :: CInt -> CInt -> Bool #

(>) :: CInt -> CInt -> Bool #

(>=) :: CInt -> CInt -> Bool #

max :: CInt -> CInt -> CInt #

min :: CInt -> CInt -> CInt #

Ord CUInt 

Methods

compare :: CUInt -> CUInt -> Ordering #

(<) :: CUInt -> CUInt -> Bool #

(<=) :: CUInt -> CUInt -> Bool #

(>) :: CUInt -> CUInt -> Bool #

(>=) :: CUInt -> CUInt -> Bool #

max :: CUInt -> CUInt -> CUInt #

min :: CUInt -> CUInt -> CUInt #

Ord CLong 

Methods

compare :: CLong -> CLong -> Ordering #

(<) :: CLong -> CLong -> Bool #

(<=) :: CLong -> CLong -> Bool #

(>) :: CLong -> CLong -> Bool #

(>=) :: CLong -> CLong -> Bool #

max :: CLong -> CLong -> CLong #

min :: CLong -> CLong -> CLong #

Ord CULong 
Ord CLLong 
Ord CULLong 
Ord CFloat 
Ord CDouble 
Ord CPtrdiff 
Ord CSize 

Methods

compare :: CSize -> CSize -> Ordering #

(<) :: CSize -> CSize -> Bool #

(<=) :: CSize -> CSize -> Bool #

(>) :: CSize -> CSize -> Bool #

(>=) :: CSize -> CSize -> Bool #

max :: CSize -> CSize -> CSize #

min :: CSize -> CSize -> CSize #

Ord CWchar 
Ord CSigAtomic 
Ord CClock 
Ord CTime 

Methods

compare :: CTime -> CTime -> Ordering #

(<) :: CTime -> CTime -> Bool #

(<=) :: CTime -> CTime -> Bool #

(>) :: CTime -> CTime -> Bool #

(>=) :: CTime -> CTime -> Bool #

max :: CTime -> CTime -> CTime #

min :: CTime -> CTime -> CTime #

Ord CUSeconds 
Ord CSUSeconds 
Ord CIntPtr 
Ord CUIntPtr 
Ord CIntMax 
Ord CUIntMax 
Ord All 

Methods

compare :: All -> All -> Ordering #

(<) :: All -> All -> Bool #

(<=) :: All -> All -> Bool #

(>) :: All -> All -> Bool #

(>=) :: All -> All -> Bool #

max :: All -> All -> All #

min :: All -> All -> All #

Ord Any 

Methods

compare :: Any -> Any -> Ordering #

(<) :: Any -> Any -> Bool #

(<=) :: Any -> Any -> Bool #

(>) :: Any -> Any -> Bool #

(>=) :: Any -> Any -> Bool #

max :: Any -> Any -> Any #

min :: Any -> Any -> Any #

Ord Fixity 
Ord Associativity 
Ord SourceUnpackedness 
Ord SourceStrictness 
Ord DecidedStrictness 
Ord ErrorCall 
Ord ArithException 
Ord Fingerprint 
Ord GeneralCategory 
Ord ShortByteString 
Ord IntSet 
Ord DirectoryType 

Methods

compare :: DirectoryType -> DirectoryType -> Ordering #

(<) :: DirectoryType -> DirectoryType -> Bool #

(<=) :: DirectoryType -> DirectoryType -> Bool #

(>) :: DirectoryType -> DirectoryType -> Bool #

(>=) :: DirectoryType -> DirectoryType -> Bool #

max :: DirectoryType -> DirectoryType -> DirectoryType #

min :: DirectoryType -> DirectoryType -> DirectoryType #

Ord Permissions 
Ord XdgDirectory 
Ord DefName 
Ord ModName 
Ord PkgName 
Ord Module 
Ord OccName 
Ord NameFlavour 
Ord NameSpace 
Ord Loc 

Methods

compare :: Loc -> Loc -> Ordering #

(<) :: Loc -> Loc -> Bool #

(<=) :: Loc -> Loc -> Bool #

(>) :: Loc -> Loc -> Bool #

(>=) :: Loc -> Loc -> Bool #

max :: Loc -> Loc -> Loc #

min :: Loc -> Loc -> Loc #

Ord Info 

Methods

compare :: Info -> Info -> Ordering #

(<) :: Info -> Info -> Bool #

(<=) :: Info -> Info -> Bool #

(>) :: Info -> Info -> Bool #

(>=) :: Info -> Info -> Bool #

max :: Info -> Info -> Info #

min :: Info -> Info -> Info #

Ord ModuleInfo 
Ord Fixity 
Ord FixityDirection 
Ord Lit 

Methods

compare :: Lit -> Lit -> Ordering #

(<) :: Lit -> Lit -> Bool #

(<=) :: Lit -> Lit -> Bool #

(>) :: Lit -> Lit -> Bool #

(>=) :: Lit -> Lit -> Bool #

max :: Lit -> Lit -> Lit #

min :: Lit -> Lit -> Lit #

Ord Body 

Methods

compare :: Body -> Body -> Ordering #

(<) :: Body -> Body -> Bool #

(<=) :: Body -> Body -> Bool #

(>) :: Body -> Body -> Bool #

(>=) :: Body -> Body -> Bool #

max :: Body -> Body -> Body #

min :: Body -> Body -> Body #

Ord Guard 

Methods

compare :: Guard -> Guard -> Ordering #

(<) :: Guard -> Guard -> Bool #

(<=) :: Guard -> Guard -> Bool #

(>) :: Guard -> Guard -> Bool #

(>=) :: Guard -> Guard -> Bool #

max :: Guard -> Guard -> Guard #

min :: Guard -> Guard -> Guard #

Ord Stmt 

Methods

compare :: Stmt -> Stmt -> Ordering #

(<) :: Stmt -> Stmt -> Bool #

(<=) :: Stmt -> Stmt -> Bool #

(>) :: Stmt -> Stmt -> Bool #

(>=) :: Stmt -> Stmt -> Bool #

max :: Stmt -> Stmt -> Stmt #

min :: Stmt -> Stmt -> Stmt #

Ord Range 

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

Ord TypeFamilyHead 
Ord TySynEqn 
Ord FamFlavour 
Ord Foreign 
Ord Callconv 
Ord Safety 
Ord Pragma 
Ord Inline 
Ord RuleMatch 
Ord Phases 
Ord RuleBndr 
Ord AnnTarget 
Ord SourceUnpackedness 
Ord SourceStrictness 
Ord DecidedStrictness 
Ord Bang 

Methods

compare :: Bang -> Bang -> Ordering #

(<) :: Bang -> Bang -> Bool #

(<=) :: Bang -> Bang -> Bool #

(>) :: Bang -> Bang -> Bool #

(>=) :: Bang -> Bang -> Bool #

max :: Bang -> Bang -> Bang #

min :: Bang -> Bang -> Bang #

Ord FamilyResultSig 
Ord TyLit 

Methods

compare :: TyLit -> TyLit -> Ordering #

(<) :: TyLit -> TyLit -> Bool #

(<=) :: TyLit -> TyLit -> Bool #

(>) :: TyLit -> TyLit -> Bool #

(>=) :: TyLit -> TyLit -> Bool #

max :: TyLit -> TyLit -> TyLit #

min :: TyLit -> TyLit -> TyLit #

Ord Role 

Methods

compare :: Role -> Role -> Ordering #

(<) :: Role -> Role -> Bool #

(<=) :: Role -> Role -> Bool #

(>) :: Role -> Role -> Bool #

(>=) :: Role -> Role -> Bool #

max :: Role -> Role -> Role #

min :: Role -> Role -> Role #

Ord AnnLookup 
Ord LocalTime 
Ord TimeOfDay 
Ord TimeLocale 
Ord TimeZone 
Ord NominalDiffTime 
Ord Day 

Methods

compare :: Day -> Day -> Ordering #

(<) :: Day -> Day -> Bool #

(<=) :: Day -> Day -> Bool #

(>) :: Day -> Day -> Bool #

(>=) :: Day -> Day -> Bool #

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

Ord UniversalTime 
Ord DiffTime 
Ord a => Ord [a] 

Methods

compare :: [a] -> [a] -> Ordering #

(<) :: [a] -> [a] -> Bool #

(<=) :: [a] -> [a] -> Bool #

(>) :: [a] -> [a] -> Bool #

(>=) :: [a] -> [a] -> Bool #

max :: [a] -> [a] -> [a] #

min :: [a] -> [a] -> [a] #

Ord a => Ord (Maybe a) 

Methods

compare :: Maybe a -> Maybe a -> Ordering #

(<) :: Maybe a -> Maybe a -> Bool #

(<=) :: Maybe a -> Maybe a -> Bool #

(>) :: Maybe a -> Maybe a -> Bool #

(>=) :: Maybe a -> Maybe a -> Bool #

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Integral a => Ord (Ratio a) 

Methods

compare :: Ratio a -> Ratio a -> Ordering #

(<) :: Ratio a -> Ratio a -> Bool #

(<=) :: Ratio a -> Ratio a -> Bool #

(>) :: Ratio a -> Ratio a -> Bool #

(>=) :: Ratio a -> Ratio a -> Bool #

max :: Ratio a -> Ratio a -> Ratio a #

min :: Ratio a -> Ratio a -> Ratio a #

Ord (Ptr a) 

Methods

compare :: Ptr a -> Ptr a -> Ordering #

(<) :: Ptr a -> Ptr a -> Bool #

(<=) :: Ptr a -> Ptr a -> Bool #

(>) :: Ptr a -> Ptr a -> Bool #

(>=) :: Ptr a -> Ptr a -> Bool #

max :: Ptr a -> Ptr a -> Ptr a #

min :: Ptr a -> Ptr a -> Ptr a #

Ord (FunPtr a) 

Methods

compare :: FunPtr a -> FunPtr a -> Ordering #

(<) :: FunPtr a -> FunPtr a -> Bool #

(<=) :: FunPtr a -> FunPtr a -> Bool #

(>) :: FunPtr a -> FunPtr a -> Bool #

(>=) :: FunPtr a -> FunPtr a -> Bool #

max :: FunPtr a -> FunPtr a -> FunPtr a #

min :: FunPtr a -> FunPtr a -> FunPtr a #

Ord (V1 p) 

Methods

compare :: V1 p -> V1 p -> Ordering #

(<) :: V1 p -> V1 p -> Bool #

(<=) :: V1 p -> V1 p -> Bool #

(>) :: V1 p -> V1 p -> Bool #

(>=) :: V1 p -> V1 p -> Bool #

max :: V1 p -> V1 p -> V1 p #

min :: V1 p -> V1 p -> V1 p #

Ord (U1 p) 

Methods

compare :: U1 p -> U1 p -> Ordering #

(<) :: U1 p -> U1 p -> Bool #

(<=) :: U1 p -> U1 p -> Bool #

(>) :: U1 p -> U1 p -> Bool #

(>=) :: U1 p -> U1 p -> Bool #

max :: U1 p -> U1 p -> U1 p #

min :: U1 p -> U1 p -> U1 p #

Ord p => Ord (Par1 p) 

Methods

compare :: Par1 p -> Par1 p -> Ordering #

(<) :: Par1 p -> Par1 p -> Bool #

(<=) :: Par1 p -> Par1 p -> Bool #

(>) :: Par1 p -> Par1 p -> Bool #

(>=) :: Par1 p -> Par1 p -> Bool #

max :: Par1 p -> Par1 p -> Par1 p #

min :: Par1 p -> Par1 p -> Par1 p #

Ord (ForeignPtr a) 
Ord a => Ord (Identity a) 

Methods

compare :: Identity a -> Identity a -> Ordering #

(<) :: Identity a -> Identity a -> Bool #

(<=) :: Identity a -> Identity a -> Bool #

(>) :: Identity a -> Identity a -> Bool #

(>=) :: Identity a -> Identity a -> Bool #

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Ord a => Ord (Min a) 

Methods

compare :: Min a -> Min a -> Ordering #

(<) :: Min a -> Min a -> Bool #

(<=) :: Min a -> Min a -> Bool #

(>) :: Min a -> Min a -> Bool #

(>=) :: Min a -> Min a -> Bool #

max :: Min a -> Min a -> Min a #

min :: Min a -> Min a -> Min a #

Ord a => Ord (Max a) 

Methods

compare :: Max a -> Max a -> Ordering #

(<) :: Max a -> Max a -> Bool #

(<=) :: Max a -> Max a -> Bool #

(>) :: Max a -> Max a -> Bool #

(>=) :: Max a -> Max a -> Bool #

max :: Max a -> Max a -> Max a #

min :: Max a -> Max a -> Max a #

Ord a => Ord (First a) 

Methods

compare :: First a -> First a -> Ordering #

(<) :: First a -> First a -> Bool #

(<=) :: First a -> First a -> Bool #

(>) :: First a -> First a -> Bool #

(>=) :: First a -> First a -> Bool #

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord a => Ord (Last a) 

Methods

compare :: Last a -> Last a -> Ordering #

(<) :: Last a -> Last a -> Bool #

(<=) :: Last a -> Last a -> Bool #

(>) :: Last a -> Last a -> Bool #

(>=) :: Last a -> Last a -> Bool #

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord m => Ord (WrappedMonoid m) 
Ord a => Ord (Option a) 

Methods

compare :: Option a -> Option a -> Ordering #

(<) :: Option a -> Option a -> Bool #

(<=) :: Option a -> Option a -> Bool #

(>) :: Option a -> Option a -> Bool #

(>=) :: Option a -> Option a -> Bool #

max :: Option a -> Option a -> Option a #

min :: Option a -> Option a -> Option a #

Ord a => Ord (NonEmpty a) 

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Ord (Fixed a) 

Methods

compare :: Fixed a -> Fixed a -> Ordering #

(<) :: Fixed a -> Fixed a -> Bool #

(<=) :: Fixed a -> Fixed a -> Bool #

(>) :: Fixed a -> Fixed a -> Bool #

(>=) :: Fixed a -> Fixed a -> Bool #

max :: Fixed a -> Fixed a -> Fixed a #

min :: Fixed a -> Fixed a -> Fixed a #

Ord a => Ord (ZipList a) 

Methods

compare :: ZipList a -> ZipList a -> Ordering #

(<) :: ZipList a -> ZipList a -> Bool #

(<=) :: ZipList a -> ZipList a -> Bool #

(>) :: ZipList a -> ZipList a -> Bool #

(>=) :: ZipList a -> ZipList a -> Bool #

max :: ZipList a -> ZipList a -> ZipList a #

min :: ZipList a -> ZipList a -> ZipList a #

Ord a => Ord (Dual a) 

Methods

compare :: Dual a -> Dual a -> Ordering #

(<) :: Dual a -> Dual a -> Bool #

(<=) :: Dual a -> Dual a -> Bool #

(>) :: Dual a -> Dual a -> Bool #

(>=) :: Dual a -> Dual a -> Bool #

max :: Dual a -> Dual a -> Dual a #

min :: Dual a -> Dual a -> Dual a #

Ord a => Ord (Sum a) 

Methods

compare :: Sum a -> Sum a -> Ordering #

(<) :: Sum a -> Sum a -> Bool #

(<=) :: Sum a -> Sum a -> Bool #

(>) :: Sum a -> Sum a -> Bool #

(>=) :: Sum a -> Sum a -> Bool #

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Ord a => Ord (Product a) 

Methods

compare :: Product a -> Product a -> Ordering #

(<) :: Product a -> Product a -> Bool #

(<=) :: Product a -> Product a -> Bool #

(>) :: Product a -> Product a -> Bool #

(>=) :: Product a -> Product a -> Bool #

max :: Product a -> Product a -> Product a #

min :: Product a -> Product a -> Product a #

Ord a => Ord (First a) 

Methods

compare :: First a -> First a -> Ordering #

(<) :: First a -> First a -> Bool #

(<=) :: First a -> First a -> Bool #

(>) :: First a -> First a -> Bool #

(>=) :: First a -> First a -> Bool #

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord a => Ord (Last a) 

Methods

compare :: Last a -> Last a -> Ordering #

(<) :: Last a -> Last a -> Bool #

(<=) :: Last a -> Last a -> Bool #

(>) :: Last a -> Last a -> Bool #

(>=) :: Last a -> Last a -> Bool #

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord a => Ord (Down a) 

Methods

compare :: Down a -> Down a -> Ordering #

(<) :: Down a -> Down a -> Bool #

(<=) :: Down a -> Down a -> Bool #

(>) :: Down a -> Down a -> Bool #

(>=) :: Down a -> Down a -> Bool #

max :: Down a -> Down a -> Down a #

min :: Down a -> Down a -> Down a #

Ord a => Ord (IntMap a) 

Methods

compare :: IntMap a -> IntMap a -> Ordering #

(<) :: IntMap a -> IntMap a -> Bool #

(<=) :: IntMap a -> IntMap a -> Bool #

(>) :: IntMap a -> IntMap a -> Bool #

(>=) :: IntMap a -> IntMap a -> Bool #

max :: IntMap a -> IntMap a -> IntMap a #

min :: IntMap a -> IntMap a -> IntMap a #

Ord a => Ord (Seq a) 

Methods

compare :: Seq a -> Seq a -> Ordering #

(<) :: Seq a -> Seq a -> Bool #

(<=) :: Seq a -> Seq a -> Bool #

(>) :: Seq a -> Seq a -> Bool #

(>=) :: Seq a -> Seq a -> Bool #

max :: Seq a -> Seq a -> Seq a #

min :: Seq a -> Seq a -> Seq a #

Ord a => Ord (ViewL a) 

Methods

compare :: ViewL a -> ViewL a -> Ordering #

(<) :: ViewL a -> ViewL a -> Bool #

(<=) :: ViewL a -> ViewL a -> Bool #

(>) :: ViewL a -> ViewL a -> Bool #

(>=) :: ViewL a -> ViewL a -> Bool #

max :: ViewL a -> ViewL a -> ViewL a #

min :: ViewL a -> ViewL a -> ViewL a #

Ord a => Ord (ViewR a) 

Methods

compare :: ViewR a -> ViewR a -> Ordering #

(<) :: ViewR a -> ViewR a -> Bool #

(<=) :: ViewR a -> ViewR a -> Bool #

(>) :: ViewR a -> ViewR a -> Bool #

(>=) :: ViewR a -> ViewR a -> Bool #

max :: ViewR a -> ViewR a -> ViewR a #

min :: ViewR a -> ViewR a -> ViewR a #

Ord a => Ord (Set a) 

Methods

compare :: Set a -> Set a -> Ordering #

(<) :: Set a -> Set a -> Bool #

(<=) :: Set a -> Set a -> Bool #

(>) :: Set a -> Set a -> Bool #

(>=) :: Set a -> Set a -> Bool #

max :: Set a -> Set a -> Set a #

min :: Set a -> Set a -> Set a #

Ord a => Ord (DList a) 

Methods

compare :: DList a -> DList a -> Ordering #

(<) :: DList a -> DList a -> Bool #

(<=) :: DList a -> DList a -> Bool #

(>) :: DList a -> DList a -> Bool #

(>=) :: DList a -> DList a -> Bool #

max :: DList a -> DList a -> DList a #

min :: DList a -> DList a -> DList a #

Ord a => Ord (Hashed a) 

Methods

compare :: Hashed a -> Hashed a -> Ordering #

(<) :: Hashed a -> Hashed a -> Bool #

(<=) :: Hashed a -> Hashed a -> Bool #

(>) :: Hashed a -> Hashed a -> Bool #

(>=) :: Hashed a -> Hashed a -> Bool #

max :: Hashed a -> Hashed a -> Hashed a #

min :: Hashed a -> Hashed a -> Hashed a #

Ord a => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Prim a, Ord a) => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Storable a, Ord a) => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

(Ord b, Ord a) => Ord (Either a b) 

Methods

compare :: Either a b -> Either a b -> Ordering #

(<) :: Either a b -> Either a b -> Bool #

(<=) :: Either a b -> Either a b -> Bool #

(>) :: Either a b -> Either a b -> Bool #

(>=) :: Either a b -> Either a b -> Bool #

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

Ord (f p) => Ord (Rec1 f p) 

Methods

compare :: Rec1 f p -> Rec1 f p -> Ordering #

(<) :: Rec1 f p -> Rec1 f p -> Bool #

(<=) :: Rec1 f p -> Rec1 f p -> Bool #

(>) :: Rec1 f p -> Rec1 f p -> Bool #

(>=) :: Rec1 f p -> Rec1 f p -> Bool #

max :: Rec1 f p -> Rec1 f p -> Rec1 f p #

min :: Rec1 f p -> Rec1 f p -> Rec1 f p #

Ord (URec Char p) 

Methods

compare :: URec Char p -> URec Char p -> Ordering #

(<) :: URec Char p -> URec Char p -> Bool #

(<=) :: URec Char p -> URec Char p -> Bool #

(>) :: URec Char p -> URec Char p -> Bool #

(>=) :: URec Char p -> URec Char p -> Bool #

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

Ord (URec Double p) 

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

Ord (URec Float p) 

Methods

compare :: URec Float p -> URec Float p -> Ordering #

(<) :: URec Float p -> URec Float p -> Bool #

(<=) :: URec Float p -> URec Float p -> Bool #

(>) :: URec Float p -> URec Float p -> Bool #

(>=) :: URec Float p -> URec Float p -> Bool #

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

Ord (URec Int p) 

Methods

compare :: URec Int p -> URec Int p -> Ordering #

(<) :: URec Int p -> URec Int p -> Bool #

(<=) :: URec Int p -> URec Int p -> Bool #

(>) :: URec Int p -> URec Int p -> Bool #

(>=) :: URec Int p -> URec Int p -> Bool #

max :: URec Int p -> URec Int p -> URec Int p #

min :: URec Int p -> URec Int p -> URec Int p #

Ord (URec Word p) 

Methods

compare :: URec Word p -> URec Word p -> Ordering #

(<) :: URec Word p -> URec Word p -> Bool #

(<=) :: URec Word p -> URec Word p -> Bool #

(>) :: URec Word p -> URec Word p -> Bool #

(>=) :: URec Word p -> URec Word p -> Bool #

max :: URec Word p -> URec Word p -> URec Word p #

min :: URec Word p -> URec Word p -> URec Word p #

Ord (URec (Ptr ()) p) 

Methods

compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering #

(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

(Ord a, Ord b) => Ord (a, b) 

Methods

compare :: (a, b) -> (a, b) -> Ordering #

(<) :: (a, b) -> (a, b) -> Bool #

(<=) :: (a, b) -> (a, b) -> Bool #

(>) :: (a, b) -> (a, b) -> Bool #

(>=) :: (a, b) -> (a, b) -> Bool #

max :: (a, b) -> (a, b) -> (a, b) #

min :: (a, b) -> (a, b) -> (a, b) #

(Ord k, Ord v) => Ord (Map k v) 

Methods

compare :: Map k v -> Map k v -> Ordering #

(<) :: Map k v -> Map k v -> Bool #

(<=) :: Map k v -> Map k v -> Bool #

(>) :: Map k v -> Map k v -> Bool #

(>=) :: Map k v -> Map k v -> Bool #

max :: Map k v -> Map k v -> Map k v #

min :: Map k v -> Map k v -> Map k v #

(Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e) 

Methods

compare :: UArray ix e -> UArray ix e -> Ordering #

(<) :: UArray ix e -> UArray ix e -> Bool #

(<=) :: UArray ix e -> UArray ix e -> Bool #

(>) :: UArray ix e -> UArray ix e -> Bool #

(>=) :: UArray ix e -> UArray ix e -> Bool #

max :: UArray ix e -> UArray ix e -> UArray ix e #

min :: UArray ix e -> UArray ix e -> UArray ix e #

(Ix i, Ord e) => Ord (Array i e) 

Methods

compare :: Array i e -> Array i e -> Ordering #

(<) :: Array i e -> Array i e -> Bool #

(<=) :: Array i e -> Array i e -> Bool #

(>) :: Array i e -> Array i e -> Bool #

(>=) :: Array i e -> Array i e -> Bool #

max :: Array i e -> Array i e -> Array i e #

min :: Array i e -> Array i e -> Array i e #

Ord a => Ord (Arg a b) 

Methods

compare :: Arg a b -> Arg a b -> Ordering #

(<) :: Arg a b -> Arg a b -> Bool #

(<=) :: Arg a b -> Arg a b -> Bool #

(>) :: Arg a b -> Arg a b -> Bool #

(>=) :: Arg a b -> Arg a b -> Bool #

max :: Arg a b -> Arg a b -> Arg a b #

min :: Arg a b -> Arg a b -> Arg a b #

Ord (Proxy k s) 

Methods

compare :: Proxy k s -> Proxy k s -> Ordering #

(<) :: Proxy k s -> Proxy k s -> Bool #

(<=) :: Proxy k s -> Proxy k s -> Bool #

(>) :: Proxy k s -> Proxy k s -> Bool #

(>=) :: Proxy k s -> Proxy k s -> Bool #

max :: Proxy k s -> Proxy k s -> Proxy k s #

min :: Proxy k s -> Proxy k s -> Proxy k s #

(Ord (f (Cofree f a)), Ord a) => Ord (Cofree f a) 

Methods

compare :: Cofree f a -> Cofree f a -> Ordering #

(<) :: Cofree f a -> Cofree f a -> Bool #

(<=) :: Cofree f a -> Cofree f a -> Bool #

(>) :: Cofree f a -> Cofree f a -> Bool #

(>=) :: Cofree f a -> Cofree f a -> Bool #

max :: Cofree f a -> Cofree f a -> Cofree f a #

min :: Cofree f a -> Cofree f a -> Cofree f a #

Ord (f a) => Ord (Yoneda f a) 

Methods

compare :: Yoneda f a -> Yoneda f a -> Ordering #

(<) :: Yoneda f a -> Yoneda f a -> Bool #

(<=) :: Yoneda f a -> Yoneda f a -> Bool #

(>) :: Yoneda f a -> Yoneda f a -> Bool #

(>=) :: Yoneda f a -> Yoneda f a -> Bool #

max :: Yoneda f a -> Yoneda f a -> Yoneda f a #

min :: Yoneda f a -> Yoneda f a -> Yoneda f a #

(Ord a, Ord i) => Ord (Level i a) 

Methods

compare :: Level i a -> Level i a -> Ordering #

(<) :: Level i a -> Level i a -> Bool #

(<=) :: Level i a -> Level i a -> Bool #

(>) :: Level i a -> Level i a -> Bool #

(>=) :: Level i a -> Level i a -> Bool #

max :: Level i a -> Level i a -> Level i a #

min :: Level i a -> Level i a -> Level i a #

(Ord1 m, Ord a) => Ord (ListT m a) 

Methods

compare :: ListT m a -> ListT m a -> Ordering #

(<) :: ListT m a -> ListT m a -> Bool #

(<=) :: ListT m a -> ListT m a -> Bool #

(>) :: ListT m a -> ListT m a -> Bool #

(>=) :: ListT m a -> ListT m a -> Bool #

max :: ListT m a -> ListT m a -> ListT m a #

min :: ListT m a -> ListT m a -> ListT m a #

(Ord1 m, Ord a) => Ord (MaybeT m a) 

Methods

compare :: MaybeT m a -> MaybeT m a -> Ordering #

(<) :: MaybeT m a -> MaybeT m a -> Bool #

(<=) :: MaybeT m a -> MaybeT m a -> Bool #

(>) :: MaybeT m a -> MaybeT m a -> Bool #

(>=) :: MaybeT m a -> MaybeT m a -> Bool #

max :: MaybeT m a -> MaybeT m a -> MaybeT m a #

min :: MaybeT m a -> MaybeT m a -> MaybeT m a #

(Ord v, Ord k) => Ord (AList k v) # 

Methods

compare :: AList k v -> AList k v -> Ordering #

(<) :: AList k v -> AList k v -> Bool #

(<=) :: AList k v -> AList k v -> Bool #

(>) :: AList k v -> AList k v -> Bool #

(>=) :: AList k v -> AList k v -> Bool #

max :: AList k v -> AList k v -> AList k v #

min :: AList k v -> AList k v -> AList k v #

Ord c => Ord (K1 i c p) 

Methods

compare :: K1 i c p -> K1 i c p -> Ordering #

(<) :: K1 i c p -> K1 i c p -> Bool #

(<=) :: K1 i c p -> K1 i c p -> Bool #

(>) :: K1 i c p -> K1 i c p -> Bool #

(>=) :: K1 i c p -> K1 i c p -> Bool #

max :: K1 i c p -> K1 i c p -> K1 i c p #

min :: K1 i c p -> K1 i c p -> K1 i c p #

(Ord (g p), Ord (f p)) => Ord ((:+:) f g p) 

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

(Ord (g p), Ord (f p)) => Ord ((:*:) f g p) 

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

Ord (f (g p)) => Ord ((:.:) f g p) 

Methods

compare :: (f :.: g) p -> (f :.: g) p -> Ordering #

(<) :: (f :.: g) p -> (f :.: g) p -> Bool #

(<=) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>=) :: (f :.: g) p -> (f :.: g) p -> Bool #

max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

(Ord a, Ord b, Ord c) => Ord (a, b, c) 

Methods

compare :: (a, b, c) -> (a, b, c) -> Ordering #

(<) :: (a, b, c) -> (a, b, c) -> Bool #

(<=) :: (a, b, c) -> (a, b, c) -> Bool #

(>) :: (a, b, c) -> (a, b, c) -> Bool #

(>=) :: (a, b, c) -> (a, b, c) -> Bool #

max :: (a, b, c) -> (a, b, c) -> (a, b, c) #

min :: (a, b, c) -> (a, b, c) -> (a, b, c) #

Ord a => Ord (Const k a b) 

Methods

compare :: Const k a b -> Const k a b -> Ordering #

(<) :: Const k a b -> Const k a b -> Bool #

(<=) :: Const k a b -> Const k a b -> Bool #

(>) :: Const k a b -> Const k a b -> Bool #

(>=) :: Const k a b -> Const k a b -> Bool #

max :: Const k a b -> Const k a b -> Const k a b #

min :: Const k a b -> Const k a b -> Const k a b #

Ord (f a) => Ord (Alt k f a) 

Methods

compare :: Alt k f a -> Alt k f a -> Ordering #

(<) :: Alt k f a -> Alt k f a -> Bool #

(<=) :: Alt k f a -> Alt k f a -> Bool #

(>) :: Alt k f a -> Alt k f a -> Bool #

(>=) :: Alt k f a -> Alt k f a -> Bool #

max :: Alt k f a -> Alt k f a -> Alt k f a #

min :: Alt k f a -> Alt k f a -> Alt k f a #

Ord (Coercion k a b) 

Methods

compare :: Coercion k a b -> Coercion k a b -> Ordering #

(<) :: Coercion k a b -> Coercion k a b -> Bool #

(<=) :: Coercion k a b -> Coercion k a b -> Bool #

(>) :: Coercion k a b -> Coercion k a b -> Bool #

(>=) :: Coercion k a b -> Coercion k a b -> Bool #

max :: Coercion k a b -> Coercion k a b -> Coercion k a b #

min :: Coercion k a b -> Coercion k a b -> Coercion k a b #

Ord ((:~:) k a b) 

Methods

compare :: (k :~: a) b -> (k :~: a) b -> Ordering #

(<) :: (k :~: a) b -> (k :~: a) b -> Bool #

(<=) :: (k :~: a) b -> (k :~: a) b -> Bool #

(>) :: (k :~: a) b -> (k :~: a) b -> Bool #

(>=) :: (k :~: a) b -> (k :~: a) b -> Bool #

max :: (k :~: a) b -> (k :~: a) b -> (k :~: a) b #

min :: (k :~: a) b -> (k :~: a) b -> (k :~: a) b #

Ord (p a a) => Ord (Join k p a) 

Methods

compare :: Join k p a -> Join k p a -> Ordering #

(<) :: Join k p a -> Join k p a -> Bool #

(<=) :: Join k p a -> Join k p a -> Bool #

(>) :: Join k p a -> Join k p a -> Bool #

(>=) :: Join k p a -> Join k p a -> Bool #

max :: Join k p a -> Join k p a -> Join k p a #

min :: Join k p a -> Join k p a -> Join k p a #

(Ord1 f, Ord a) => Ord (IdentityT * f a) 

Methods

compare :: IdentityT * f a -> IdentityT * f a -> Ordering #

(<) :: IdentityT * f a -> IdentityT * f a -> Bool #

(<=) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>=) :: IdentityT * f a -> IdentityT * f a -> Bool #

max :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

min :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

(Ord (f b), Ord a) => Ord (FreeF f a b) 

Methods

compare :: FreeF f a b -> FreeF f a b -> Ordering #

(<) :: FreeF f a b -> FreeF f a b -> Bool #

(<=) :: FreeF f a b -> FreeF f a b -> Bool #

(>) :: FreeF f a b -> FreeF f a b -> Bool #

(>=) :: FreeF f a b -> FreeF f a b -> Bool #

max :: FreeF f a b -> FreeF f a b -> FreeF f a b #

min :: FreeF f a b -> FreeF f a b -> FreeF f a b #

Ord (m (FreeF f a (FreeT f m a))) => Ord (FreeT f m a) 

Methods

compare :: FreeT f m a -> FreeT f m a -> Ordering #

(<) :: FreeT f m a -> FreeT f m a -> Bool #

(<=) :: FreeT f m a -> FreeT f m a -> Bool #

(>) :: FreeT f m a -> FreeT f m a -> Bool #

(>=) :: FreeT f m a -> FreeT f m a -> Bool #

max :: FreeT f m a -> FreeT f m a -> FreeT f m a #

min :: FreeT f m a -> FreeT f m a -> FreeT f m a #

(Ord1 f, Ord a) => Ord (Backwards * f a) 

Methods

compare :: Backwards * f a -> Backwards * f a -> Ordering #

(<) :: Backwards * f a -> Backwards * f a -> Bool #

(<=) :: Backwards * f a -> Backwards * f a -> Bool #

(>) :: Backwards * f a -> Backwards * f a -> Bool #

(>=) :: Backwards * f a -> Backwards * f a -> Bool #

max :: Backwards * f a -> Backwards * f a -> Backwards * f a #

min :: Backwards * f a -> Backwards * f a -> Backwards * f a #

(Ord e, Ord1 m, Ord a) => Ord (ErrorT e m a) 

Methods

compare :: ErrorT e m a -> ErrorT e m a -> Ordering #

(<) :: ErrorT e m a -> ErrorT e m a -> Bool #

(<=) :: ErrorT e m a -> ErrorT e m a -> Bool #

(>) :: ErrorT e m a -> ErrorT e m a -> Bool #

(>=) :: ErrorT e m a -> ErrorT e m a -> Bool #

max :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #

min :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #

(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) 

Methods

compare :: ExceptT e m a -> ExceptT e m a -> Ordering #

(<) :: ExceptT e m a -> ExceptT e m a -> Bool #

(<=) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>=) :: ExceptT e m a -> ExceptT e m a -> Bool #

max :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

min :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) 

Methods

compare :: WriterT w m a -> WriterT w m a -> Ordering #

(<) :: WriterT w m a -> WriterT w m a -> Bool #

(<=) :: WriterT w m a -> WriterT w m a -> Bool #

(>) :: WriterT w m a -> WriterT w m a -> Bool #

(>=) :: WriterT w m a -> WriterT w m a -> Bool #

max :: WriterT w m a -> WriterT w m a -> WriterT w m a #

min :: WriterT w m a -> WriterT w m a -> WriterT w m a #

(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) 

Methods

compare :: WriterT w m a -> WriterT w m a -> Ordering #

(<) :: WriterT w m a -> WriterT w m a -> Bool #

(<=) :: WriterT w m a -> WriterT w m a -> Bool #

(>) :: WriterT w m a -> WriterT w m a -> Bool #

(>=) :: WriterT w m a -> WriterT w m a -> Bool #

max :: WriterT w m a -> WriterT w m a -> WriterT w m a #

min :: WriterT w m a -> WriterT w m a -> WriterT w m a #

Ord b => Ord (Tagged k s b) 

Methods

compare :: Tagged k s b -> Tagged k s b -> Ordering #

(<) :: Tagged k s b -> Tagged k s b -> Bool #

(<=) :: Tagged k s b -> Tagged k s b -> Bool #

(>) :: Tagged k s b -> Tagged k s b -> Bool #

(>=) :: Tagged k s b -> Tagged k s b -> Bool #

max :: Tagged k s b -> Tagged k s b -> Tagged k s b #

min :: Tagged k s b -> Tagged k s b -> Tagged k s b #

(Ord1 f, Ord a) => Ord (Reverse * f a) 

Methods

compare :: Reverse * f a -> Reverse * f a -> Ordering #

(<) :: Reverse * f a -> Reverse * f a -> Bool #

(<=) :: Reverse * f a -> Reverse * f a -> Bool #

(>) :: Reverse * f a -> Reverse * f a -> Bool #

(>=) :: Reverse * f a -> Reverse * f a -> Bool #

max :: Reverse * f a -> Reverse * f a -> Reverse * f a #

min :: Reverse * f a -> Reverse * f a -> Reverse * f a #

Ord a => Ord (Constant k a b) 

Methods

compare :: Constant k a b -> Constant k a b -> Ordering #

(<) :: Constant k a b -> Constant k a b -> Bool #

(<=) :: Constant k a b -> Constant k a b -> Bool #

(>) :: Constant k a b -> Constant k a b -> Bool #

(>=) :: Constant k a b -> Constant k a b -> Bool #

max :: Constant k a b -> Constant k a b -> Constant k a b #

min :: Constant k a b -> Constant k a b -> Constant k a b #

Ord (f p) => Ord (M1 i c f p) 

Methods

compare :: M1 i c f p -> M1 i c f p -> Ordering #

(<) :: M1 i c f p -> M1 i c f p -> Bool #

(<=) :: M1 i c f p -> M1 i c f p -> Bool #

(>) :: M1 i c f p -> M1 i c f p -> Bool #

(>=) :: M1 i c f p -> M1 i c f p -> Bool #

max :: M1 i c f p -> M1 i c f p -> M1 i c f p #

min :: M1 i c f p -> M1 i c f p -> M1 i c f p #

(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) 

Methods

compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering #

(<) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(>) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

(>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #

max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

(Ord1 f, Ord1 g, Ord a) => Ord (Sum * f g a) 

Methods

compare :: Sum * f g a -> Sum * f g a -> Ordering #

(<) :: Sum * f g a -> Sum * f g a -> Bool #

(<=) :: Sum * f g a -> Sum * f g a -> Bool #

(>) :: Sum * f g a -> Sum * f g a -> Bool #

(>=) :: Sum * f g a -> Sum * f g a -> Bool #

max :: Sum * f g a -> Sum * f g a -> Sum * f g a #

min :: Sum * f g a -> Sum * f g a -> Sum * f g a #

(Ord1 f, Ord1 g, Ord a) => Ord (Product * f g a) 

Methods

compare :: Product * f g a -> Product * f g a -> Ordering #

(<) :: Product * f g a -> Product * f g a -> Bool #

(<=) :: Product * f g a -> Product * f g a -> Bool #

(>) :: Product * f g a -> Product * f g a -> Bool #

(>=) :: Product * f g a -> Product * f g a -> Bool #

max :: Product * f g a -> Product * f g a -> Product * f g a #

min :: Product * f g a -> Product * f g a -> Product * f g a #

(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) 

Methods

compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering #

(<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

(>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #

max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

(Ord1 f, Ord1 g, Ord a) => Ord (Compose * * f g a) 

Methods

compare :: Compose * * f g a -> Compose * * f g a -> Ordering #

(<) :: Compose * * f g a -> Compose * * f g a -> Bool #

(<=) :: Compose * * f g a -> Compose * * f g a -> Bool #

(>) :: Compose * * f g a -> Compose * * f g a -> Bool #

(>=) :: Compose * * f g a -> Compose * * f g a -> Bool #

max :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #

min :: Compose * * f g a -> Compose * * f g a -> Compose * * f g a #

Ord (p a b) => Ord (WrappedBifunctor k1 k p a b) 

Methods

compare :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Ordering #

(<) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(<=) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(>) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

(>=) :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> Bool #

max :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b #

min :: WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b -> WrappedBifunctor k1 k p a b #

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 #

Ord (p b a) => Ord (Flip k k1 p a b) 

Methods

compare :: Flip k k1 p a b -> Flip k k1 p a b -> Ordering #

(<) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(<=) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(>) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

(>=) :: Flip k k1 p a b -> Flip k k1 p a b -> Bool #

max :: Flip k k1 p a b -> Flip k k1 p a b -> Flip k k1 p a b #

min :: Flip k k1 p a b -> Flip k k1 p a b -> Flip k k1 p a b #

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 #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) 

Methods

compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering #

(<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #

(Ord (g a b), Ord (f a b)) => Ord (Product k1 k f g a b) 

Methods

compare :: Product k1 k f g a b -> Product k1 k f g a b -> Ordering #

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

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

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

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

max :: Product k1 k f g a b -> Product k1 k f g a b -> Product k1 k f g a b #

min :: Product k1 k f g a b -> Product k1 k f g a b -> Product k1 k f g a b #

(Ord (q a b), Ord (p a b)) => Ord (Sum k1 k p q a b) 

Methods

compare :: Sum k1 k p q a b -> Sum k1 k p q a b -> Ordering #

(<) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(<=) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(>) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

(>=) :: Sum k1 k p q a b -> Sum k1 k p q a b -> Bool #

max :: Sum k1 k p q a b -> Sum k1 k p q a b -> Sum k1 k p q a b #

min :: Sum k1 k p q a b -> Sum k1 k p q a b -> Sum k1 k p q a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) 

Methods

compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering #

(<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #

Ord (f (p a b)) => Ord (Tannen k2 k1 k f p a b) 

Methods

compare :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Ordering #

(<) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(<=) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(>) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

(>=) :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Bool #

max :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b #

min :: Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b -> Tannen k2 k1 k f p a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) 

Methods

compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) 

Methods

compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #

Ord (p (f a) (g b)) => Ord (Biff k3 k2 k1 k p f g a b) 

Methods

compare :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Ordering #

(<) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(<=) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(>) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

(>=) :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Bool #

max :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b #

min :: Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b -> Biff k3 k2 k1 k p f g a b #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

data Traversed a f :: * -> (* -> *) -> * #

Used internally by traverseOf_ and the like.

The argument a of the result should not be used!

Instances

Apply f => Semigroup (Traversed a f) 

Methods

(<>) :: Traversed a f -> Traversed a f -> Traversed a f #

sconcat :: NonEmpty (Traversed a f) -> Traversed a f #

stimes :: Integral b => b -> Traversed a f -> Traversed a f #

Applicative f => Monoid (Traversed a f) 

Methods

mempty :: Traversed a f #

mappend :: Traversed a f -> Traversed a f -> Traversed a f #

mconcat :: [Traversed a f] -> Traversed a f #

data Traversed a f :: * -> (* -> *) -> * #

Used internally by traverseOf_ and the like.

The argument a of the result should not be used!

Instances

Apply f => Semigroup (Traversed a f) 

Methods

(<>) :: Traversed a f -> Traversed a f -> Traversed a f #

sconcat :: NonEmpty (Traversed a f) -> Traversed a f #

stimes :: Integral b => b -> Traversed a f -> Traversed a f #

Applicative f => Monoid (Traversed a f) 

Methods

mempty :: Traversed a f #

mappend :: Traversed a f -> Traversed a f -> Traversed a f #

mconcat :: [Traversed a f] -> Traversed a f #

type Traversing p f s t a b = Over * * p (BazaarT p f a b) s t a b #

When you see this as an argument to a function, it expects

type Traversing' p f s a = Traversing p f s s a a #

type Traversing1 p f s t a b = Over * * p (BazaarT1 p f a b) s t a b #

type Traversing1' p f s a = Traversing1 p f s s a a #

type family Unwrapped s :: * #

Instances

type Unwrapped PatternMatchFail 
type Unwrapped RecSelError 
type Unwrapped RecConError 
type Unwrapped RecUpdError 
type Unwrapped NoMethodError 
type Unwrapped AssertionFailed 
type Unwrapped All 
type Unwrapped Any 
type Unwrapped ErrorCall 
type Unwrapped IntSet 
type Unwrapped (Identity a) 
type Unwrapped (Identity a) = a
type Unwrapped (Min a) 
type Unwrapped (Min a) = a
type Unwrapped (Max a) 
type Unwrapped (Max a) = a
type Unwrapped (First a) 
type Unwrapped (First a) = a
type Unwrapped (Last a) 
type Unwrapped (Last a) = a
type Unwrapped (WrappedMonoid a) 
type Unwrapped (Option a) 
type Unwrapped (Option a) = Maybe a
type Unwrapped (NonEmpty a) 
type Unwrapped (NonEmpty a) = (a, [a])
type Unwrapped (ZipList a) 
type Unwrapped (ZipList a) = [a]
type Unwrapped (Dual a) 
type Unwrapped (Dual a) = a
type Unwrapped (Endo a) 
type Unwrapped (Endo a) = a -> a
type Unwrapped (Sum a) 
type Unwrapped (Sum a) = a
type Unwrapped (Product a) 
type Unwrapped (Product a) = a
type Unwrapped (First a) 
type Unwrapped (First a) = Maybe a
type Unwrapped (Last a) 
type Unwrapped (Last a) = Maybe a
type Unwrapped (Down a) 
type Unwrapped (Down a) = a
type Unwrapped (IntMap a) 
type Unwrapped (IntMap a) = [(Int, a)]
type Unwrapped (Seq a) 
type Unwrapped (Seq a) = [a]
type Unwrapped (Set a) 
type Unwrapped (Set a) = [a]
type Unwrapped (Predicate a) 
type Unwrapped (Predicate a) = a -> Bool
type Unwrapped (Comparison a) 
type Unwrapped (Comparison a) = a -> a -> Ordering
type Unwrapped (Equivalence a) 
type Unwrapped (Equivalence a) = a -> a -> Bool
type Unwrapped (Vector a) 
type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) 
type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) 
type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) 
type Unwrapped (Vector a) = [a]
type Unwrapped (HashSet a) 
type Unwrapped (HashSet a) = [a]
type Unwrapped (Op a b) 
type Unwrapped (Op a b) = b -> a
type Unwrapped (HashMap k a) 
type Unwrapped (HashMap k a) = [(k, a)]
type Unwrapped (Map k a) 
type Unwrapped (Map k a) = [(k, a)]
type Unwrapped (WrappedMonad m a) 
type Unwrapped (WrappedMonad m a) = m a
type Unwrapped (ArrowMonad m a) 
type Unwrapped (ArrowMonad m a) = m () a
type Unwrapped (ListT m a) 
type Unwrapped (ListT m a) = m [a]
type Unwrapped (MaybeT m a) 
type Unwrapped (MaybeT m a) = m (Maybe a)
type Unwrapped (WrappedArrow a b c) 
type Unwrapped (WrappedArrow a b c) = a b c
type Unwrapped (Kleisli m a b) 
type Unwrapped (Kleisli m a b) = a -> m b
type Unwrapped (Const k a x) 
type Unwrapped (Const k a x) = a
type Unwrapped (Alt k f a) 
type Unwrapped (Alt k f a) = f a
type Unwrapped (TracedT m w a) 
type Unwrapped (TracedT m w a) = w (m -> a)
type Unwrapped (IdentityT k m a) 
type Unwrapped (IdentityT k m a) = m a
type Unwrapped (Compose f g a) 
type Unwrapped (Compose f g a) = f (g a)
type Unwrapped (ComposeFC f g a) 
type Unwrapped (ComposeFC f g a) = f (g a)
type Unwrapped (ComposeCF f g a) 
type Unwrapped (ComposeCF f g a) = f (g a)
type Unwrapped (Backwards k f a) 
type Unwrapped (Backwards k f a) = f a
type Unwrapped (ErrorT e m a) 
type Unwrapped (ErrorT e m a) = m (Either e a)
type Unwrapped (StateT s m a) 
type Unwrapped (StateT s m a) = s -> m (a, s)
type Unwrapped (StateT s m a) 
type Unwrapped (StateT s m a) = s -> m (a, s)
type Unwrapped (WriterT w m a) 
type Unwrapped (WriterT w m a) = m (a, w)
type Unwrapped (WriterT w m a) 
type Unwrapped (WriterT w m a) = m (a, w)
type Unwrapped (Tagged k s a) 
type Unwrapped (Tagged k s a) = a
type Unwrapped (Reverse k f a) 
type Unwrapped (Reverse k f a) = f a
type Unwrapped (Constant k a b) 
type Unwrapped (Constant k a b) = a
type Unwrapped (ContT k r m a) 
type Unwrapped (ContT k r m a) = (a -> m r) -> m r
type Unwrapped (ReaderT k r m a) 
type Unwrapped (ReaderT k r m a) = r -> m a
type Unwrapped (Compose k k1 f g a) 
type Unwrapped (Compose k k1 f g a) = f (g a)
type Unwrapped (RWST r w s m a) 
type Unwrapped (RWST r w s m a) = r -> s -> m (a, s, w)
type Unwrapped (RWST r w s m a) 
type Unwrapped (RWST r w s m a) = r -> s -> m (a, s, w)

class Wrapped s where #

Wrapped provides isomorphisms to wrap and unwrap newtypes or data types with one constructor.

Associated Types

type Unwrapped s :: * #

Methods

_Wrapped' :: Iso' s (Unwrapped s) #

An isomorphism between s and a.

Instances

Wrapped PatternMatchFail 
Wrapped RecSelError 

Associated Types

type Unwrapped RecSelError :: * #

Wrapped RecConError 

Associated Types

type Unwrapped RecConError :: * #

Wrapped RecUpdError 

Associated Types

type Unwrapped RecUpdError :: * #

Wrapped NoMethodError 
Wrapped AssertionFailed 
Wrapped All 

Associated Types

type Unwrapped All :: * #

Wrapped Any 

Associated Types

type Unwrapped Any :: * #

Wrapped ErrorCall 

Associated Types

type Unwrapped ErrorCall :: * #

Wrapped IntSet 

Associated Types

type Unwrapped IntSet :: * #

Wrapped (Identity a) 

Associated Types

type Unwrapped (Identity a) :: * #

Wrapped (Min a) 

Associated Types

type Unwrapped (Min a) :: * #

Methods

_Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) #

Wrapped (Max a) 

Associated Types

type Unwrapped (Max a) :: * #

Methods

_Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (WrappedMonoid a) 

Associated Types

type Unwrapped (WrappedMonoid a) :: * #

Wrapped (Option a) 

Associated Types

type Unwrapped (Option a) :: * #

Methods

_Wrapped' :: Iso' (Option a) (Unwrapped (Option a)) #

Wrapped (NonEmpty a) 

Associated Types

type Unwrapped (NonEmpty a) :: * #

Wrapped (ZipList a) 

Associated Types

type Unwrapped (ZipList a) :: * #

Methods

_Wrapped' :: Iso' (ZipList a) (Unwrapped (ZipList a)) #

Wrapped (Dual a) 

Associated Types

type Unwrapped (Dual a) :: * #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

Wrapped (Endo a) 

Associated Types

type Unwrapped (Endo a) :: * #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

Wrapped (Sum a) 

Associated Types

type Unwrapped (Sum a) :: * #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

Wrapped (Product a) 

Associated Types

type Unwrapped (Product a) :: * #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (Down a) 

Associated Types

type Unwrapped (Down a) :: * #

Methods

_Wrapped' :: Iso' (Down a) (Unwrapped (Down a)) #

Wrapped (IntMap a) 

Associated Types

type Unwrapped (IntMap a) :: * #

Methods

_Wrapped' :: Iso' (IntMap a) (Unwrapped (IntMap a)) #

Wrapped (Seq a) 

Associated Types

type Unwrapped (Seq a) :: * #

Methods

_Wrapped' :: Iso' (Seq a) (Unwrapped (Seq a)) #

Ord a => Wrapped (Set a) 

Associated Types

type Unwrapped (Set a) :: * #

Methods

_Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) #

Wrapped (Predicate a) 

Associated Types

type Unwrapped (Predicate a) :: * #

Wrapped (Comparison a) 

Associated Types

type Unwrapped (Comparison a) :: * #

Wrapped (Equivalence a) 

Associated Types

type Unwrapped (Equivalence a) :: * #

Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Prim a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Storable a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Unbox a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

(Hashable a, Eq a) => Wrapped (HashSet a) 

Associated Types

type Unwrapped (HashSet a) :: * #

Methods

_Wrapped' :: Iso' (HashSet a) (Unwrapped (HashSet a)) #

Wrapped (Op a b) 

Associated Types

type Unwrapped (Op a b) :: * #

Methods

_Wrapped' :: Iso' (Op a b) (Unwrapped (Op a b)) #

(Hashable k, Eq k) => Wrapped (HashMap k a) 

Associated Types

type Unwrapped (HashMap k a) :: * #

Methods

_Wrapped' :: Iso' (HashMap k a) (Unwrapped (HashMap k a)) #

Ord k => Wrapped (Map k a) 

Associated Types

type Unwrapped (Map k a) :: * #

Methods

_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) #

Wrapped (WrappedMonad m a) 

Associated Types

type Unwrapped (WrappedMonad m a) :: * #

Wrapped (ArrowMonad m a) 

Associated Types

type Unwrapped (ArrowMonad m a) :: * #

Methods

_Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) #

Wrapped (ListT m a) 

Associated Types

type Unwrapped (ListT m a) :: * #

Methods

_Wrapped' :: Iso' (ListT m a) (Unwrapped (ListT m a)) #

Wrapped (MaybeT m a) 

Associated Types

type Unwrapped (MaybeT m a) :: * #

Methods

_Wrapped' :: Iso' (MaybeT m a) (Unwrapped (MaybeT m a)) #

Wrapped (WrappedArrow a b c) 

Associated Types

type Unwrapped (WrappedArrow a b c) :: * #

Methods

_Wrapped' :: Iso' (WrappedArrow a b c) (Unwrapped (WrappedArrow a b c)) #

Wrapped (Kleisli m a b) 

Associated Types

type Unwrapped (Kleisli m a b) :: * #

Methods

_Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) #

Wrapped (Const k a x) 

Associated Types

type Unwrapped (Const k a x) :: * #

Methods

_Wrapped' :: Iso' (Const k a x) (Unwrapped (Const k a x)) #

Wrapped (Alt k f a) 

Associated Types

type Unwrapped (Alt k f a) :: * #

Methods

_Wrapped' :: Iso' (Alt k f a) (Unwrapped (Alt k f a)) #

Wrapped (TracedT m w a) 

Associated Types

type Unwrapped (TracedT m w a) :: * #

Methods

_Wrapped' :: Iso' (TracedT m w a) (Unwrapped (TracedT m w a)) #

Wrapped (IdentityT k m a) 

Associated Types

type Unwrapped (IdentityT k m a) :: * #

Methods

_Wrapped' :: Iso' (IdentityT k m a) (Unwrapped (IdentityT k m a)) #

Wrapped (Compose f g a) 

Associated Types

type Unwrapped (Compose f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) #

Wrapped (ComposeFC f g a) 

Associated Types

type Unwrapped (ComposeFC f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeFC f g a) (Unwrapped (ComposeFC f g a)) #

Wrapped (ComposeCF f g a) 

Associated Types

type Unwrapped (ComposeCF f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeCF f g a) (Unwrapped (ComposeCF f g a)) #

Wrapped (Backwards k f a) 

Associated Types

type Unwrapped (Backwards k f a) :: * #

Methods

_Wrapped' :: Iso' (Backwards k f a) (Unwrapped (Backwards k f a)) #

Wrapped (ErrorT e m a) 

Associated Types

type Unwrapped (ErrorT e m a) :: * #

Methods

_Wrapped' :: Iso' (ErrorT e m a) (Unwrapped (ErrorT e m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (Tagged k s a) 

Associated Types

type Unwrapped (Tagged k s a) :: * #

Methods

_Wrapped' :: Iso' (Tagged k s a) (Unwrapped (Tagged k s a)) #

Wrapped (Reverse k f a) 

Associated Types

type Unwrapped (Reverse k f a) :: * #

Methods

_Wrapped' :: Iso' (Reverse k f a) (Unwrapped (Reverse k f a)) #

Wrapped (Constant k a b) 

Associated Types

type Unwrapped (Constant k a b) :: * #

Methods

_Wrapped' :: Iso' (Constant k a b) (Unwrapped (Constant k a b)) #

Wrapped (ContT k r m a) 

Associated Types

type Unwrapped (ContT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ContT k r m a) (Unwrapped (ContT k r m a)) #

Wrapped (ReaderT k r m a) 

Associated Types

type Unwrapped (ReaderT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ReaderT k r m a) (Unwrapped (ReaderT k r m a)) #

Wrapped (Compose k k1 f g a) 

Associated Types

type Unwrapped (Compose k k1 f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose k k1 f g a) (Unwrapped (Compose k k1 f g a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

class Wrapped s where #

Wrapped provides isomorphisms to wrap and unwrap newtypes or data types with one constructor.

Associated Types

type Unwrapped s :: * #

Methods

_Wrapped' :: Iso' s (Unwrapped s) #

An isomorphism between s and a.

Instances

Wrapped PatternMatchFail 
Wrapped RecSelError 

Associated Types

type Unwrapped RecSelError :: * #

Wrapped RecConError 

Associated Types

type Unwrapped RecConError :: * #

Wrapped RecUpdError 

Associated Types

type Unwrapped RecUpdError :: * #

Wrapped NoMethodError 
Wrapped AssertionFailed 
Wrapped All 

Associated Types

type Unwrapped All :: * #

Wrapped Any 

Associated Types

type Unwrapped Any :: * #

Wrapped ErrorCall 

Associated Types

type Unwrapped ErrorCall :: * #

Wrapped IntSet 

Associated Types

type Unwrapped IntSet :: * #

Wrapped (Identity a) 

Associated Types

type Unwrapped (Identity a) :: * #

Wrapped (Min a) 

Associated Types

type Unwrapped (Min a) :: * #

Methods

_Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) #

Wrapped (Max a) 

Associated Types

type Unwrapped (Max a) :: * #

Methods

_Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (WrappedMonoid a) 

Associated Types

type Unwrapped (WrappedMonoid a) :: * #

Wrapped (Option a) 

Associated Types

type Unwrapped (Option a) :: * #

Methods

_Wrapped' :: Iso' (Option a) (Unwrapped (Option a)) #

Wrapped (NonEmpty a) 

Associated Types

type Unwrapped (NonEmpty a) :: * #

Wrapped (ZipList a) 

Associated Types

type Unwrapped (ZipList a) :: * #

Methods

_Wrapped' :: Iso' (ZipList a) (Unwrapped (ZipList a)) #

Wrapped (Dual a) 

Associated Types

type Unwrapped (Dual a) :: * #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

Wrapped (Endo a) 

Associated Types

type Unwrapped (Endo a) :: * #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

Wrapped (Sum a) 

Associated Types

type Unwrapped (Sum a) :: * #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

Wrapped (Product a) 

Associated Types

type Unwrapped (Product a) :: * #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

Wrapped (First a) 

Associated Types

type Unwrapped (First a) :: * #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 

Associated Types

type Unwrapped (Last a) :: * #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (Down a) 

Associated Types

type Unwrapped (Down a) :: * #

Methods

_Wrapped' :: Iso' (Down a) (Unwrapped (Down a)) #

Wrapped (IntMap a) 

Associated Types

type Unwrapped (IntMap a) :: * #

Methods

_Wrapped' :: Iso' (IntMap a) (Unwrapped (IntMap a)) #

Wrapped (Seq a) 

Associated Types

type Unwrapped (Seq a) :: * #

Methods

_Wrapped' :: Iso' (Seq a) (Unwrapped (Seq a)) #

Ord a => Wrapped (Set a) 

Associated Types

type Unwrapped (Set a) :: * #

Methods

_Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) #

Wrapped (Predicate a) 

Associated Types

type Unwrapped (Predicate a) :: * #

Wrapped (Comparison a) 

Associated Types

type Unwrapped (Comparison a) :: * #

Wrapped (Equivalence a) 

Associated Types

type Unwrapped (Equivalence a) :: * #

Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Prim a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Storable a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Unbox a => Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

(Hashable a, Eq a) => Wrapped (HashSet a) 

Associated Types

type Unwrapped (HashSet a) :: * #

Methods

_Wrapped' :: Iso' (HashSet a) (Unwrapped (HashSet a)) #

Wrapped (Op a b) 

Associated Types

type Unwrapped (Op a b) :: * #

Methods

_Wrapped' :: Iso' (Op a b) (Unwrapped (Op a b)) #

(Hashable k, Eq k) => Wrapped (HashMap k a) 

Associated Types

type Unwrapped (HashMap k a) :: * #

Methods

_Wrapped' :: Iso' (HashMap k a) (Unwrapped (HashMap k a)) #

Ord k => Wrapped (Map k a) 

Associated Types

type Unwrapped (Map k a) :: * #

Methods

_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) #

Wrapped (WrappedMonad m a) 

Associated Types

type Unwrapped (WrappedMonad m a) :: * #

Wrapped (ArrowMonad m a) 

Associated Types

type Unwrapped (ArrowMonad m a) :: * #

Methods

_Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) #

Wrapped (ListT m a) 

Associated Types

type Unwrapped (ListT m a) :: * #

Methods

_Wrapped' :: Iso' (ListT m a) (Unwrapped (ListT m a)) #

Wrapped (MaybeT m a) 

Associated Types

type Unwrapped (MaybeT m a) :: * #

Methods

_Wrapped' :: Iso' (MaybeT m a) (Unwrapped (MaybeT m a)) #

Wrapped (WrappedArrow a b c) 

Associated Types

type Unwrapped (WrappedArrow a b c) :: * #

Methods

_Wrapped' :: Iso' (WrappedArrow a b c) (Unwrapped (WrappedArrow a b c)) #

Wrapped (Kleisli m a b) 

Associated Types

type Unwrapped (Kleisli m a b) :: * #

Methods

_Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) #

Wrapped (Const k a x) 

Associated Types

type Unwrapped (Const k a x) :: * #

Methods

_Wrapped' :: Iso' (Const k a x) (Unwrapped (Const k a x)) #

Wrapped (Alt k f a) 

Associated Types

type Unwrapped (Alt k f a) :: * #

Methods

_Wrapped' :: Iso' (Alt k f a) (Unwrapped (Alt k f a)) #

Wrapped (TracedT m w a) 

Associated Types

type Unwrapped (TracedT m w a) :: * #

Methods

_Wrapped' :: Iso' (TracedT m w a) (Unwrapped (TracedT m w a)) #

Wrapped (IdentityT k m a) 

Associated Types

type Unwrapped (IdentityT k m a) :: * #

Methods

_Wrapped' :: Iso' (IdentityT k m a) (Unwrapped (IdentityT k m a)) #

Wrapped (Compose f g a) 

Associated Types

type Unwrapped (Compose f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) #

Wrapped (ComposeFC f g a) 

Associated Types

type Unwrapped (ComposeFC f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeFC f g a) (Unwrapped (ComposeFC f g a)) #

Wrapped (ComposeCF f g a) 

Associated Types

type Unwrapped (ComposeCF f g a) :: * #

Methods

_Wrapped' :: Iso' (ComposeCF f g a) (Unwrapped (ComposeCF f g a)) #

Wrapped (Backwards k f a) 

Associated Types

type Unwrapped (Backwards k f a) :: * #

Methods

_Wrapped' :: Iso' (Backwards k f a) (Unwrapped (Backwards k f a)) #

Wrapped (ErrorT e m a) 

Associated Types

type Unwrapped (ErrorT e m a) :: * #

Methods

_Wrapped' :: Iso' (ErrorT e m a) (Unwrapped (ErrorT e m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (WriterT w m a) 

Associated Types

type Unwrapped (WriterT w m a) :: * #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (Tagged k s a) 

Associated Types

type Unwrapped (Tagged k s a) :: * #

Methods

_Wrapped' :: Iso' (Tagged k s a) (Unwrapped (Tagged k s a)) #

Wrapped (Reverse k f a) 

Associated Types

type Unwrapped (Reverse k f a) :: * #

Methods

_Wrapped' :: Iso' (Reverse k f a) (Unwrapped (Reverse k f a)) #

Wrapped (Constant k a b) 

Associated Types

type Unwrapped (Constant k a b) :: * #

Methods

_Wrapped' :: Iso' (Constant k a b) (Unwrapped (Constant k a b)) #

Wrapped (ContT k r m a) 

Associated Types

type Unwrapped (ContT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ContT k r m a) (Unwrapped (ContT k r m a)) #

Wrapped (ReaderT k r m a) 

Associated Types

type Unwrapped (ReaderT k r m a) :: * #

Methods

_Wrapped' :: Iso' (ReaderT k r m a) (Unwrapped (ReaderT k r m a)) #

Wrapped (Compose k k1 f g a) 

Associated Types

type Unwrapped (Compose k k1 f g a) :: * #

Methods

_Wrapped' :: Iso' (Compose k k1 f g a) (Unwrapped (Compose k k1 f g a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

Wrapped (RWST r w s m a) 

Associated Types

type Unwrapped (RWST r w s m a) :: * #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

type family Zoomed (m :: * -> *) :: * -> * -> * #

This type family is used by Zoom to describe the common effect type.

Instances

type Zoomed (ListT m) 
type Zoomed (ListT m) = FocusingOn [] (Zoomed m)
type Zoomed (MaybeT m) 
type Zoomed (IdentityT * m) 
type Zoomed (IdentityT * m) = Zoomed m
type Zoomed (FreeT f m) 
type Zoomed (FreeT f m) = FocusingFree f m (Zoomed m)
type Zoomed (ErrorT e m) 
type Zoomed (ErrorT e m) = FocusingErr e (Zoomed m)
type Zoomed (ExceptT e m) 
type Zoomed (ExceptT e m) = FocusingErr e (Zoomed m)
type Zoomed (StateT s z) 
type Zoomed (StateT s z) = Focusing z
type Zoomed (StateT s z) 
type Zoomed (StateT s z) = Focusing z
type Zoomed (WriterT w m) 
type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (WriterT w m) 
type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (ReaderT * e m) 
type Zoomed (ReaderT * e m) = Zoomed m
type Zoomed (RWST r w s z) 
type Zoomed (RWST r w s z) = FocusingWith w z
type Zoomed (RWST r w s z) 
type Zoomed (RWST r w s z) = FocusingWith w z

(^#) :: s -> ALens s t a b -> a infixl 8 #

A version of (^.) that works on ALens.

>>> ("hello","world")^#_2
"world"

(^.) :: s -> Getting a s a -> a infixl 8 #

View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values.

This is the same operation as view with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (.).

>>> (a,b)^._2
b
>>> ("hello","world")^._2
"world"
>>> import Data.Complex
>>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
2.23606797749979
(^.) ::             s -> Getter s a     -> a
(^.) :: Monoid m => s -> Fold s m       -> m
(^.) ::             s -> Iso' s a       -> a
(^.) ::             s -> Lens' s a      -> a
(^.) :: Monoid m => s -> Traversal' s m -> m

(^..) :: s -> Getting (Endo [a]) s a -> [a] infixl 8 #

A convenient infix (flipped) version of toListOf.

>>> [[1,2],[3]]^..id
[[[1,2],[3]]]
>>> [[1,2],[3]]^..traverse
[[1,2],[3]]
>>> [[1,2],[3]]^..traverse.traverse
[1,2,3]
>>> (1,2)^..both
[1,2]
toList xs ≡ xs ^.. folded
(^..) ≡ flip toListOf
(^..) :: s -> Getter s a     -> a :: s -> Fold s a       -> a :: s -> Lens' s a      -> a :: s -> Iso' s a       -> a :: s -> Traversal' s a -> a :: s -> Prism' s a     -> [a]

(^=) :: (MonadState s m, Num a, Integral e) => ASetter' s a -> e -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to a non-negative integral power.

(^=) ::  (MonadState s m, Num a, Integral e) => Setter' s a    -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Iso' s a       -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Lens' s a      -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Traversal' s a -> e -> m ()

(^?) :: s -> Getting (First a) s a -> Maybe a infixl 8 #

Perform a safe head of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

When using a Traversal as a partial Lens, or a Fold as a partial Getter this can be a convenient way to extract the optional value.

Note: if you get stack overflows due to this, you may want to use firstOf instead, which can deal more gracefully with heavily left-biased trees.

>>> Left 4 ^?_Left
Just 4
>>> Right 4 ^?_Left
Nothing
>>> "world" ^? ix 3
Just 'l'
>>> "world" ^? ix 20
Nothing
(^?) ≡ flip preview
(^?) :: s -> Getter s a     -> Maybe a
(^?) :: s -> Fold s a       -> Maybe a
(^?) :: s -> Lens' s a      -> Maybe a
(^?) :: s -> Iso' s a       -> Maybe a
(^?) :: s -> Traversal' s a -> Maybe a

(^?!) :: s -> Getting (Endo a) s a -> a infixl 8 #

Perform an *UNSAFE* head of a Fold or Traversal assuming that it is there.

>>> Left 4 ^?! _Left
4
>>> "world" ^?! ix 3
'l'
(^?!) :: s -> Getter s a     -> a
(^?!) :: s -> Fold s a       -> a
(^?!) :: s -> Lens' s a      -> a
(^?!) :: s -> Iso' s a       -> a
(^?!) :: s -> Traversal' s a -> a

(^@.) :: s -> IndexedGetting i (i, a) s a -> (i, a) infixl 8 #

View the index and value of an IndexedGetter or IndexedLens.

This is the same operation as iview with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (.).

(^@.) :: s -> IndexedGetter i s a -> (i, a)
(^@.) :: s -> IndexedLens' i s a  -> (i, a)

The result probably doesn't have much meaning when applied to an IndexedFold.

(^@..) :: s -> IndexedGetting i (Endo [(i, a)]) s a -> [(i, a)] infixl 8 #

An infix version of itoListOf.

(^@?) :: s -> IndexedGetting i (Endo (Maybe (i, a))) s a -> Maybe (i, a) infixl 8 #

Perform a safe head (with index) of an IndexedFold or IndexedTraversal or retrieve Just the index and result from an IndexedGetter or IndexedLens.

When using a IndexedTraversal as a partial IndexedLens, or an IndexedFold as a partial IndexedGetter this can be a convenient way to extract the optional value.

(^@?) :: s -> IndexedGetter i s a     -> Maybe (i, a)
(^@?) :: s -> IndexedFold i s a       -> Maybe (i, a)
(^@?) :: s -> IndexedLens' i s a      -> Maybe (i, a)
(^@?) :: s -> IndexedTraversal' i s a -> Maybe (i, a)

(^@?!) :: s -> IndexedGetting i (Endo (i, a)) s a -> (i, a) infixl 8 #

Perform an *UNSAFE* head (with index) of an IndexedFold or IndexedTraversal assuming that it is there.

(^@?!) :: s -> IndexedGetter i s a     -> (i, a)
(^@?!) :: s -> IndexedFold i s a       -> (i, a)
(^@?!) :: s -> IndexedLens' i s a      -> (i, a)
(^@?!) :: s -> IndexedTraversal' i s a -> (i, a)

(^^=) :: (MonadState s m, Fractional a, Integral e) => ASetter' s a -> e -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to an integral power.

(^^=) ::  (MonadState s m, Fractional a, Integral e) => Setter' s a    -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Iso' s a       -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Lens' s a      -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Traversal' s a -> e -> m ()

(^^~) :: (Fractional a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 #

Raise the target(s) of a fractionally valued Lens, Setter or Traversal to an integral power.

>>> (1,2) & _2 ^^~ (-1)
(1,0.5)
(^^~) :: (Fractional a, Integral e) => Setter' s a    -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Iso' s a       -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Lens' s a      -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Traversal' s a -> e -> s -> s

(^~) :: (Num a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to a non-negative integral power.

>>> (1,3) & _2 ^~ 2
(1,9)
(^~) :: (Num a, Integral e) => Setter' s a    -> e -> s -> s
(^~) :: (Num a, Integral e) => Iso' s a       -> e -> s -> s
(^~) :: (Num a, Integral e) => Lens' s a      -> e -> s -> s
(^~) :: (Num a, Integral e) => Traversal' s a -> e -> s -> s

_1' :: Field1 s t a b => Lens s t a b #

Strict version of _1

_2' :: Field2 s t a b => Lens s t a b #

Strict version of _2

_3' :: Field3 s t a b => Lens s t a b #

Strict version of _3

_4' :: Field4 s t a b => Lens s t a b #

Strict version of _4

_5' :: Field5 s t a b => Lens s t a b #

Strict version of _5

_6' :: Field6 s t a b => Lens s t a b #

Strict version of _6

_7' :: Field7 s t a b => Lens s t a b #

Strict version of _7

_8' :: Field8 s t a b => Lens s t a b #

Strict version of _8

_9' :: Field9 s t a b => Lens s t a b #

Strict version of _9

_Just :: (Choice p, Applicative f) => p a (f b) -> p (Maybe a) (f (Maybe b)) #

This Prism provides a Traversal for tweaking the target of the value of Just in a Maybe.

>>> over _Just (+1) (Just 2)
Just 3

Unlike traverse this is a Prism, and so you can use it to inject as well:

>>> _Just # 5
Just 5
>>> 5^.re _Just
Just 5

Interestingly,

m ^? _Just ≡ m
>>> Just x ^? _Just
Just x
>>> Nothing ^? _Just
Nothing

_Left :: (Choice p, Applicative f) => p a (f b) -> p (Either a c) (f (Either b c)) #

This Prism provides a Traversal for tweaking the Left half of an Either:

>>> over _Left (+1) (Left 2)
Left 3
>>> over _Left (+1) (Right 2)
Right 2
>>> Right 42 ^._Left :: String
""
>>> Left "hello" ^._Left
"hello"

It also can be turned around to obtain the embedding into the Left half of an Either:

>>> _Left # 5
Left 5
>>> 5^.re _Left
Left 5

_Nothing :: (Choice p, Applicative f) => p () (f ()) -> p (Maybe a) (f (Maybe a)) #

This Prism provides the Traversal of a Nothing in a Maybe.

>>> Nothing ^? _Nothing
Just ()
>>> Just () ^? _Nothing
Nothing

But you can turn it around and use it to construct Nothing as well:

>>> _Nothing # ()
Nothing

_Right :: (Choice p, Applicative f) => p a (f b) -> p (Either c a) (f (Either c b)) #

This Prism provides a Traversal for tweaking the Right half of an Either:

>>> over _Right (+1) (Left 2)
Left 2
>>> over _Right (+1) (Right 2)
Right 3
>>> Right "hello" ^._Right
"hello"
>>> Left "hello" ^._Right :: [Double]
[]

It also can be turned around to obtain the embedding into the Right half of an Either:

>>> _Right # 5
Right 5
>>> 5^.re _Right
Right 5

_Show :: (Read a, Show a) => Prism' String a #

This is an improper prism for text formatting based on Read and Show.

This Prism is "improper" in the sense that it normalizes the text formatting, but round tripping is idempotent given sane 'Read'/'Show' instances.

>>> _Show # 2
"2"
>>> "EQ" ^? _Show :: Maybe Ordering
Just EQ
_Showprism' show readMaybe

_Unwrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso (Unwrapped t) (Unwrapped s) t s #

This is a convenient version of _Unwrapped with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

_Unwrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' (Unwrapped s) s #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_Void :: (Choice p, Applicative f) => p a (f Void) -> p s (f s) #

Void is a logically uninhabited data type.

This is a Prism that will always fail to match.

_Wrapped :: Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t) #

Work under a newtype wrapper.

>>> Const "hello" & _Wrapped %~ Prelude.length & getConst
5
_Wrappedfrom _Unwrapped
_Unwrappedfrom _Wrapped

_Wrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t) #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

_Wrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' s (Unwrapped s) #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_head :: Cons s s a a => Traversal' s a #

A Traversal reading and writing to the head of a non-empty container.

>>> [a,b,c]^? _head
Just a
>>> [a,b,c] & _head .~ d
[d,b,c]
>>> [a,b,c] & _head %~ f
[f a,b,c]
>>> [] & _head %~ f
[]
>>> [1,2,3]^?!_head
1
>>> []^?_head
Nothing
>>> [1,2]^?_head
Just 1
>>> [] & _head .~ 1
[]
>>> [0] & _head .~ 2
[2]
>>> [0,1] & _head .~ 2
[2,1]

This isn't limited to lists.

For instance you can also traverse the head of a Seq:

>>> Seq.fromList [a,b,c,d] & _head %~ f
fromList [f a,b,c,d]
>>> Seq.fromList [] ^? _head
Nothing
>>> Seq.fromList [a,b,c,d] ^? _head
Just a
_head :: Traversal' [a] a
_head :: Traversal' (Seq a) a
_head :: Traversal' (Vector a) a

_init :: Snoc s s a a => Traversal' s s #

A Traversal reading and replacing all but the a last element of a non-empty container.

>>> [a,b,c,d]^?_init
Just [a,b,c]
>>> []^?_init
Nothing
>>> [a,b] & _init .~ [c,d,e]
[c,d,e,b]
>>> [] & _init .~ [a,b]
[]
>>> [a,b,c,d] & _init.traverse %~ f
[f a,f b,f c,d]
>>> [1,2,3]^?_init
Just [1,2]
>>> [1,2,3,4]^?!_init
[1,2,3]
>>> "hello"^._init
"hell"
>>> ""^._init
""
_init :: Traversal' [a] [a]
_init :: Traversal' (Seq a) (Seq a)
_init :: Traversal' (Vector a) (Vector a)

_last :: Snoc s s a a => Traversal' s a #

A Traversal reading and writing to the last element of a non-empty container.

>>> [a,b,c]^?!_last
c
>>> []^?_last
Nothing
>>> [a,b,c] & _last %~ f
[a,b,f c]
>>> [1,2]^?_last
Just 2
>>> [] & _last .~ 1
[]
>>> [0] & _last .~ 2
[2]
>>> [0,1] & _last .~ 2
[0,2]

This Traversal is not limited to lists, however. We can also work with other containers, such as a Vector.

>>> Vector.fromList "abcde" ^? _last
Just 'e'
>>> Vector.empty ^? _last
Nothing
>>> (Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ"
True
_last :: Traversal' [a] a
_last :: Traversal' (Seq a) a
_last :: Traversal' (Vector a) a

_tail :: Cons s s a a => Traversal' s s #

A Traversal reading and writing to the tail of a non-empty container.

>>> [a,b] & _tail .~ [c,d,e]
[a,c,d,e]
>>> [] & _tail .~ [a,b]
[]
>>> [a,b,c,d,e] & _tail.traverse %~ f
[a,f b,f c,f d,f e]
>>> [1,2] & _tail .~ [3,4,5]
[1,3,4,5]
>>> [] & _tail .~ [1,2]
[]
>>> [a,b,c]^?_tail
Just [b,c]
>>> [1,2]^?!_tail
[2]
>>> "hello"^._tail
"ello"
>>> ""^._tail
""

This isn't limited to lists. For instance you can also traverse the tail of a Seq.

>>> Seq.fromList [a,b] & _tail .~ Seq.fromList [c,d,e]
fromList [a,c,d,e]
>>> Seq.fromList [a,b,c] ^? _tail
Just (fromList [b,c])
>>> Seq.fromList [] ^? _tail
Nothing
_tail :: Traversal' [a] [a]
_tail :: Traversal' (Seq a) (Seq a)
_tail :: Traversal' (Vector a) (Vector a)

abbreviatedFields :: LensRules #

Field rules fields in the form prefixFieldname or _prefixFieldname If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note that prefix may be any string of characters that are not uppercase letters. (In particular, it may be arbitrary string of lowercase letters and numbers) This is the behavior that defaultFieldRules had in lens 4.4 and earlier.

ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s) #

This combinator is based on ala from Conor McBride's work on Epigram.

As with _Wrapping, the user supplied function for the newtype is ignored.

>>> ala Sum foldMap [1,2,3,4]
10
>>> ala All foldMap [True,True]
True
>>> ala All foldMap [True,False]
False
>>> ala Any foldMap [False,False]
False
>>> ala Any foldMap [True,False]
True
>>> ala Sum foldMap [1,2,3,4]
10
>>> ala Product foldMap [1,2,3,4]
24

You may want to think of this combinator as having the following, simpler, type.

ala :: Rewrapping s t => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> e -> s) -> e -> Unwrapped s

alaf :: (Functor f, Functor g, Rewrapping s t) => (Unwrapped s -> s) -> (f t -> g s) -> f (Unwrapped t) -> g (Unwrapped s) #

This combinator is based on ala' from Conor McBride's work on Epigram.

As with _Wrapping, the user supplied function for the newtype is ignored.

alaf :: Rewrapping s t => (Unwrapped s -> s) -> ((r ->  t) -> e -> s) -> (r -> Unwrapped t) -> e -> Unwrapped s
>>> alaf Sum foldMap Prelude.length ["hello","world"]
10

allOf :: Getting All s a -> (a -> Bool) -> s -> Bool #

Returns True if every target of a Fold satisfies a predicate.

>>> allOf both (>=3) (4,5)
True
>>> allOf folded (>=2) [1..10]
False
allallOf folded
iallOf l = allOf l . Indexed
allOf :: Getter s a     -> (a -> Bool) -> s -> Bool
allOf :: Fold s a       -> (a -> Bool) -> s -> Bool
allOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
allOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
allOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
allOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

alongside :: LensLike * (AlongsideLeft f b') s t a b -> LensLike * (AlongsideRight f t) s' t' a' b' -> LensLike * f (s, s') (t, t') (a, a') (b, b') #

alongside makes a Lens from two other lenses or a Getter from two other getters by executing them on their respective halves of a product.

>>> (Left a, Right b)^.alongside chosen chosen
(a,b)
>>> (Left a, Right b) & alongside chosen chosen .~ (c,d)
(Left c,Right d)
alongside :: Lens   s t a b -> Lens   s' t' a' b' -> Lens   (s,s') (t,t') (a,a') (b,b')
alongside :: Getter s t a b -> Getter s' t' a' b' -> Getter (s,s') (t,t') (a,a') (b,b')

andOf :: Getting All s Bool -> s -> Bool #

Returns True if every target of a Fold is True.

>>> andOf both (True,False)
False
>>> andOf both (True,True)
True
andandOf folded
andOf :: Getter s Bool     -> s -> Bool
andOf :: Fold s Bool       -> s -> Bool
andOf :: Lens' s Bool      -> s -> Bool
andOf :: Iso' s Bool       -> s -> Bool
andOf :: Traversal' s Bool -> s -> Bool
andOf :: Prism' s Bool     -> s -> Bool

anon :: a -> (a -> Bool) -> Iso' (Maybe a) a #

anon a p generalizes non a to take any value and a predicate.

This function assumes that p a holds True and generates an isomorphism between Maybe (a | not (p a)) and a.

>>> Map.empty & at "hello" . anon Map.empty Map.null . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]
>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . anon Map.empty Map.null . at "world" .~ Nothing
fromList []

anyOf :: Getting Any s a -> (a -> Bool) -> s -> Bool #

Returns True if any target of a Fold satisfies a predicate.

>>> anyOf both (=='x') ('x','y')
True
>>> import Data.Data.Lens
>>> anyOf biplate (== "world") (((),2::Int),"hello",("world",11::Int))
True
anyanyOf folded
ianyOf l ≡ anyOf l . Indexed
anyOf :: Getter s a     -> (a -> Bool) -> s -> Bool
anyOf :: Fold s a       -> (a -> Bool) -> s -> Bool
anyOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
anyOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
anyOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
anyOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

argument :: Profunctor p => Setter (p b r) (p a r) a b #

This Setter can be used to map over the input of a Profunctor.

The most common Profunctor to use this with is (->).

>>> (argument %~ f) g x
g (f x)
>>> (argument %~ show) length [1,2,3]
7
>>> (argument %~ f) h x y
h (f x) y

Map over the argument of the result of a function -- i.e., its second argument:

>>> (mapped.argument %~ f) h x y
h x (f y)
argument :: Setter (b -> r) (a -> r) a b

asIndex :: (Indexable i p, Contravariant f, Functor f) => p i (f i) -> Indexed i s (f s) #

When composed with an IndexedFold or IndexedTraversal this yields an (Indexed) Fold of the indices.

aside :: APrism s t a b -> Prism (e, s) (e, t) (e, a) (e, b) #

Use a Prism to work over part of a structure.

assign :: MonadState s m => ASetter s s a b -> b -> m () #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is an alias for (.=).

>>> execState (do assign _1 c; assign _2 d) (a,b)
(c,d)
>>> execState (both .= c) (a,b)
(c,c)
assign :: MonadState s m => Iso' s a       -> a -> m ()
assign :: MonadState s m => Lens' s a      -> a -> m ()
assign :: MonadState s m => Traversal' s a -> a -> m ()
assign :: MonadState s m => Setter' s a    -> a -> m ()

assignA :: Arrow p => ASetter s t a b -> p s b -> p s t #

Run an arrow command and use the output to set all the targets of a Lens, Setter or Traversal to the result.

assignA can be used very similarly to (<~), except that the type of the object being modified can change; for example:

runKleisli action ((), (), ()) where
  action =      assignA _1 (Kleisli (const getVal1))
           >>> assignA _2 (Kleisli (const getVal2))
           >>> assignA _3 (Kleisli (const getVal3))
  getVal1 :: Either String Int
  getVal1 = ...
  getVal2 :: Either String Bool
  getVal2 = ...
  getVal3 :: Either String Char
  getVal3 = ...

has the type Either String (Int, Bool, Char)

assignA :: Arrow p => Iso s t a b       -> p s b -> p s t
assignA :: Arrow p => Lens s t a b      -> p s b -> p s t
assignA :: Arrow p => Traversal s t a b -> p s b -> p s t
assignA :: Arrow p => Setter s t a b    -> p s b -> p s t

asumOf :: Alternative f => Getting (Endo (f a)) s (f a) -> s -> f a #

The sum of a collection of actions, generalizing concatOf.

>>> asumOf both ("hello","world")
"helloworld"
>>> asumOf each (Nothing, Just "hello", Nothing)
Just "hello"
asumasumOf folded
asumOf :: Alternative f => Getter s (f a)     -> s -> f a
asumOf :: Alternative f => Fold s (f a)       -> s -> f a
asumOf :: Alternative f => Lens' s (f a)      -> s -> f a
asumOf :: Alternative f => Iso' s (f a)       -> s -> f a
asumOf :: Alternative f => Traversal' s (f a) -> s -> f a
asumOf :: Alternative f => Prism' s (f a)     -> s -> f a

au :: Functor f => AnIso s t a b -> ((b -> t) -> f s) -> f a #

Based on ala from Conor McBride's work on Epigram.

This version is generalized to accept any Iso, not just a newtype.

>>> au (_Wrapping Sum) foldMap [1,2,3,4]
10

You may want to think of this combinator as having the following, simpler type:

au :: AnIso s t a b -> ((b -> t) -> e -> s) -> e -> a

auf :: Optic * * * (Costar f) g s t a b -> (f a -> g b) -> f s -> g t #

Based on ala' from Conor McBride's work on Epigram.

This version is generalized to accept any Iso, not just a newtype.

For a version you pass the name of the newtype constructor to, see alaf.

>>> auf (_Unwrapping Sum) (foldMapOf both) Prelude.length ("hello","world")
10

Mnemonically, the German auf plays a similar role to à la, and the combinator is au with an extra function argument:

auf :: Iso s t a b -> ((r ->  a) -> e -> b) -> (r -> s) -> e -> t

but the signature is general.

backwards :: (Profunctor p, Profunctor q) => Optical * * * * p q (Backwards * f) s t a b -> Optical * * * * p q f s t a b #

This allows you to traverse the elements of a pretty much any LensLike construction in the opposite order.

This will preserve indexes on Indexed types and will give you the elements of a (finite) Fold or Traversal in the opposite order.

This has no practical impact on a Getter, Setter, Lens or Iso.

NB: To write back through an Iso, you want to use from. Similarly, to write back through an Prism, you want to use re.

below :: Traversable f => APrism' s a -> Prism' (f s) (f a) #

lift a Prism through a Traversable functor, giving a Prism that matches only if all the elements of the container match the Prism.

>>> [Left 1, Right "foo", Left 4, Right "woot"]^..below _Right
[]
>>> [Right "hail hydra!", Right "foo", Right "blah", Right "woot"]^..below _Right
[["hail hydra!","foo","blah","woot"]]

beside :: (Representable q, Applicative (Rep q), Applicative f, Bitraversable r) => Optical * * * * p q f s t a b -> Optical * * * * p q f s' t' a b -> Optical * * * * p q f (r s s') (r t t') a b #

Apply a different Traversal or Fold to each side of a Bitraversable container.

beside :: Traversal s t a b                -> Traversal s' t' a b                -> Traversal (r s s') (r t t') a b
beside :: IndexedTraversal i s t a b       -> IndexedTraversal i s' t' a b       -> IndexedTraversal i (r s s') (r t t') a b
beside :: IndexPreservingTraversal s t a b -> IndexPreservingTraversal s' t' a b -> IndexPreservingTraversal (r s s') (r t t') a b
beside :: Traversal s t a b                -> Traversal s' t' a b                -> Traversal (s,s') (t,t') a b
beside :: Lens s t a b                     -> Lens s' t' a b                     -> Traversal (s,s') (t,t') a b
beside :: Fold s a                         -> Fold s' a                          -> Fold (s,s') a
beside :: Getter s a                       -> Getter s' a                        -> Fold (s,s') a
beside :: IndexedTraversal i s t a b       -> IndexedTraversal i s' t' a b       -> IndexedTraversal i (s,s') (t,t') a b
beside :: IndexedLens i s t a b            -> IndexedLens i s' t' a b            -> IndexedTraversal i (s,s') (t,t') a b
beside :: IndexedFold i s a                -> IndexedFold i s' a                 -> IndexedFold i (s,s') a
beside :: IndexedGetter i s a              -> IndexedGetter i s' a               -> IndexedFold i (s,s') a
beside :: IndexPreservingTraversal s t a b -> IndexPreservingTraversal s' t' a b -> IndexPreservingTraversal (s,s') (t,t') a b
beside :: IndexPreservingLens s t a b      -> IndexPreservingLens s' t' a b      -> IndexPreservingTraversal (s,s') (t,t') a b
beside :: IndexPreservingFold s a          -> IndexPreservingFold s' a           -> IndexPreservingFold (s,s') a
beside :: IndexPreservingGetter s a        -> IndexPreservingGetter s' a         -> IndexPreservingFold (s,s') a
>>> ("hello",["world","!!!"])^..beside id traverse
["hello","world","!!!"]

bimapping :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (f s s') (g t t') (f a a') (g b b') #

Lift two Isos into both arguments of a Bifunctor.

bimapping :: Bifunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p s s') (p t t') (p a a') (p b b')
bimapping :: Bifunctor p => Iso' s a -> Iso' s' a' -> Iso' (p s s') (p a a')

both :: Bitraversable r => Traversal (r a a) (r b b) a b #

Traverse both parts of a Bitraversable container with matching types.

Usually that type will be a pair.

>>> (1,2) & both *~ 10
(10,20)
>>> over both length ("hello","world")
(5,5)
>>> ("hello","world")^.both
"helloworld"
both :: Traversal (a, a)       (b, b)       a b
both :: Traversal (Either a a) (Either b b) a b

camelCaseFields :: LensRules #

Field rules for fields in the form prefixFieldname or _prefixFieldname If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note: The prefix must be the same as the typename (with the first letter lowercased). This is a change from lens versions before lens 4.5. If you want the old behaviour, use makeLensesWith abbreviatedFields

censoring :: MonadWriter w m => Setter w w u v -> (u -> v) -> m a -> m a #

This is a generalization of censor that alows you to censor just a portion of the resulting MonadWriter.

children :: Plated a => a -> [a] #

Extract the immediate descendants of a Plated container.

childrentoListOf plate

choosing :: Functor f => LensLike * f s t a b -> LensLike * f s' t' a b -> LensLike * f (Either s s') (Either t t') a b #

Merge two lenses, getters, setters, folds or traversals.

chosenchoosing id id
choosing :: Getter s a     -> Getter s' a     -> Getter (Either s s') a
choosing :: Fold s a       -> Fold s' a       -> Fold (Either s s') a
choosing :: Lens' s a      -> Lens' s' a      -> Lens' (Either s s') a
choosing :: Traversal' s a -> Traversal' s' a -> Traversal' (Either s s') a
choosing :: Setter' s a    -> Setter' s' a    -> Setter' (Either s s') a

chosen :: (Conjoined p, Functor f) => p a (f b) -> p (Either a a) (f (Either b b)) #

This is a Lens that updates either side of an Either, where both sides have the same type.

chosenchoosing id id
>>> Left a^.chosen
a
>>> Right a^.chosen
a
>>> Right "hello"^.chosen
"hello"
>>> Right a & chosen *~ b
Right (a * b)
chosen :: Lens (Either a a) (Either b b) a b
chosen f (Left a)  = Left <$> f a
chosen f (Right a) = Right <$> f a

classyRules :: LensRules #

Rules for making lenses and traversals that precompose another Lens.

cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b #

Clone a Lens as an IndexedPreservingLens that just passes through whatever index is on any IndexedLens, IndexedFold, IndexedGetter or IndexedTraversal it is composed with.

cloneIndexPreservingTraversal :: ATraversal s t a b -> IndexPreservingTraversal s t a b #

Clone a Traversal yielding an IndexPreservingTraversal that passes through whatever index it is composed with.

cloneIndexPreservingTraversal1 :: ATraversal1 s t a b -> IndexPreservingTraversal1 s t a b #

Clone a Traversal1 yielding an IndexPreservingTraversal1 that passes through whatever index it is composed with.

cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b #

Clone an IndexedLens as an IndexedLens with the same index.

cloneIndexedTraversal :: AnIndexedTraversal i s t a b -> IndexedTraversal i s t a b #

Clone an IndexedTraversal yielding an IndexedTraversal with the same index.

cloneIndexedTraversal1 :: AnIndexedTraversal1 i s t a b -> IndexedTraversal1 i s t a b #

Clone an IndexedTraversal1 yielding an IndexedTraversal1 with the same index.

cloneIso :: AnIso s t a b -> Iso s t a b #

Convert from AnIso back to any Iso.

This is useful when you need to store an isomorphism as a data type inside a container and later reconstitute it as an overloaded function.

See cloneLens or cloneTraversal for more information on why you might want to do this.

cloneLens :: ALens s t a b -> Lens s t a b #

Cloning a Lens is one way to make sure you aren't given something weaker, such as a Traversal and can be used as a way to pass around lenses that have to be monomorphic in f.

Note: This only accepts a proper Lens.

>>> let example l x = set (cloneLens l) (x^.cloneLens l + 1) x in example _2 ("hello",1,"you")
("hello",2,"you")

clonePrism :: APrism s t a b -> Prism s t a b #

Clone a Prism so that you can reuse the same monomorphically typed Prism for different purposes.

See cloneLens and cloneTraversal for examples of why you might want to do this.

cloneSetter :: ASetter s t a b -> Setter s t a b #

Restore ASetter to a full Setter.

cloneTraversal :: ATraversal s t a b -> Traversal s t a b #

A Traversal is completely characterized by its behavior on a Bazaar.

Cloning a Traversal is one way to make sure you aren't given something weaker, such as a Fold and can be used as a way to pass around traversals that have to be monomorphic in f.

Note: This only accepts a proper Traversal (or Lens). To clone a Lens as such, use cloneLens.

Note: It is usually better to use ReifiedTraversal and runTraversal than to cloneTraversal. The former can execute at full speed, while the latter needs to round trip through the Bazaar.

>>> let foo l a = (view (getting (cloneTraversal l)) a, set (cloneTraversal l) 10 a)
>>> foo both ("hello","world")
("helloworld",(10,10))
cloneTraversal :: LensLike (Bazaar (->) a b) s t a b -> Traversal s t a b

cloneTraversal1 :: ATraversal1 s t a b -> Traversal1 s t a b #

A Traversal1 is completely characterized by its behavior on a Bazaar1.

coerced :: (Coercible * s a, Coercible * t b) => Iso s t a b #

Data types that are representationally equal are isomorphic.

This is only available on GHC 7.10+

Since: 4.13

composOpFold :: Plated a => b -> (b -> b -> b) -> (a -> b) -> a -> b #

Fold the immediate children of a Plated container.

composOpFold z c f = foldrOf plate (c . f) z

concatMapOf :: Getting [r] s a -> (a -> [r]) -> s -> [r] #

Map a function over all the targets of a Fold of a container and concatenate the resulting lists.

>>> concatMapOf both (\x -> [x, x + 1]) (1,3)
[1,2,3,4]
concatMapconcatMapOf folded
concatMapOf :: Getter s a     -> (a -> [r]) -> s -> [r]
concatMapOf :: Fold s a       -> (a -> [r]) -> s -> [r]
concatMapOf :: Lens' s a      -> (a -> [r]) -> s -> [r]
concatMapOf :: Iso' s a       -> (a -> [r]) -> s -> [r]
concatMapOf :: Traversal' s a -> (a -> [r]) -> s -> [r]

concatOf :: Getting [r] s [r] -> s -> [r] #

Concatenate all of the lists targeted by a Fold into a longer list.

>>> concatOf both ("pan","ama")
"panama"
concatconcatOf folded
concatOfview
concatOf :: Getter s [r]     -> s -> [r]
concatOf :: Fold s [r]       -> s -> [r]
concatOf :: Iso' s [r]       -> s -> [r]
concatOf :: Lens' s [r]      -> s -> [r]
concatOf :: Traversal' s [r] -> s -> [r]

confusing :: Applicative f => LensLike * (Curried (Yoneda f) (Yoneda f)) s t a b -> LensLike * f s t a b #

Fuse a Traversal by reassociating all of the \<*\> operations to the left and fusing all of the fmap calls into one. This is particularly useful when constructing a Traversal using operations from GHC.Generics.

Given a pair of Traversals foo and bar,

confusing (foo.bar) = foo.bar

However, foo and bar are each going to use the Applicative they are given.

confusing exploits the Yoneda lemma to merge their separate uses of fmap into a single fmap. and it further exploits an interesting property of the right Kan lift (or Curried) to left associate all of the uses of '(*)' to make it possible to fuse together more fmaps.

This is particularly effective when the choice of functor f is unknown at compile time or when the Traversal foo.bar in the above description is recursive or complex enough to prevent inlining.

fusing is a version of this combinator suitable for fusing lenses.

confusing :: Traversal s t a b -> Traversal s t a b

cons :: Cons s s a a => a -> s -> s infixr 5 #

cons an element onto a container.

>>> cons a []
[a]
>>> cons a [b, c]
[a,b,c]
>>> cons a (Seq.fromList [])
fromList [a]
>>> cons a (Seq.fromList [b, c])
fromList [a,b,c]

contexts :: Plated a => a -> [Context a a a] #

Return a list of all of the editable contexts for every location in the structure, recursively.

propUniverse x = universe x == map pos (contexts x)
propId x = all (== x) [extract w | w <- contexts x]
contextscontextsOf plate

contextsOf :: ATraversal' a a -> a -> [Context a a a] #

Return a list of all of the editable contexts for every location in the structure, recursively, using a user-specified Traversal to walk each layer.

propUniverse l x = universeOf l x == map pos (contextsOf l x)
propId l x = all (== x) [extract w | w <- contextsOf l x]
contextsOf :: Traversal' a a -> a -> [Context a a a]

contextsOn :: Plated a => ATraversal s t a a -> s -> [Context a a t] #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using plate.

contextsOn b ≡ contextsOnOf b plate
contextsOn :: Plated a => Traversal' s a -> s -> [Context a a s]

contextsOnOf :: ATraversal s t a a -> ATraversal' a a -> s -> [Context a a t] #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using another user-supplied Traversal to walk each layer.

contextsOnOf :: Traversal' s a -> Traversal' a a -> s -> [Context a a s]

contramapped :: Contravariant f => Setter (f b) (f a) a b #

This Setter can be used to map over all of the inputs to a Contravariant.

contramapover contramapped
>>> getPredicate (over contramapped (*2) (Predicate even)) 5
True
>>> getOp (over contramapped (*5) (Op show)) 100
"500"
>>> Prelude.map ($ 1) $ over (mapped . _Unwrapping' Op . contramapped) (*12) [(*2),(+1),(^3)]
[24,13,1728]

contramapping :: Contravariant f => AnIso s t a b -> Iso (f a) (f b) (f s) (f t) #

Lift an Iso into a Contravariant functor.

contramapping :: Contravariant f => Iso s t a b -> Iso (f a) (f b) (f s) (f t)
contramapping :: Contravariant f => Iso' s a -> Iso' (f a) (f s)

cosmos :: Plated a => Fold a a #

Fold over all transitive descendants of a Plated container, including itself.

cosmosOf :: (Applicative f, Contravariant f) => LensLike' f a a -> LensLike' f a a #

Given a Fold that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself.

cosmosOf :: Fold a a -> Fold a a

cosmosOn :: (Applicative f, Contravariant f, Plated a) => LensLike' f s a -> LensLike' f s a #

Given a Fold that knows how to find Plated parts of a container fold them and all of their descendants, recursively.

cosmosOn :: Plated a => Fold s a -> Fold s a

cosmosOnOf :: (Applicative f, Contravariant f) => LensLike' f s a -> LensLike' f a a -> LensLike' f s a #

Given a Fold that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself that lie in a region indicated by another Fold.

cosmosOnOf :: Fold s a -> Fold a a -> Fold s a

createClass :: Lens' LensRules Bool #

Create the class if the constructor is Simple and the lensClass rule matches.

curried :: (Profunctor p, Functor f) => p (a -> b -> c) (f (d -> e -> f)) -> p ((a, b) -> c) (f ((d, e) -> f)) #

The canonical isomorphism for currying and uncurrying a function.

curried = iso curry uncurry
>>> (fst^.curried) 3 4
3
>>> view curried fst 3 4
3

cycled :: Apply f => LensLike * f s t a b -> LensLike * f s t a b #

Transform a non-empty Fold into a Fold1 that loops over its elements over and over.

>>> timingOut $ [1,2,3]^..taking 7 (cycled traverse)
[1,2,3,1,2,3,1]
cycled :: Fold1 s a -> Fold1 s a

declareClassy :: DecsQ -> DecsQ #

For each record in the declaration quote, make lenses and traversals for it, and create a class when the type has no arguments. All record syntax in the input will be stripped off.

e.g.

declareClassy [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
class HasFoo t where
  foo :: Lens' t Foo
instance HasFoo Foo where foo = id
fooX, fooY :: HasFoo t => Lens' t Int

declareClassyFor :: [(String, (String, String))] -> [(String, String)] -> DecsQ -> DecsQ #

Similar to makeClassyFor, but takes a declaration quote.

declareLenses :: DecsQ -> DecsQ #

Make lenses for all records in the given declaration quote. All record syntax in the input will be stripped off.

e.g.

declareLenses [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
fooX, fooY :: Lens' Foo Int

declareLensesFor :: [(String, String)] -> DecsQ -> DecsQ #

Similar to makeLensesFor, but takes a declaration quote.

declareLensesWith :: LensRules -> DecsQ -> DecsQ #

Declare lenses for each records in the given declarations, using the specified LensRules. Any record syntax in the input will be stripped off.

declarePrisms :: DecsQ -> DecsQ #

Generate a Prism for each constructor of each data type.

e.g.

declarePrisms [d|
  data Exp = Lit Int | Var String | Lambda{ bound::String, body::Exp }
  |]

will create

data Exp = Lit Int | Var String | Lambda { bound::String, body::Exp }
_Lit :: Prism' Exp Int
_Var :: Prism' Exp String
_Lambda :: Prism' Exp (String, Exp)

declareWrapped :: DecsQ -> DecsQ #

Build Wrapped instance for each newtype.

deep :: (Conjoined p, Applicative f, Plated s) => Traversing p f s s a b -> Over * * p f s s a b #

Try to apply a traversal to all transitive descendants of a Plated container, but do not recurse through matching descendants.

deep :: Plated s => Fold s a                 -> Fold s a
deep :: Plated s => IndexedFold s a          -> IndexedFold s a
deep :: Plated s => Traversal s s a b        -> Traversal s s a b
deep :: Plated s => IndexedTraversal s s a b -> IndexedTraversal s s a b

deepOf :: (Conjoined p, Applicative f) => LensLike * f s t s t -> Traversing p f s t a b -> Over * * p f s t a b #

Try the second traversal. If it returns no entries, try again with all entries from the first traversal, recursively.

deepOf :: Fold s s          -> Fold s a                   -> Fold s a
deepOf :: Traversal' s s    -> Traversal' s a             -> Traversal' s a
deepOf :: Traversal s t s t -> Traversal s t a b          -> Traversal s t a b
deepOf :: Fold s s          -> IndexedFold i s a          -> IndexedFold i s a
deepOf :: Traversal s t s t -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b

devoid :: Over * * p f Void Void a b #

There is a field for every type in the Void. Very zen.

>>> [] & mapped.devoid +~ 1
[]
>>> Nothing & mapped.devoid %~ abs
Nothing
devoid :: Lens' Void a

dimapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (p a s') (q b t') (p s a') (q t b') #

Lift two Isos into both arguments of a Profunctor simultaneously.

dimapping :: Profunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p a s') (p b t') (p s a') (p t b')
dimapping :: Profunctor p => Iso' s a -> Iso' s' a' -> Iso' (p a s') (p s a')

dropping :: (Conjoined p, Applicative f) => Int -> Over * * p (Indexing f) s t a a -> Over * * p f s t a a #

Visit all but the first n targets of a Traversal, Fold, Getter or Lens.

>>> ("hello","world") ^? dropping 1 both
Just "world"

Dropping works on infinite traversals as well:

>>> [1..] ^? dropping 1 folded
Just 2
dropping :: Int -> Traversal' s a                   -> Traversal' s a
dropping :: Int -> Lens' s a                        -> Traversal' s a
dropping :: Int -> Iso' s a                         -> Traversal' s a
dropping :: Int -> Prism' s a                       -> Traversal' s a
dropping :: Int -> Getter s a                       -> Fold s a
dropping :: Int -> Fold s a                         -> Fold s a
dropping :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
dropping :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
dropping :: Int -> IndexedGetter i s a              -> IndexedFold i s a
dropping :: Int -> IndexedFold i s a                -> IndexedFold i s a

droppingWhile :: (Conjoined p, Profunctor q, Applicative f) => (a -> Bool) -> Optical * * * * p q (Compose * * (State Bool) f) s t a a -> Optical * * * * p q f s t a a #

Obtain a Fold by dropping elements from another Fold, Lens, Iso, Getter or Traversal while a predicate holds.

dropWhile p ≡ toListOf (droppingWhile p folded)
>>> toListOf (droppingWhile (<=3) folded) [1..6]
[4,5,6]
>>> toListOf (droppingWhile (<=3) folded) [1,6,1]
[6,1]
droppingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
droppingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
droppingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingTraversal' s a    -> IndexPreservingFold s a -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingLens' s a         -> IndexPreservingFold s a -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingGetter s a        -> IndexPreservingFold s a
droppingWhile :: (a -> Bool) -> IndexPreservingFold s a          -> IndexPreservingFold s a
droppingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a       -- see notes
droppingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a       -- see notes
droppingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a
droppingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a

Note: Many uses of this combinator will yield something that meets the types, but not the laws of a valid Traversal or IndexedTraversal. The Traversal and IndexedTraversal laws are only satisfied if the new values you assign also pass the predicate! Otherwise subsequent traversals will visit fewer elements and Traversal fusion is not sound.

elemIndexOf :: Eq a => IndexedGetting i (First i) s a -> a -> s -> Maybe i #

Retrieve the index of the first value targeted by a IndexedFold or IndexedTraversal which is equal to a given value.

elemIndexelemIndexOf folded
elemIndexOf :: Eq a => IndexedFold i s a       -> a -> s -> Maybe i
elemIndexOf :: Eq a => IndexedTraversal' i s a -> a -> s -> Maybe i

elemIndicesOf :: Eq a => IndexedGetting i (Endo [i]) s a -> a -> s -> [i] #

Retrieve the indices of the values targeted by a IndexedFold or IndexedTraversal which are equal to a given value.

elemIndiceselemIndicesOf folded
elemIndicesOf :: Eq a => IndexedFold i s a       -> a -> s -> [i]
elemIndicesOf :: Eq a => IndexedTraversal' i s a -> a -> s -> [i]

elemOf :: Eq a => Getting Any s a -> a -> s -> Bool #

Does the element occur anywhere within a given Fold of the structure?

>>> elemOf both "hello" ("hello","world")
True
elemelemOf folded
elemOf :: Eq a => Getter s a     -> a -> s -> Bool
elemOf :: Eq a => Fold s a       -> a -> s -> Bool
elemOf :: Eq a => Lens' s a      -> a -> s -> Bool
elemOf :: Eq a => Iso' s a       -> a -> s -> Bool
elemOf :: Eq a => Traversal' s a -> a -> s -> Bool
elemOf :: Eq a => Prism' s a     -> a -> s -> Bool

element :: Traversable t => Int -> IndexedTraversal' Int (t a) a #

Traverse the nth element of a Traversable container.

elementelementOf traverse

elementOf :: Applicative f => LensLike * (Indexing f) s t a a -> Int -> IndexedLensLike * Int f s t a a #

Traverse the nth elementOf a Traversal, Lens or Iso if it exists.

>>> [[1],[3,4]] & elementOf (traverse.traverse) 1 .~ 5
[[1],[5,4]]
>>> [[1],[3,4]] ^? elementOf (folded.folded) 1
Just 3
>>> timingOut $ ['a'..] ^?! elementOf folded 5
'f'
>>> timingOut $ take 10 $ elementOf traverse 3 .~ 16 $ [0..]
[0,1,2,16,4,5,6,7,8,9]
elementOf :: Traversal' s a -> Int -> IndexedTraversal' Int s a
elementOf :: Fold s a       -> Int -> IndexedFold Int s a

elements :: Traversable t => (Int -> Bool) -> IndexedTraversal' Int (t a) a #

Traverse elements of a Traversable container where their ordinal positions match a predicate.

elementselementsOf traverse

elementsOf :: Applicative f => LensLike * (Indexing f) s t a a -> (Int -> Bool) -> IndexedLensLike * Int f s t a a #

Traverse (or fold) selected elements of a Traversal (or Fold) where their ordinal positions match a predicate.

elementsOf :: Traversal' s a -> (Int -> Bool) -> IndexedTraversal' Int s a
elementsOf :: Fold s a       -> (Int -> Bool) -> IndexedFold Int s a

enum :: Enum a => Iso' Int a #

This isomorphism can be used to convert to or from an instance of Enum.

>>> LT^.from enum
0
>>> 97^.enum :: Char
'a'

Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

failing :: (Conjoined p, Applicative f) => Traversing p f s t a b -> Over * * p f s t a b -> Over * * p f s t a b infixl 5 #

Try the first Traversal (or Fold), falling back on the second Traversal (or Fold) if it returns no entries.

This is only a valid Traversal if the second Traversal is disjoint from the result of the first or returns exactly the same results. These conditions are trivially met when given a Lens, Iso, Getter, Prism or "affine" Traversal -- one that has 0 or 1 target.

Mutatis mutandis for Fold.

>>> [0,1,2,3] ^? failing (ix 1) (ix 2)
Just 1
>>> [0,1,2,3] ^? failing (ix 42) (ix 2)
Just 2
failing :: Traversal s t a b -> Traversal s t a b -> Traversal s t a b
failing :: Prism s t a b     -> Prism s t a b     -> Traversal s t a b
failing :: Fold s a          -> Fold s a          -> Fold s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

failing :: Lens s t a b      -> Traversal s t a b -> Traversal s t a b
failing :: Iso s t a b       -> Traversal s t a b -> Traversal s t a b
failing :: Equality s t a b  -> Traversal s t a b -> Traversal s t a b
failing :: Getter s a        -> Fold s a          -> Fold s a

If both of the inputs are indexed, the result is also indexed, so you can apply this to a pair of indexed traversals or indexed folds, obtaining an indexed traversal or indexed fold.

failing :: IndexedTraversal i s t a b -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
failing :: IndexedFold i s a          -> IndexedFold i s a          -> IndexedFold i s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

failing :: IndexedLens i s t a b      -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
failing :: IndexedGetter i s a        -> IndexedGetter i s a        -> IndexedFold i s a

failover :: Alternative m => LensLike * ((,) Any) s t a b -> (a -> b) -> s -> m t #

Try to map a function over this Traversal, failing if the Traversal has no targets.

>>> failover (element 3) (*2) [1,2] :: Maybe [Int]
Nothing
>>> failover _Left (*2) (Right 4) :: Maybe (Either Int Int)
Nothing
>>> failover _Right (*2) (Right 4) :: Maybe (Either Int Int)
Just (Right 8)
failover :: Alternative m => Traversal s t a b -> (a -> b) -> s -> m t

filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' * * p f a a #

Obtain an Fold that can be composed with to filter another Lens, Iso, Getter, Fold (or Traversal).

Note: This is not a legal Traversal, unless you are very careful not to invalidate the predicate on the target.

Note: This is also not a legal Prism, unless you are very careful not to inject a value that matches the predicate.

As a counter example, consider that given evens = filtered even the second Traversal law is violated:

over evens succ . over evens succ /= over evens (succ . succ)

So, in order for this to qualify as a legal Traversal you can only use it for actions that preserve the result of the predicate!

>>> [1..10]^..folded.filtered even
[2,4,6,8,10]

This will preserve an index if it is present.

findIndexOf :: IndexedGetting i (First i) s a -> (a -> Bool) -> s -> Maybe i #

Retrieve the index of the first value targeted by a IndexedFold or IndexedTraversal which satisfies a predicate.

findIndexfindIndexOf folded
findIndexOf :: IndexedFold i s a       -> (a -> Bool) -> s -> Maybe i
findIndexOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> Maybe i

findIndicesOf :: IndexedGetting i (Endo [i]) s a -> (a -> Bool) -> s -> [i] #

Retrieve the indices of the values targeted by a IndexedFold or IndexedTraversal which satisfy a predicate.

findIndicesfindIndicesOf folded
findIndicesOf :: IndexedFold i s a       -> (a -> Bool) -> s -> [i]
findIndicesOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> [i]

findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a) #

The findMOf function takes a Lens (or Getter, Iso, Fold, or Traversal), a monadic predicate and a structure and returns in the monad the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

>>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,4,6)
"Checking 1"
"Checking 3"
"Checking 4"
Just 4
>>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,5,7)
"Checking 1"
"Checking 3"
"Checking 5"
"Checking 7"
Nothing
findMOf :: (Monad m, Getter s a)     -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Fold s a)       -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Iso' s a)       -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Lens' s a)      -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Traversal' s a) -> (a -> m Bool) -> s -> m (Maybe a)
findMOf folded :: (Monad m, Foldable f) => (a -> m Bool) -> f a -> m (Maybe a)
ifindMOf l ≡ findMOf l . Indexed

A simpler version that didn't permit indexing, would be:

findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a)
findMOf l p = foldrOf l (a y -> p a >>= x -> if x then return (Just a) else y) $ return Nothing

findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a #

The findOf function takes a Lens (or Getter, Iso, Fold, or Traversal), a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

>>> findOf each even (1,3,4,6)
Just 4
>>> findOf folded even [1,3,5,7]
Nothing
findOf :: Getter s a     -> (a -> Bool) -> s -> Maybe a
findOf :: Fold s a       -> (a -> Bool) -> s -> Maybe a
findOf :: Iso' s a       -> (a -> Bool) -> s -> Maybe a
findOf :: Lens' s a      -> (a -> Bool) -> s -> Maybe a
findOf :: Traversal' s a -> (a -> Bool) -> s -> Maybe a
findfindOf folded
ifindOf l ≡ findOf l . Indexed

A simpler version that didn't permit indexing, would be:

findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a
findOf l p = foldrOf l (a y -> if p a then Just a else y) Nothing

firstOf :: Getting (Leftmost a) s a -> s -> Maybe a #

Retrieve the First entry of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

The answer is computed in a manner that leaks space less than ala First . foldMapOf and gives you back access to the outermost Just constructor more quickly, but may have worse constant factors.

>>> firstOf traverse [1..10]
Just 1
>>> firstOf both (1,2)
Just 1
>>> firstOf ignored ()
Nothing
firstOf :: Getter s a     -> s -> Maybe a
firstOf :: Fold s a       -> s -> Maybe a
firstOf :: Lens' s a      -> s -> Maybe a
firstOf :: Iso' s a       -> s -> Maybe a
firstOf :: Traversal' s a -> s -> Maybe a

firsting :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f s x) (g t y) (f a x) (g b y) #

Lift an Iso into the first argument of a Bifunctor.

firsting :: Bifunctor p => Iso s t a b -> Iso (p s x) (p t y) (p a x) (p b y)
firsting :: Bifunctor p => Iso' s a -> Iso' (p s x) (p a x)

flipped :: (Profunctor p, Functor f) => p (b -> a -> c) (f (b' -> a' -> c')) -> p (a -> b -> c) (f (a' -> b' -> c')) #

The isomorphism for flipping a function.

>>> ((,)^.flipped) 1 2
(2,1)

foldBy :: Foldable t => (a -> a -> a) -> a -> t a -> a #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like fold where the Monoid instance can be manually specified.

foldBy mappend memptyfold
>>> foldBy (++) [] ["hello","world"]
"helloworld"

foldByOf :: Fold s a -> (a -> a -> a) -> a -> s -> a #

Fold a value using a specified Fold and Monoid operations. This is like foldBy where the Foldable instance can be manually specified.

foldByOf foldedfoldBy
foldByOf :: Getter s a     -> (a -> a -> a) -> a -> s -> a
foldByOf :: Fold s a       -> (a -> a -> a) -> a -> s -> a
foldByOf :: Lens' s a      -> (a -> a -> a) -> a -> s -> a
foldByOf :: Traversal' s a -> (a -> a -> a) -> a -> s -> a
foldByOf :: Iso' s a       -> (a -> a -> a) -> a -> s -> a
>>> foldByOf both (++) [] ("hello","world")
"helloworld"

foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like foldMap where the Monoid instance can be manually specified.

foldMapBy mappend memptyfoldMap
>>> foldMapBy (+) 0 length ["hello","world"]
10

foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r #

Fold a value using a specified Fold and Monoid operations. This is like foldMapBy where the Foldable instance can be manually specified.

foldMapByOf foldedfoldMapBy
foldMapByOf :: Getter s a     -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Fold s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Traversal' s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Lens' s a      -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Iso' s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
>>> foldMapByOf both (+) 0 length ("hello","world")
10

foldMapOf :: Getting r s a -> (a -> r) -> s -> r #

Map each part of a structure viewed through a Lens, Getter, Fold or Traversal to a monoid and combine the results.

>>> foldMapOf (folded . both . _Just) Sum [(Just 21, Just 21)]
Sum {getSum = 42}
foldMap = foldMapOf folded
foldMapOfviews
ifoldMapOf l = foldMapOf l . Indexed
foldMapOf ::             Getter s a     -> (a -> r) -> s -> r
foldMapOf :: Monoid r => Fold s a       -> (a -> r) -> s -> r
foldMapOf ::             Lens' s a      -> (a -> r) -> s -> r
foldMapOf ::             Iso' s a       -> (a -> r) -> s -> r
foldMapOf :: Monoid r => Traversal' s a -> (a -> r) -> s -> r
foldMapOf :: Monoid r => Prism' s a     -> (a -> r) -> s -> r
foldMapOf :: Getting r s a -> (a -> r) -> s -> r

foldOf :: Getting a s a -> s -> a #

Combine the elements of a structure viewed through a Lens, Getter, Fold or Traversal using a monoid.

>>> foldOf (folded.folded) [[Sum 1,Sum 4],[Sum 8, Sum 8],[Sum 21]]
Sum {getSum = 42}
fold = foldOf folded
foldOfview
foldOf ::             Getter s m     -> s -> m
foldOf :: Monoid m => Fold s m       -> s -> m
foldOf ::             Lens' s m      -> s -> m
foldOf ::             Iso' s m       -> s -> m
foldOf :: Monoid m => Traversal' s m -> s -> m
foldOf :: Monoid m => Prism' s m     -> s -> m

folded :: Foldable f => IndexedFold Int (f a) a #

Obtain a Fold from any Foldable indexed by ordinal position.

>>> Just 3^..folded
[3]
>>> Nothing^..folded
[]
>>> [(1,2),(3,4)]^..folded.both
[1,2,3,4]

folded64 :: Foldable f => IndexedFold Int64 (f a) a #

Obtain a Fold from any Foldable indexed by ordinal position.

folding :: Foldable f => (s -> f a) -> Fold s a #

Obtain a Fold by lifting an operation that returns a Foldable result.

This can be useful to lift operations from Data.List and elsewhere into a Fold.

>>> [1,2,3,4]^..folding tail
[2,3,4]

foldl1Of :: Getting (Dual (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a #

A variant of foldlOf that has no base case and thus may only be applied to lenses and structures such that the Lens views at least one element of the structure.

>>> foldl1Of each (+) (1,2,3,4)
10
foldl1Of l f ≡ foldl1 f . toListOf l
foldl1foldl1Of folded
foldl1Of :: Getter s a     -> (a -> a -> a) -> s -> a
foldl1Of :: Fold s a       -> (a -> a -> a) -> s -> a
foldl1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
foldl1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
foldl1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldl1Of' :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a #

A variant of foldlOf' that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

foldl1Of' l f ≡ foldl1' f . toListOf l
foldl1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
foldl1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
foldl1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
foldl1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
foldl1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldlMOf :: Monad m => Getting (Endo (r -> m r)) s a -> (r -> a -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

foldlMfoldlMOf folded
foldlMOf :: Monad m => Getter s a     -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Fold s a       -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Iso' s a       -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Lens' s a      -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Traversal' s a -> (r -> a -> m r) -> r -> s -> m r

foldlOf :: Getting (Dual (Endo r)) s a -> (r -> a -> r) -> r -> s -> r #

Left-associative fold of the parts of a structure that are viewed through a Lens, Getter, Fold or Traversal.

foldlfoldlOf folded
foldlOf :: Getter s a     -> (r -> a -> r) -> r -> s -> r
foldlOf :: Fold s a       -> (r -> a -> r) -> r -> s -> r
foldlOf :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
foldlOf :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
foldlOf :: Traversal' s a -> (r -> a -> r) -> r -> s -> r
foldlOf :: Prism' s a     -> (r -> a -> r) -> r -> s -> r

foldlOf' :: Getting (Endo (Endo r)) s a -> (r -> a -> r) -> r -> s -> r #

Fold over the elements of a structure, associating to the left, but strictly.

foldl'foldlOf' folded
foldlOf' :: Getter s a     -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Fold s a       -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Traversal' s a -> (r -> a -> r) -> r -> s -> r

foldr1Of :: Getting (Endo (Maybe a)) s a -> (a -> a -> a) -> s -> a #

A variant of foldrOf that has no base case and thus may only be applied to lenses and structures such that the Lens views at least one element of the structure.

>>> foldr1Of each (+) (1,2,3,4)
10
foldr1Of l f ≡ foldr1 f . toListOf l
foldr1foldr1Of folded
foldr1Of :: Getter s a     -> (a -> a -> a) -> s -> a
foldr1Of :: Fold s a       -> (a -> a -> a) -> s -> a
foldr1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
foldr1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
foldr1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldr1Of' :: Getting (Dual (Endo (Endo (Maybe a)))) s a -> (a -> a -> a) -> s -> a #

A variant of foldrOf' that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

foldr1Of l f ≡ foldr1 f . toListOf l
foldr1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
foldr1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
foldr1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
foldr1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
foldr1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldrMOf :: Monad m => Getting (Dual (Endo (r -> m r))) s a -> (a -> r -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

foldrMfoldrMOf folded
foldrMOf :: Monad m => Getter s a     -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Fold s a       -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Iso' s a       -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Lens' s a      -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Traversal' s a -> (a -> r -> m r) -> r -> s -> m r

foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r #

Right-associative fold of parts of a structure that are viewed through a Lens, Getter, Fold or Traversal.

foldrfoldrOf folded
foldrOf :: Getter s a     -> (a -> r -> r) -> r -> s -> r
foldrOf :: Fold s a       -> (a -> r -> r) -> r -> s -> r
foldrOf :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
foldrOf :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
foldrOf :: Traversal' s a -> (a -> r -> r) -> r -> s -> r
foldrOf :: Prism' s a     -> (a -> r -> r) -> r -> s -> r
ifoldrOf l ≡ foldrOf l . Indexed
foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r

foldrOf' :: Getting (Dual (Endo (Endo r))) s a -> (a -> r -> r) -> r -> s -> r #

Strictly fold right over the elements of a structure.

foldr'foldrOf' folded
foldrOf' :: Getter s a     -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Fold s a       -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Traversal' s a -> (a -> r -> r) -> r -> s -> r

foldring :: (Contravariant f, Applicative f) => ((a -> f a -> f a) -> f a -> s -> f a) -> LensLike * f s t a b #

Obtain a Fold by lifting foldr like function.

>>> [1,2,3,4]^..foldring foldr
[1,2,3,4]

forMOf :: LensLike * (WrappedMonad m) s t a b -> s -> (a -> m b) -> m t #

forMOf is a flipped version of mapMOf, consistent with the definition of forM.

>>> forMOf both (1,3) $ \x -> [x, x + 1]
[(1,3),(1,4),(2,3),(2,4)]
forMforMOf traverse
forMOf l ≡ flip (mapMOf l)
iforMOf l s ≡ forM l s . Indexed
forMOf :: Monad m => Iso s t a b       -> s -> (a -> m b) -> m t
forMOf :: Monad m => Lens s t a b      -> s -> (a -> m b) -> m t
forMOf :: Monad m => Traversal s t a b -> s -> (a -> m b) -> m t

forMOf_ :: Monad m => Getting (Sequenced r m) s a -> s -> (a -> m r) -> m () #

forMOf_ is mapMOf_ with two of its arguments flipped.

>>> forMOf_ both ("hello","world") putStrLn
hello
world
forM_forMOf_ folded
forMOf_ :: Monad m => Getter s a     -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Fold s a       -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Lens' s a      -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Iso' s a       -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Traversal' s a -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Prism' s a     -> s -> (a -> m r) -> m ()

forOf :: LensLike * f s t a b -> s -> (a -> f b) -> f t #

A version of traverseOf with the arguments flipped, such that:

>>> forOf each (1,2,3) print
1
2
3
((),(),())

This function is only provided for consistency, flip is strictly more general.

forOfflip
forOfflip . traverseOf
forforOf traverse
ifor l s ≡ for l s . Indexed
forOf :: Functor f => Iso s t a b -> s -> (a -> f b) -> f t
forOf :: Functor f => Lens s t a b -> s -> (a -> f b) -> f t
forOf :: Applicative f => Traversal s t a b -> s -> (a -> f b) -> f t

forOf_ :: Functor f => Getting (Traversed r f) s a -> s -> (a -> f r) -> f () #

Traverse over all of the targets of a Fold (or Getter), computing an Applicative (or Functor)-based answer, but unlike forOf do not construct a new structure. forOf_ generalizes for_ to work over any Fold.

When passed a Getter, forOf_ can work over any Functor, but when passed a Fold, forOf_ requires an Applicative.

for_forOf_ folded
>>> forOf_ both ("hello","world") putStrLn
hello
world

The rather specific signature of forOf_ allows it to be used as if the signature was any of:

iforOf_ l s ≡ forOf_ l s . Indexed
forOf_ :: Functor f     => Getter s a     -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Fold s a       -> s -> (a -> f r) -> f ()
forOf_ :: Functor f     => Lens' s a      -> s -> (a -> f r) -> f ()
forOf_ :: Functor f     => Iso' s a       -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Traversal' s a -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Prism' s a     -> s -> (a -> f r) -> f ()

from :: AnIso s t a b -> Iso b a t s #

Invert an isomorphism.

from (from l) ≡ l

fromEq :: AnEquality k1 k2 s t a b -> Equality k2 k1 b a t s #

Equality is symmetric.

fusing :: Functor f => LensLike * (Yoneda f) s t a b -> LensLike * f s t a b #

Fuse a composition of lenses using Yoneda to provide fmap fusion.

In general, given a pair of lenses foo and bar

fusing (foo.bar) = foo.bar

however, foo and bar are either going to fmap internally or they are trivial.

fusing exploits the Yoneda lemma to merge these separate uses into a single fmap.

This is particularly effective when the choice of functor f is unknown at compile time or when the Lens foo.bar in the above description is recursive or complex enough to prevent inlining.

fusing :: Lens s t a b -> Lens s t a b

generateLazyPatterns :: Lens' LensRules Bool #

Generate optics using lazy pattern matches. This can allow fields of an undefined value to be initialized with lenses:

data Foo = Foo {_x :: Int, _y :: Bool}
  deriving Show

makeLensesWith (lensRules & generateLazyPatterns .~ True) ''Foo
> undefined & x .~ 8 & y .~ True
Foo {_x = 8, _y = True}

The downside of this flag is that it can lead to space-leaks and code-size/compile-time increases when generated for large records. By default this flag is turned off, and strict optics are generated.

When using lazy optics the strict optic can be recovered by composing with $!:

strictOptic = ($!) . lazyOptic

generateSignatures :: Lens' LensRules Bool #

Indicate whether or not to supply the signatures for the generated lenses.

Disabling this can be useful if you want to provide a more restricted type signature or if you want to supply hand-written haddocks.

generateUpdateableOptics :: Lens' LensRules Bool #

Generate "updateable" optics when True. When False, Folds will be generated instead of Traversals and Getters will be generated instead of Lenses. This mode is intended to be used for types with invariants which must be maintained by "smart" constructors.

getting :: (Functor f, Contravariant f) => LensLike * f s t a b -> LensLike' f s a #

Coerce a Getter-compatible LensLike to a LensLike'. This is useful when using a Traversal that is not simple as a Getter or a Fold.

gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a #

Implement plate operation for a type using its Generic instance.

has :: Getting Any s a -> s -> Bool #

Check to see if this Fold or Traversal matches 1 or more entries.

>>> has (element 0) []
False
>>> has _Left (Left 12)
True
>>> has _Right (Left 12)
False

This will always return True for a Lens or Getter.

>>> has _1 ("hello","world")
True
has :: Getter s a     -> s -> Bool
has :: Fold s a       -> s -> Bool
has :: Iso' s a       -> s -> Bool
has :: Lens' s a      -> s -> Bool
has :: Traversal' s a -> s -> Bool

hasn't :: Getting All s a -> s -> Bool #

Check to see if this Fold or Traversal has no matches.

>>> hasn't _Left (Right 12)
True
>>> hasn't _Left (Left 12)
False

holes :: Plated a => a -> [Pretext (->) a a a] #

The one-level version of context. This extracts a list of the immediate children as editable contexts.

Given a context you can use pos to see the values, peek at what the structure would be like with an edited result, or simply extract the original structure.

propChildren x = children l x == map pos (holes l x)
propId x = all (== x) [extract w | w <- holes l x]
holes = holesOf plate

holesOf :: Conjoined p => Over * * p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] #

The one-level version of contextsOf. This extracts a list of the immediate children according to a given Traversal as editable contexts.

Given a context you can use pos to see the values, peek at what the structure would be like with an edited result, or simply extract the original structure.

propChildren l x = childrenOf l x == map pos (holesOf l x)
propId l x = all (== x) [extract w | w <- holesOf l x]
holesOf :: Iso' s a                -> s -> [Pretext' (->) a s]
holesOf :: Lens' s a               -> s -> [Pretext' (->) a s]
holesOf :: Traversal' s a          -> s -> [Pretext' (->) a s]
holesOf :: IndexedLens' i s a      -> s -> [Pretext' (Indexed i) a s]
holesOf :: IndexedTraversal' i s a -> s -> [Pretext' (Indexed i) a s]

holesOn :: Conjoined p => Over * * p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] #

An alias for holesOf, provided for consistency with the other combinators.

holesOnholesOf
holesOn :: Iso' s a                -> s -> [Pretext (->) a a s]
holesOn :: Lens' s a               -> s -> [Pretext (->) a a s]
holesOn :: Traversal' s a          -> s -> [Pretext (->) a a s]
holesOn :: IndexedLens' i s a      -> s -> [Pretext (Indexed i) a a s]
holesOn :: IndexedTraversal' i s a -> s -> [Pretext (Indexed i) a a s]

holesOnOf :: Conjoined p => LensLike * (Bazaar p r r) s t a b -> Over * * p (Bazaar p r r) a b r r -> s -> [Pretext p r r t] #

Extract one level of holes from a container in a region specified by one Traversal, using another.

holesOnOf b l ≡ holesOf (b . l)
holesOnOf :: Iso' s a       -> Iso' a a                -> s -> [Pretext (->) a a s]
holesOnOf :: Lens' s a      -> Lens' a a               -> s -> [Pretext (->) a a s]
holesOnOf :: Traversal' s a -> Traversal' a a          -> s -> [Pretext (->) a a s]
holesOnOf :: Lens' s a      -> IndexedLens' i a a      -> s -> [Pretext (Indexed i) a a s]
holesOnOf :: Traversal' s a -> IndexedTraversal' i a a -> s -> [Pretext (Indexed i) a a s]

iall :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not all elements in a container satisfy a predicate, with access to the index i.

When you don't need access to the index then all is more flexible in what it accepts.

alliall . const

iallOf :: IndexedGetting i All s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not all elements viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then allOf is more flexible in what it accepts.

allOf l ≡ iallOf l . const
iallOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

iany :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not any element in a container satisfies a predicate, with access to the index i.

When you don't need access to the index then any is more flexible in what it accepts.

anyiany . const

ianyOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not any element viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then anyOf is more flexible in what it accepts.

anyOf l ≡ ianyOf l . const
ianyOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

iat :: At m => Index m -> IndexedLens' (Index m) m (Maybe (IxValue m)) #

An indexed version of at.

>>> Map.fromList [(1,"world")] ^@. iat 1
(1,Just "world")
>>> iat 1 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
fromList [(1,"hello")]
>>> iat 2 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
fromList []

icensoring :: MonadWriter w m => IndexedSetter i w w u v -> (i -> u -> v) -> m a -> m a #

This is a generalization of censor that alows you to censor just a portion of the resulting MonadWriter, with access to the index of an IndexedSetter.

icompose :: Indexable p c => (i -> j -> p) -> (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> c a b -> r #

Composition of Indexed functions with a user supplied function for combining indices.

iconcatMap :: FoldableWithIndex i f => (i -> a -> [b]) -> f a -> [b] #

Concatenate the results of a function of the elements of an indexed container with access to the index.

When you don't need access to the index then concatMap is more flexible in what it accepts.

concatMapiconcatMap . const
iconcatMapifoldMap

iconcatMapOf :: IndexedGetting i [r] s a -> (i -> a -> [r]) -> s -> [r] #

Concatenate the results of a function of the elements of an IndexedFold or IndexedTraversal with access to the index.

When you don't need access to the index then concatMapOf is more flexible in what it accepts.

concatMapOf l ≡ iconcatMapOf l . const
iconcatMapOfifoldMapOf
iconcatMapOf :: IndexedGetter i s a     -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedFold i s a       -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedLens' i s a      -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedTraversal' i s a -> (i -> a -> [r]) -> s -> [r]

icontains :: Contains m => Index m -> IndexedLens' (Index m) m Bool #

An indexed version of contains.

>>> IntSet.fromList [1,2,3,4] ^@. icontains 3
(3,True)
>>> IntSet.fromList [1,2,3,4] ^@. icontains 5
(5,False)
>>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if odd i then not x else x
fromList [1,2,4]
>>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if even i then not x else x
fromList [1,2,3,4]

idroppingWhile :: (Indexable i p, Profunctor q, Applicative f) => (i -> a -> Bool) -> Optical * * * * (Indexed i) q (Compose * * (State Bool) f) s t a a -> Optical * * * * p q f s t a a #

Obtain an IndexedFold by dropping elements from another IndexedFold, IndexedLens, IndexedGetter or IndexedTraversal while a predicate holds.

idroppingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
idroppingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a -- see notes
idroppingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a -- see notes
idroppingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

Applying idroppingWhile to an IndexedLens or IndexedTraversal will still allow you to use it as a pseudo-IndexedTraversal, but if you change the value of the targets to ones where the predicate returns True, then you will break the Traversal laws and Traversal fusion will no longer be sound.

ifailover :: Alternative m => Over * * (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t #

Try to map a function which uses the index over this IndexedTraversal, failing if the IndexedTraversal has no targets.

ifailover :: Alternative m => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> m t

ifiltered :: (Indexable i p, Applicative f) => (i -> a -> Bool) -> Optical' * * p (Indexed i) f a a #

Filter an IndexedFold or IndexedGetter, obtaining an IndexedFold.

>>> [0,0,0,5,5,5]^..traversed.ifiltered (\i a -> i <= a)
[0,5,5,5]

Compose with filtered to filter another IndexedLens, IndexedIso, IndexedGetter, IndexedFold (or IndexedTraversal) with access to both the value and the index.

Note: As with filtered, this is not a legal IndexedTraversal, unless you are very careful not to invalidate the predicate on the target!

ifind :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Maybe (i, a) #

Searches a container with a predicate that is also supplied the index, returning the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then find is more flexible in what it accepts.

findifind . const

ifindMOf :: Monad m => IndexedGetting i (Endo (m (Maybe a))) s a -> (i -> a -> m Bool) -> s -> m (Maybe a) #

The ifindMOf function takes an IndexedFold or IndexedTraversal, a monadic predicate that is also supplied the index, a structure and returns in the monad the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then findMOf is more flexible in what it accepts.

findMOf l ≡ ifindMOf l . const
ifindMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedFold i s a       -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> m Bool) -> s -> m (Maybe a)

ifindOf :: IndexedGetting i (Endo (Maybe a)) s a -> (i -> a -> Bool) -> s -> Maybe a #

The ifindOf function takes an IndexedFold or IndexedTraversal, a predicate that is also supplied the index, a structure and returns the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then findOf is more flexible in what it accepts.

findOf l ≡ ifindOf l . const
ifindOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Maybe a

ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r #

ifoldMapByOf :: IndexedFold i t a -> (r -> r -> r) -> r -> (i -> a -> r) -> t -> r #

ifoldMapOf :: IndexedGetting i m s a -> (i -> a -> m) -> s -> m #

Fold an IndexedFold or IndexedTraversal by mapping indices and values to an arbitrary Monoid with access to the i.

When you don't need access to the index then foldMapOf is more flexible in what it accepts.

foldMapOf l ≡ ifoldMapOf l . const
ifoldMapOf ::             IndexedGetter i s a     -> (i -> a -> m) -> s -> m
ifoldMapOf :: Monoid m => IndexedFold i s a       -> (i -> a -> m) -> s -> m
ifoldMapOf ::             IndexedLens' i s a      -> (i -> a -> m) -> s -> m
ifoldMapOf :: Monoid m => IndexedTraversal' i s a -> (i -> a -> m) -> s -> m

ifolding :: (Foldable f, Indexable i p, Contravariant g, Applicative g) => (s -> f (i, a)) -> Over * * p g s t a b #

ifoldlM :: (FoldableWithIndex i f, Monad m) => (i -> b -> a -> m b) -> b -> f a -> m b #

Monadic fold over the elements of a structure with an index, associating to the left.

When you don't need access to the index then foldlM is more flexible in what it accepts.

foldlMifoldlM . const

ifoldlMOf :: Monad m => IndexedGetting i (Endo (r -> m r)) s a -> (i -> r -> a -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure with an index, associating to the left.

When you don't need access to the index then foldlMOf is more flexible in what it accepts.

foldlMOf l ≡ ifoldlMOf l . const
ifoldlMOf :: Monad m => IndexedGetter i s a     -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedFold i s a       -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedLens' i s a      -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedTraversal' i s a -> (i -> r -> a -> m r) -> r -> s -> m r

ifoldlOf :: IndexedGetting i (Dual (Endo r)) s a -> (i -> r -> a -> r) -> r -> s -> r #

Left-associative fold of the parts of a structure that are viewed through an IndexedFold or IndexedTraversal with access to the i.

When you don't need access to the index then foldlOf is more flexible in what it accepts.

foldlOf l ≡ ifoldlOf l . const
ifoldlOf :: IndexedGetter i s a     -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedFold i s a       -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedLens' i s a      -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedTraversal' i s a -> (i -> r -> a -> r) -> r -> s -> r

ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> r #

Fold over the elements of a structure with an index, associating to the left, but strictly.

When you don't need access to the index then foldlOf' is more flexible in what it accepts.

foldlOf' l ≡ ifoldlOf' l . const
ifoldlOf' :: IndexedGetter i s a       -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedFold i s a         -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedLens' i s a        -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedTraversal' i s a   -> (i -> r -> a -> r) -> r -> s -> r

ifoldrM :: (FoldableWithIndex i f, Monad m) => (i -> a -> b -> m b) -> b -> f a -> m b #

Monadic fold right over the elements of a structure with an index.

When you don't need access to the index then foldrM is more flexible in what it accepts.

foldrMifoldrM . const

ifoldrMOf :: Monad m => IndexedGetting i (Dual (Endo (r -> m r))) s a -> (i -> a -> r -> m r) -> r -> s -> m r #

Monadic fold right over the elements of a structure with an index.

When you don't need access to the index then foldrMOf is more flexible in what it accepts.

foldrMOf l ≡ ifoldrMOf l . const
ifoldrMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedFold i s a       -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> r -> m r) -> r -> s -> m r

ifoldrOf :: IndexedGetting i (Endo r) s a -> (i -> a -> r -> r) -> r -> s -> r #

Right-associative fold of parts of a structure that are viewed through an IndexedFold or IndexedTraversal with access to the i.

When you don't need access to the index then foldrOf is more flexible in what it accepts.

foldrOf l ≡ ifoldrOf l . const
ifoldrOf :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldrOf' :: IndexedGetting i (Dual (Endo (r -> r))) s a -> (i -> a -> r -> r) -> r -> s -> r #

Strictly fold right over the elements of a structure with an index.

When you don't need access to the index then foldrOf' is more flexible in what it accepts.

foldrOf' l ≡ ifoldrOf' l . const
ifoldrOf' :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldring :: (Indexable i p, Contravariant f, Applicative f) => ((i -> a -> f a -> f a) -> f a -> s -> f a) -> Over * * p f s t a b #

Obtain FoldWithIndex by lifting ifoldr like function.

ifor :: (TraversableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f (t b) #

Traverse with an index (and the arguments flipped).

for a ≡ ifor a . const
iforflip itraverse

iforM :: (TraversableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results, with access its position (and the arguments flipped).

forM a ≡ iforM a . const
iforMflip imapM

iforMOf :: (Indexed i a (WrappedMonad m b) -> s -> WrappedMonad m t) -> s -> (i -> a -> m b) -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results, with access its position (and the arguments flipped).

forMOf l a ≡ iforMOf l a . const
iforMOfflip . imapMOf
iforMOf :: Monad m => IndexedLens i s t a b      -> s -> (i -> a -> m b) -> m t
iforMOf :: Monad m => IndexedTraversal i s t a b -> s -> (i -> a -> m b) -> m t

iforMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> s -> (i -> a -> m r) -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforMOf_flip . imapMOf_

When you don't need access to the index then forMOf_ is more flexible in what it accepts.

forMOf_ l a ≡ iforMOf l a . const
iforMOf_ :: Monad m => IndexedGetter i s a     -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedFold i s a       -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedLens' i s a      -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedTraversal' i s a -> s -> (i -> a -> m r) -> m ()

iforM_ :: (FoldableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforM_flip imapM_

When you don't need access to the index then forMOf_ is more flexible in what it accepts.

forMOf_ l a ≡ iforMOf l a . const

iforOf :: (Indexed i a (f b) -> s -> f t) -> s -> (i -> a -> f b) -> f t #

Traverse with an index (and the arguments flipped).

forOf l a ≡ iforOf l a . const
iforOfflip . itraverseOf
iforOf :: Functor f     => IndexedLens i s t a b       -> s -> (i -> a -> f b) -> f t
iforOf :: Applicative f => IndexedTraversal i s t a b  -> s -> (i -> a -> f b) -> f t
iforOf :: Apply f       => IndexedTraversal1 i s t a b -> s -> (i -> a -> f b) -> f t

iforOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> s -> (i -> a -> f r) -> f () #

Traverse the targets of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforOf_flip . itraverseOf_

When you don't need access to the index then forOf_ is more flexible in what it accepts.

forOf_ l a ≡ iforOf_ l a . const
iforOf_ :: Functor f     => IndexedGetter i s a     -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Applicative f => IndexedFold i s a       -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Functor f     => IndexedLens' i s a      -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Applicative f => IndexedTraversal' i s a -> s -> (i -> a -> f r) -> f ()

ifor_ :: (FoldableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f () #

Traverse elements with access to the index i, discarding the results (with the arguments flipped).

ifor_flip itraverse_

When you don't need access to the index then for_ is more flexible in what it accepts.

for_ a ≡ ifor_ a . const

ignored :: Applicative f => pafb -> s -> f s #

This is the trivial empty Traversal.

ignored :: IndexedTraversal i s s a b
ignoredconst pure
>>> 6 & ignored %~ absurd
6

iix :: Ixed m => Index m -> IndexedTraversal' (Index m) m (IxValue m) #

An indexed version of ix.

>>> Seq.fromList [a,b,c,d] & iix 2 %@~ f'
fromList [a,b,f' 2 c,d]
>>> Seq.fromList [a,b,c,d] & iix 2 .@~ h
fromList [a,b,h 2,d]
>>> Seq.fromList [a,b,c,d] ^@? iix 2
Just (2,c)
>>> Seq.fromList [] ^@? iix 2
Nothing

ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b #

Build an IndexedLens from a Getter and a Setter.

ilevels :: AnIndexedTraversal i s t a b -> IndexedTraversal Int s t (Level i a) (Level j b) #

This provides a breadth-first Traversal of the individual levels of any other Traversal via iterative deepening depth-first search. The levels are returned to you in a compressed format.

This is similar to levels, but retains the index of the original IndexedTraversal, so you can access it when traversing the levels later on.

>>> ["dog","cat"]^@..ilevels (traversed<.>traversed).itraversed
[((0,0),'d'),((0,1),'o'),((1,0),'c'),((0,2),'g'),((1,1),'a'),((1,2),'t')]

The resulting Traversal of the levels which is indexed by the depth of each Level.

>>> ["dog","cat"]^@..ilevels (traversed<.>traversed)<.>itraversed
[((2,(0,0)),'d'),((3,(0,1)),'o'),((3,(1,0)),'c'),((4,(0,2)),'g'),((4,(1,1)),'a'),((5,(1,2)),'t')]

Note: Internally this is implemented by using an illegal Applicative, as it extracts information in an order that violates the Applicative laws.

ilike :: (Indexable i p, Contravariant f) => i -> a -> Over' p f s a #

ilike :: i -> a -> IndexedGetter i s a

ilistening :: MonadWriter w m => IndexedGetting i (i, u) w u -> m a -> m (a, (i, u)) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

ilistening :: MonadWriter w m             => IndexedGetter i w u     -> m a -> m (a, (i, u))
ilistening :: MonadWriter w m             => IndexedLens' i w u      -> m a -> m (a, (i, u))
ilistening :: (MonadWriter w m, Monoid u) => IndexedFold i w u       -> m a -> m (a, (i, u))
ilistening :: (MonadWriter w m, Monoid u) => IndexedTraversal' i w u -> m a -> m (a, (i, u))

ilistenings :: MonadWriter w m => IndexedGetting i v w u -> (i -> u -> v) -> m a -> m (a, v) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

ilistenings :: MonadWriter w m             => IndexedGetter w u     -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: MonadWriter w m             => IndexedLens' w u      -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: (MonadWriter w m, Monoid v) => IndexedFold w u       -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: (MonadWriter w m, Monoid v) => IndexedTraversal' w u -> (i -> u -> v) -> m a -> m (a, v)

iloci :: (Indexable i p, Applicative f) => p a (f b) -> Bazaar (Indexed i) a c s -> f (Bazaar (Indexed i) b c s) #

This IndexedTraversal allows you to traverse the individual stores in a Bazaar with access to their indices.

imagma :: Over * * (Indexed i) (Molten i a b) s t a b -> Iso s t' (Magma i t b a) (Magma j t' c c) #

This isomorphism can be used to inspect an IndexedTraversal to see how it associates the structure and it can also be used to bake the IndexedTraversal into a Magma so that you can traverse over it multiple times with access to the original indices.

imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

Generalizes mapAccumL to add access to the index.

imapAccumLOf accumulates state from left to right.

mapAccumLOfimapAccumL . const

imapAccumLOf :: Over * * (Indexed i) (State acc) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

Generalizes mapAccumL to an arbitrary IndexedTraversal with access to the index.

imapAccumLOf accumulates state from left to right.

mapAccumLOf l ≡ imapAccumLOf l . const
imapAccumLOf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
imapAccumLOf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

imapAccumR :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

Generalizes mapAccumR to add access to the index.

imapAccumROf accumulates state from right to left.

mapAccumRimapAccumR . const

imapAccumROf :: Over * * (Indexed i) (Backwards * (State acc)) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

Generalizes mapAccumR to an arbitrary IndexedTraversal with access to the index.

imapAccumROf accumulates state from right to left.

mapAccumROf l ≡ imapAccumROf l . const
imapAccumROf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
imapAccumROf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

imapM :: (TraversableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results, with access the index.

When you don't need access to the index mapM is more liberal in what it can accept.

mapMimapM . const

imapMOf :: Over * * (Indexed i) (WrappedMonad m) s t a b -> (i -> a -> m b) -> s -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results, with access its position.

When you don't need access to the index mapMOf is more liberal in what it can accept.

mapMOf l ≡ imapMOf l . const
imapMOf :: Monad m => IndexedLens       i s t a b -> (i -> a -> m b) -> s -> m t
imapMOf :: Monad m => IndexedTraversal  i s t a b -> (i -> a -> m b) -> s -> m t
imapMOf :: Bind  m => IndexedTraversal1 i s t a b -> (i -> a -> m b) -> s -> m t

imapMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> (i -> a -> m r) -> s -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results.

When you don't need access to the index then mapMOf_ is more flexible in what it accepts.

mapMOf_ l ≡ imapMOf l . const
imapMOf_ :: Monad m => IndexedGetter i s a     -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedFold i s a       -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedLens' i s a      -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedTraversal' i s a -> (i -> a -> m r) -> s -> m ()

imapM_ :: (FoldableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results.

When you don't need access to the index then mapMOf_ is more flexible in what it accepts.

mapM_imapM . const

imapOf :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t #

Map with index. (Deprecated alias for iover).

When you do not need access to the index, then mapOf is more liberal in what it can accept.

mapOf l ≡ imapOf l . const
imapOf :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
imapOf :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
imapOf :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

imodifying :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () #

This is an alias for (%@=).

index :: (Indexable i p, Eq i, Applicative f) => i -> Optical' * * p (Indexed i) f a a #

This allows you to filter an IndexedFold, IndexedGetter, IndexedTraversal or IndexedLens based on an index.

>>> ["hello","the","world","!!!"]^?traversed.index 2
Just "world"

indexing :: Indexable Int p => ((a -> Indexing f b) -> s -> Indexing f t) -> p a (f b) -> s -> f t #

Transform a Traversal into an IndexedTraversal or a Fold into an IndexedFold, etc.

indexing :: Traversal s t a b -> IndexedTraversal Int s t a b
indexing :: Prism s t a b     -> IndexedTraversal Int s t a b
indexing :: Lens s t a b      -> IndexedLens Int  s t a b
indexing :: Iso s t a b       -> IndexedLens Int s t a b
indexing :: Fold s a          -> IndexedFold Int s a
indexing :: Getter s a        -> IndexedGetter Int s a
indexing :: Indexable Int p => LensLike (Indexing f) s t a b -> Over p f s t a b

indexing64 :: Indexable Int64 p => ((a -> Indexing64 f b) -> s -> Indexing64 f t) -> p a (f b) -> s -> f t #

Transform a Traversal into an IndexedTraversal or a Fold into an IndexedFold, etc.

This combinator is like indexing except that it handles large traversals and folds gracefully.

indexing64 :: Traversal s t a b -> IndexedTraversal Int64 s t a b
indexing64 :: Prism s t a b     -> IndexedTraversal Int64 s t a b
indexing64 :: Lens s t a b      -> IndexedLens Int64 s t a b
indexing64 :: Iso s t a b       -> IndexedLens Int64 s t a b
indexing64 :: Fold s a          -> IndexedFold Int64 s a
indexing64 :: Getter s a        -> IndexedGetter Int64 s a
indexing64 :: Indexable Int64 p => LensLike (Indexing64 f) s t a b -> Over p f s t a b

indices :: (Indexable i p, Applicative f) => (i -> Bool) -> Optical' * * p (Indexed i) f a a #

This allows you to filter an IndexedFold, IndexedGetter, IndexedTraversal or IndexedLens based on a predicate on the indices.

>>> ["hello","the","world","!!!"]^..traversed.indices even
["hello","world"]
>>> over (traversed.indices (>0)) Prelude.reverse $ ["He","was","stressed","o_O"]
["He","saw","desserts","O_o"]

inone :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not none of the elements in a container satisfy a predicate, with access to the index i.

When you don't need access to the index then none is more flexible in what it accepts.

noneinone . const
inone f ≡ not . iany f

inoneOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not none of the elements viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then noneOf is more flexible in what it accepts.

noneOf l ≡ inoneOf l . const
inoneOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

inside :: Corepresentable p => ALens s t a b -> Lens (p e s) (p e t) (p e a) (p e b) #

Lift a Lens so it can run under a function (or other corepresentable profunctor).

inside :: Lens s t a b -> Lens (e -> s) (e -> t) (e -> a) (e -> b)
>>> (\x -> (x-1,x+1)) ^. inside _1 $ 5
4
>>> runState (modify (1:) >> modify (2:)) ^. (inside _2) $ []
[2,1]

involuted :: (a -> a) -> Iso' a a #

Given a function that is its own inverse, this gives you an Iso using it in both directions.

involutedjoin iso
>>> "live" ^. involuted reverse
"evil"
>>> "live" & involuted reverse %~ ('d':)
"lived"

iover :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t #

Map with index. This is an alias for imapOf.

When you do not need access to the index, then over is more liberal in what it can accept.

over l ≡ iover l . const
iover l ≡ over l . Indexed
iover :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
iover :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
iover :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

ipartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a a -> Over * * p f s t [a] [a] #

An indexed version of partsOf that receives the entire list of indices as its index.

ipartsOf' :: (Indexable [i] p, Functor f) => Over * * (Indexed i) (Bazaar' (Indexed i) a) s t a a -> Over * * p f s t [a] [a] #

A type-restricted version of ipartsOf that can only be used with an IndexedTraversal.

ipassing :: MonadWriter w m => IndexedSetter i w w u v -> m (a, i -> u -> v) -> m a #

This is a generalization of pass that alows you to modify just a portion of the resulting MonadWriter with access to the index of an IndexedSetter.

iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b #

Build an index-preserving Lens from a Getter and a Setter.

ipre :: IndexedGetting i (First (i, a)) s a -> IndexPreservingGetter s (Maybe (i, a)) #

This converts an IndexedFold to an IndexPreservingGetter that returns the first index and element, if they exist, as a Maybe.

ipre :: IndexedGetter i s a     -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedFold i s a       -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedTraversal' i s a -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedLens' i s a      -> IndexPreservingGetter s (Maybe (i, a))

ipreuse :: MonadState s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) #

Retrieve the first index and value targeted by an IndexedFold or IndexedTraversal (or Just the index and result from an IndexedGetter or IndexedLens) into the current state.

ipreuse = use . ipre
ipreuse :: MonadState s m => IndexedGetter i s a     -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedFold i s a       -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedLens' i s a      -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedTraversal' i s a -> m (Maybe (i, a))

ipreuses :: MonadState s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) #

Retrieve a function of the first index and value targeted by an IndexedFold or IndexedTraversal (or a function of Just the index and result from an IndexedGetter or IndexedLens) into the current state.

ipreuses = uses . ipre
ipreuses :: MonadState s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

ipreview :: MonadReader s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) #

Retrieve the first index and value targeted by a Fold or Traversal (or Just the result from a Getter or Lens). See also (^@?).

ipreview = view . ipre

This is usually applied in the Reader Monad (->) s.

ipreview :: IndexedGetter i s a     -> s -> Maybe (i, a)
ipreview :: IndexedFold i s a       -> s -> Maybe (i, a)
ipreview :: IndexedLens' i s a      -> s -> Maybe (i, a)
ipreview :: IndexedTraversal' i s a -> s -> Maybe (i, a)

However, it may be useful to think of its full generality when working with a Monad transformer stack:

ipreview :: MonadReader s m => IndexedGetter s a     -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedFold s a       -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedLens' s a      -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedTraversal' s a -> m (Maybe (i, a))

ipreviews :: MonadReader s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) #

Retrieve a function of the first index and value targeted by an IndexedFold or IndexedTraversal (or Just the result from an IndexedGetter or IndexedLens). See also (^@?).

ipreviews = views . ipre

This is usually applied in the Reader Monad (->) s.

ipreviews :: IndexedGetter i s a     -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedFold i s a       -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedLens' i s a      -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedTraversal' i s a -> (i -> a -> r) -> s -> Maybe r

However, it may be useful to think of its full generality when working with a Monad transformer stack:

ipreviews :: MonadReader s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t #

Set with index. Equivalent to iover with the current value ignored.

When you do not need access to the index, then set is more liberal in what it can accept.

set l ≡ iset l . const
iset :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
iset :: IndexedLens i s t a b      -> (i -> b) -> s -> t
iset :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

isets :: ((i -> a -> b) -> s -> t) -> IndexedSetter i s t a b #

Build an IndexedSetter from an imap-like function.

Your supplied function f is required to satisfy:

f idid
f g . f h ≡ f (g . h)

Equational reasoning:

isets . ioverid
iover . isetsid

Another way to view isets is that it takes a "semantic editor combinator" which has been modified to carry an index and transforms it into a IndexedSetter.

isn't :: APrism s t a b -> s -> Bool #

Check to see if this Prism doesn't match.

>>> isn't _Left (Right 12)
True
>>> isn't _Left (Left 12)
False
>>> isn't _Empty []
False

iso :: (s -> a) -> (b -> t) -> Iso s t a b #

Build a simple isomorphism from a pair of inverse functions.

view (iso f g) ≡ f
view (from (iso f g)) ≡ g
over (iso f g) h ≡ g . h . f
over (from (iso f g)) h ≡ f . h . g

itakingWhile :: (Indexable i p, Profunctor q, Contravariant f, Applicative f) => (i -> a -> Bool) -> Optical' * * (Indexed i) q (Const * (Endo (f s))) s a -> Optical' * * p q f s a #

Obtain an IndexedFold by taking elements from another IndexedFold, IndexedLens, IndexedGetter or IndexedTraversal while a predicate holds.

itakingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

iterated :: Apply f => (a -> a) -> LensLike' f a a #

x ^. iterated f returns an infinite Fold1 of repeated applications of f to x.

toListOf (iterated f) a ≡ iterate f a
iterated :: (a -> a) -> Fold1 a a

ito :: (Indexable i p, Contravariant f) => (s -> (i, a)) -> Over' p f s a #

ito :: (s -> (i, a)) -> IndexedGetter i s a

itoList :: FoldableWithIndex i f => f a -> [(i, a)] #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then toList is more flexible in what it accepts.

toListmap snd . itoList

itoListOf :: IndexedGetting i (Endo [(i, a)]) s a -> s -> [(i, a)] #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then toListOf is more flexible in what it accepts.

toListOf l ≡ map snd . itoListOf l
itoListOf :: IndexedGetter i s a     -> s -> [(i,a)]
itoListOf :: IndexedFold i s a       -> s -> [(i,a)]
itoListOf :: IndexedLens' i s a      -> s -> [(i,a)]
itoListOf :: IndexedTraversal' i s a -> s -> [(i,a)]

itraverseBy :: TraversableWithIndex i t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> t a -> f (t b) #

itraverseByOf :: IndexedTraversal i s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> s -> f t #

itraverseOf :: (Indexed i a (f b) -> s -> f t) -> (i -> a -> f b) -> s -> f t #

Traversal with an index.

NB: When you don't need access to the index then you can just apply your IndexedTraversal directly as a function!

itraverseOfwithIndex
traverseOf l = itraverseOf l . const = id
itraverseOf :: Functor f     => IndexedLens i s t a b       -> (i -> a -> f b) -> s -> f t
itraverseOf :: Applicative f => IndexedTraversal i s t a b  -> (i -> a -> f b) -> s -> f t
itraverseOf :: Apply f       => IndexedTraversal1 i s t a b -> (i -> a -> f b) -> s -> f t

itraverseOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> (i -> a -> f r) -> s -> f () #

Traverse the targets of an IndexedFold or IndexedTraversal with access to the i, discarding the results.

When you don't need access to the index then traverseOf_ is more flexible in what it accepts.

traverseOf_ l ≡ itraverseOf l . const
itraverseOf_ :: Functor f     => IndexedGetter i s a     -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Applicative f => IndexedFold i s a       -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Functor f     => IndexedLens' i s a      -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Applicative f => IndexedTraversal' i s a -> (i -> a -> f r) -> s -> f ()

itraverse_ :: (FoldableWithIndex i t, Applicative f) => (i -> a -> f b) -> t a -> f () #

Traverse elements with access to the index i, discarding the results.

When you don't need access to the index then traverse_ is more flexible in what it accepts.

traverse_ l = itraverse . const

iunsafePartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a b -> Over * * p f s t [a] [b] #

An indexed version of unsafePartsOf that receives the entire list of indices as its index.

iunsafePartsOf' :: Over * * (Indexed i) (Bazaar (Indexed i) a b) s t a b -> IndexedLens [i] s t [a] [b] #

iuse :: MonadState s m => IndexedGetting i (i, a) s a -> m (i, a) #

Use the index and value of an IndexedGetter into the current state as a pair.

When applied to an IndexedFold the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iuses :: MonadState s m => IndexedGetting i r s a -> (i -> a -> r) -> m r #

Use a function of the index and value of an IndexedGetter into the current state.

When applied to an IndexedFold the result will be a monoidal summary instead of a single answer.

iview :: MonadReader s m => IndexedGetting i (i, a) s a -> m (i, a) #

View the index and value of an IndexedGetter into the current environment as a pair.

When applied to an IndexedFold the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iviews :: MonadReader s m => IndexedGetting i r s a -> (i -> a -> r) -> m r #

View a function of the index and value of an IndexedGetter into the current environment.

When applied to an IndexedFold the result will be a monoidal summary instead of a single answer.

iviewsifoldMapOf

ixAt :: At m => Index m -> Traversal' m (IxValue m) #

A definition of ix for types with an At instance. This is the default if you don't specify a definition for ix.

lastOf :: Getting (Rightmost a) s a -> s -> Maybe a #

Retrieve the Last entry of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

The answer is computed in a manner that leaks space less than ala Last . foldMapOf and gives you back access to the outermost Just constructor more quickly, but may have worse constant factors.

>>> lastOf traverse [1..10]
Just 10
>>> lastOf both (1,2)
Just 2
>>> lastOf ignored ()
Nothing
lastOf :: Getter s a     -> s -> Maybe a
lastOf :: Fold s a       -> s -> Maybe a
lastOf :: Lens' s a      -> s -> Maybe a
lastOf :: Iso' s a       -> s -> Maybe a
lastOf :: Traversal' s a -> s -> Maybe a

lazy :: Strict lazy strict => Iso' strict lazy #

An Iso between the strict variant of a structure and its lazy counterpart.

lazy = from strict

See http://hackage.haskell.org/package/strict-base-types for an example use.

lengthOf :: Getting (Endo (Endo Int)) s a -> s -> Int #

Calculate the number of targets there are for a Fold in a given container.

Note: This can be rather inefficient for large containers and just like length, this will not terminate for infinite folds.

lengthlengthOf folded
>>> lengthOf _1 ("hello",())
1
>>> lengthOf traverse [1..10]
10
>>> lengthOf (traverse.traverse) [[1,2],[3,4],[5,6]]
6
lengthOf (folded . folded) :: (Foldable f, Foldable g) => f (g a) -> Int
lengthOf :: Getter s a     -> s -> Int
lengthOf :: Fold s a       -> s -> Int
lengthOf :: Lens' s a      -> s -> Int
lengthOf :: Iso' s a       -> s -> Int
lengthOf :: Traversal' s a -> s -> Int

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b #

Build a Lens from a getter and a setter.

lens :: Functor f => (s -> a) -> (s -> b -> t) -> (a -> f b) -> s -> f t
>>> s ^. lens getter setter
getter s
>>> s & lens getter setter .~ b
setter s b
>>> s & lens getter setter %~ f
setter s (f (getter s))
lens :: (s -> a) -> (s -> a -> s) -> Lens' s a

lensClass :: Lens' LensRules ClassyNamer #

Lens' to access the option for naming "classy" lenses.

lensField :: Lens' LensRules FieldNamer #

Lens' to access the convention for naming fields in our LensRules.

lensRules :: LensRules #

Rules for making fairly simple partial lenses, ignoring the special cases for isomorphisms and traversals, and not making any classes. It uses underscoreNoPrefixNamer.

lensRulesFor #

Arguments

:: [(String, String)]
(Field Name, Definition Name)
-> LensRules 

Construct a LensRules value for generating top-level definitions using the given map from field names to definition names.

levels :: ATraversal s t a b -> IndexedTraversal Int s t (Level () a) (Level () b) #

This provides a breadth-first Traversal of the individual levels of any other Traversal via iterative deepening depth-first search. The levels are returned to you in a compressed format.

This can permit us to extract the levels directly:

>>> ["hello","world"]^..levels (traverse.traverse)
[Zero,Zero,One () 'h',Two 0 (One () 'e') (One () 'w'),Two 0 (One () 'l') (One () 'o'),Two 0 (One () 'l') (One () 'r'),Two 0 (One () 'o') (One () 'l'),One () 'd']

But we can also traverse them in turn:

>>> ["hello","world"]^..levels (traverse.traverse).traverse
"hewlolrold"

We can use this to traverse to a fixed depth in the tree of (<*>) used in the Traversal:

>>> ["hello","world"] & taking 4 (levels (traverse.traverse)).traverse %~ toUpper
["HEllo","World"]

Or we can use it to traverse the first n elements in found in that Traversal regardless of the depth at which they were found.

>>> ["hello","world"] & taking 4 (levels (traverse.traverse).traverse) %~ toUpper
["HELlo","World"]

The resulting Traversal of the levels which is indexed by the depth of each Level.

>>> ["dog","cat"]^@..levels (traverse.traverse) <. traverse
[(2,'d'),(3,'o'),(3,'c'),(4,'g'),(4,'a'),(5,'t')]

Note: Internally this is implemented by using an illegal Applicative, as it extracts information in an order that violates the Applicative laws.

lifted :: Monad m => Setter (m a) (m b) a b #

This setter can be used to modify all of the values in a Monad.

You sometimes have to use this rather than mapped -- due to temporary insanity Functor is not a superclass of Monad.

liftMover lifted
>>> over lifted f [a,b,c]
[f a,f b,f c]
>>> set lifted b (Just a)
Just b

If you want an IndexPreservingSetter use setting liftM.

like :: (Profunctor p, Contravariant f) => a -> Optic' * * p f s a #

Build an constant-valued (index-preserving) Getter from an arbitrary Haskell value.

like a . like b ≡ like b
a ^. like b ≡ b
a ^. like b ≡ a ^. to (const b)

This can be useful as a second case failing a Fold e.g. foo failing like 0

like :: a -> IndexPreservingGetter s a

lined :: Applicative f => IndexedLensLike' Int f String String #

A Fold over the individual lines of a String.

lined :: Fold String String
lined :: Traversal' String String
lined :: IndexedFold Int String String
lined :: IndexedTraversal' Int String String

Note: This function type-checks as a Traversal but it doesn't satisfy the laws. It's only valid to use it when you don't insert any newline characters while traversing, and if your original String contains only isolated newline characters.

listening :: MonadWriter w m => Getting u w u -> m a -> m (a, u) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

listening :: MonadWriter w m             => Getter w u     -> m a -> m (a, u)
listening :: MonadWriter w m             => Lens' w u      -> m a -> m (a, u)
listening :: MonadWriter w m             => Iso' w u       -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Fold w u       -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Traversal' w u -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Prism' w u     -> m a -> m (a, u)

listenings :: MonadWriter w m => Getting v w u -> (u -> v) -> m a -> m (a, v) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

listenings :: MonadWriter w m             => Getter w u     -> (u -> v) -> m a -> m (a, v)
listenings :: MonadWriter w m             => Lens' w u      -> (u -> v) -> m a -> m (a, v)
listenings :: MonadWriter w m             => Iso' w u       -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Fold w u       -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Traversal' w u -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Prism' w u     -> (u -> v) -> m a -> m (a, v)

lmapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p a x) (q b y) (p s x) (q t y) #

Lift an Iso contravariantly into the left argument of a Profunctor.

lmapping :: Profunctor p => Iso s t a b -> Iso (p a x) (p b y) (p s x) (p t y)
lmapping :: Profunctor p => Iso' s a -> Iso' (p a x) (p s x)

loci :: Applicative f => (a -> f b) -> Bazaar (->) a c s -> f (Bazaar (->) b c s) #

This Traversal allows you to traverse the individual stores in a Bazaar.

locus :: IndexedComonadStore p => Lens (p a c s) (p b c s) a b #

This Lens lets you view the current pos of any indexed store comonad and seek to a new position. This reduces the API for working these instances to a single Lens.

ipos w ≡ w ^. locus
iseek s w ≡ w & locus .~ s
iseeks f w ≡ w & locus %~ f
locus :: Lens' (Context' a s) a
locus :: Conjoined p => Lens' (Pretext' p a s) a
locus :: Conjoined p => Lens' (PretextT' p g a s) a

lookingupNamer :: [(String, String)] -> FieldNamer #

Create a FieldNamer from explicit pairings of (fieldName, lensName).

lookupOf :: Eq k => Getting (Endo (Maybe v)) s (k, v) -> k -> s -> Maybe v #

The lookupOf function takes a Fold (or Getter, Traversal, Lens, Iso, etc.), a key, and a structure containing key/value pairs. It returns the first value corresponding to the given key. This function generalizes lookup to work on an arbitrary Fold instead of lists.

>>> lookupOf folded 4 [(2, 'a'), (4, 'b'), (4, 'c')]
Just 'b'
>>> lookupOf each 2 [(2, 'a'), (4, 'b'), (4, 'c')]
Just 'a'
lookupOf :: Eq k => Fold s (k,v) -> k -> s -> Maybe v

magma :: LensLike * (Mafic a b) s t a b -> Iso s u (Magma Int t b a) (Magma j u c c) #

This isomorphism can be used to inspect a Traversal to see how it associates the structure and it can also be used to bake the Traversal into a Magma so that you can traverse over it multiple times.

makeClassy :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments.

e.g.

data Foo = Foo { _fooX, _fooY :: Int }
makeClassy ''Foo

will create

class HasFoo t where
  foo :: Lens' t Foo
  fooX :: Lens' t Int
  fooX = foo . go where go f (Foo x y) = (\x' -> Foo x' y) <$> f x
  fooY :: Lens' t Int
  fooY = foo . go where go f (Foo x y) = (\y' -> Foo x y') <$> f y
instance HasFoo Foo where
  foo = id
makeClassy = makeLensesWith classyRules

makeClassyFor :: String -> String -> [(String, String)] -> Name -> DecsQ #

Derive lenses and traversals, using a named wrapper class, and specifying explicit pairings of (fieldName, traversalName).

Example usage:

makeClassyFor "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo

makeClassyPrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type and combine them into a single class. No Isos are created. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makeClassyPrisms ''FooBarBaz

will create

class AsFooBarBaz s a | s -> a where
  _FooBarBaz :: Prism' s (FooBarBaz a)
  _Foo :: Prism' s Int
  _Bar :: Prism' s a
  _Baz :: Prism' s (Int,Char)

  _Foo = _FooBarBaz . _Foo
  _Bar = _FooBarBaz . _Bar
  _Baz = _FooBarBaz . _Baz

instance AsFooBarBaz (FooBarBaz a) a

Generate an As class of prisms. Names are selected by prefixing the constructor name with an underscore. Constructors with multiple fields will construct Prisms to tuples of those fields.

makeClassy_ :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments. Works the same as makeClassy except that (a) it expects that record field names do not begin with an underscore, (b) all record fields are made into lenses, and (c) the resulting lens is prefixed with an underscore.

makeFields :: Name -> DecsQ #

Generate overloaded field accessors.

e.g

data Foo a = Foo { _fooX :: Int, _fooY : a }
newtype Bar = Bar { _barX :: Char }
makeFields ''Foo
makeFields ''Bar

will create

_fooXLens :: Lens' (Foo a) Int
_fooYLens :: Lens (Foo a) (Foo b) a b
class HasX s a | s -> a where
  x :: Lens' s a
instance HasX (Foo a) Int where
  x = _fooXLens
class HasY s a | s -> a where
  y :: Lens' s a
instance HasY (Foo a) a where
  y = _fooYLens
_barXLens :: Iso' Bar Char
instance HasX Bar Char where
  x = _barXLens

For details, see camelCaseFields.

makeFields = makeLensesWith defaultFieldRules

makeLenses :: Name -> DecsQ #

Build lenses (and traversals) with a sensible default configuration.

e.g.

data FooBar
  = Foo { _x, _y :: Int }
  | Bar { _x :: Int }
makeLenses ''FooBar

will create

x :: Lens' FooBar Int
x f (Foo a b) = (\a' -> Foo a' b) <$> f a
x f (Bar a)   = Bar <$> f a
y :: Traversal' FooBar Int
y f (Foo a b) = (\b' -> Foo a  b') <$> f b
y _ c@(Bar _) = pure c
makeLenses = makeLensesWith lensRules

makeLensesFor :: [(String, String)] -> Name -> DecsQ #

Derive lenses and traversals, specifying explicit pairings of (fieldName, lensName).

If you map multiple names to the same label, and it is present in the same constructor then this will generate a Traversal.

e.g.

makeLensesFor [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo
makeLensesFor [("_barX", "bar"), ("_barY", "bar")] ''Bar

makeLensesWith :: LensRules -> Name -> DecsQ #

Build lenses with a custom configuration.

makePrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type. Isos generated when possible. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makePrisms ''FooBarBaz

will create

_Foo :: Prism' (FooBarBaz a) Int
_Bar :: Prism (FooBarBaz a) (FooBarBaz b) a b
_Baz :: Prism' (FooBarBaz a) (Int, Char)

makeWrapped :: Name -> DecsQ #

Build Wrapped instance for a given newtype

mapAccumLOf :: LensLike * (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

This generalizes mapAccumL to an arbitrary Traversal.

mapAccumLmapAccumLOf traverse

mapAccumLOf accumulates State from left to right.

mapAccumLOf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf l f acc0 s = swap (runState (l (a -> state (acc -> swap (f acc a))) s) acc0)

mapAccumROf :: LensLike * (Backwards * (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

This generalizes mapAccumR to an arbitrary Traversal.

mapAccumRmapAccumROf traverse

mapAccumROf accumulates State from right to left.

mapAccumROf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

mapEq :: AnEquality k2 k1 s t a b -> f s -> f a #

We can use Equality to do substitution into anything.

mapMOf :: LensLike * (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results.

>>> mapMOf both (\x -> [x, x + 1]) (1,3)
[(1,3),(1,4),(2,3),(2,4)]
mapMmapMOf traverse
imapMOf l ≡ forM l . Indexed
mapMOf :: Monad m => Iso s t a b       -> (a -> m b) -> s -> m t
mapMOf :: Monad m => Lens s t a b      -> (a -> m b) -> s -> m t
mapMOf :: Monad m => Traversal s t a b -> (a -> m b) -> s -> m t

mapMOf_ :: Monad m => Getting (Sequenced r m) s a -> (a -> m r) -> s -> m () #

Map each target of a Fold on a structure to a monadic action, evaluate these actions from left to right, and ignore the results.

>>> mapMOf_ both putStrLn ("hello","world")
hello
world
mapM_mapMOf_ folded
mapMOf_ :: Monad m => Getter s a     -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Fold s a       -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Lens' s a      -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Iso' s a       -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Traversal' s a -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Prism' s a     -> (a -> m r) -> s -> m ()

mapOf :: ASetter s t a b -> (a -> b) -> s -> t #

mapOf is a deprecated alias for over.

mapped :: Functor f => Setter (f a) (f b) a b #

This Setter can be used to map over all of the values in a Functor.

fmapover mapped
fmapDefaultover traverse
(<$) ≡ set mapped
>>> over mapped f [a,b,c]
[f a,f b,f c]
>>> over mapped (+1) [1,2,3]
[2,3,4]
>>> set mapped x [a,b,c]
[x,x,x]
>>> [[a,b],[c]] & mapped.mapped +~ x
[[a + x,b + x],[c + x]]
>>> over (mapped._2) length [("hello","world"),("leaders","!!!")]
[("hello",5),("leaders",3)]
mapped :: Functor f => Setter (f a) (f b) a b

If you want an IndexPreservingSetter use setting fmap.

mapping :: (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) #

This can be used to lift any Iso into an arbitrary Functor.

mappingNamer #

Arguments

:: (String -> [String])

A function that maps a fieldName to lensNames.

-> FieldNamer 

Create a FieldNamer from a mapping function. If the function returns [], it creates no lens for the field.

matching :: APrism s t a b -> s -> Either t a #

Retrieve the value targeted by a Prism or return the original value while allowing the type to change if it does not match.

>>> matching _Just (Just 12)
Right 12
>>> matching _Just (Nothing :: Maybe Int) :: Either (Maybe Bool) Int
Left Nothing

maximumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a #

Obtain the maximum element (if any) targeted by a Fold, Traversal, Lens, Iso, or Getter according to a user supplied Ordering.

>>> maximumByOf traverse (compare `on` length) ["mustard","relish","ham"]
Just "mustard"

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

maximumBy cmp ≡ fromMaybe (error "empty") . maximumByOf folded cmp
maximumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

maximumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a #

Obtain the maximum element (if any) targeted by a Fold or Traversal safely.

Note: maximumOf on a valid Iso, Lens or Getter will always return Just a value.

>>> maximumOf traverse [1..10]
Just 10
>>> maximumOf traverse []
Nothing
>>> maximumOf (folded.filtered even) [1,4,3,6,7,9,2]
Just 6
maximumfromMaybe (error "empty") . maximumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. rmap getMax (foldMapOf l Max) has lazier semantics but could leak memory.

maximumOf :: Ord a => Getter s a     -> s -> Maybe a
maximumOf :: Ord a => Fold s a       -> s -> Maybe a
maximumOf :: Ord a => Iso' s a       -> s -> Maybe a
maximumOf :: Ord a => Lens' s a      -> s -> Maybe a
maximumOf :: Ord a => Traversal' s a -> s -> Maybe a

minimumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a #

Obtain the minimum element (if any) targeted by a Fold, Traversal, Lens, Iso or Getter according to a user supplied Ordering.

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

>>> minimumByOf traverse (compare `on` length) ["mustard","relish","ham"]
Just "ham"
minimumBy cmp ≡ fromMaybe (error "empty") . minimumByOf folded cmp
minimumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

minimumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a #

Obtain the minimum element (if any) targeted by a Fold or Traversal safely.

Note: minimumOf on a valid Iso, Lens or Getter will always return Just a value.

>>> minimumOf traverse [1..10]
Just 1
>>> minimumOf traverse []
Nothing
>>> minimumOf (folded.filtered even) [1,4,3,6,7,9,2]
Just 2
minimumfromMaybe (error "empty") . minimumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. rmap getMin (foldMapOf l Min) has lazier semantics but could leak memory.

minimumOf :: Ord a => Getter s a     -> s -> Maybe a
minimumOf :: Ord a => Fold s a       -> s -> Maybe a
minimumOf :: Ord a => Iso' s a       -> s -> Maybe a
minimumOf :: Ord a => Lens' s a      -> s -> Maybe a
minimumOf :: Ord a => Traversal' s a -> s -> Maybe a

modifying :: MonadState s m => ASetter s s a b -> (a -> b) -> m () #

This is an alias for (%=).

msumOf :: MonadPlus m => Getting (Endo (m a)) s (m a) -> s -> m a #

The sum of a collection of actions, generalizing concatOf.

>>> msumOf both ("hello","world")
"helloworld"
>>> msumOf each (Nothing, Just "hello", Nothing)
Just "hello"
msummsumOf folded
msumOf :: MonadPlus m => Getter s (m a)     -> s -> m a
msumOf :: MonadPlus m => Fold s (m a)       -> s -> m a
msumOf :: MonadPlus m => Lens' s (m a)      -> s -> m a
msumOf :: MonadPlus m => Iso' s (m a)       -> s -> m a
msumOf :: MonadPlus m => Traversal' s (m a) -> s -> m a
msumOf :: MonadPlus m => Prism' s (m a)     -> s -> m a

nearly :: a -> (a -> Bool) -> Prism' a () #

This Prism compares for approximate equality with a given value and a predicate for testing, an example where the value is the empty list and the predicate checks that a list is empty (same as _Empty with the AsEmpty list instance):

>>> nearly [] null # ()
[]
>>> [1,2,3,4] ^? nearly [] null
Nothing
nearly [] null :: Prism' [a] ()

To comply with the Prism laws the arguments you supply to nearly a p are somewhat constrained.

We assume p x holds iff x ≡ a. Under that assumption then this is a valid Prism.

This is useful when working with a type where you can test equality for only a subset of its values, and the prism selects such a value.

non :: Eq a => a -> Iso' (Maybe a) a #

If v is an element of a type a, and a' is a sans the element v, then non v is an isomorphism from Maybe a' to a.

nonnon' . only

Keep in mind this is only a real isomorphism if you treat the domain as being Maybe (a sans v).

This is practically quite useful when you want to have a Map where all the entries should have non-zero values.

>>> Map.fromList [("hello",1)] & at "hello" . non 0 +~ 2
fromList [("hello",3)]
>>> Map.fromList [("hello",1)] & at "hello" . non 0 -~ 1
fromList []
>>> Map.fromList [("hello",1)] ^. at "hello" . non 0
1
>>> Map.fromList [] ^. at "hello" . non 0
0

This combinator is also particularly useful when working with nested maps.

e.g. When you want to create the nested Map when it is missing:

>>> Map.empty & at "hello" . non Map.empty . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]

and when have deleting the last entry from the nested Map mean that we should delete its entry from the surrounding one:

>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . non Map.empty . at "world" .~ Nothing
fromList []

It can also be used in reverse to exclude a given value:

>>> non 0 # rem 10 4
Just 2
>>> non 0 # rem 10 5
Nothing

non' :: APrism' a () -> Iso' (Maybe a) a #

non' p generalizes non (p # ()) to take any unit Prism

This function generates an isomorphism between Maybe (a | isn't p a) and a.

>>> Map.singleton "hello" Map.empty & at "hello" . non' _Empty . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]
>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . non' _Empty . at "world" .~ Nothing
fromList []

none :: Foldable f => (a -> Bool) -> f a -> Bool #

Determines whether no elements of the structure satisfy the predicate.

none f ≡ not . any f

noneOf :: Getting Any s a -> (a -> Bool) -> s -> Bool #

Returns True only if no targets of a Fold satisfy a predicate.

>>> noneOf each (is _Nothing) (Just 3, Just 4, Just 5)
True
>>> noneOf (folded.folded) (<10) [[13,99,20],[3,71,42]]
False
inoneOf l = noneOf l . Indexed
noneOf :: Getter s a     -> (a -> Bool) -> s -> Bool
noneOf :: Fold s a       -> (a -> Bool) -> s -> Bool
noneOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
noneOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
noneOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
noneOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

notElemOf :: Eq a => Getting All s a -> a -> s -> Bool #

Does the element not occur anywhere within a given Fold of the structure?

>>> notElemOf each 'd' ('a','b','c')
True
>>> notElemOf each 'a' ('a','b','c')
False
notElemnotElemOf folded
notElemOf :: Eq a => Getter s a     -> a -> s -> Bool
notElemOf :: Eq a => Fold s a       -> a -> s -> Bool
notElemOf :: Eq a => Iso' s a       -> a -> s -> Bool
notElemOf :: Eq a => Lens' s a      -> a -> s -> Bool
notElemOf :: Eq a => Traversal' s a -> a -> s -> Bool
notElemOf :: Eq a => Prism' s a     -> a -> s -> Bool

notNullOf :: Getting Any s a -> s -> Bool #

Returns True if this Fold or Traversal has any targets in the given container.

A more "conversational" alias for this combinator is has.

Note: notNullOf on a valid Iso, Lens or Getter should always return True.

not . nullnotNullOf folded

This may be rather inefficient compared to the not . null check of many containers.

>>> notNullOf _1 (1,2)
True
>>> notNullOf traverse [1..10]
True
>>> notNullOf folded []
False
>>> notNullOf (element 20) [1..10]
False
notNullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool
notNullOf :: Getter s a     -> s -> Bool
notNullOf :: Fold s a       -> s -> Bool
notNullOf :: Iso' s a       -> s -> Bool
notNullOf :: Lens' s a      -> s -> Bool
notNullOf :: Traversal' s a -> s -> Bool

nullOf :: Getting All s a -> s -> Bool #

Returns True if this Fold or Traversal has no targets in the given container.

Note: nullOf on a valid Iso, Lens or Getter should always return False.

nullnullOf folded

This may be rather inefficient compared to the null check of many containers.

>>> nullOf _1 (1,2)
False
>>> nullOf ignored ()
True
>>> nullOf traverse []
True
>>> nullOf (element 20) [1..10]
True
nullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool
nullOf :: Getter s a     -> s -> Bool
nullOf :: Fold s a       -> s -> Bool
nullOf :: Iso' s a       -> s -> Bool
nullOf :: Lens' s a      -> s -> Bool
nullOf :: Traversal' s a -> s -> Bool

only :: Eq a => a -> Prism' a () #

This Prism compares for exact equality with a given value.

>>> only 4 # ()
4
>>> 5 ^? only 4
Nothing

op :: Wrapped s => (Unwrapped s -> s) -> s -> Unwrapped s #

Given the constructor for a Wrapped type, return a deconstructor that is its inverse.

Assuming the Wrapped instance is legal, these laws hold:

op f . f ≡ id
f . op f ≡ id
>>> op Identity (Identity 4)
4
>>> op Const (Const "hello")
"hello"

orOf :: Getting Any s Bool -> s -> Bool #

Returns True if any target of a Fold is True.

>>> orOf both (True,False)
True
>>> orOf both (False,False)
False
ororOf folded
orOf :: Getter s Bool     -> s -> Bool
orOf :: Fold s Bool       -> s -> Bool
orOf :: Lens' s Bool      -> s -> Bool
orOf :: Iso' s Bool       -> s -> Bool
orOf :: Traversal' s Bool -> s -> Bool
orOf :: Prism' s Bool     -> s -> Bool

outside :: Representable p => APrism s t a b -> Lens (p t r) (p s r) (p b r) (p a r) #

Use a Prism as a kind of first-class pattern.

outside :: Prism s t a b -> Lens (t -> r) (s -> r) (b -> r) (a -> r)

over :: ASetter s t a b -> (a -> b) -> s -> t #

Modify the target of a Lens or all the targets of a Setter or Traversal with a function.

fmapover mapped
fmapDefaultover traverse
sets . overid
over . setsid

Given any valid Setter l, you can also rely on the law:

over l f . over l g = over l (f . g)

e.g.

>>> over mapped f (over mapped g [a,b,c]) == over mapped (f . g) [a,b,c]
True

Another way to view over is to say that it transforms a Setter into a "semantic editor combinator".

>>> over mapped f (Just a)
Just (f a)
>>> over mapped (*10) [1,2,3]
[10,20,30]
>>> over _1 f (a,b)
(f a,b)
>>> over _1 show (10,20)
("10",20)
over :: Setter s t a b -> (a -> b) -> s -> t
over :: ASetter s t a b -> (a -> b) -> s -> t

overA :: Arrow ar => LensLike * (Context a b) s t a b -> ar a b -> ar s t #

over for Arrows.

Unlike over, overA can't accept a simple Setter, but requires a full lens, or close enough.

overA :: Arrow ar => Lens s t a b -> ar a b -> ar s t

para :: Plated a => (a -> [r] -> r) -> a -> r #

Perform a fold-like computation on each value, technically a paramorphism.

paraparaOf plate

paraOf :: Getting (Endo [a]) a a -> (a -> [r] -> r) -> a -> r #

Perform a fold-like computation on each value, technically a paramorphism.

paraOf :: Fold a a -> (a -> [r] -> r) -> a -> r

parts :: Plated a => Lens' a [a] #

The original uniplate combinator, implemented in terms of Plated as a Lens.

partspartsOf plate

The resulting Lens is safer to use as it ignores 'over-application' and deals gracefully with under-application, but it is only a proper Lens if you don't change the list length!

partsOf :: Functor f => Traversing (->) f s t a a -> LensLike * f s t [a] [a] #

partsOf turns a Traversal into a Lens that resembles an early version of the uniplate (or biplate) type.

Note: You should really try to maintain the invariant of the number of children in the list.

>>> (a,b,c) & partsOf each .~ [x,y,z]
(x,y,z)

Any extras will be lost. If you do not supply enough, then the remainder will come from the original structure.

>>> (a,b,c) & partsOf each .~ [w,x,y,z]
(w,x,y)
>>> (a,b,c) & partsOf each .~ [x,y]
(x,y,c)
>>> ('b', 'a', 'd', 'c') & partsOf each %~ sort
('a','b','c','d')

So technically, this is only a Lens if you do not change the number of results it returns.

When applied to a Fold the result is merely a Getter.

partsOf :: Iso' s a       -> Lens' s [a]
partsOf :: Lens' s a      -> Lens' s [a]
partsOf :: Traversal' s a -> Lens' s [a]
partsOf :: Fold s a       -> Getter s [a]
partsOf :: Getter s a     -> Getter s [a]

partsOf' :: ATraversal s t a a -> Lens s t [a] [a] #

A type-restricted version of partsOf that can only be used with a Traversal.

passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a #

This is a generalization of pass that alows you to modify just a portion of the resulting MonadWriter.

pre :: Getting (First a) s a -> IndexPreservingGetter s (Maybe a) #

This converts a Fold to a IndexPreservingGetter that returns the first element, if it exists, as a Maybe.

pre :: Getter s a     -> IndexPreservingGetter s (Maybe a)
pre :: Fold s a       -> IndexPreservingGetter s (Maybe a)
pre :: Traversal' s a -> IndexPreservingGetter s (Maybe a)
pre :: Lens' s a      -> IndexPreservingGetter s (Maybe a)
pre :: Iso' s a       -> IndexPreservingGetter s (Maybe a)
pre :: Prism' s a     -> IndexPreservingGetter s (Maybe a)

preuse :: MonadState s m => Getting (First a) s a -> m (Maybe a) #

Retrieve the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens) into the current state.

preuse = use . pre
preuse :: MonadState s m => Getter s a     -> m (Maybe a)
preuse :: MonadState s m => Fold s a       -> m (Maybe a)
preuse :: MonadState s m => Lens' s a      -> m (Maybe a)
preuse :: MonadState s m => Iso' s a       -> m (Maybe a)
preuse :: MonadState s m => Traversal' s a -> m (Maybe a)

preuses :: MonadState s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) #

Retrieve a function of the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens) into the current state.

preuses = uses . pre
preuses :: MonadState s m => Getter s a     -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Fold s a       -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Lens' s a      -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Iso' s a       -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Traversal' s a -> (a -> r) -> m (Maybe r)

preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a) #

Retrieve the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens). See also (^?).

listToMaybe . toListpreview folded

This is usually applied in the Reader Monad (->) s.

preview = view . pre
preview :: Getter s a     -> s -> Maybe a
preview :: Fold s a       -> s -> Maybe a
preview :: Lens' s a      -> s -> Maybe a
preview :: Iso' s a       -> s -> Maybe a
preview :: Traversal' s a -> s -> Maybe a

However, it may be useful to think of its full generality when working with a Monad transformer stack:

preview :: MonadReader s m => Getter s a     -> m (Maybe a)
preview :: MonadReader s m => Fold s a       -> m (Maybe a)
preview :: MonadReader s m => Lens' s a      -> m (Maybe a)
preview :: MonadReader s m => Iso' s a       -> m (Maybe a)
preview :: MonadReader s m => Traversal' s a -> m (Maybe a)

previews :: MonadReader s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) #

Retrieve a function of the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens).

This is usually applied in the Reader Monad (->) s.

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b #

Build a Prism.

Either t a is used instead of Maybe a to permit the types of s and t to differ.

prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b #

This is usually used to build a Prism', when you have to use an operation like cast which already returns a Maybe.

productOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a #

Calculate the Product of every number targeted by a Fold.

>>> productOf both (4,5)
20
>>> productOf folded [1,2,3,4,5]
120
productproductOf folded

This operation may be more strict than you would expect. If you want a lazier version use ala Product . foldMapOf

productOf :: Num a => Getter s a     -> s -> a
productOf :: Num a => Fold s a       -> s -> a
productOf :: Num a => Lens' s a      -> s -> a
productOf :: Num a => Iso' s a       -> s -> a
productOf :: Num a => Traversal' s a -> s -> a
productOf :: Num a => Prism' s a     -> s -> a

re :: Contravariant f => AReview t b -> LensLike' f b t #

Turn a Prism or Iso around to build a Getter.

If you have an Iso, from is a more powerful version of this function that will return an Iso instead of a mere Getter.

>>> 5 ^.re _Left
Left 5
>>> 6 ^.re (_Left.unto succ)
Left 7
reviewview  . re
reviewsviews . re
reuseuse   . re
reusesuses  . re
re :: Prism s t a b -> Getter b t
re :: Iso s t a b   -> Getter b t

reindexed :: Indexable j p => (i -> j) -> (Indexed i a b -> r) -> p a b -> r #

Remap the index.

repeated :: Apply f => LensLike' f a a #

Form a Fold1 by repeating the input forever.

repeattoListOf repeated
>>> timingOut $ 5^..taking 20 repeated
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]
repeated :: Fold1 a a

replicated :: Int -> Fold a a #

A Fold that replicates its input n times.

replicate n ≡ toListOf (replicated n)
>>> 5^..replicated 20
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]

retagged :: (Profunctor p, Bifunctor p) => p a b -> p s b #

This is a profunctor used internally to implement Review

It plays a role similar to that of Accessor or Const do for Control.Lens.Getter

reuse :: MonadState b m => AReview t b -> m t #

This can be used to turn an Iso or Prism around and use a value (or the current environment) through it the other way.

reuseuse . re
reuse . untogets
>>> evalState (reuse _Left) 5
Left 5
>>> evalState (reuse (unto succ)) 5
6
reuse :: MonadState a m => Prism' s a -> m s
reuse :: MonadState a m => Iso' s a   -> m s

reuses :: MonadState b m => AReview t b -> (t -> r) -> m r #

This can be used to turn an Iso or Prism around and use the current state through it the other way, applying a function.

reusesuses . re
reuses (unto f) g ≡ gets (g . f)
>>> evalState (reuses _Left isLeft) (5 :: Int)
True
reuses :: MonadState a m => Prism' s a -> (s -> r) -> m r
reuses :: MonadState a m => Iso' s a   -> (s -> r) -> m r

reversed :: Reversing a => Iso' a a #

An Iso between a list, ByteString, Text fragment, etc. and its reversal.

>>> "live" ^. reversed
"evil"
>>> "live" & reversed %~ ('d':)
"lived"

review :: MonadReader b m => AReview t b -> m t #

This can be used to turn an Iso or Prism around and view a value (or the current environment) through it the other way.

reviewview . re
review . untoid
>>> review _Left "mustard"
Left "mustard"
>>> review (unto succ) 5
6

Usually review is used in the (->) Monad with a Prism or Iso, in which case it may be useful to think of it as having one of these more restricted type signatures:

review :: Iso' s a   -> a -> s
review :: Prism' s a -> a -> s

However, when working with a Monad transformer stack, it is sometimes useful to be able to review the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

review :: MonadReader a m => Iso' s a   -> m s
review :: MonadReader a m => Prism' s a -> m s

reviews :: MonadReader b m => AReview t b -> (t -> r) -> m r #

This can be used to turn an Iso or Prism around and view a value (or the current environment) through it the other way, applying a function.

reviewsviews . re
reviews (unto f) g ≡ g . f
>>> reviews _Left isRight "mustard"
False
>>> reviews (unto succ) (*2) 3
8

Usually this function is used in the (->) Monad with a Prism or Iso, in which case it may be useful to think of it as having one of these more restricted type signatures:

reviews :: Iso' s a   -> (s -> r) -> a -> r
reviews :: Prism' s a -> (s -> r) -> a -> r

However, when working with a Monad transformer stack, it is sometimes useful to be able to review the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

reviews :: MonadReader a m => Iso' s a   -> (s -> r) -> m r
reviews :: MonadReader a m => Prism' s a -> (s -> r) -> m r

rewrite :: Plated a => (a -> Maybe a) -> a -> a #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

propRewrite r x = all (isNothing . r) (universe (rewrite r x))

Usually transform is more appropriate, but rewrite can give better compositionality. Given two single transformations f and g, you can construct a -> f a mplus g a which performs both rewrites until a fixed point.

rewriteM :: (Monad m, Plated a) => (a -> m (Maybe a)) -> a -> m a #

Rewrite by applying a monadic rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOf :: Monad m => LensLike' (WrappedMonad m) a a -> (a -> m (Maybe a)) -> a -> m a #

Rewrite by applying a monadic rule everywhere you recursing with a user-specified Traversal. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOn :: (Monad m, Plated a) => LensLike * (WrappedMonad m) s t a a -> (a -> m (Maybe a)) -> s -> m t #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified Traversal. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOnOf :: Monad m => LensLike * (WrappedMonad m) s t a a -> LensLike' (WrappedMonad m) a a -> (a -> m (Maybe a)) -> s -> m t #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified Traversal, using a user-specified Traversal for recursion. Ensures that the rule cannot be applied anywhere in the result.

rewriteOf :: ASetter' a a -> (a -> Maybe a) -> a -> a #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

propRewriteOf l r x = all (isNothing . r) (universeOf l (rewriteOf l r x))

Usually transformOf is more appropriate, but rewriteOf can give better compositionality. Given two single transformations f and g, you can construct a -> f a mplus g a which performs both rewrites until a fixed point.

rewriteOf :: Iso' a a       -> (a -> Maybe a) -> a -> a
rewriteOf :: Lens' a a      -> (a -> Maybe a) -> a -> a
rewriteOf :: Traversal' a a -> (a -> Maybe a) -> a -> a
rewriteOf :: Setter' a a    -> (a -> Maybe a) -> a -> a

rewriteOn :: Plated a => ASetter s t a a -> (a -> Maybe a) -> s -> t #

Rewrite recursively over part of a larger structure.

rewriteOn :: Plated a => Iso' s a       -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => Lens' s a      -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => Traversal' s a -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => ASetter' s a   -> (a -> Maybe a) -> s -> s

rewriteOnOf :: ASetter s t a a -> ASetter' a a -> (a -> Maybe a) -> s -> t #

Rewrite recursively over part of a larger structure using a specified Setter.

rewriteOnOf :: Iso' s a       -> Iso' a a       -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Lens' s a      -> Lens' a a      -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Traversal' s a -> Traversal' a a -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Setter' s a    -> Setter' a a    -> (a -> Maybe a) -> s -> s

rmapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p x s) (q y t) (p x a) (q y b) #

Lift an Iso covariantly into the right argument of a Profunctor.

rmapping :: Profunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
rmapping :: Profunctor p => Iso' s a -> Iso' (p x s) (p x a)

runEq :: AnEquality k k1 s t a b -> Identical k k1 s t a b #

Extract a witness of type Equality.

sans :: At m => Index m -> m -> m #

Delete the value associated with a key in a Map-like container

sans k = at k .~ Nothing

scanl1Of :: LensLike * (State (Maybe a)) s t a a -> (a -> a -> a) -> s -> t #

This permits the use of scanl1 over an arbitrary Traversal or Lens.

scanl1scanl1Of traverse
scanl1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
scanl1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
scanl1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

scanr1Of :: LensLike * (Backwards * (State (Maybe a))) s t a a -> (a -> a -> a) -> s -> t #

This permits the use of scanr1 over an arbitrary Traversal or Lens.

scanr1scanr1Of traverse
scanr1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
scanr1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
scanr1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

scribe :: (MonadWriter t m, Monoid s) => ASetter s t a b -> b -> m () #

Write to a fragment of a larger Writer format.

seconding :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f x s) (g y t) (f x a) (g y b) #

Lift an Iso into the second argument of a Bifunctor. This is essentially the same as mapping, but it takes a 'Bifunctor p' constraint instead of a 'Functor (p a)' one.

seconding :: Bifunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
seconding :: Bifunctor p => Iso' s a -> Iso' (p x s) (p x a)

selfIndex :: Indexable a p => p a fb -> a -> fb #

Use a value itself as its own index. This is essentially an indexed version of id.

Note: When used to modify the value, this can break the index requirements assumed by indices and similar, so this is only properly an IndexedGetter, but it can be used as more.

selfIndex :: IndexedGetter a a b

sequenceAOf :: LensLike * f s t (f b) b -> s -> f t #

Evaluate each action in the structure from left to right, and collect the results.

>>> sequenceAOf both ([1,2],[3,4])
[(1,3),(1,4),(2,3),(2,4)]
sequenceAsequenceAOf traversetraverse id
sequenceAOf l ≡ traverseOf l id ≡ l id
sequenceAOf :: Functor f => Iso s t (f b) b       -> s -> f t
sequenceAOf :: Functor f => Lens s t (f b) b      -> s -> f t
sequenceAOf :: Applicative f => Traversal s t (f b) b -> s -> f t

sequenceAOf_ :: Functor f => Getting (Traversed a f) s (f a) -> s -> f () #

Evaluate each action in observed by a Fold on a structure from left to right, ignoring the results.

sequenceA_sequenceAOf_ folded
>>> sequenceAOf_ both (putStrLn "hello",putStrLn "world")
hello
world
sequenceAOf_ :: Functor f     => Getter s (f a)     -> s -> f ()
sequenceAOf_ :: Applicative f => Fold s (f a)       -> s -> f ()
sequenceAOf_ :: Functor f     => Lens' s (f a)      -> s -> f ()
sequenceAOf_ :: Functor f     => Iso' s (f a)       -> s -> f ()
sequenceAOf_ :: Applicative f => Traversal' s (f a) -> s -> f ()
sequenceAOf_ :: Applicative f => Prism' s (f a)     -> s -> f ()

sequenceBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> t (f a) -> f (t a) #

Sequence a container using its Traversable instance using explicitly provided Applicative operations. This is like sequence where the Applicative instance can be manually specified.

sequenceByOf :: Traversal s t (f b) b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> s -> f t #

Sequence a container using a specified Applicative.

This is like traverseBy where the Traversable instance can be specified by any Traversal

sequenceByOf traversesequenceBy

sequenceOf :: LensLike * (WrappedMonad m) s t (m b) b -> s -> m t #

Sequence the (monadic) effects targeted by a Lens in a container from left to right.

>>> sequenceOf each ([1,2],[3,4],[5,6])
[(1,3,5),(1,3,6),(1,4,5),(1,4,6),(2,3,5),(2,3,6),(2,4,5),(2,4,6)]
sequencesequenceOf traverse
sequenceOf l ≡ mapMOf l id
sequenceOf l ≡ unwrapMonad . l WrapMonad
sequenceOf :: Monad m => Iso s t (m b) b       -> s -> m t
sequenceOf :: Monad m => Lens s t (m b) b      -> s -> m t
sequenceOf :: Monad m => Traversal s t (m b) b -> s -> m t

sequenceOf_ :: Monad m => Getting (Sequenced a m) s (m a) -> s -> m () #

Evaluate each monadic action referenced by a Fold on the structure from left to right, and ignore the results.

>>> sequenceOf_ both (putStrLn "hello",putStrLn "world")
hello
world
sequence_sequenceOf_ folded
sequenceOf_ :: Monad m => Getter s (m a)     -> s -> m ()
sequenceOf_ :: Monad m => Fold s (m a)       -> s -> m ()
sequenceOf_ :: Monad m => Lens' s (m a)      -> s -> m ()
sequenceOf_ :: Monad m => Iso' s (m a)       -> s -> m ()
sequenceOf_ :: Monad m => Traversal' s (m a) -> s -> m ()
sequenceOf_ :: Monad m => Prism' s (m a)     -> s -> m ()

set :: ASetter s t a b -> b -> s -> t #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

(<$) ≡ set mapped
>>> set _2 "hello" (1,())
(1,"hello")
>>> set mapped () [1,2,3,4]
[(),(),(),()]

Note: Attempting to set a Fold or Getter will fail at compile time with an relatively nice error message.

set :: Setter s t a b    -> b -> s -> t
set :: Iso s t a b       -> b -> s -> t
set :: Lens s t a b      -> b -> s -> t
set :: Traversal s t a b -> b -> s -> t

set' :: ASetter' s a -> a -> s -> s #

Replace the target of a Lens or all of the targets of a Setter' or Traversal with a constant value, without changing its type.

This is a type restricted version of set, which retains the type of the original.

>>> set' mapped x [a,b,c,d]
[x,x,x,x]
>>> set' _2 "hello" (1,"world")
(1,"hello")
>>> set' mapped 0 [1,2,3,4]
[0,0,0,0]

Note: Attempting to adjust set' a Fold or Getter will fail at compile time with an relatively nice error message.

set' :: Setter' s a    -> a -> s -> s
set' :: Iso' s a       -> a -> s -> s
set' :: Lens' s a      -> a -> s -> s
set' :: Traversal' s a -> a -> s -> s

sets :: (Profunctor p, Profunctor q, Settable f) => (p a b -> q s t) -> Optical * * * * p q f s t a b #

Build a Setter, IndexedSetter or IndexPreservingSetter depending on your choice of Profunctor.

sets :: ((a -> b) -> s -> t) -> Setter s t a b

setting :: ((a -> b) -> s -> t) -> IndexPreservingSetter s t a b #

Build an index-preserving Setter from a map-like function.

Your supplied function f is required to satisfy:

f idid
f g . f h ≡ f (g . h)

Equational reasoning:

setting . overid
over . settingid

Another way to view sets is that it takes a "semantic editor combinator" and transforms it into a Setter.

setting :: ((a -> b) -> s -> t) -> Setter s t a b

simple :: p a (f a) -> p a (f a) #

Composition with this isomorphism is occasionally useful when your Lens, Traversal or Iso has a constraint on an unused argument to force that argument to agree with the type of a used argument and avoid ScopedTypeVariables or other ugliness.

simpleLenses :: Lens' LensRules Bool #

Generate "simple" optics even when type-changing optics are possible. (e.g. Lens' instead of Lens)

simply :: (Optic' k k1 p f s a -> r) -> Optic' k k1 p f s a -> r #

This is an adverb that can be used to modify many other Lens combinators to make them require simple lenses, simple traversals, simple prisms or simple isos as input.

singular :: (Conjoined p, Functor f) => Traversing p f s t a a -> Over * * p f s t a a #

This converts a Traversal that you "know" will target one or more elements to a Lens. It can also be used to transform a non-empty Fold into a Getter.

The resulting Lens or Getter will be partial if the supplied Traversal returns no results.

>>> [1,2,3] ^. singular _head
1
>>> [] ^. singular _head
*** Exception: singular: empty traversal
>>> Left 4 ^. singular _Left
4
>>> [1..10] ^. singular (ix 7)
8
>>> [] & singular traverse .~ 0
[]
singular :: Traversal s t a a          -> Lens s t a a
singular :: Fold s a                   -> Getter s a
singular :: IndexedTraversal i s t a a -> IndexedLens i s t a a
singular :: IndexedFold i s a          -> IndexedGetter i s a

snoc :: Snoc s s a a => s -> a -> s infixl 5 #

snoc an element onto the end of a container.

>>> snoc (Seq.fromList []) a
fromList [a]
>>> snoc (Seq.fromList [b, c]) a
fromList [b,c,a]
>>> snoc (LazyT.pack "hello") '!'
"hello!"

storing :: ALens s t a b -> b -> s -> t #

A version of set that works on ALens.

>>> storing _2 "world" ("hello","there")
("hello","world")

substEq :: AnEquality k k1 s t a b -> ((~) k1 s a -> (~) k t b -> r) -> r #

Substituting types with Equality.

sumOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a #

Calculate the Sum of every number targeted by a Fold.

>>> sumOf both (5,6)
11
>>> sumOf folded [1,2,3,4]
10
>>> sumOf (folded.both) [(1,2),(3,4)]
10
>>> import Data.Data.Lens
>>> sumOf biplate [(1::Int,[]),(2,[(3::Int,4::Int)])] :: Int
10
sumsumOf folded

This operation may be more strict than you would expect. If you want a lazier version use ala Sum . foldMapOf

sumOf _1 :: Num a => (a, b) -> a
sumOf (folded . _1) :: (Foldable f, Num a) => f (a, b) -> a
sumOf :: Num a => Getter s a     -> s -> a
sumOf :: Num a => Fold s a       -> s -> a
sumOf :: Num a => Lens' s a      -> s -> a
sumOf :: Num a => Iso' s a       -> s -> a
sumOf :: Num a => Traversal' s a -> s -> a
sumOf :: Num a => Prism' s a     -> s -> a

taking :: (Conjoined p, Applicative f) => Int -> Traversing p f s t a a -> Over * * p f s t a a #

Visit the first n targets of a Traversal, Fold, Getter or Lens.

>>> [("hello","world"),("!!!","!!!")]^.. taking 2 (traverse.both)
["hello","world"]
>>> timingOut $ [1..] ^.. taking 3 traverse
[1,2,3]
>>> over (taking 5 traverse) succ "hello world"
"ifmmp world"
taking :: Int -> Traversal' s a                   -> Traversal' s a
taking :: Int -> Lens' s a                        -> Traversal' s a
taking :: Int -> Iso' s a                         -> Traversal' s a
taking :: Int -> Prism' s a                       -> Traversal' s a
taking :: Int -> Getter s a                       -> Fold s a
taking :: Int -> Fold s a                         -> Fold s a
taking :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
taking :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
taking :: Int -> IndexedGetter i s a              -> IndexedFold i s a
taking :: Int -> IndexedFold i s a                -> IndexedFold i s a

takingWhile :: (Conjoined p, Applicative f) => (a -> Bool) -> Over * * p (TakingWhile p f a a) s t a a -> Over * * p f s t a a #

Obtain a Fold by taking elements from another Fold, Lens, Iso, Getter or Traversal while a predicate holds.

takeWhile p ≡ toListOf (takingWhile p folded)
>>> timingOut $ toListOf (takingWhile (<=3) folded) [1..]
[1,2,3]
takingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
takingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
takingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a
takingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a

Note: When applied to a Traversal, takingWhile yields something that can be used as if it were a Traversal, but which is not a Traversal per the laws, unless you are careful to ensure that you do not invalidate the predicate when writing back through it.

to :: (Profunctor p, Contravariant f) => (s -> a) -> Optic' * * p f s a #

Build an (index-preserving) Getter from an arbitrary Haskell function.

to f . to g ≡ to (g . f)
a ^. to f ≡ f a
>>> a ^.to f
f a
>>> ("hello","world")^.to snd
"world"
>>> 5^.to succ
6
>>> (0, -5)^._2.to abs
5
to :: (s -> a) -> IndexPreservingGetter s a

toListOf :: Getting (Endo [a]) s a -> s -> [a] #

Extract a list of the targets of a Fold. See also (^..).

toListtoListOf folded
(^..) ≡ flip toListOf

transform :: Plated a => (a -> a) -> a -> a #

Transform every element in the tree, in a bottom-up manner.

For example, replacing negative literals with literals:

negLits = transform $ \x -> case x of
  Neg (Lit i) -> Lit (negate i)
  _           -> x

transformM :: (Monad m, Plated a) => (a -> m a) -> a -> m a #

Transform every element in the tree, in a bottom-up manner, monadically.

transformMOf :: Monad m => LensLike' (WrappedMonad m) a a -> (a -> m a) -> a -> m a #

Transform every element in a tree using a user supplied Traversal in a bottom-up manner with a monadic effect.

transformMOf :: Monad m => Traversal' a a -> (a -> m a) -> a -> m a

transformMOn :: (Monad m, Plated a) => LensLike * (WrappedMonad m) s t a a -> (a -> m a) -> s -> m t #

Transform every element in the tree in a region indicated by a supplied Traversal, in a bottom-up manner, monadically.

transformMOn :: (Monad m, Plated a) => Traversal' s a -> (a -> m a) -> s -> m s

transformMOnOf :: Monad m => LensLike * (WrappedMonad m) s t a a -> LensLike' (WrappedMonad m) a a -> (a -> m a) -> s -> m t #

Transform every element in a tree that lies in a region indicated by a supplied Traversal, walking with a user supplied Traversal in a bottom-up manner with a monadic effect.

transformMOnOf :: Monad m => Traversal' s a -> Traversal' a a -> (a -> m a) -> s -> m s

transformOf :: ASetter' a a -> (a -> a) -> a -> a #

Transform every element by recursively applying a given Setter in a bottom-up manner.

transformOf :: Traversal' a a -> (a -> a) -> a -> a
transformOf :: Setter' a a    -> (a -> a) -> a -> a

transformOn :: Plated a => ASetter s t a a -> (a -> a) -> s -> t #

Transform every element in the tree in a bottom-up manner over a region indicated by a Setter.

transformOn :: Plated a => Traversal' s a -> (a -> a) -> s -> s
transformOn :: Plated a => Setter' s a    -> (a -> a) -> s -> s

transformOnOf :: ASetter s t a a -> ASetter' a a -> (a -> a) -> s -> t #

Transform every element in a region indicated by a Setter by recursively applying another Setter in a bottom-up manner.

transformOnOf :: Setter' s a -> Traversal' a a -> (a -> a) -> s -> s
transformOnOf :: Setter' s a -> Setter' a a    -> (a -> a) -> s -> s

transposeOf :: LensLike * ZipList s t [a] a -> s -> [t] #

This generalizes transpose to an arbitrary Traversal.

Note: transpose handles ragged inputs more intelligently, but for non-ragged inputs:

>>> transposeOf traverse [[1,2,3],[4,5,6]]
[[1,4],[2,5],[3,6]]
transposetransposeOf traverse

Since every Lens is a Traversal, we can use this as a form of monadic strength as well:

transposeOf _2 :: (b, [a]) -> [(b, a)]

traverseBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> t a -> f (t b) #

Traverse a container using its Traversable instance using explicitly provided Applicative operations. This is like traverse where the Applicative instance can be manually specified.

traverseByOf :: Traversal s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> s -> f t #

Traverse a container using a specified Applicative.

This is like traverseBy where the Traversable instance can be specified by any Traversal

traverseByOf traversetraverseBy

traverseOf :: LensLike * f s t a b -> (a -> f b) -> s -> f t #

Map each element of a structure targeted by a Lens or Traversal, evaluate these actions from left to right, and collect the results.

This function is only provided for consistency, id is strictly more general.

>>> traverseOf each print (1,2,3)
1
2
3
((),(),())
traverseOfid
itraverseOf l ≡ traverseOf l . Indexed
itraverseOf itraverseditraverse

This yields the obvious law:

traversetraverseOf traverse
traverseOf :: Functor f => Iso s t a b       -> (a -> f b) -> s -> f t
traverseOf :: Functor f => Lens s t a b      -> (a -> f b) -> s -> f t
traverseOf :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t

traverseOf_ :: Functor f => Getting (Traversed r f) s a -> (a -> f r) -> s -> f () #

Traverse over all of the targets of a Fold (or Getter), computing an Applicative (or Functor)-based answer, but unlike traverseOf do not construct a new structure. traverseOf_ generalizes traverse_ to work over any Fold.

When passed a Getter, traverseOf_ can work over any Functor, but when passed a Fold, traverseOf_ requires an Applicative.

>>> traverseOf_ both putStrLn ("hello","world")
hello
world
traverse_traverseOf_ folded
traverseOf_ _2 :: Functor f => (c -> f r) -> (d, c) -> f ()
traverseOf_ _Left :: Applicative f => (a -> f b) -> Either a c -> f ()
itraverseOf_ l ≡ traverseOf_ l . Indexed

The rather specific signature of traverseOf_ allows it to be used as if the signature was any of:

traverseOf_ :: Functor f     => Getter s a     -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Fold s a       -> (a -> f r) -> s -> f ()
traverseOf_ :: Functor f     => Lens' s a      -> (a -> f r) -> s -> f ()
traverseOf_ :: Functor f     => Iso' s a       -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Traversal' s a -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Prism' s a     -> (a -> f r) -> s -> f ()

traversed :: Traversable f => IndexedTraversal Int (f a) (f b) a b #

Traverse any Traversable container. This is an IndexedTraversal that is indexed by ordinal position.

traversed1 :: Traversable1 f => IndexedTraversal1 Int (f a) (f b) a b #

Traverse any Traversable1 container. This is an IndexedTraversal1 that is indexed by ordinal position.

traversed64 :: Traversable f => IndexedTraversal Int64 (f a) (f b) a b #

Traverse any Traversable container. This is an IndexedTraversal that is indexed by ordinal position.

un :: (Profunctor p, Bifunctor p, Functor f) => Getting a s a -> Optic' * * p f a s #

Turn a Getter around to get a Review

un = unto . view
unto = un . to
>>> un (to length) # [1,2,3]
3

uncons :: Cons s s a a => s -> Maybe (a, s) #

Attempt to extract the left-most element from a container, and a version of the container without that element.

>>> uncons []
Nothing
>>> uncons [a, b, c]
Just (a,[b,c])

uncurried :: (Profunctor p, Functor f) => p ((a, b) -> c) (f ((d, e) -> f)) -> p (a -> b -> c) (f (d -> e -> f)) #

The canonical isomorphism for uncurrying and currying a function.

uncurried = iso uncurry curry
uncurried = from curried
>>> ((+)^.uncurried) (1,2)
3

under :: AnIso s t a b -> (t -> s) -> b -> a #

The opposite of working over a Setter is working under an isomorphism.

underover . from
under :: Iso s t a b -> (t -> s) -> b -> a

underscoreFields :: LensRules #

Field rules for fields in the form _prefix_fieldname

underscoreNoPrefixNamer :: FieldNamer #

A FieldNamer that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.

unfolded :: (b -> Maybe (a, b)) -> Fold b a #

Build a Fold that unfolds its values from a seed.

unfoldrtoListOf . unfolded
>>> 10^..unfolded (\b -> if b == 0 then Nothing else Just (b, b-1))
[10,9,8,7,6,5,4,3,2,1]

united :: Functor f => (() -> f ()) -> a -> f a #

We can always retrieve a () from any type.

>>> "hello"^.united
()
>>> "hello" & united .~ ()
"hello"

universe :: Plated a => a -> [a] #

Retrieve all of the transitive descendants of a Plated container, including itself.

universeOf :: Getting [a] a a -> a -> [a] #

Given a Fold that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.

universeOf :: Fold a a -> a -> [a]

universeOn :: Plated a => Getting [a] s a -> s -> [a] #

Given a Fold that knows how to find Plated parts of a container retrieve them and all of their descendants, recursively.

universeOnOf :: Getting [a] s a -> Getting [a] a a -> s -> [a] #

Given a Fold that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself that lie in a region indicated by another Fold.

toListOf l ≡ universeOnOf l ignored

unsafePartsOf :: Functor f => Traversing (->) f s t a b -> LensLike * f s t [a] [b] #

unsafePartsOf turns a Traversal into a uniplate (or biplate) family.

If you do not need the types of s and t to be different, it is recommended that you use partsOf.

It is generally safer to traverse with the Bazaar rather than use this combinator. However, it is sometimes convenient.

This is unsafe because if you don't supply at least as many b's as you were given a's, then the reconstruction of t will result in an error!

When applied to a Fold the result is merely a Getter (and becomes safe).

unsafePartsOf :: Iso s t a b       -> Lens s t [a] [b]
unsafePartsOf :: Lens s t a b      -> Lens s t [a] [b]
unsafePartsOf :: Traversal s t a b -> Lens s t [a] [b]
unsafePartsOf :: Fold s a          -> Getter s [a]
unsafePartsOf :: Getter s a        -> Getter s [a]

unsafePartsOf' :: ATraversal s t a b -> Lens s t [a] [b] #

unsafeSingular :: (Conjoined p, Functor f) => Traversing p f s t a b -> Over * * p f s t a b #

This converts a Traversal that you "know" will target only one element to a Lens. It can also be used to transform a Fold into a Getter.

The resulting Lens or Getter will be partial if the Traversal targets nothing or more than one element.

>>> [] & unsafeSingular traverse .~ 0
*** Exception: unsafeSingular: empty traversal
unsafeSingular :: Traversal s t a b          -> Lens s t a b
unsafeSingular :: Fold s a                   -> Getter s a
unsafeSingular :: IndexedTraversal i s t a b -> IndexedLens i s t a b
unsafeSingular :: IndexedFold i s a          -> IndexedGetter i s a

unsnoc :: Snoc s s a a => s -> Maybe (s, a) #

Attempt to extract the right-most element from a container, and a version of the container without that element.

>>> unsnoc (LazyT.pack "hello!")
Just ("hello",'!')
>>> unsnoc (LazyT.pack "")
Nothing
>>> unsnoc (Seq.fromList [b,c,a])
Just (fromList [b,c],a)
>>> unsnoc (Seq.fromList [])
Nothing

unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic * * * p f s t a b #

An analogue of to for review.

unto :: (b -> t) -> Review' t b
unto = un . to

use :: MonadState s m => Getting a s a -> m a #

Use the target of a Lens, Iso, or Getter in the current state, or use a summary of a Fold or Traversal that points to a monoidal value.

>>> evalState (use _1) (a,b)
a
>>> evalState (use _1) ("hello","world")
"hello"
use :: MonadState s m             => Getter s a     -> m a
use :: (MonadState s m, Monoid r) => Fold s r       -> m r
use :: MonadState s m             => Iso' s a       -> m a
use :: MonadState s m             => Lens' s a      -> m a
use :: (MonadState s m, Monoid r) => Traversal' s r -> m r

uses :: MonadState s m => LensLike' (Const * r) s a -> (a -> r) -> m r #

Use the target of a Lens, Iso or Getter in the current state, or use a summary of a Fold or Traversal that points to a monoidal value.

>>> evalState (uses _1 length) ("hello","world")
5
uses :: MonadState s m             => Getter s a     -> (a -> r) -> m r
uses :: (MonadState s m, Monoid r) => Fold s a       -> (a -> r) -> m r
uses :: MonadState s m             => Lens' s a      -> (a -> r) -> m r
uses :: MonadState s m             => Iso' s a       -> (a -> r) -> m r
uses :: (MonadState s m, Monoid r) => Traversal' s a -> (a -> r) -> m r
uses :: MonadState s m => Getting r s t a b -> (a -> r) -> m r

view :: MonadReader s m => Getting a s a -> m a #

View the value pointed to by a Getter, Iso or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal value.

view . toid
>>> view (to f) a
f a
>>> view _2 (1,"hello")
"hello"
>>> view (to succ) 5
6
>>> view (_2._1) ("hello",("world","!!!"))
"world"

As view is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold, It may be useful to think of it as having one of these more restricted signatures:

view ::             Getter s a     -> s -> a
view :: Monoid m => Fold s m       -> s -> m
view ::             Iso' s a       -> s -> a
view ::             Lens' s a      -> s -> a
view :: Monoid m => Traversal' s m -> s -> m

In a more general setting, such as when working with a Monad transformer stack you can use:

view :: MonadReader s m             => Getter s a     -> m a
view :: (MonadReader s m, Monoid a) => Fold s a       -> m a
view :: MonadReader s m             => Iso' s a       -> m a
view :: MonadReader s m             => Lens' s a      -> m a
view :: (MonadReader s m, Monoid a) => Traversal' s a -> m a

views :: MonadReader s m => LensLike' (Const * r) s a -> (a -> r) -> m r #

View a function of the value pointed to by a Getter or Lens or the result of folding over the result of mapping the targets of a Fold or Traversal.

views l f ≡ view (l . to f)
>>> views (to f) g a
g (f a)
>>> views _2 length (1,"hello")
5

As views is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold, It may be useful to think of it as having one of these more restricted signatures:

views ::             Getter s a     -> (a -> r) -> s -> r
views :: Monoid m => Fold s a       -> (a -> m) -> s -> m
views ::             Iso' s a       -> (a -> r) -> s -> r
views ::             Lens' s a      -> (a -> r) -> s -> r
views :: Monoid m => Traversal' s a -> (a -> m) -> s -> m

In a more general setting, such as when working with a Monad transformer stack you can use:

views :: MonadReader s m             => Getter s a     -> (a -> r) -> m r
views :: (MonadReader s m, Monoid r) => Fold s a       -> (a -> r) -> m r
views :: MonadReader s m             => Iso' s a       -> (a -> r) -> m r
views :: MonadReader s m             => Lens' s a      -> (a -> r) -> m r
views :: (MonadReader s m, Monoid r) => Traversal' s a -> (a -> r) -> m r
views :: MonadReader s m => Getting r s a -> (a -> r) -> m r

withIndex :: (Indexable i p, Functor f) => p (i, s) (f (j, t)) -> Indexed i s (f t) #

Fold a container with indices returning both the indices and the values.

The result is only valid to compose in a Traversal, if you don't edit the index as edits to the index have no effect.

withIso :: AnIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r #

Extract the two functions, one from s -> a and one from b -> t that characterize an Iso.

withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r #

Convert APrism to the pair of functions that characterize it.

without :: APrism s t a b -> APrism u v c d -> Prism (Either s u) (Either t v) (Either a c) (Either b d) #

Given a pair of prisms, project sums.

Viewing a Prism as a co-Lens, this combinator can be seen to be dual to alongside.

worded :: Applicative f => IndexedLensLike' Int f String String #

A Fold over the individual words of a String.

worded :: Fold String String
worded :: Traversal' String String
worded :: IndexedFold Int String String
worded :: IndexedTraversal' Int String String

Note: This function type-checks as a Traversal but it doesn't satisfy the laws. It's only valid to use it when you don't insert any whitespace characters while traversing, and if your original String contains only isolated space characters (and no other characters that count as space, such as non-breaking spaces).

(|>) :: Snoc s s a a => s -> a -> s infixl 5 #

snoc an element onto the end of a container.

This is an infix alias for snoc.

>>> Seq.fromList [] |> a
fromList [a]
>>> Seq.fromList [b, c] |> a
fromList [b,c,a]
>>> LazyT.pack "hello" |> '!'
"hello!"

(||=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 #

Modify the target(s) of a Lens', 'Iso, Setter or Traversal by taking their logical || with a value.

>>> execState (do _1 ||= True; _2 ||= False; _3 ||= True; _4 ||= False) (True,True,False,False)
(True,True,True,False)
(||=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
(||=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
(||=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
(||=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(||~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 #

Logically || the target(s) of a Bool-valued Lens or Setter.

>>> both ||~ True $ (False,True)
(True,True)
>>> both ||~ False $ (False,True)
(False,True)
(||~) :: Setter' s Bool    -> Bool -> s -> s
(||~) :: Iso' s Bool       -> Bool -> s -> s
(||~) :: Lens' s Bool      -> Bool -> s -> s
(||~) :: Traversal' s Bool -> Bool -> s -> s

State monads

Class

class MonadTrans t where #

The class of monad transformers. Instances should satisfy the following laws, which state that lift is a monad transformation:

Minimal complete definition

lift

Methods

lift :: Monad m => m a -> t m a #

Lift a computation from the argument monad to the constructed monad.

Instances

MonadTrans Yoneda 

Methods

lift :: Monad m => m a -> Yoneda m a #

MonadTrans ListT 

Methods

lift :: Monad m => m a -> ListT m a #

MonadTrans MaybeT 

Methods

lift :: Monad m => m a -> MaybeT m a #

MonadTrans (IdentityT *) 

Methods

lift :: Monad m => m a -> IdentityT * m a #

MonadTrans (FreeT f) 

Methods

lift :: Monad m => m a -> FreeT f m a #

MonadTrans (ErrorT e) 

Methods

lift :: Monad m => m a -> ErrorT e m a #

MonadTrans (ExceptT e) 

Methods

lift :: Monad m => m a -> ExceptT e m a #

MonadTrans (StateT s) 

Methods

lift :: Monad m => m a -> StateT s m a #

MonadTrans (StateT s) 

Methods

lift :: Monad m => m a -> StateT s m a #

Monoid w => MonadTrans (WriterT w) 

Methods

lift :: Monad m => m a -> WriterT w m a #

Monoid w => MonadTrans (WriterT w) 

Methods

lift :: Monad m => m a -> WriterT w m a #

MonadTrans (ContT * r) 

Methods

lift :: Monad m => m a -> ContT * r m a #

MonadTrans (ReaderT * r) 

Methods

lift :: Monad m => m a -> ReaderT * r m a #

Monoid w => MonadTrans (RWST r w s) 

Methods

lift :: Monad m => m a -> RWST r w s m a #

Monoid w => MonadTrans (RWST r w s) 

Methods

lift :: Monad m => m a -> RWST r w s m a #

Class

class Monad m => MonadIO m where #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Minimal complete definition

liftIO

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances

MonadIO IO 

Methods

liftIO :: IO a -> IO a #

MonadIO m => MonadIO (ListT m) 

Methods

liftIO :: IO a -> ListT m a #

MonadIO m => MonadIO (MaybeT m) 

Methods

liftIO :: IO a -> MaybeT m a #

MonadIO m => MonadIO (IdentityT * m) 

Methods

liftIO :: IO a -> IdentityT * m a #

(Functor f, MonadIO m) => MonadIO (FreeT f m) 

Methods

liftIO :: IO a -> FreeT f m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (ExceptT e m) 

Methods

liftIO :: IO a -> ExceptT e m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

MonadIO m => MonadIO (ContT * r m) 

Methods

liftIO :: IO a -> ContT * r m a #

MonadIO m => MonadIO (ReaderT * r m) 

Methods

liftIO :: IO a -> ReaderT * r m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #

State

class Monad m => MonadState s m | m -> s where #

Minimal definition is either both of get and put or just state

Minimal complete definition

state | get, put

Methods

get :: m s #

Return the state from the internals of the monad.

put :: s -> m () #

Replace the state inside the monad.

state :: (s -> (a, s)) -> m a #

Embed a simple state action into the monad.

Instances

MonadState s m => MonadState s (MaybeT m) 

Methods

get :: MaybeT m s #

put :: s -> MaybeT m () #

state :: (s -> (a, s)) -> MaybeT m a #

MonadState s m => MonadState s (ListT m) 

Methods

get :: ListT m s #

put :: s -> ListT m () #

state :: (s -> (a, s)) -> ListT m a #

(Monoid w, MonadState s m) => MonadState s (WriterT w m) 

Methods

get :: WriterT w m s #

put :: s -> WriterT w m () #

state :: (s -> (a, s)) -> WriterT w m a #

(Monoid w, MonadState s m) => MonadState s (WriterT w m) 

Methods

get :: WriterT w m s #

put :: s -> WriterT w m () #

state :: (s -> (a, s)) -> WriterT w m a #

Monad m => MonadState s (StateT s m) 

Methods

get :: StateT s m s #

put :: s -> StateT s m () #

state :: (s -> (a, s)) -> StateT s m a #

Monad m => MonadState s (StateT s m) 

Methods

get :: StateT s m s #

put :: s -> StateT s m () #

state :: (s -> (a, s)) -> StateT s m a #

MonadState s m => MonadState s (IdentityT * m) 

Methods

get :: IdentityT * m s #

put :: s -> IdentityT * m () #

state :: (s -> (a, s)) -> IdentityT * m a #

MonadState s m => MonadState s (ExceptT e m) 

Methods

get :: ExceptT e m s #

put :: s -> ExceptT e m () #

state :: (s -> (a, s)) -> ExceptT e m a #

(Error e, MonadState s m) => MonadState s (ErrorT e m) 

Methods

get :: ErrorT e m s #

put :: s -> ErrorT e m () #

state :: (s -> (a, s)) -> ErrorT e m a #

(Functor f, MonadState s m) => MonadState s (FreeT f m) 

Methods

get :: FreeT f m s #

put :: s -> FreeT f m () #

state :: (s -> (a, s)) -> FreeT f m a #

MonadState s m => MonadState s (ReaderT * r m) 

Methods

get :: ReaderT * r m s #

put :: s -> ReaderT * r m () #

state :: (s -> (a, s)) -> ReaderT * r m a #

MonadState s m => MonadState s (ContT * r m) 

Methods

get :: ContT * r m s #

put :: s -> ContT * r m () #

state :: (s -> (a, s)) -> ContT * r m a #

(Monad m, Monoid w) => MonadState s (RWST r w s m) 

Methods

get :: RWST r w s m s #

put :: s -> RWST r w s m () #

state :: (s -> (a, s)) -> RWST r w s m a #

(Monad m, Monoid w) => MonadState s (RWST r w s m) 

Methods

get :: RWST r w s m s #

put :: s -> RWST r w s m () #

state :: (s -> (a, s)) -> RWST r w s m a #

modify :: MonadState s m => (s -> s) -> m () #

Monadic state transformer.

Maps an old state to a new state inside a state monad. The old state is thrown away.

     Main> :t modify ((+1) :: Int -> Int)
     modify (...) :: (MonadState Int a) => a ()

This says that modify (+1) acts over any Monad that is a member of the MonadState class, with an Int state.

modify' :: MonadState s m => (s -> s) -> m () #

A variant of modify in which the computation is strict in the new state.

gets :: MonadState s m => (s -> a) -> m a #

Gets specific component of the state, using a projection function supplied.

type State s = StateT s Identity #

A state monad parameterized by the type s of the state to carry.

The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.

runState #

Arguments

:: State s a

state-passing computation to execute

-> s

initial state

-> (a, s)

return value and final state

Unwrap a state monad computation as a function. (The inverse of state.)

evalState #

Arguments

:: State s a

state-passing computation to execute

-> s

initial value

-> a

return value of the state computation

Evaluate a state computation with the given initial state and return the final value, discarding the final state.

execState #

Arguments

:: State s a

state-passing computation to execute

-> s

initial value

-> s

final state

Evaluate a state computation with the given initial state and return the final state, discarding the final value.

mapState :: ((a, s) -> (b, s)) -> State s a -> State s b #

Map both the return value and final state of a computation using the given function.

withState :: (s -> s) -> State s a -> State s a #

withState f m executes action m on a state modified by applying f.

newtype StateT s m a :: * -> (* -> *) -> * -> * #

A state transformer monad parameterized by:

  • s - The state.
  • m - The inner monad.

The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.

Constructors

StateT 

Fields

Instances

Monad m => MonadState s (StateT s m) 

Methods

get :: StateT s m s #

put :: s -> StateT s m () #

state :: (s -> (a, s)) -> StateT s m a #

MonadReader r m => MonadReader r (StateT s m) 

Methods

ask :: StateT s m r #

local :: (r -> r) -> StateT s m a -> StateT s m a #

reader :: (r -> a) -> StateT s m a #

MonadWriter w m => MonadWriter w (StateT s m) 

Methods

writer :: (a, w) -> StateT s m a #

tell :: w -> StateT s m () #

listen :: StateT s m a -> StateT s m (a, w) #

pass :: StateT s m (a, w -> w) -> StateT s m a #

MonadTrans (StateT s) 

Methods

lift :: Monad m => m a -> StateT s m a #

Monad m => Monad (StateT s m) 

Methods

(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #

(>>) :: StateT s m a -> StateT s m b -> StateT s m b #

return :: a -> StateT s m a #

fail :: String -> StateT s m a #

Functor m => Functor (StateT s m) 

Methods

fmap :: (a -> b) -> StateT s m a -> StateT s m b #

(<$) :: a -> StateT s m b -> StateT s m a #

MonadFix m => MonadFix (StateT s m) 

Methods

mfix :: (a -> StateT s m a) -> StateT s m a #

MonadFail m => MonadFail (StateT s m) 

Methods

fail :: String -> StateT s m a #

(Functor m, Monad m) => Applicative (StateT s m) 

Methods

pure :: a -> StateT s m a #

(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #

(*>) :: StateT s m a -> StateT s m b -> StateT s m b #

(<*) :: StateT s m a -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (StateT s m) 

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

(Functor m, MonadPlus m) => Alternative (StateT s m) 

Methods

empty :: StateT s m a #

(<|>) :: StateT s m a -> StateT s m a -> StateT s m a #

some :: StateT s m a -> StateT s m [a] #

many :: StateT s m a -> StateT s m [a] #

MonadPlus m => MonadPlus (StateT s m) 

Methods

mzero :: StateT s m a #

mplus :: StateT s m a -> StateT s m a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

Bind m => Apply (StateT s m) 

Methods

(<.>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #

(.>) :: StateT s m a -> StateT s m b -> StateT s m b #

(<.) :: StateT s m a -> StateT s m b -> StateT s m a #

Bind m => Bind (StateT s m) 

Methods

(>>-) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #

join :: StateT s m (StateT s m a) -> StateT s m a #

Monad z => Zoom (StateT s z) (StateT t z) s t 

Methods

zoom :: LensLike' (Zoomed (StateT s z) c) t s -> StateT s z c -> StateT t z c #

Wrapped (StateT s m a) 

Associated Types

type Unwrapped (StateT s m a) :: * #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

(~) * t (StateT s' m' a') => Rewrapped (StateT s m a) t 
Strict (StateT s m a) (StateT s m a) 

Methods

strict :: Iso' (StateT s m a) (StateT s m a) #

type Zoomed (StateT s z) 
type Zoomed (StateT s z) = Focusing z
type Unwrapped (StateT s m a) 
type Unwrapped (StateT s m a) = s -> m (a, s)

runStateT :: StateT s m a -> s -> m (a, s) #

evalStateT :: Monad m => StateT s m a -> s -> m a #

Evaluate a state computation with the given initial state and return the final value, discarding the final state.

execStateT :: Monad m => StateT s m a -> s -> m s #

Evaluate a state computation with the given initial state and return the final state, discarding the final value.

mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b #

Map both the return value and final state of a computation using the given function.

withStateT :: (s -> s) -> StateT s m a -> StateT s m a #

withStateT f m executes action m on a state modified by applying f.

Painless String Types

s :: (ToString a, IsString b) => a -> b #

class ToString a where #

Defines how a given type should be converted to String. If at all possible, the conversion should be loss-less, and if encodings are involved, UTF-8 should be the default.

Minimal complete definition

toString

Methods

toString :: a -> String #

class IsString a where #

Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).

Minimal complete definition

fromString

Methods

fromString :: String -> a #

Instances

IsString ByteString 
IsString ByteString 
IsString Value 

Methods

fromString :: String -> Value #

IsString ShortByteString 
(~) * a Char => IsString [a] 

Methods

fromString :: String -> [a] #

IsString a => IsString (Identity a) 

Methods

fromString :: String -> Identity a #

IsString (Seq Char) 

Methods

fromString :: String -> Seq Char #

(~) * a Char => IsString (DList a) 

Methods

fromString :: String -> DList a #

(IsString a, Hashable a) => IsString (Hashed a) 

Methods

fromString :: String -> Hashed a #

IsString a => IsString (Const * a b) 

Methods

fromString :: String -> Const * a b #

IsString a => IsString (Tagged k s a) 

Methods

fromString :: String -> Tagged k s a #

type Text = Text Source #

Generalized String Operations

trim :: (IsString a, ToString a) => a -> a Source #

ltrim :: (IsString a, ToString a) => a -> a Source #

rtrim :: (IsString a, ToString a) => a -> a Source #

words :: (IsString a, ToString a) => a -> [a] Source #

lines :: (IsString a, ToString a) => a -> [a] Source #

data Char :: * #

The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.

To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).

Instances

Bounded Char 
Enum Char 

Methods

succ :: Char -> Char #

pred :: Char -> Char #

toEnum :: Int -> Char #

fromEnum :: Char -> Int #

enumFrom :: Char -> [Char] #

enumFromThen :: Char -> Char -> [Char] #

enumFromTo :: Char -> Char -> [Char] #

enumFromThenTo :: Char -> Char -> Char -> [Char] #

Eq Char 

Methods

(==) :: Char -> Char -> Bool #

(/=) :: Char -> Char -> Bool #

Data Char 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char #

toConstr :: Char -> Constr #

dataTypeOf :: Char -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Char) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) #

gmapT :: (forall b. Data b => b -> b) -> Char -> Char #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r #

gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #

Ord Char 

Methods

compare :: Char -> Char -> Ordering #

(<) :: Char -> Char -> Bool #

(<=) :: Char -> Char -> Bool #

(>) :: Char -> Char -> Bool #

(>=) :: Char -> Char -> Bool #

max :: Char -> Char -> Char #

min :: Char -> Char -> Char #

Read Char 
Show Char 

Methods

showsPrec :: Int -> Char -> ShowS #

show :: Char -> String #

showList :: [Char] -> ShowS #

Ix Char 

Methods

range :: (Char, Char) -> [Char] #

index :: (Char, Char) -> Char -> Int #

unsafeIndex :: (Char, Char) -> Char -> Int

inRange :: (Char, Char) -> Char -> Bool #

rangeSize :: (Char, Char) -> Int #

unsafeRangeSize :: (Char, Char) -> Int

Lift Char 

Methods

lift :: Char -> Q Exp #

PrintfArg Char 
IsChar Char 

Methods

toChar :: Char -> Char #

fromChar :: Char -> Char #

NFData Char 

Methods

rnf :: Char -> () #

Hashable Char 

Methods

hashWithSalt :: Int -> Char -> Int #

hash :: Char -> Int #

Unbox Char 
ErrorList Char 

Methods

listMsg :: String -> [Char] #

StringIO String Source # 
IArray UArray Char 

Methods

bounds :: Ix i => UArray i Char -> (i, i) #

numElements :: Ix i => UArray i Char -> Int

unsafeArray :: Ix i => (i, i) -> [(Int, Char)] -> UArray i Char

unsafeAt :: Ix i => UArray i Char -> Int -> Char

unsafeReplace :: Ix i => UArray i Char -> [(Int, Char)] -> UArray i Char

unsafeAccum :: Ix i => (Char -> e' -> Char) -> UArray i Char -> [(Int, e')] -> UArray i Char

unsafeAccumArray :: Ix i => (Char -> e' -> Char) -> Char -> (i, i) -> [(Int, e')] -> UArray i Char

Vector Vector Char 
MVector MVector Char 
ListLike LText Char Source # 
ListLike Text Char Source # 
KnownSymbol n => Reifies Symbol n String 

Methods

reflect :: proxy String -> a #

Cons Text Text Char Char 

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Cons Text Text Char Char 

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Snoc Text Text Char Char 

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Snoc Text Text Char Char 

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Functor (URec Char) 

Methods

fmap :: (a -> b) -> URec Char a -> URec Char b #

(<$) :: a -> URec Char b -> URec Char a #

IsString (Seq Char) 

Methods

fromString :: String -> Seq Char #

Foldable (URec Char) 

Methods

fold :: Monoid m => URec Char m -> m #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m #

foldr :: (a -> b -> b) -> b -> URec Char a -> b #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b #

foldl :: (b -> a -> b) -> b -> URec Char a -> b #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b #

foldr1 :: (a -> a -> a) -> URec Char a -> a #

foldl1 :: (a -> a -> a) -> URec Char a -> a #

toList :: URec Char a -> [a] #

null :: URec Char a -> Bool #

length :: URec Char a -> Int #

elem :: Eq a => a -> URec Char a -> Bool #

maximum :: Ord a => URec Char a -> a #

minimum :: Ord a => URec Char a -> a #

sum :: Num a => URec Char a -> a #

product :: Num a => URec Char a -> a #

Traversable (URec Char) 

Methods

traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) #

sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) #

mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) #

sequence :: Monad m => URec Char (m a) -> m (URec Char a) #

Generic1 (URec Char) 

Associated Types

type Rep1 (URec Char :: * -> *) :: * -> * #

Methods

from1 :: URec Char a -> Rep1 (URec Char) a #

to1 :: Rep1 (URec Char) a -> URec Char a #

ToString [Char] 

Methods

toString :: [Char] -> String #

MArray (STUArray s) Char (ST s) 

Methods

getBounds :: Ix i => STUArray s i Char -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Char -> ST s Int

newArray :: Ix i => (i, i) -> Char -> ST s (STUArray s i Char) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Char) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Char)

unsafeRead :: Ix i => STUArray s i Char -> Int -> ST s Char

unsafeWrite :: Ix i => STUArray s i Char -> Int -> Char -> ST s ()

Eq (URec Char p) 

Methods

(==) :: URec Char p -> URec Char p -> Bool #

(/=) :: URec Char p -> URec Char p -> Bool #

Ord (URec Char p) 

Methods

compare :: URec Char p -> URec Char p -> Ordering #

(<) :: URec Char p -> URec Char p -> Bool #

(<=) :: URec Char p -> URec Char p -> Bool #

(>) :: URec Char p -> URec Char p -> Bool #

(>=) :: URec Char p -> URec Char p -> Bool #

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

Show (URec Char p) 

Methods

showsPrec :: Int -> URec Char p -> ShowS #

show :: URec Char p -> String #

showList :: [URec Char p] -> ShowS #

Generic (URec Char p) 

Associated Types

type Rep (URec Char p) :: * -> * #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

data URec Char

Used for marking occurrences of Char#

data URec Char = UChar {}
data Vector Char 
data MVector s Char 
type Rep1 (URec Char) 
type Rep1 (URec Char) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just Symbol "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) UChar))
type Rep (URec Char p) 
type Rep (URec Char p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just Symbol "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) UChar))

isControl :: Char -> Bool #

Selects control characters, which are the non-printing characters of the Latin-1 subset of Unicode.

isSpace :: Char -> Bool #

Returns True for any Unicode space character, and the control characters \t, \n, \r, \f, \v.

isLower :: Char -> Bool #

Selects lower-case alphabetic Unicode characters (letters).

isUpper :: Char -> Bool #

Selects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj.

isAlpha :: Char -> Bool #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to isLetter.

isAlphaNum :: Char -> Bool #

Selects alphabetic or numeric digit Unicode characters.

Note that numeric digits outside the ASCII range are selected by this function but not by isDigit. Such digits may be part of identifiers but are not used by the printer and reader to represent numbers.

isPrint :: Char -> Bool #

Selects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces).

isDigit :: Char -> Bool #

Selects ASCII digits, i.e. '0'..'9'.

isOctDigit :: Char -> Bool #

Selects ASCII octal digits, i.e. '0'..'7'.

isHexDigit :: Char -> Bool #

Selects ASCII hexadecimal digits, i.e. '0'..'9', 'a'..'f', 'A'..'F'.

isLetter :: Char -> Bool #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to isAlpha.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Letter".

Examples

Basic usage:

>>> isLetter 'a'
True
>>> isLetter 'A'
True
>>> isLetter '0'
False
>>> isLetter '%'
False
>>> isLetter '♥'
False
>>> isLetter '\31'
False

Ensure that isLetter and isAlpha are equivalent.

>>> let chars = [(chr 0)..]
>>> let letters = map isLetter chars
>>> let alphas = map isAlpha chars
>>> letters == alphas
True

isMark :: Char -> Bool #

Selects Unicode mark characters, for example accents and the like, which combine with preceding characters.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Mark".

Examples

Basic usage:

>>> isMark 'a'
False
>>> isMark '0'
False

Combining marks such as accent characters usually need to follow another character before they become printable:

>>> map isMark "ò"
[False,True]

Puns are not necessarily supported:

>>> isMark '✓'
False

isNumber :: Char -> Bool #

Selects Unicode numeric characters, including digits from various scripts, Roman numerals, et cetera.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Number".

Examples

Basic usage:

>>> isNumber 'a'
False
>>> isNumber '%'
False
>>> isNumber '3'
True

ASCII '0' through '9' are all numbers:

>>> and $ map isNumber ['0'..'9']
True

Unicode Roman numerals are "numbers" as well:

>>> isNumber 'Ⅸ'
True

isPunctuation :: Char -> Bool #

Selects Unicode punctuation characters, including various kinds of connectors, brackets and quotes.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Punctuation".

Examples

Basic usage:

>>> isPunctuation 'a'
False
>>> isPunctuation '7'
False
>>> isPunctuation '♥'
False
>>> isPunctuation '"'
True
>>> isPunctuation '?'
True
>>> isPunctuation '—'
True

isSymbol :: Char -> Bool #

Selects Unicode symbol characters, including mathematical and currency symbols.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Symbol".

Examples

Basic usage:

>>> isSymbol 'a'
False
>>> isSymbol '6'
False
>>> isSymbol '='
True

The definition of "math symbol" may be a little counter-intuitive depending on one's background:

>>> isSymbol '+'
True
>>> isSymbol '-'
False

isSeparator :: Char -> Bool #

Selects Unicode space and separator characters.

This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Separator".

Examples

Basic usage:

>>> isSeparator 'a'
False
>>> isSeparator '6'
False
>>> isSeparator ' '
True

Warning: newlines and tab characters are not considered separators.

>>> isSeparator '\n'
False
>>> isSeparator '\t'
False

But some more exotic characters are (like HTML's &nbsp;):

>>> isSeparator '\160'
True

isAscii :: Char -> Bool #

Selects the first 128 characters of the Unicode character set, corresponding to the ASCII character set.

isLatin1 :: Char -> Bool #

Selects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.

isAsciiUpper :: Char -> Bool #

Selects ASCII upper-case letters, i.e. characters satisfying both isAscii and isUpper.

isAsciiLower :: Char -> Bool #

Selects ASCII lower-case letters, i.e. characters satisfying both isAscii and isLower.

data GeneralCategory :: * #

Unicode General Categories (column 2 of the UnicodeData table) in the order they are listed in the Unicode standard (the Unicode Character Database, in particular).

Examples

Basic usage:

>>> :t OtherLetter
OtherLetter :: GeneralCategory

Eq instance:

>>> UppercaseLetter == UppercaseLetter
True
>>> UppercaseLetter == LowercaseLetter
False

Ord instance:

>>> NonSpacingMark <= MathSymbol
True

Enum instance:

>>> enumFromTo ModifierLetter SpacingCombiningMark
[ModifierLetter,OtherLetter,NonSpacingMark,SpacingCombiningMark]

Read instance:

>>> read "DashPunctuation" :: GeneralCategory
DashPunctuation
>>> read "17" :: GeneralCategory
*** Exception: Prelude.read: no parse

Show instance:

>>> show EnclosingMark
"EnclosingMark"

Bounded instance:

>>> minBound :: GeneralCategory
UppercaseLetter
>>> maxBound :: GeneralCategory
NotAssigned

Ix instance:

>>> import Data.Ix ( index )
>>> index (OtherLetter,Control) FinalQuote
12
>>> index (OtherLetter,Control) Format
*** Exception: Error in array index

Constructors

UppercaseLetter

Lu: Letter, Uppercase

LowercaseLetter

Ll: Letter, Lowercase

TitlecaseLetter

Lt: Letter, Titlecase

ModifierLetter

Lm: Letter, Modifier

OtherLetter

Lo: Letter, Other

NonSpacingMark

Mn: Mark, Non-Spacing

SpacingCombiningMark

Mc: Mark, Spacing Combining

EnclosingMark

Me: Mark, Enclosing

DecimalNumber

Nd: Number, Decimal

LetterNumber

Nl: Number, Letter

OtherNumber

No: Number, Other

ConnectorPunctuation

Pc: Punctuation, Connector

DashPunctuation

Pd: Punctuation, Dash

OpenPunctuation

Ps: Punctuation, Open

ClosePunctuation

Pe: Punctuation, Close

InitialQuote

Pi: Punctuation, Initial quote

FinalQuote

Pf: Punctuation, Final quote

OtherPunctuation

Po: Punctuation, Other

MathSymbol

Sm: Symbol, Math

CurrencySymbol

Sc: Symbol, Currency

ModifierSymbol

Sk: Symbol, Modifier

OtherSymbol

So: Symbol, Other

Space

Zs: Separator, Space

LineSeparator

Zl: Separator, Line

ParagraphSeparator

Zp: Separator, Paragraph

Control

Cc: Other, Control

Format

Cf: Other, Format

Surrogate

Cs: Other, Surrogate

PrivateUse

Co: Other, Private Use

NotAssigned

Cn: Other, Not Assigned

Instances

Bounded GeneralCategory 
Enum GeneralCategory 
Eq GeneralCategory 
Ord GeneralCategory 
Read GeneralCategory 
Show GeneralCategory 
Ix GeneralCategory 

generalCategory :: Char -> GeneralCategory #

The Unicode general category of the character. This relies on the Enum instance of GeneralCategory, which must remain in the same order as the categories are presented in the Unicode standard.

Examples

Basic usage:

>>> generalCategory 'a'
LowercaseLetter
>>> generalCategory 'A'
UppercaseLetter
>>> generalCategory '0'
DecimalNumber
>>> generalCategory '%'
OtherPunctuation
>>> generalCategory '♥'
OtherSymbol
>>> generalCategory '\31'
Control
>>> generalCategory ' '
Space

toUpper :: Char -> Char #

Convert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.

toLower :: Char -> Char #

Convert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.

toTitle :: Char -> Char #

Convert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged.

digitToInt :: Char -> Int #

Convert a single digit Char to the corresponding Int. This function fails unless its argument satisfies isHexDigit, but recognises both upper- and lower-case hexadecimal digits (that is, '0'..'9', 'a'..'f', 'A'..'F').

Examples

Characters '0' through '9' are converted properly to 0..9:

>>> map digitToInt ['0'..'9']
[0,1,2,3,4,5,6,7,8,9]

Both upper- and lower-case 'A' through 'F' are converted as well, to 10..15.

>>> map digitToInt ['a'..'f']
[10,11,12,13,14,15]
>>> map digitToInt ['A'..'F']
[10,11,12,13,14,15]

Anything else throws an exception:

>>> digitToInt 'G'
*** Exception: Char.digitToInt: not a digit 'G'
>>> digitToInt '♥'
*** Exception: Char.digitToInt: not a digit '\9829'

intToDigit :: Int -> Char #

Convert an Int in the range 0..15 to the corresponding single digit Char. This function fails on other inputs, and generates lower-case hexadecimal digits.

ord :: Char -> Int #

The fromEnum method restricted to the type Char.

chr :: Int -> Char #

The toEnum method restricted to the type Char.

showLitChar :: Char -> ShowS #

Convert a character to a string using only printable characters, using Haskell source-language escape conventions. For example:

showLitChar '\n' s  =  "\\n" ++ s

lexLitChar :: ReadS String #

Read a string representation of a character, using Haskell source-language escape conventions. For example:

lexLitChar  "\\nHello"  =  [("\\n", "Hello")]

readLitChar :: ReadS Char #

Read a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example:

readLitChar "\\nHello"  =  [('\n', "Hello")]

String Case Conversions

kebab :: String -> String #

Directly convert to kebab-case through fromAny

snake :: String -> String #

Directly convert to snake_Case through fromAny

pascal :: String -> String #

Directly convert to PascalCase through fromAny

quietSnake :: String -> String #

Directly convert to quiet_snake_case through fromAny

screamingSnake :: String -> String #

Directly convert to SCREAMING_SNAKE_CASE through fromAny

I/O

stderr :: Handle #

A handle managing output to the Haskell program's standard error channel.

stdout :: Handle #

A handle managing output to the Haskell program's standard output channel.

stdin :: Handle #

A handle managing input from the Haskell program's standard input channel.

data Handle :: * #

Haskell defines operations to read and write characters from and to files, represented by values of type Handle. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

  • whether it manages input or output or both;
  • whether it is open, closed or semi-closed;
  • whether the object is seekable;
  • whether buffering is disabled, or enabled on a line or block basis;
  • a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the Show and Eq classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to == only to itself; no attempt is made to compare the internal state of different handles for equality.

Instances

Eq Handle 

Methods

(==) :: Handle -> Handle -> Bool #

(/=) :: Handle -> Handle -> Bool #

Show Handle 

Environment

getArgs :: IO [String] #

Computation getArgs returns a list of the program's command line arguments (not including the program name).

getProgName :: IO String #

Computation getProgName returns the name of the program as it was invoked.

However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, and that is what getProgName will return.

getExecutablePath :: IO FilePath #

Returns the absolute pathname of the current executable.

Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)

Since: 4.6.0.0

getEnv :: String -> IO String #

Computation getEnv var returns the value of the environment variable var. For the inverse, POSIX users can use putEnv.

This computation may fail with:

lookupEnv :: String -> IO (Maybe String) #

Return the value of the environment variable var, or Nothing if there is no such value.

For POSIX users, this is equivalent to getEnv.

Since: 4.6.0.0

setEnv :: String -> String -> IO () #

setEnv name value sets the specified environment variable to value.

On Windows setting an environment variable to the empty string removes that environment variable from the environment. For the sake of compatibility we adopt that behavior. In particular

setEnv name ""

has the same effect as

unsetEnv name

If you don't care about Windows support and want to set an environment variable to the empty string use System.Posix.Env.setEnv from the unix package instead.

Throws IOException if name is the empty string or contains an equals sign.

Since: 4.7.0.0

unsetEnv :: String -> IO () #

unSet name removes the specified environment variable from the environment of the current process.

Throws IOException if name is the empty string or contains an equals sign.

Since: 4.7.0.0

withArgs :: [String] -> IO a -> IO a #

withArgs args act - while executing action act, have getArgs return args.

withProgName :: String -> IO a -> IO a #

withProgName name act - while executing action act, have getProgName return name.

getEnvironment :: IO [(String, String)] #

getEnvironment retrieves the entire environment as a list of (key,value) pairs.

If an environment entry does not contain an '=' character, the key is the whole entry and the value is the empty string.

Generalized I/O

class StringIO a where Source #

Types that can be written to / read from file descriptors.

Minimal complete definition

putStr, hPutStr, readFile, writeFile, getContents, hGetContents

Methods

putStr :: a -> IO () Source #

putStrLn :: a -> IO () Source #

hPutStr :: Handle -> a -> IO () Source #

hPutStrLn :: Handle -> a -> IO () Source #

readFile :: FilePath -> IO a Source #

writeFile :: FilePath -> a -> IO () Source #

getContents :: IO a Source #

hGetContents :: Handle -> IO a Source #

Instances

StringIO String Source # 
StringIO LByteString Source # 
StringIO ByteString Source # 
StringIO LText Source # 
StringIO Text Source # 

Printf

Printf

printf :: PrintfType r => String -> r #

Format a variable number of arguments with the C-style formatting string. The return value is either String or (IO a) (which should be (IO '()'), but Haskell's type system makes this hard).

The format string consists of ordinary characters and conversion specifications, which specify how to format one of the arguments to printf in the output string. A format specification is introduced by the % character; this character can be self-escaped into the format string using %%. A format specification ends with a /format character/ that provides the primary information about how to format the value. The rest of the conversion specification is optional. In order, one may have flag characters, a width specifier, a precision specifier, and type-specific modifier characters.

Unlike C printf(3), the formatting of this printf is driven by the argument type; formatting is type specific. The types formatted by printf "out of the box" are:

printf is also extensible to support other types: see below.

A conversion specification begins with the character %, followed by zero or more of the following flags:

   -      left adjust (default is right adjust)
   +      always use a sign (+ or -) for signed conversions
   space  leading space for positive numbers in signed conversions
   0      pad with zeros rather than spaces
   #      use an \"alternate form\": see below

When both flags are given, - overrides 0 and + overrides space. A negative width specifier in a * conversion is treated as positive but implies the left adjust flag.

The "alternate form" for unsigned radix conversions is as in C printf(3):

   %o           prefix with a leading 0 if needed
   %x           prefix with a leading 0x if nonzero
   %X           prefix with a leading 0X if nonzero
   %b           prefix with a leading 0b if nonzero
   %[eEfFgG]    ensure that the number contains a decimal point

Any flags are followed optionally by a field width:

   num    field width
   *      as num, but taken from argument list

The field width is a minimum, not a maximum: it will be expanded as needed to avoid mutilating a value.

Any field width is followed optionally by a precision:

   .num   precision
   .      same as .0
   .*     as num, but taken from argument list

Negative precision is taken as 0. The meaning of the precision depends on the conversion type.

   Integral    minimum number of digits to show
   RealFloat   number of digits after the decimal point
   String      maximum number of characters

The precision for Integral types is accomplished by zero-padding. If both precision and zero-pad are given for an Integral field, the zero-pad is ignored.

Any precision is followed optionally for Integral types by a width modifier; the only use of this modifier being to set the implicit size of the operand for conversion of a negative operand to unsigned:

   hh     Int8
   h      Int16
   l      Int32
   ll     Int64
   L      Int64

The specification ends with a format character:

   c      character               Integral
   d      decimal                 Integral
   o      octal                   Integral
   x      hexadecimal             Integral
   X      hexadecimal             Integral
   b      binary                  Integral
   u      unsigned decimal        Integral
   f      floating point          RealFloat
   F      floating point          RealFloat
   g      general format float    RealFloat
   G      general format float    RealFloat
   e      exponent format float   RealFloat
   E      exponent format float   RealFloat
   s      string                  String
   v      default format          any type

The "%v" specifier is provided for all built-in types, and should be provided for user-defined type formatters as well. It picks a "best" representation for the given type. For the built-in types the "%v" specifier is converted as follows:

   c      Char
   u      other unsigned Integral
   d      other signed Integral
   g      RealFloat
   s      String

Mismatch between the argument types and the format string, as well as any other syntactic or semantic errors in the format string, will cause an exception to be thrown at runtime.

Note that the formatting for RealFloat types is currently a bit different from that of C printf(3), conforming instead to showEFloat, showFFloat and showGFloat (and their alternate versions showFFloatAlt and showGFloatAlt). This is hard to fix: the fixed versions would format in a backward-incompatible way. In any case the Haskell behavior is generally more sensible than the C behavior. A brief summary of some key differences:

  • Haskell printf never uses the default "6-digit" precision used by C printf.
  • Haskell printf treats the "precision" specifier as indicating the number of digits after the decimal point.
  • Haskell printf prints the exponent of e-format numbers without a gratuitous plus sign, and with the minimum possible number of digits.
  • Haskell printf will place a zero after a decimal point when possible.

Examples

  > printf "%d\n" (23::Int)
  23
  > printf "%s %s\n" "Hello" "World"
  Hello World
  > printf "%.2f\n" pi
  3.14

hPrintf :: HPrintfType r => Handle -> String -> r #

Similar to printf, except that output is via the specified Handle. The return type is restricted to (IO a).

class PrintfArg a where #

Typeclass of printf-formattable values. The formatArg method takes a value and a field format descriptor and either fails due to a bad descriptor or produces a ShowS as the result. The default parseFormat expects no modifiers: this is the normal case. Minimal instance: formatArg.

Minimal complete definition

formatArg

Methods

formatArg :: a -> FieldFormatter #

Since: 4.7.0.0

parseFormat :: a -> ModifierParser #

Since: 4.7.0.0

Instances

PrintfArg Char 
PrintfArg Double 
PrintfArg Float 
PrintfArg Int 
PrintfArg Int8 
PrintfArg Int16 
PrintfArg Int32 
PrintfArg Int64 
PrintfArg Integer 
PrintfArg Word 
PrintfArg Word8 
PrintfArg Word16 
PrintfArg Word32 
PrintfArg Word64 
PrintfArg Natural 
IsChar c => PrintfArg [c] 

type FieldFormatter = FieldFormat -> ShowS #

This is the type of a field formatter reified over its argument.

Since: 4.7.0.0

data FieldFormat :: * #

Description of field formatting for formatArg. See UNIX printf(3) for a description of how field formatting works.

Since: 4.7.0.0

Constructors

FieldFormat 

Fields

data FormatAdjustment :: * #

Whether to left-adjust or zero-pad a field. These are mutually exclusive, with LeftAdjust taking precedence.

Since: 4.7.0.0

Constructors

LeftAdjust 
ZeroPad 

data FormatSign :: * #

How to handle the sign of a numeric field. These are mutually exclusive, with SignPlus taking precedence.

Since: 4.7.0.0

Constructors

SignPlus 
SignSpace 

vFmt :: Char -> FieldFormat -> FieldFormat #

Substitute a 'v' format character with the given default format character in the FieldFormat. A convenience for user-implemented types, which should support "%v".

Since: 4.7.0.0

type ModifierParser = String -> FormatParse #

Type of a function that will parse modifier characters from the format string.

Since: 4.7.0.0

data FormatParse :: * #

The "format parser" walks over argument-type-specific modifier characters to find the primary format character. This is the type of its result.

Since: 4.7.0.0

Constructors

FormatParse 

Fields

formatString :: IsChar a => [a] -> FieldFormatter #

Formatter for String values.

Since: 4.7.0.0

formatChar :: Char -> FieldFormatter #

Formatter for Char values.

Since: 4.7.0.0

formatInt :: (Integral a, Bounded a) => a -> FieldFormatter #

Formatter for Int values.

Since: 4.7.0.0

formatInteger :: Integer -> FieldFormatter #

Formatter for Integer values.

Since: 4.7.0.0

formatRealFloat :: RealFloat a => a -> FieldFormatter #

Formatter for RealFloat values.

Since: 4.7.0.0

errorBadFormat :: Char -> a #

Calls perror to indicate an unknown format letter for a given type.

Since: 4.7.0.0

errorShortFormat :: a #

Calls perror to indicate that the format string ended early.

Since: 4.7.0.0

errorMissingArgument :: a #

Calls perror to indicate that there is a missing argument in the argument list.

Since: 4.7.0.0

errorBadArgument :: a #

Calls perror to indicate that there is a type error or similar in the given argument.

Since: 4.7.0.0

perror :: String -> a #

Raises an error with a printf-specific prefix on the message string.

Since: 4.7.0.0

class PrintfType t #

The PrintfType class provides the variable argument magic for printf. Its implementation is intentionally not visible from this module. If you attempt to pass an argument of a type which is not an instance of this class to printf or hPrintf, then the compiler will report it as a missing instance of PrintfArg.

Minimal complete definition

spr

Instances

IsChar c => PrintfType [c] 

Methods

spr :: String -> [UPrintf] -> [c]

(~) * a () => PrintfType (IO a) 

Methods

spr :: String -> [UPrintf] -> IO a

(PrintfArg a, PrintfType r) => PrintfType (a -> r) 

Methods

spr :: String -> [UPrintf] -> a -> r

class HPrintfType t #

The HPrintfType class provides the variable argument magic for hPrintf. Its implementation is intentionally not visible from this module.

Minimal complete definition

hspr

Instances

(~) * a () => HPrintfType (IO a) 

Methods

hspr :: Handle -> String -> [UPrintf] -> IO a

(PrintfArg a, HPrintfType r) => HPrintfType (a -> r) 

Methods

hspr :: Handle -> String -> [UPrintf] -> a -> r

class IsChar c where #

This class, with only the one instance, is used as a workaround for the fact that String, as a concrete type, is not allowable as a typeclass instance. IsChar is exported for backward-compatibility.

Minimal complete definition

toChar, fromChar

Methods

toChar :: c -> Char #

Since: 4.7.0.0

fromChar :: Char -> c #

Since: 4.7.0.0

Instances

IsChar Char 

Methods

toChar :: Char -> Char #

fromChar :: Char -> Char #

Filename And File System Manipulation

FilePath

(</>) :: FilePath -> FilePath -> FilePath infixr 5 #

Combine two paths with a path separator. If the second path starts with a path separator or a drive letter, then it returns the second. The intention is that readFile (dir </> file) will access the same file as setCurrentDirectory dir; readFile file.

Posix:   "/directory" </> "file.ext" == "/directory/file.ext"
Windows: "/directory" </> "file.ext" == "/directory\\file.ext"
         "directory" </> "/file.ext" == "/file.ext"
Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x

Combined:

Posix:   "/" </> "test" == "/test"
Posix:   "home" </> "bob" == "home/bob"
Posix:   "x:" </> "foo" == "x:/foo"
Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar"
Windows: "home" </> "bob" == "home\\bob"

Not combined:

Posix:   "home" </> "/bob" == "/bob"
Windows: "home" </> "C:\\bob" == "C:\\bob"

Not combined (tricky):

On Windows, if a filepath starts with a single slash, it is relative to the root of the current drive. In [1], this is (confusingly) referred to as an absolute path. The current behavior of </> is to never combine these forms.

Windows: "home" </> "/bob" == "/bob"
Windows: "home" </> "\\bob" == "\\bob"
Windows: "C:\\home" </> "\\bob" == "\\bob"

On Windows, from [1]: "If a file name begins with only a disk designator but not the backslash after the colon, it is interpreted as a relative path to the current directory on the drive with the specified letter." The current behavior of </> is to never combine these forms.

Windows: "D:\\foo" </> "C:bar" == "C:bar"
Windows: "C:\\foo" </> "C:bar" == "C:bar"

type FilePath = String #

File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

addExtension :: FilePath -> String -> FilePath #

Add an extension, even if there is already one there, equivalent to <.>.

addExtension "/directory/path" "ext" == "/directory/path.ext"
addExtension "file.txt" "bib" == "file.txt.bib"
addExtension "file." ".bib" == "file..bib"
addExtension "file" ".bib" == "file.bib"
addExtension "/" "x" == "/.x"
Valid x => takeFileName (addExtension (addTrailingPathSeparator x) "ext") == ".ext"
Windows: addExtension "\\\\share" ".txt" == "\\\\share\\.txt"

addTrailingPathSeparator :: FilePath -> FilePath #

Add a trailing file path separator if one is not already present.

hasTrailingPathSeparator (addTrailingPathSeparator x)
hasTrailingPathSeparator x ==> addTrailingPathSeparator x == x
Posix:    addTrailingPathSeparator "test/rest" == "test/rest/"

combine :: FilePath -> FilePath -> FilePath #

An alias for </>.

dropDrive :: FilePath -> FilePath #

Delete the drive, if it exists.

dropDrive x == snd (splitDrive x)

dropExtension :: FilePath -> FilePath #

Remove last extension, and the "." preceding it.

dropExtension "/directory/path.ext" == "/directory/path"
dropExtension x == fst (splitExtension x)

dropExtensions :: FilePath -> FilePath #

Drop all extensions.

dropExtensions "/directory/path.ext" == "/directory/path"
dropExtensions "file.tar.gz" == "file"
not $ hasExtension $ dropExtensions x
not $ any isExtSeparator $ takeFileName $ dropExtensions x

dropFileName :: FilePath -> FilePath #

Drop the filename. Unlike takeDirectory, this function will leave a trailing path separator on the directory.

dropFileName "/directory/file.ext" == "/directory/"
dropFileName x == fst (splitFileName x)

dropTrailingPathSeparator :: FilePath -> FilePath #

Remove any trailing path separators

dropTrailingPathSeparator "file/test/" == "file/test"
          dropTrailingPathSeparator "/" == "/"
Windows:  dropTrailingPathSeparator "\\" == "\\"
Posix:    not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x

equalFilePath :: FilePath -> FilePath -> Bool #

Equality of two FilePaths. If you call System.Directory.canonicalizePath first this has a much better chance of working. Note that this doesn't follow symlinks or DOSNAM~1s.

         x == y ==> equalFilePath x y
         normalise x == normalise y ==> equalFilePath x y
         equalFilePath "foo" "foo/"
         not (equalFilePath "foo" "/foo")
Posix:   not (equalFilePath "foo" "FOO")
Windows: equalFilePath "foo" "FOO"
Windows: not (equalFilePath "C:" "C:/")

extSeparator :: Char #

File extension character

extSeparator == '.'

getSearchPath :: IO [FilePath] #

Get a list of FilePaths in the $PATH variable.

hasDrive :: FilePath -> Bool #

Does a path have a drive.

not (hasDrive x) == null (takeDrive x)
Posix:   hasDrive "/foo" == True
Windows: hasDrive "C:\\foo" == True
Windows: hasDrive "C:foo" == True
         hasDrive "foo" == False
         hasDrive "" == False

hasExtension :: FilePath -> Bool #

Does the given filename have an extension?

hasExtension "/directory/path.ext" == True
hasExtension "/directory/path" == False
null (takeExtension x) == not (hasExtension x)

hasTrailingPathSeparator :: FilePath -> Bool #

Is an item either a directory or the last character a path separator?

hasTrailingPathSeparator "test" == False
hasTrailingPathSeparator "test/" == True

isAbsolute :: FilePath -> Bool #

not . isRelative
isAbsolute x == not (isRelative x)

isDrive :: FilePath -> Bool #

Is an element a drive

Posix:   isDrive "/" == True
Posix:   isDrive "/foo" == False
Windows: isDrive "C:\\" == True
Windows: isDrive "C:\\foo" == False
         isDrive "" == False

isExtSeparator :: Char -> Bool #

Is the character an extension character?

isExtSeparator a == (a == extSeparator)

isPathSeparator :: Char -> Bool #

Rather than using (== pathSeparator), use this. Test if something is a path separator.

isPathSeparator a == (a `elem` pathSeparators)

isRelative :: FilePath -> Bool #

Is a path relative, or is it fixed to the root?

Windows: isRelative "path\\test" == True
Windows: isRelative "c:\\test" == False
Windows: isRelative "c:test" == True
Windows: isRelative "c:\\" == False
Windows: isRelative "c:/" == False
Windows: isRelative "c:" == True
Windows: isRelative "\\\\foo" == False
Windows: isRelative "\\\\?\\foo" == False
Windows: isRelative "\\\\?\\UNC\\foo" == False
Windows: isRelative "/foo" == True
Windows: isRelative "\\foo" == True
Posix:   isRelative "test/path" == True
Posix:   isRelative "/test" == False
Posix:   isRelative "/" == False

According to [1]:

  • "A UNC name of any format [is never relative]."
  • "You cannot use the "\?" prefix with a relative path."

isSearchPathSeparator :: Char -> Bool #

Is the character a file separator?

isSearchPathSeparator a == (a == searchPathSeparator)

joinDrive :: FilePath -> FilePath -> FilePath #

Join a drive and the rest of the path.

Valid x => uncurry joinDrive (splitDrive x) == x
Windows: joinDrive "C:" "foo" == "C:foo"
Windows: joinDrive "C:\\" "bar" == "C:\\bar"
Windows: joinDrive "\\\\share" "foo" == "\\\\share\\foo"
Windows: joinDrive "/:" "foo" == "/:\\foo"

joinPath :: [FilePath] -> FilePath #

Join path elements back together.

joinPath ["/","directory/","file.ext"] == "/directory/file.ext"
Valid x => joinPath (splitPath x) == x
joinPath [] == ""
Posix: joinPath ["test","file","path"] == "test/file/path"

makeRelative :: FilePath -> FilePath -> FilePath #

Contract a filename, based on a relative path. Note that the resulting path will never introduce .. paths, as the presence of symlinks means ../b may not reach a/b if it starts from a/c. For a worked example see this blog post.

The corresponding makeAbsolute function can be found in System.Directory.

         makeRelative "/directory" "/directory/file.ext" == "file.ext"
         Valid x => makeRelative (takeDirectory x) x `equalFilePath` takeFileName x
         makeRelative x x == "."
         Valid x y => equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y </> makeRelative y x) x
Windows: makeRelative "C:\\Home" "c:\\home\\bob" == "bob"
Windows: makeRelative "C:\\Home" "c:/home/bob" == "bob"
Windows: makeRelative "C:\\Home" "D:\\Home\\Bob" == "D:\\Home\\Bob"
Windows: makeRelative "C:\\Home" "C:Home\\Bob" == "C:Home\\Bob"
Windows: makeRelative "/Home" "/home/bob" == "bob"
Windows: makeRelative "/" "//" == "//"
Posix:   makeRelative "/Home" "/home/bob" == "/home/bob"
Posix:   makeRelative "/home/" "/home/bob/foo/bar" == "bob/foo/bar"
Posix:   makeRelative "/fred" "bob" == "bob"
Posix:   makeRelative "/file/test" "/file/test/fred" == "fred"
Posix:   makeRelative "/file/test" "/file/test/fred/" == "fred/"
Posix:   makeRelative "some/path" "some/path/a/b/c" == "a/b/c"

makeValid :: FilePath -> FilePath #

Take a FilePath and make it valid; does not change already valid FilePaths.

isValid (makeValid x)
isValid x ==> makeValid x == x
makeValid "" == "_"
makeValid "file\0name" == "file_name"
Windows: makeValid "c:\\already\\/valid" == "c:\\already\\/valid"
Windows: makeValid "c:\\test:of_test" == "c:\\test_of_test"
Windows: makeValid "test*" == "test_"
Windows: makeValid "c:\\test\\nul" == "c:\\test\\nul_"
Windows: makeValid "c:\\test\\prn.txt" == "c:\\test\\prn_.txt"
Windows: makeValid "c:\\test/prn.txt" == "c:\\test/prn_.txt"
Windows: makeValid "c:\\nul\\file" == "c:\\nul_\\file"
Windows: makeValid "\\\\\\foo" == "\\\\drive"
Windows: makeValid "\\\\?\\D:file" == "\\\\?\\D:\\file"
Windows: makeValid "nul .txt" == "nul _.txt"

normalise :: FilePath -> FilePath #

Normalise a file

  • // outside of the drive can be made blank
  • / -> pathSeparator
  • ./ -> ""
Posix:   normalise "/file/\\test////" == "/file/\\test/"
Posix:   normalise "/file/./test" == "/file/test"
Posix:   normalise "/test/file/../bob/fred/" == "/test/file/../bob/fred/"
Posix:   normalise "../bob/fred/" == "../bob/fred/"
Posix:   normalise "./bob/fred/" == "bob/fred/"
Windows: normalise "c:\\file/bob\\" == "C:\\file\\bob\\"
Windows: normalise "c:\\" == "C:\\"
Windows: normalise "C:.\\" == "C:"
Windows: normalise "\\\\server\\test" == "\\\\server\\test"
Windows: normalise "//server/test" == "\\\\server\\test"
Windows: normalise "c:/file" == "C:\\file"
Windows: normalise "/file" == "\\file"
Windows: normalise "\\" == "\\"
Windows: normalise "/./" == "\\"
         normalise "." == "."
Posix:   normalise "./" == "./"
Posix:   normalise "./." == "./"
Posix:   normalise "/./" == "/"
Posix:   normalise "/" == "/"
Posix:   normalise "bob/fred/." == "bob/fred/"
Posix:   normalise "//home" == "/home"

pathSeparator :: Char #

The character that separates directories. In the case where more than one character is possible, pathSeparator is the 'ideal' one.

Windows: pathSeparator == '\\'
Posix:   pathSeparator ==  '/'
isPathSeparator pathSeparator

pathSeparators :: [Char] #

The list of all possible separators.

Windows: pathSeparators == ['\\', '/']
Posix:   pathSeparators == ['/']
pathSeparator `elem` pathSeparators

replaceBaseName :: FilePath -> String -> FilePath #

Set the base name.

replaceBaseName "/directory/other.ext" "file" == "/directory/file.ext"
replaceBaseName "file/test.txt" "bob" == "file/bob.txt"
replaceBaseName "fred" "bill" == "bill"
replaceBaseName "/dave/fred/bob.gz.tar" "new" == "/dave/fred/new.tar"
Valid x => replaceBaseName x (takeBaseName x) == x

replaceDirectory :: FilePath -> String -> FilePath #

Set the directory, keeping the filename the same.

replaceDirectory "root/file.ext" "/directory/" == "/directory/file.ext"
Valid x => replaceDirectory x (takeDirectory x) `equalFilePath` x

replaceExtension :: FilePath -> String -> FilePath #

Set the extension of a file, overwriting one if already present, equivalent to -<.>.

replaceExtension "/directory/path.txt" "ext" == "/directory/path.ext"
replaceExtension "/directory/path.txt" ".ext" == "/directory/path.ext"
replaceExtension "file.txt" ".bob" == "file.bob"
replaceExtension "file.txt" "bob" == "file.bob"
replaceExtension "file" ".bob" == "file.bob"
replaceExtension "file.txt" "" == "file"
replaceExtension "file.fred.bob" "txt" == "file.fred.txt"
replaceExtension x y == addExtension (dropExtension x) y

replaceFileName :: FilePath -> String -> FilePath #

Set the filename.

replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext"
Valid x => replaceFileName x (takeFileName x) == x

searchPathSeparator :: Char #

The character that is used to separate the entries in the $PATH environment variable.

Windows: searchPathSeparator == ';'
Posix:   searchPathSeparator == ':'

splitDirectories :: FilePath -> [FilePath] #

Just as splitPath, but don't add the trailing slashes to each element.

         splitDirectories "/directory/file.ext" == ["/","directory","file.ext"]
         splitDirectories "test/file" == ["test","file"]
         splitDirectories "/test/file" == ["/","test","file"]
Windows: splitDirectories "C:\\test\\file" == ["C:\\", "test", "file"]
         Valid x => joinPath (splitDirectories x) `equalFilePath` x
         splitDirectories "" == []
Windows: splitDirectories "C:\\test\\\\\\file" == ["C:\\", "test", "file"]
         splitDirectories "/test///file" == ["/","test","file"]

splitDrive :: FilePath -> (FilePath, FilePath) #

Split a path into a drive and a path. On Posix, / is a Drive.

uncurry (++) (splitDrive x) == x
Windows: splitDrive "file" == ("","file")
Windows: splitDrive "c:/file" == ("c:/","file")
Windows: splitDrive "c:\\file" == ("c:\\","file")
Windows: splitDrive "\\\\shared\\test" == ("\\\\shared\\","test")
Windows: splitDrive "\\\\shared" == ("\\\\shared","")
Windows: splitDrive "\\\\?\\UNC\\shared\\file" == ("\\\\?\\UNC\\shared\\","file")
Windows: splitDrive "\\\\?\\UNCshared\\file" == ("\\\\?\\","UNCshared\\file")
Windows: splitDrive "\\\\?\\d:\\file" == ("\\\\?\\d:\\","file")
Windows: splitDrive "/d" == ("","/d")
Posix:   splitDrive "/test" == ("/","test")
Posix:   splitDrive "//test" == ("//","test")
Posix:   splitDrive "test/file" == ("","test/file")
Posix:   splitDrive "file" == ("","file")

splitExtension :: FilePath -> (String, String) #

Split on the extension. addExtension is the inverse.

splitExtension "/directory/path.ext" == ("/directory/path",".ext")
uncurry (++) (splitExtension x) == x
Valid x => uncurry addExtension (splitExtension x) == x
splitExtension "file.txt" == ("file",".txt")
splitExtension "file" == ("file","")
splitExtension "file/file.txt" == ("file/file",".txt")
splitExtension "file.txt/boris" == ("file.txt/boris","")
splitExtension "file.txt/boris.ext" == ("file.txt/boris",".ext")
splitExtension "file/path.txt.bob.fred" == ("file/path.txt.bob",".fred")
splitExtension "file/path.txt/" == ("file/path.txt/","")

splitExtensions :: FilePath -> (FilePath, String) #

Split on all extensions.

splitExtensions "/directory/path.ext" == ("/directory/path",".ext")
splitExtensions "file.tar.gz" == ("file",".tar.gz")
uncurry (++) (splitExtensions x) == x
Valid x => uncurry addExtension (splitExtensions x) == x
splitExtensions "file.tar.gz" == ("file",".tar.gz")

splitFileName :: FilePath -> (String, String) #

Split a filename into directory and file. </> is the inverse. The first component will often end with a trailing slash.

splitFileName "/directory/file.ext" == ("/directory/","file.ext")
Valid x => uncurry (</>) (splitFileName x) == x || fst (splitFileName x) == "./"
Valid x => isValid (fst (splitFileName x))
splitFileName "file/bob.txt" == ("file/", "bob.txt")
splitFileName "file/" == ("file/", "")
splitFileName "bob" == ("./", "bob")
Posix:   splitFileName "/" == ("/","")
Windows: splitFileName "c:" == ("c:","")

splitPath :: FilePath -> [FilePath] #

Split a path by the directory separator.

splitPath "/directory/file.ext" == ["/","directory/","file.ext"]
concat (splitPath x) == x
splitPath "test//item/" == ["test//","item/"]
splitPath "test/item/file" == ["test/","item/","file"]
splitPath "" == []
Windows: splitPath "c:\\test\\path" == ["c:\\","test\\","path"]
Posix:   splitPath "/file/test" == ["/","file/","test"]

splitSearchPath :: String -> [FilePath] #

Take a string, split it on the searchPathSeparator character. Blank items are ignored on Windows, and converted to . on Posix. On Windows path elements are stripped of quotes.

Follows the recommendations in http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

Posix:   splitSearchPath "File1:File2:File3"  == ["File1","File2","File3"]
Posix:   splitSearchPath "File1::File2:File3" == ["File1",".","File2","File3"]
Windows: splitSearchPath "File1;File2;File3"  == ["File1","File2","File3"]
Windows: splitSearchPath "File1;;File2;File3" == ["File1","File2","File3"]
Windows: splitSearchPath "File1;\"File2\";File3" == ["File1","File2","File3"]

takeBaseName :: FilePath -> String #

Get the base name, without an extension or path.

takeBaseName "/directory/file.ext" == "file"
takeBaseName "file/test.txt" == "test"
takeBaseName "dave.ext" == "dave"
takeBaseName "" == ""
takeBaseName "test" == "test"
takeBaseName (addTrailingPathSeparator x) == ""
takeBaseName "file/file.tar.gz" == "file.tar"

takeDirectory :: FilePath -> FilePath #

Get the directory name, move up one level.

          takeDirectory "/directory/other.ext" == "/directory"
          takeDirectory x `isPrefixOf` x || takeDirectory x == "."
          takeDirectory "foo" == "."
          takeDirectory "/" == "/"
          takeDirectory "/foo" == "/"
          takeDirectory "/foo/bar/baz" == "/foo/bar"
          takeDirectory "/foo/bar/baz/" == "/foo/bar/baz"
          takeDirectory "foo/bar/baz" == "foo/bar"
Windows:  takeDirectory "foo\\bar" == "foo"
Windows:  takeDirectory "foo\\bar\\\\" == "foo\\bar"
Windows:  takeDirectory "C:\\" == "C:\\"

takeDrive :: FilePath -> FilePath #

Get the drive from a filepath.

takeDrive x == fst (splitDrive x)

takeExtension :: FilePath -> String #

Get the extension of a file, returns "" for no extension, .ext otherwise.

takeExtension "/directory/path.ext" == ".ext"
takeExtension x == snd (splitExtension x)
Valid x => takeExtension (addExtension x "ext") == ".ext"
Valid x => takeExtension (replaceExtension x "ext") == ".ext"

takeExtensions :: FilePath -> String #

Get all extensions.

takeExtensions "/directory/path.ext" == ".ext"
takeExtensions "file.tar.gz" == ".tar.gz"

takeFileName :: FilePath -> FilePath #

Get the file name.

takeFileName "/directory/file.ext" == "file.ext"
takeFileName "test/" == ""
takeFileName x `isSuffixOf` x
takeFileName x == snd (splitFileName x)
Valid x => takeFileName (replaceFileName x "fred") == "fred"
Valid x => takeFileName (x </> "fred") == "fred"
Valid x => isRelative (takeFileName x)

module System.Directory

data XdgDirectory :: * #

Special directories for storing user-specific application data, configuration, and cache files, as specified by the XDG Base Directory Specification.

Note: On Windows, XdgData and XdgConfig map to the same directory.

Since: 1.2.3.0

Constructors

XdgData

For data files (e.g. images). Defaults to ~/.local/share and can be overridden by the XDG_DATA_HOME environment variable. On Windows, it is %APPDATA% (e.g. C:/Users/<user>/AppData/Roaming). Can be considered as the user-specific equivalent of /usr/share.

XdgConfig

For configuration files. Defaults to ~/.config and can be overridden by the XDG_CONFIG_HOME environment variable. On Windows, it is %APPDATA% (e.g. C:/Users/<user>/AppData/Roaming). Can be considered as the user-specific equivalent of /etc.

XdgCache

For non-essential files (e.g. cache). Defaults to ~/.cache and can be overridden by the XDG_CACHE_HOME environment variable. On Windows, it is %LOCALAPPDATA% (e.g. C:/Users/<user>/AppData/Local). Can be considered as the user-specific equivalent of /var/cache.

canonicalizePath :: FilePath -> IO FilePath #

Make a path absolute and remove as many indirections from it as possible. Indirections include the two special directories . and .., as well as any Unix symbolic links. The input path does not have to point to an existing file or directory.

Note: if you only need an absolute path, use makeAbsolute instead. Most programs should not worry about whether a path contains symbolic links.

Since symbolic links and the special parent directory (..) are dependent on the state of the existing filesystem, the function can only make a conservative attempt by removing symbolic links and .. from the longest prefix of the path that still points to an existing file or directory. If the input path points to an existing file or directory, then the output path shall also point to the same file or directory, provided that the relevant parts of the filesystem have not changed in the meantime (the function is not atomic).

Despite the name, the function does not guarantee canonicity of the returned path due to the presence of hard links, mount points, etc.

Similar to normalise, passing an empty path is equivalent to passing the current directory. The function preserves the presence or absence of the trailing path separator unless the path refers to the root directory /.

Known bug(s): on Windows, the function does not resolve symbolic links.

Changes since 1.2.3.0: The function has been altered to be more robust and has the same exception behavior as makeAbsolute.

copyFile #

Arguments

:: FilePath

Source filename

-> FilePath

Destination filename

-> IO () 

Copy a file with its permissions. If the destination file already exists, it is replaced atomically. Neither path may refer to an existing directory. No exceptions are thrown if the permissions could not be copied.

copyFileWithMetadata #

Arguments

:: FilePath

Source file

-> FilePath

Destination file

-> IO () 

Copy a file with its associated metadata. If the destination file already exists, it is overwritten. There is no guarantee of atomicity in the replacement of the destination file. Neither path may refer to an existing directory. If the source and/or destination are symbolic links, the copy is performed on the targets of the links.

On Windows, it behaves like the Win32 function CopyFile, which copies various kinds of metadata including file attributes and security resource properties.

On Unix-like systems, permissions, access time, and modification time are preserved. If possible, the owner and group are also preserved. Note that the very act of copying can change the access time of the source file, hence the access times of the two files may differ after the operation completes.

Since: 1.2.6.0

createDirectory :: FilePath -> IO () #

createDirectory dir creates a new directory dir which is initially empty, or as near to empty as the operating system allows.

The operation may fail with:

  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES]
  • isAlreadyExistsError / AlreadyExists The operand refers to a directory that already exists. [EEXIST]
  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • NoSuchThing There is no path to the directory. [ENOENT, ENOTDIR]
  • ResourceExhausted Insufficient resources (virtual memory, process file descriptors, physical disk space, etc.) are available to perform the operation. [EDQUOT, ENOSPC, ENOMEM, EMLINK]
  • InappropriateType The path refers to an existing non-directory object. [EEXIST]

createDirectoryIfMissing #

Arguments

:: Bool

Create its parents too?

-> FilePath

The path to the directory you want to make

-> IO () 

createDirectoryIfMissing parents dir creates a new directory dir if it doesn't exist. If the first argument is True the function will also create all parent directories if they are missing.

doesDirectoryExist :: FilePath -> IO Bool #

The operation doesDirectoryExist returns True if the argument file exists and is either a directory or a symbolic link to a directory, and False otherwise.

doesFileExist :: FilePath -> IO Bool #

The operation doesFileExist returns True if the argument file exists and is not a directory, and False otherwise.

findExecutable :: String -> IO (Maybe FilePath) #

Given an executable file name, searches for such file in the directories listed in system PATH. The returned value is the path to the found executable or Nothing if an executable with the given name was not found. For example (findExecutable "ghc") gives you the path to GHC.

The path returned by findExecutable corresponds to the program that would be executed by createProcess when passed the same string (as a RawCommand, not a ShellCommand).

On Windows, findExecutable calls the Win32 function SearchPath, which may search other places before checking the directories in PATH. Where it actually searches depends on registry settings, but notably includes the directory containing the current executable. See http://msdn.microsoft.com/en-us/library/aa365527.aspx for more details.

findExecutables :: String -> IO [FilePath] #

Given a file name, searches for the file and returns a list of all occurences that are executable.

On Windows, this only returns the first ocurrence, if any. It uses the SearchPath from the Win32 API, so the caveats noted in findExecutable apply here as well.

Since: 1.2.2.0

findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath] #

Given a file name, searches for the file on the given paths and returns a list of all occurences that are executable.

Since: 1.2.4.0

findFile :: [FilePath] -> String -> IO (Maybe FilePath) #

Search through the given set of directories for the given file.

findFileWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO (Maybe FilePath) #

Search through the given set of directories for the given file and with the given property (usually permissions) and returns the file path where the given file exists and has the property.

Since: 1.2.6.0

findFiles :: [FilePath] -> String -> IO [FilePath] #

Search through the given set of directories for the given file and returns a list of paths where the given file exists.

Since: 1.2.1.0

findFilesWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath] #

Search through the given set of directories for the given file and with the given property (usually permissions) and returns a list of paths where the given file exists and has the property.

Since: 1.2.1.0

getAccessTime :: FilePath -> IO UTCTime #

Obtain the time at which the file or directory was last accessed.

The operation may fail with:

Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against unix-2.6.0.0 or later and the underlying filesystem supports them.

Since: 1.2.3.0

getAppUserDataDirectory #

Arguments

:: FilePath

a relative path that is appended to the path

-> IO FilePath 

Obtain the path to a special directory for storing user-specific application data (traditional Unix location). Newer applications may prefer the the XDG-conformant location provided by getXdgDirectory (migration guide).

The argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters.

  • On Unix-like systems, the path is ~/.<app>.
  • On Windows, the path is %APPDATA%/<app> (e.g. C:/Users/<user>/AppData/Roaming/<app>)

Note: the directory may not actually exist, in which case you would need to create it. It is expected that the parent directory exists and is writable.

The operation may fail with:

  • UnsupportedOperation The operating system has no notion of application-specific data directory.
  • isDoesNotExistError The home directory for the current user does not exist, or cannot be found.

getCurrentDirectory :: IO FilePath #

Obtain the current working directory as an absolute path.

In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: makeAbsolute).

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • isDoesNotExistError or NoSuchThing There is no path referring to the working directory. [EPERM, ENOENT, ESTALE...]
  • isPermissionError or PermissionDenied The process has insufficient privileges to perform the operation. [EACCES]
  • ResourceExhausted Insufficient resources are available to perform the operation.
  • UnsupportedOperation The operating system has no notion of current working directory.

getDirectoryContents :: FilePath -> IO [FilePath] #

Similar to listDirectory, but always includes the special entries (. and ..). (This applies to Windows as well.)

The operation may fail with the same exceptions as listDirectory.

getHomeDirectory :: IO FilePath #

Returns the current user's home directory.

The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use getXdgDirectory or getAppUserDataDirectory instead.

On Unix, getHomeDirectory returns the value of the HOME environment variable. On Windows, the system is queried for a suitable path; a typical path might be C:/Users/<user>.

The operation may fail with:

  • UnsupportedOperation The operating system has no notion of home directory.
  • isDoesNotExistError The home directory for the current user does not exist, or cannot be found.

getModificationTime :: FilePath -> IO UTCTime #

Obtain the time at which the file or directory was last modified.

The operation may fail with:

Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against unix-2.6.0.0 or later and the underlying filesystem supports them.

getPermissions :: FilePath -> IO Permissions #

The getPermissions operation returns the permissions for the file or directory.

The operation may fail with:

getTemporaryDirectory :: IO FilePath #

Returns the current directory for temporary files.

On Unix, getTemporaryDirectory returns the value of the TMPDIR environment variable or "/tmp" if the variable isn't defined. On Windows, the function checks for the existence of environment variables in the following order and uses the first path found:

  • TMP environment variable.
  • TEMP environment variable.
  • USERPROFILE environment variable.
  • The Windows directory

The operation may fail with:

  • UnsupportedOperation The operating system has no notion of temporary directory.

The function doesn't verify whether the path exists.

getUserDocumentsDirectory :: IO FilePath #

Returns the current user's document directory.

The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use getXdgDirectory or getAppUserDataDirectory instead.

On Unix, getUserDocumentsDirectory returns the value of the HOME environment variable. On Windows, the system is queried for a suitable path; a typical path might be C:/Users/<user>/Documents.

The operation may fail with:

  • UnsupportedOperation The operating system has no notion of document directory.
  • isDoesNotExistError The document directory for the current user does not exist, or cannot be found.

getXdgDirectory #

Arguments

:: XdgDirectory

which special directory

-> FilePath

a relative path that is appended to the path; if empty, the base path is returned

-> IO FilePath 

Obtain the paths to special directories for storing user-specific application data, configuration, and cache files, conforming to the XDG Base Directory Specification. Compared with getAppUserDataDirectory, this function provides a more fine-grained hierarchy as well as greater flexibility for the user.

It also works on Windows, although in that case XdgData and XdgConfig will map to the same directory.

The second argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters.

Note: The directory may not actually exist, in which case you would need to create it with file mode 700 (i.e. only accessible by the owner).

Since: 1.2.3.0

isSymbolicLink :: FilePath -> IO Bool #

Check whether the path refers to a symbolic link. On Windows, this tests for FILE_ATTRIBUTE_REPARSE_POINT.

Since: 1.2.6.0

listDirectory :: FilePath -> IO [FilePath] #

listDirectory dir returns a list of all entries in dir without the special entries (. and ..).

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The directory does not exist. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EACCES]
  • ResourceExhausted Insufficient resources are available to perform the operation. [EMFILE, ENFILE]
  • InappropriateType The path refers to an existing non-directory object. [ENOTDIR]

Since: 1.2.5.0

makeAbsolute :: FilePath -> IO FilePath #

Convert a path into an absolute path. If the given path is relative, the current directory is prepended and then the combined result is normalised. If the path is already absolute, the path is simply normalised. The function preserves the presence or absence of the trailing path separator unless the path refers to the root directory /.

If the path is already absolute, the operation never fails. Otherwise, the operation may fail with the same exceptions as getCurrentDirectory.

Since: 1.2.2.0

makeRelativeToCurrentDirectory :: FilePath -> IO FilePath #

Construct a path relative to the current directory, similar to makeRelative.

The operation may fail with the same exceptions as getCurrentDirectory.

removeDirectory :: FilePath -> IO () #

removeDirectory dir removes an existing directory dir. The implementation may specify additional constraints which must be satisfied before a directory can be removed (e.g. the directory has to be empty, or may not be in use by other processes). It is not legal for an implementation to partially remove a directory unless the entire directory is removed. A conformant implementation need not support directory removal in all situations (e.g. removal of the root directory).

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The directory does not exist. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]
  • UnsatisfiedConstraints Implementation-dependent constraints are not satisfied. [EBUSY, ENOTEMPTY, EEXIST]
  • UnsupportedOperation The implementation does not support removal in this situation. [EINVAL]
  • InappropriateType The operand refers to an existing non-directory object. [ENOTDIR]

removeDirectoryRecursive :: FilePath -> IO () #

removeDirectoryRecursive dir removes an existing directory dir together with its contents and subdirectories. Within this directory, symbolic links are removed without affecting their targets.

On Windows, the operation fails if dir is a directory symbolic link.

removeFile :: FilePath -> IO () #

removeFile file removes the directory entry for an existing file file, where file is not itself a directory. The implementation may specify additional constraints which must be satisfied before a file can be removed (e.g. the file may not be in use by other processes).

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid file name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The file does not exist. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]
  • UnsatisfiedConstraints Implementation-dependent constraints are not satisfied. [EBUSY]
  • InappropriateType The operand refers to an existing directory. [EPERM, EINVAL]

renameDirectory :: FilePath -> FilePath -> IO () #

renameDirectory old new changes the name of an existing directory from old to new. If the new directory already exists, it is atomically replaced by the old directory. If the new directory is neither the old directory nor an alias of the old directory, it is removed as if by removeDirectory. A conformant implementation need not support renaming directories in all situations (e.g. renaming to an existing directory, or across different physical devices), but the constraints must be documented.

On Win32 platforms, renameDirectory fails if the new directory already exists.

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument Either operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The original directory does not exist, or there is no path to the target. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]
  • ResourceExhausted Insufficient resources are available to perform the operation. [EDQUOT, ENOSPC, ENOMEM, EMLINK]
  • UnsatisfiedConstraints Implementation-dependent constraints are not satisfied. [EBUSY, ENOTEMPTY, EEXIST]
  • UnsupportedOperation The implementation does not support renaming in this situation. [EINVAL, EXDEV]
  • InappropriateType Either path refers to an existing non-directory object. [ENOTDIR, EISDIR]

renameFile :: FilePath -> FilePath -> IO () #

renameFile old new changes the name of an existing file system object from old to new. If the new object already exists, it is atomically replaced by the old object. Neither path may refer to an existing directory. A conformant implementation need not support renaming files in all situations (e.g. renaming across different physical devices), but the constraints must be documented.

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument Either operand is not a valid file name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError / NoSuchThing The original file does not exist, or there is no path to the target. [ENOENT, ENOTDIR]
  • isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]
  • ResourceExhausted Insufficient resources are available to perform the operation. [EDQUOT, ENOSPC, ENOMEM, EMLINK]
  • UnsatisfiedConstraints Implementation-dependent constraints are not satisfied. [EBUSY]
  • UnsupportedOperation The implementation does not support renaming in this situation. [EXDEV]
  • InappropriateType Either path refers to an existing directory. [ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]

setAccessTime :: FilePath -> UTCTime -> IO () #

Change the time at which the file or directory was last accessed.

The operation may fail with:

Some caveats for POSIX systems:

  • Not all systems support utimensat, in which case the function can only emulate the behavior by reading the modification time and then setting both the access and modification times together. On systems where utimensat is supported, the access time is set atomically with nanosecond precision.
  • If compiled against a version of unix prior to 2.7.0.0, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the modification time.

Since: 1.2.3.0

setCurrentDirectory :: FilePath -> IO () #

Change the working directory to the given path.

In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: makeAbsolute).

The operation may fail with:

  • HardwareFault A physical I/O error has occurred. [EIO]
  • InvalidArgument The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]
  • isDoesNotExistError or NoSuchThing The directory does not exist. [ENOENT, ENOTDIR]
  • isPermissionError or PermissionDenied The process has insufficient privileges to perform the operation. [EACCES]
  • UnsupportedOperation The operating system has no notion of current working directory, or the working directory cannot be dynamically changed.
  • InappropriateType The path refers to an existing non-directory object. [ENOTDIR]

setModificationTime :: FilePath -> UTCTime -> IO () #

Change the time at which the file or directory was last modified.

The operation may fail with:

Some caveats for POSIX systems:

  • Not all systems support utimensat, in which case the function can only emulate the behavior by reading the access time and then setting both the access and modification times together. On systems where utimensat is supported, the modification time is set atomically with nanosecond precision.
  • If compiled against a version of unix prior to 2.7.0.0, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the access time.

Since: 1.2.3.0

setPermissions :: FilePath -> Permissions -> IO () #

The setPermissions operation sets the permissions for the file or directory.

The operation may fail with:

withCurrentDirectory #

Arguments

:: FilePath

Directory to execute in

-> IO a

Action to be executed

-> IO a 

Run an IO action with the given working directory and restore the original working directory afterwards, even if the given action fails due to an exception.

The operation may fail with the same exceptions as getCurrentDirectory and setCurrentDirectory.

Since: 1.2.3.0

exeExtension :: String #

Filename extension for executable files (including the dot if any) (usually "" on POSIX systems and ".exe" on Windows or OS/2).

Since: 1.2.4.0

Type Forcers

Container Types With Unified Interfaces

class Foldable t where #

Data structures that can be folded.

For example, given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Foldable Tree where
   foldMap f Empty = mempty
   foldMap f (Leaf x) = f x
   foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define foldr:

instance Foldable Tree where
   foldr f z Empty = z
   foldr f z (Leaf x) = f x z
   foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

Foldable instances are expected to satisfy the following laws:

foldr f z t = appEndo (foldMap (Endo . f) t ) z
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
fold = foldMap id

sum, product, maximum, and minimum should all be essentially equivalent to foldMap forms, such as

sum = getSum . foldMap Sum

but may be less defined.

If the type is also a Functor instance, it should satisfy

foldMap f = fold . fmap f

which implies that

foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

foldMap | foldr

Methods

fold :: Monoid m => t m -> m #

Combine the elements of a structure using a monoid.

foldMap :: Monoid m => (a -> m) -> t a -> m #

Map each element of the structure to a monoid, and combine the results.

foldr :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure.

In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, foldr can produce a terminating expression from an infinite list.

For a general Foldable structure this should be semantically identical to,

foldr f z = foldr f z . toList

foldr' :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure, but with strict application of the operator.

foldl :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure.

In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.

Also note that if you want an efficient left-fold, you probably want to use foldl' instead of foldl. The reason for this is that latter does not force the "inner" results (e.g. z f x1 in the above example) before applying them to the operator (e.g. to (f x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl f z . toList

foldl' :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure but with strict application of the operator.

This ensures that each step of the fold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite list to a single, monolithic result (e.g. length).

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl' f z . toList

foldr1 :: (a -> a -> a) -> t a -> a #

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.

foldr1 f = foldr1 f . toList

foldl1 :: (a -> a -> a) -> t a -> a #

A variant of foldl that has no base case, and thus may only be applied to non-empty structures.

foldl1 f = foldl1 f . toList

toList :: t a -> [a] #

List of elements of a structure, from left to right.

null :: t a -> Bool #

Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

length :: t a -> Int #

Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

elem :: Eq a => a -> t a -> Bool infix 4 #

Does the element occur in the structure?

maximum :: Ord a => t a -> a #

The largest element of a non-empty structure.

minimum :: Ord a => t a -> a #

The least element of a non-empty structure.

sum :: Num a => t a -> a #

The sum function computes the sum of the numbers of a structure.

product :: Num a => t a -> a #

The product function computes the product of the numbers of a structure.

Instances

Foldable [] 

Methods

fold :: Monoid m => [m] -> m #

foldMap :: Monoid m => (a -> m) -> [a] -> m #

foldr :: (a -> b -> b) -> b -> [a] -> b #

foldr' :: (a -> b -> b) -> b -> [a] -> b #

foldl :: (b -> a -> b) -> b -> [a] -> b #

foldl' :: (b -> a -> b) -> b -> [a] -> b #

foldr1 :: (a -> a -> a) -> [a] -> a #

foldl1 :: (a -> a -> a) -> [a] -> a #

toList :: [a] -> [a] #

null :: [a] -> Bool #

length :: [a] -> Int #

elem :: Eq a => a -> [a] -> Bool #

maximum :: Ord a => [a] -> a #

minimum :: Ord a => [a] -> a #

sum :: Num a => [a] -> a #

product :: Num a => [a] -> a #

Foldable Maybe 

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Foldable V1 

Methods

fold :: Monoid m => V1 m -> m #

foldMap :: Monoid m => (a -> m) -> V1 a -> m #

foldr :: (a -> b -> b) -> b -> V1 a -> b #

foldr' :: (a -> b -> b) -> b -> V1 a -> b #

foldl :: (b -> a -> b) -> b -> V1 a -> b #

foldl' :: (b -> a -> b) -> b -> V1 a -> b #

foldr1 :: (a -> a -> a) -> V1 a -> a #

foldl1 :: (a -> a -> a) -> V1 a -> a #

toList :: V1 a -> [a] #

null :: V1 a -> Bool #

length :: V1 a -> Int #

elem :: Eq a => a -> V1 a -> Bool #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

sum :: Num a => V1 a -> a #

product :: Num a => V1 a -> a #

Foldable U1 

Methods

fold :: Monoid m => U1 m -> m #

foldMap :: Monoid m => (a -> m) -> U1 a -> m #

foldr :: (a -> b -> b) -> b -> U1 a -> b #

foldr' :: (a -> b -> b) -> b -> U1 a -> b #

foldl :: (b -> a -> b) -> b -> U1 a -> b #

foldl' :: (b -> a -> b) -> b -> U1 a -> b #

foldr1 :: (a -> a -> a) -> U1 a -> a #

foldl1 :: (a -> a -> a) -> U1 a -> a #

toList :: U1 a -> [a] #

null :: U1 a -> Bool #

length :: U1 a -> Int #

elem :: Eq a => a -> U1 a -> Bool #

maximum :: Ord a => U1 a -> a #

minimum :: Ord a => U1 a -> a #

sum :: Num a => U1 a -> a #

product :: Num a => U1 a -> a #

Foldable Par1 

Methods

fold :: Monoid m => Par1 m -> m #

foldMap :: Monoid m => (a -> m) -> Par1 a -> m #

foldr :: (a -> b -> b) -> b -> Par1 a -> b #

foldr' :: (a -> b -> b) -> b -> Par1 a -> b #

foldl :: (b -> a -> b) -> b -> Par1 a -> b #

foldl' :: (b -> a -> b) -> b -> Par1 a -> b #

foldr1 :: (a -> a -> a) -> Par1 a -> a #

foldl1 :: (a -> a -> a) -> Par1 a -> a #

toList :: Par1 a -> [a] #

null :: Par1 a -> Bool #

length :: Par1 a -> Int #

elem :: Eq a => a -> Par1 a -> Bool #

maximum :: Ord a => Par1 a -> a #

minimum :: Ord a => Par1 a -> a #

sum :: Num a => Par1 a -> a #

product :: Num a => Par1 a -> a #

Foldable IResult 

Methods

fold :: Monoid m => IResult m -> m #

foldMap :: Monoid m => (a -> m) -> IResult a -> m #

foldr :: (a -> b -> b) -> b -> IResult a -> b #

foldr' :: (a -> b -> b) -> b -> IResult a -> b #

foldl :: (b -> a -> b) -> b -> IResult a -> b #

foldl' :: (b -> a -> b) -> b -> IResult a -> b #

foldr1 :: (a -> a -> a) -> IResult a -> a #

foldl1 :: (a -> a -> a) -> IResult a -> a #

toList :: IResult a -> [a] #

null :: IResult a -> Bool #

length :: IResult a -> Int #

elem :: Eq a => a -> IResult a -> Bool #

maximum :: Ord a => IResult a -> a #

minimum :: Ord a => IResult a -> a #

sum :: Num a => IResult a -> a #

product :: Num a => IResult a -> a #

Foldable Result 

Methods

fold :: Monoid m => Result m -> m #

foldMap :: Monoid m => (a -> m) -> Result a -> m #

foldr :: (a -> b -> b) -> b -> Result a -> b #

foldr' :: (a -> b -> b) -> b -> Result a -> b #

foldl :: (b -> a -> b) -> b -> Result a -> b #

foldl' :: (b -> a -> b) -> b -> Result a -> b #

foldr1 :: (a -> a -> a) -> Result a -> a #

foldl1 :: (a -> a -> a) -> Result a -> a #

toList :: Result a -> [a] #

null :: Result a -> Bool #

length :: Result a -> Int #

elem :: Eq a => a -> Result a -> Bool #

maximum :: Ord a => Result a -> a #

minimum :: Ord a => Result a -> a #

sum :: Num a => Result a -> a #

product :: Num a => Result a -> a #

Foldable Identity 

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Foldable Min 

Methods

fold :: Monoid m => Min m -> m #

foldMap :: Monoid m => (a -> m) -> Min a -> m #

foldr :: (a -> b -> b) -> b -> Min a -> b #

foldr' :: (a -> b -> b) -> b -> Min a -> b #

foldl :: (b -> a -> b) -> b -> Min a -> b #

foldl' :: (b -> a -> b) -> b -> Min a -> b #

foldr1 :: (a -> a -> a) -> Min a -> a #

foldl1 :: (a -> a -> a) -> Min a -> a #

toList :: Min a -> [a] #

null :: Min a -> Bool #

length :: Min a -> Int #

elem :: Eq a => a -> Min a -> Bool #

maximum :: Ord a => Min a -> a #

minimum :: Ord a => Min a -> a #

sum :: Num a => Min a -> a #

product :: Num a => Min a -> a #

Foldable Max 

Methods

fold :: Monoid m => Max m -> m #

foldMap :: Monoid m => (a -> m) -> Max a -> m #

foldr :: (a -> b -> b) -> b -> Max a -> b #

foldr' :: (a -> b -> b) -> b -> Max a -> b #

foldl :: (b -> a -> b) -> b -> Max a -> b #

foldl' :: (b -> a -> b) -> b -> Max a -> b #

foldr1 :: (a -> a -> a) -> Max a -> a #

foldl1 :: (a -> a -> a) -> Max a -> a #

toList :: Max a -> [a] #

null :: Max a -> Bool #

length :: Max a -> Int #

elem :: Eq a => a -> Max a -> Bool #

maximum :: Ord a => Max a -> a #

minimum :: Ord a => Max a -> a #

sum :: Num a => Max a -> a #

product :: Num a => Max a -> a #

Foldable First 

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Foldable Last 

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Foldable Option 

Methods

fold :: Monoid m => Option m -> m #

foldMap :: Monoid m => (a -> m) -> Option a -> m #

foldr :: (a -> b -> b) -> b -> Option a -> b #

foldr' :: (a -> b -> b) -> b -> Option a -> b #

foldl :: (b -> a -> b) -> b -> Option a -> b #

foldl' :: (b -> a -> b) -> b -> Option a -> b #

foldr1 :: (a -> a -> a) -> Option a -> a #

foldl1 :: (a -> a -> a) -> Option a -> a #

toList :: Option a -> [a] #

null :: Option a -> Bool #

length :: Option a -> Int #

elem :: Eq a => a -> Option a -> Bool #

maximum :: Ord a => Option a -> a #

minimum :: Ord a => Option a -> a #

sum :: Num a => Option a -> a #

product :: Num a => Option a -> a #

Foldable NonEmpty 

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Foldable Complex 

Methods

fold :: Monoid m => Complex m -> m #

foldMap :: Monoid m => (a -> m) -> Complex a -> m #

foldr :: (a -> b -> b) -> b -> Complex a -> b #

foldr' :: (a -> b -> b) -> b -> Complex a -> b #

foldl :: (b -> a -> b) -> b -> Complex a -> b #

foldl' :: (b -> a -> b) -> b -> Complex a -> b #

foldr1 :: (a -> a -> a) -> Complex a -> a #

foldl1 :: (a -> a -> a) -> Complex a -> a #

toList :: Complex a -> [a] #

null :: Complex a -> Bool #

length :: Complex a -> Int #

elem :: Eq a => a -> Complex a -> Bool #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

sum :: Num a => Complex a -> a #

product :: Num a => Complex a -> a #

Foldable ZipList 

Methods

fold :: Monoid m => ZipList m -> m #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m #

foldr :: (a -> b -> b) -> b -> ZipList a -> b #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b #

foldl :: (b -> a -> b) -> b -> ZipList a -> b #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b #

foldr1 :: (a -> a -> a) -> ZipList a -> a #

foldl1 :: (a -> a -> a) -> ZipList a -> a #

toList :: ZipList a -> [a] #

null :: ZipList a -> Bool #

length :: ZipList a -> Int #

elem :: Eq a => a -> ZipList a -> Bool #

maximum :: Ord a => ZipList a -> a #

minimum :: Ord a => ZipList a -> a #

sum :: Num a => ZipList a -> a #

product :: Num a => ZipList a -> a #

Foldable Dual 

Methods

fold :: Monoid m => Dual m -> m #

foldMap :: Monoid m => (a -> m) -> Dual a -> m #

foldr :: (a -> b -> b) -> b -> Dual a -> b #

foldr' :: (a -> b -> b) -> b -> Dual a -> b #

foldl :: (b -> a -> b) -> b -> Dual a -> b #

foldl' :: (b -> a -> b) -> b -> Dual a -> b #

foldr1 :: (a -> a -> a) -> Dual a -> a #

foldl1 :: (a -> a -> a) -> Dual a -> a #

toList :: Dual a -> [a] #

null :: Dual a -> Bool #

length :: Dual a -> Int #

elem :: Eq a => a -> Dual a -> Bool #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

sum :: Num a => Dual a -> a #

product :: Num a => Dual a -> a #

Foldable Sum 

Methods

fold :: Monoid m => Sum m -> m #

foldMap :: Monoid m => (a -> m) -> Sum a -> m #

foldr :: (a -> b -> b) -> b -> Sum a -> b #

foldr' :: (a -> b -> b) -> b -> Sum a -> b #

foldl :: (b -> a -> b) -> b -> Sum a -> b #

foldl' :: (b -> a -> b) -> b -> Sum a -> b #

foldr1 :: (a -> a -> a) -> Sum a -> a #

foldl1 :: (a -> a -> a) -> Sum a -> a #

toList :: Sum a -> [a] #

null :: Sum a -> Bool #

length :: Sum a -> Int #

elem :: Eq a => a -> Sum a -> Bool #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

sum :: Num a => Sum a -> a #

product :: Num a => Sum a -> a #

Foldable Product 

Methods

fold :: Monoid m => Product m -> m #

foldMap :: Monoid m => (a -> m) -> Product a -> m #

foldr :: (a -> b -> b) -> b -> Product a -> b #

foldr' :: (a -> b -> b) -> b -> Product a -> b #

foldl :: (b -> a -> b) -> b -> Product a -> b #

foldl' :: (b -> a -> b) -> b -> Product a -> b #

foldr1 :: (a -> a -> a) -> Product a -> a #

foldl1 :: (a -> a -> a) -> Product a -> a #

toList :: Product a -> [a] #

null :: Product a -> Bool #

length :: Product a -> Int #

elem :: Eq a => a -> Product a -> Bool #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

sum :: Num a => Product a -> a #

product :: Num a => Product a -> a #

Foldable First 

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Foldable Last 

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Foldable Identifier 

Methods

fold :: Monoid m => Identifier m -> m #

foldMap :: Monoid m => (a -> m) -> Identifier a -> m #

foldr :: (a -> b -> b) -> b -> Identifier a -> b #

foldr' :: (a -> b -> b) -> b -> Identifier a -> b #

foldl :: (b -> a -> b) -> b -> Identifier a -> b #

foldl' :: (b -> a -> b) -> b -> Identifier a -> b #

foldr1 :: (a -> a -> a) -> Identifier a -> a #

foldl1 :: (a -> a -> a) -> Identifier a -> a #

toList :: Identifier a -> [a] #

null :: Identifier a -> Bool #

length :: Identifier a -> Int #

elem :: Eq a => a -> Identifier a -> Bool #

maximum :: Ord a => Identifier a -> a #

minimum :: Ord a => Identifier a -> a #

sum :: Num a => Identifier a -> a #

product :: Num a => Identifier a -> a #

Foldable Digit 

Methods

fold :: Monoid m => Digit m -> m #

foldMap :: Monoid m => (a -> m) -> Digit a -> m #

foldr :: (a -> b -> b) -> b -> Digit a -> b #

foldr' :: (a -> b -> b) -> b -> Digit a -> b #

foldl :: (b -> a -> b) -> b -> Digit a -> b #

foldl' :: (b -> a -> b) -> b -> Digit a -> b #

foldr1 :: (a -> a -> a) -> Digit a -> a #

foldl1 :: (a -> a -> a) -> Digit a -> a #

toList :: Digit a -> [a] #

null :: Digit a -> Bool #

length :: Digit a -> Int #

elem :: Eq a => a -> Digit a -> Bool #

maximum :: Ord a => Digit a -> a #

minimum :: Ord a => Digit a -> a #

sum :: Num a => Digit a -> a #

product :: Num a => Digit a -> a #

Foldable Node 

Methods

fold :: Monoid m => Node m -> m #

foldMap :: Monoid m => (a -> m) -> Node a -> m #

foldr :: (a -> b -> b) -> b -> Node a -> b #

foldr' :: (a -> b -> b) -> b -> Node a -> b #

foldl :: (b -> a -> b) -> b -> Node a -> b #

foldl' :: (b -> a -> b) -> b -> Node a -> b #

foldr1 :: (a -> a -> a) -> Node a -> a #

foldl1 :: (a -> a -> a) -> Node a -> a #

toList :: Node a -> [a] #

null :: Node a -> Bool #

length :: Node a -> Int #

elem :: Eq a => a -> Node a -> Bool #

maximum :: Ord a => Node a -> a #

minimum :: Ord a => Node a -> a #

sum :: Num a => Node a -> a #

product :: Num a => Node a -> a #

Foldable Elem 

Methods

fold :: Monoid m => Elem m -> m #

foldMap :: Monoid m => (a -> m) -> Elem a -> m #

foldr :: (a -> b -> b) -> b -> Elem a -> b #

foldr' :: (a -> b -> b) -> b -> Elem a -> b #

foldl :: (b -> a -> b) -> b -> Elem a -> b #

foldl' :: (b -> a -> b) -> b -> Elem a -> b #

foldr1 :: (a -> a -> a) -> Elem a -> a #

foldl1 :: (a -> a -> a) -> Elem a -> a #

toList :: Elem a -> [a] #

null :: Elem a -> Bool #

length :: Elem a -> Int #

elem :: Eq a => a -> Elem a -> Bool #

maximum :: Ord a => Elem a -> a #

minimum :: Ord a => Elem a -> a #

sum :: Num a => Elem a -> a #

product :: Num a => Elem a -> a #

Foldable FingerTree 

Methods

fold :: Monoid m => FingerTree m -> m #

foldMap :: Monoid m => (a -> m) -> FingerTree a -> m #

foldr :: (a -> b -> b) -> b -> FingerTree a -> b #

foldr' :: (a -> b -> b) -> b -> FingerTree a -> b #

foldl :: (b -> a -> b) -> b -> FingerTree a -> b #

foldl' :: (b -> a -> b) -> b -> FingerTree a -> b #

foldr1 :: (a -> a -> a) -> FingerTree a -> a #

foldl1 :: (a -> a -> a) -> FingerTree a -> a #

toList :: FingerTree a -> [a] #

null :: FingerTree a -> Bool #

length :: FingerTree a -> Int #

elem :: Eq a => a -> FingerTree a -> Bool #

maximum :: Ord a => FingerTree a -> a #

minimum :: Ord a => FingerTree a -> a #

sum :: Num a => FingerTree a -> a #

product :: Num a => FingerTree a -> a #

Foldable IntMap 

Methods

fold :: Monoid m => IntMap m -> m #

foldMap :: Monoid m => (a -> m) -> IntMap a -> m #

foldr :: (a -> b -> b) -> b -> IntMap a -> b #

foldr' :: (a -> b -> b) -> b -> IntMap a -> b #

foldl :: (b -> a -> b) -> b -> IntMap a -> b #

foldl' :: (b -> a -> b) -> b -> IntMap a -> b #

foldr1 :: (a -> a -> a) -> IntMap a -> a #

foldl1 :: (a -> a -> a) -> IntMap a -> a #

toList :: IntMap a -> [a] #

null :: IntMap a -> Bool #

length :: IntMap a -> Int #

elem :: Eq a => a -> IntMap a -> Bool #

maximum :: Ord a => IntMap a -> a #

minimum :: Ord a => IntMap a -> a #

sum :: Num a => IntMap a -> a #

product :: Num a => IntMap a -> a #

Foldable Tree 

Methods

fold :: Monoid m => Tree m -> m #

foldMap :: Monoid m => (a -> m) -> Tree a -> m #

foldr :: (a -> b -> b) -> b -> Tree a -> b #

foldr' :: (a -> b -> b) -> b -> Tree a -> b #

foldl :: (b -> a -> b) -> b -> Tree a -> b #

foldl' :: (b -> a -> b) -> b -> Tree a -> b #

foldr1 :: (a -> a -> a) -> Tree a -> a #

foldl1 :: (a -> a -> a) -> Tree a -> a #

toList :: Tree a -> [a] #

null :: Tree a -> Bool #

length :: Tree a -> Int #

elem :: Eq a => a -> Tree a -> Bool #

maximum :: Ord a => Tree a -> a #

minimum :: Ord a => Tree a -> a #

sum :: Num a => Tree a -> a #

product :: Num a => Tree a -> a #

Foldable Seq 

Methods

fold :: Monoid m => Seq m -> m #

foldMap :: Monoid m => (a -> m) -> Seq a -> m #

foldr :: (a -> b -> b) -> b -> Seq a -> b #

foldr' :: (a -> b -> b) -> b -> Seq a -> b #

foldl :: (b -> a -> b) -> b -> Seq a -> b #

foldl' :: (b -> a -> b) -> b -> Seq a -> b #

foldr1 :: (a -> a -> a) -> Seq a -> a #

foldl1 :: (a -> a -> a) -> Seq a -> a #

toList :: Seq a -> [a] #

null :: Seq a -> Bool #

length :: Seq a -> Int #

elem :: Eq a => a -> Seq a -> Bool #

maximum :: Ord a => Seq a -> a #

minimum :: Ord a => Seq a -> a #

sum :: Num a => Seq a -> a #

product :: Num a => Seq a -> a #

Foldable ViewL 

Methods

fold :: Monoid m => ViewL m -> m #

foldMap :: Monoid m => (a -> m) -> ViewL a -> m #

foldr :: (a -> b -> b) -> b -> ViewL a -> b #

foldr' :: (a -> b -> b) -> b -> ViewL a -> b #

foldl :: (b -> a -> b) -> b -> ViewL a -> b #

foldl' :: (b -> a -> b) -> b -> ViewL a -> b #

foldr1 :: (a -> a -> a) -> ViewL a -> a #

foldl1 :: (a -> a -> a) -> ViewL a -> a #

toList :: ViewL a -> [a] #

null :: ViewL a -> Bool #

length :: ViewL a -> Int #

elem :: Eq a => a -> ViewL a -> Bool #

maximum :: Ord a => ViewL a -> a #

minimum :: Ord a => ViewL a -> a #

sum :: Num a => ViewL a -> a #

product :: Num a => ViewL a -> a #

Foldable ViewR 

Methods

fold :: Monoid m => ViewR m -> m #

foldMap :: Monoid m => (a -> m) -> ViewR a -> m #

foldr :: (a -> b -> b) -> b -> ViewR a -> b #

foldr' :: (a -> b -> b) -> b -> ViewR a -> b #

foldl :: (b -> a -> b) -> b -> ViewR a -> b #

foldl' :: (b -> a -> b) -> b -> ViewR a -> b #

foldr1 :: (a -> a -> a) -> ViewR a -> a #

foldl1 :: (a -> a -> a) -> ViewR a -> a #

toList :: ViewR a -> [a] #

null :: ViewR a -> Bool #

length :: ViewR a -> Int #

elem :: Eq a => a -> ViewR a -> Bool #

maximum :: Ord a => ViewR a -> a #

minimum :: Ord a => ViewR a -> a #

sum :: Num a => ViewR a -> a #

product :: Num a => ViewR a -> a #

Foldable Set 

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Foldable DList 

Methods

fold :: Monoid m => DList m -> m #

foldMap :: Monoid m => (a -> m) -> DList a -> m #

foldr :: (a -> b -> b) -> b -> DList a -> b #

foldr' :: (a -> b -> b) -> b -> DList a -> b #

foldl :: (b -> a -> b) -> b -> DList a -> b #

foldl' :: (b -> a -> b) -> b -> DList a -> b #

foldr1 :: (a -> a -> a) -> DList a -> a #

foldl1 :: (a -> a -> a) -> DList a -> a #

toList :: DList a -> [a] #

null :: DList a -> Bool #

length :: DList a -> Int #

elem :: Eq a => a -> DList a -> Bool #

maximum :: Ord a => DList a -> a #

minimum :: Ord a => DList a -> a #

sum :: Num a => DList a -> a #

product :: Num a => DList a -> a #

Foldable Hashed 

Methods

fold :: Monoid m => Hashed m -> m #

foldMap :: Monoid m => (a -> m) -> Hashed a -> m #

foldr :: (a -> b -> b) -> b -> Hashed a -> b #

foldr' :: (a -> b -> b) -> b -> Hashed a -> b #

foldl :: (b -> a -> b) -> b -> Hashed a -> b #

foldl' :: (b -> a -> b) -> b -> Hashed a -> b #

foldr1 :: (a -> a -> a) -> Hashed a -> a #

foldl1 :: (a -> a -> a) -> Hashed a -> a #

toList :: Hashed a -> [a] #

null :: Hashed a -> Bool #

length :: Hashed a -> Int #

elem :: Eq a => a -> Hashed a -> Bool #

maximum :: Ord a => Hashed a -> a #

minimum :: Ord a => Hashed a -> a #

sum :: Num a => Hashed a -> a #

product :: Num a => Hashed a -> a #

Foldable Vector 

Methods

fold :: Monoid m => Vector m -> m #

foldMap :: Monoid m => (a -> m) -> Vector a -> m #

foldr :: (a -> b -> b) -> b -> Vector a -> b #

foldr' :: (a -> b -> b) -> b -> Vector a -> b #

foldl :: (b -> a -> b) -> b -> Vector a -> b #

foldl' :: (b -> a -> b) -> b -> Vector a -> b #

foldr1 :: (a -> a -> a) -> Vector a -> a #

foldl1 :: (a -> a -> a) -> Vector a -> a #

toList :: Vector a -> [a] #

null :: Vector a -> Bool #

length :: Vector a -> Int #

elem :: Eq a => a -> Vector a -> Bool #

maximum :: Ord a => Vector a -> a #

minimum :: Ord a => Vector a -> a #

sum :: Num a => Vector a -> a #

product :: Num a => Vector a -> a #

Foldable HashSet 

Methods

fold :: Monoid m => HashSet m -> m #

foldMap :: Monoid m => (a -> m) -> HashSet a -> m #

foldr :: (a -> b -> b) -> b -> HashSet a -> b #

foldr' :: (a -> b -> b) -> b -> HashSet a -> b #

foldl :: (b -> a -> b) -> b -> HashSet a -> b #

foldl' :: (b -> a -> b) -> b -> HashSet a -> b #

foldr1 :: (a -> a -> a) -> HashSet a -> a #

foldl1 :: (a -> a -> a) -> HashSet a -> a #

toList :: HashSet a -> [a] #

null :: HashSet a -> Bool #

length :: HashSet a -> Int #

elem :: Eq a => a -> HashSet a -> Bool #

maximum :: Ord a => HashSet a -> a #

minimum :: Ord a => HashSet a -> a #

sum :: Num a => HashSet a -> a #

product :: Num a => HashSet a -> a #

Foldable (Either a) 

Methods

fold :: Monoid m => Either a m -> m #

foldMap :: Monoid m => (a -> m) -> Either a a -> m #

foldr :: (a -> b -> b) -> b -> Either a a -> b #

foldr' :: (a -> b -> b) -> b -> Either a a -> b #

foldl :: (b -> a -> b) -> b -> Either a a -> b #

foldl' :: (b -> a -> b) -> b -> Either a a -> b #

foldr1 :: (a -> a -> a) -> Either a a -> a #

foldl1 :: (a -> a -> a) -> Either a a -> a #

toList :: Either a a -> [a] #

null :: Either a a -> Bool #

length :: Either a a -> Int #

elem :: Eq a => a -> Either a a -> Bool #

maximum :: Ord a => Either a a -> a #

minimum :: Ord a => Either a a -> a #

sum :: Num a => Either a a -> a #

product :: Num a => Either a a -> a #

Foldable f => Foldable (Rec1 f) 

Methods

fold :: Monoid m => Rec1 f m -> m #

foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m #

foldr :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldl :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldr1 :: (a -> a -> a) -> Rec1 f a -> a #

foldl1 :: (a -> a -> a) -> Rec1 f a -> a #

toList :: Rec1 f a -> [a] #

null :: Rec1 f a -> Bool #

length :: Rec1 f a -> Int #

elem :: Eq a => a -> Rec1 f a -> Bool #

maximum :: Ord a => Rec1 f a -> a #

minimum :: Ord a => Rec1 f a -> a #

sum :: Num a => Rec1 f a -> a #

product :: Num a => Rec1 f a -> a #

Foldable (URec Char) 

Methods

fold :: Monoid m => URec Char m -> m #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m #

foldr :: (a -> b -> b) -> b -> URec Char a -> b #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b #

foldl :: (b -> a -> b) -> b -> URec Char a -> b #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b #

foldr1 :: (a -> a -> a) -> URec Char a -> a #

foldl1 :: (a -> a -> a) -> URec Char a -> a #

toList :: URec Char a -> [a] #

null :: URec Char a -> Bool #

length :: URec Char a -> Int #

elem :: Eq a => a -> URec Char a -> Bool #

maximum :: Ord a => URec Char a -> a #

minimum :: Ord a => URec Char a -> a #

sum :: Num a => URec Char a -> a #

product :: Num a => URec Char a -> a #

Foldable (URec Double) 

Methods

fold :: Monoid m => URec Double m -> m #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m #

foldr :: (a -> b -> b) -> b -> URec Double a -> b #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b #

foldl :: (b -> a -> b) -> b -> URec Double a -> b #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b #

foldr1 :: (a -> a -> a) -> URec Double a -> a #

foldl1 :: (a -> a -> a) -> URec Double a -> a #

toList :: URec Double a -> [a] #

null :: URec Double a -> Bool #

length :: URec Double a -> Int #

elem :: Eq a => a -> URec Double a -> Bool #

maximum :: Ord a => URec Double a -> a #

minimum :: Ord a => URec Double a -> a #

sum :: Num a => URec Double a -> a #

product :: Num a => URec Double a -> a #

Foldable (URec Float) 

Methods

fold :: Monoid m => URec Float m -> m #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m #

foldr :: (a -> b -> b) -> b -> URec Float a -> b #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b #

foldl :: (b -> a -> b) -> b -> URec Float a -> b #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b #

foldr1 :: (a -> a -> a) -> URec Float a -> a #

foldl1 :: (a -> a -> a) -> URec Float a -> a #

toList :: URec Float a -> [a] #

null :: URec Float a -> Bool #

length :: URec Float a -> Int #

elem :: Eq a => a -> URec Float a -> Bool #

maximum :: Ord a => URec Float a -> a #

minimum :: Ord a => URec Float a -> a #

sum :: Num a => URec Float a -> a #

product :: Num a => URec Float a -> a #

Foldable (URec Int) 

Methods

fold :: Monoid m => URec Int m -> m #

foldMap :: Monoid m => (a -> m) -> URec Int a -> m #

foldr :: (a -> b -> b) -> b -> URec Int a -> b #

foldr' :: (a -> b -> b) -> b -> URec Int a -> b #

foldl :: (b -> a -> b) -> b -> URec Int a -> b #

foldl' :: (b -> a -> b) -> b -> URec Int a -> b #

foldr1 :: (a -> a -> a) -> URec Int a -> a #

foldl1 :: (a -> a -> a) -> URec Int a -> a #

toList :: URec Int a -> [a] #

null :: URec Int a -> Bool #

length :: URec Int a -> Int #

elem :: Eq a => a -> URec Int a -> Bool #

maximum :: Ord a => URec Int a -> a #

minimum :: Ord a => URec Int a -> a #

sum :: Num a => URec Int a -> a #

product :: Num a => URec Int a -> a #

Foldable (URec Word) 

Methods

fold :: Monoid m => URec Word m -> m #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m #

foldr :: (a -> b -> b) -> b -> URec Word a -> b #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b #

foldl :: (b -> a -> b) -> b -> URec Word a -> b #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b #

foldr1 :: (a -> a -> a) -> URec Word a -> a #

foldl1 :: (a -> a -> a) -> URec Word a -> a #

toList :: URec Word a -> [a] #

null :: URec Word a -> Bool #

length :: URec Word a -> Int #

elem :: Eq a => a -> URec Word a -> Bool #

maximum :: Ord a => URec Word a -> a #

minimum :: Ord a => URec Word a -> a #

sum :: Num a => URec Word a -> a #

product :: Num a => URec Word a -> a #

Foldable (URec (Ptr ())) 

Methods

fold :: Monoid m => URec (Ptr ()) m -> m #

foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m #

foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b #

foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b #

foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b #

foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b #

foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a #

foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a #

toList :: URec (Ptr ()) a -> [a] #

null :: URec (Ptr ()) a -> Bool #

length :: URec (Ptr ()) a -> Int #

elem :: Eq a => a -> URec (Ptr ()) a -> Bool #

maximum :: Ord a => URec (Ptr ()) a -> a #

minimum :: Ord a => URec (Ptr ()) a -> a #

sum :: Num a => URec (Ptr ()) a -> a #

product :: Num a => URec (Ptr ()) a -> a #

Foldable ((,) a) 

Methods

fold :: Monoid m => (a, m) -> m #

foldMap :: Monoid m => (a -> m) -> (a, a) -> m #

foldr :: (a -> b -> b) -> b -> (a, a) -> b #

foldr' :: (a -> b -> b) -> b -> (a, a) -> b #

foldl :: (b -> a -> b) -> b -> (a, a) -> b #

foldl' :: (b -> a -> b) -> b -> (a, a) -> b #

foldr1 :: (a -> a -> a) -> (a, a) -> a #

foldl1 :: (a -> a -> a) -> (a, a) -> a #

toList :: (a, a) -> [a] #

null :: (a, a) -> Bool #

length :: (a, a) -> Int #

elem :: Eq a => a -> (a, a) -> Bool #

maximum :: Ord a => (a, a) -> a #

minimum :: Ord a => (a, a) -> a #

sum :: Num a => (a, a) -> a #

product :: Num a => (a, a) -> a #

Foldable (HashMap k) 

Methods

fold :: Monoid m => HashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> HashMap k a -> m #

foldr :: (a -> b -> b) -> b -> HashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> HashMap k a -> b #

foldl :: (b -> a -> b) -> b -> HashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> HashMap k a -> b #

foldr1 :: (a -> a -> a) -> HashMap k a -> a #

foldl1 :: (a -> a -> a) -> HashMap k a -> a #

toList :: HashMap k a -> [a] #

null :: HashMap k a -> Bool #

length :: HashMap k a -> Int #

elem :: Eq a => a -> HashMap k a -> Bool #

maximum :: Ord a => HashMap k a -> a #

minimum :: Ord a => HashMap k a -> a #

sum :: Num a => HashMap k a -> a #

product :: Num a => HashMap k a -> a #

Foldable (Map k) 

Methods

fold :: Monoid m => Map k m -> m #

foldMap :: Monoid m => (a -> m) -> Map k a -> m #

foldr :: (a -> b -> b) -> b -> Map k a -> b #

foldr' :: (a -> b -> b) -> b -> Map k a -> b #

foldl :: (b -> a -> b) -> b -> Map k a -> b #

foldl' :: (b -> a -> b) -> b -> Map k a -> b #

foldr1 :: (a -> a -> a) -> Map k a -> a #

foldl1 :: (a -> a -> a) -> Map k a -> a #

toList :: Map k a -> [a] #

null :: Map k a -> Bool #

length :: Map k a -> Int #

elem :: Eq a => a -> Map k a -> Bool #

maximum :: Ord a => Map k a -> a #

minimum :: Ord a => Map k a -> a #

sum :: Num a => Map k a -> a #

product :: Num a => Map k a -> a #

Foldable (Array i) 

Methods

fold :: Monoid m => Array i m -> m #

foldMap :: Monoid m => (a -> m) -> Array i a -> m #

foldr :: (a -> b -> b) -> b -> Array i a -> b #

foldr' :: (a -> b -> b) -> b -> Array i a -> b #

foldl :: (b -> a -> b) -> b -> Array i a -> b #

foldl' :: (b -> a -> b) -> b -> Array i a -> b #

foldr1 :: (a -> a -> a) -> Array i a -> a #

foldl1 :: (a -> a -> a) -> Array i a -> a #

toList :: Array i a -> [a] #

null :: Array i a -> Bool #

length :: Array i a -> Int #

elem :: Eq a => a -> Array i a -> Bool #

maximum :: Ord a => Array i a -> a #

minimum :: Ord a => Array i a -> a #

sum :: Num a => Array i a -> a #

product :: Num a => Array i a -> a #

Foldable (Arg a) 

Methods

fold :: Monoid m => Arg a m -> m #

foldMap :: Monoid m => (a -> m) -> Arg a a -> m #

foldr :: (a -> b -> b) -> b -> Arg a a -> b #

foldr' :: (a -> b -> b) -> b -> Arg a a -> b #

foldl :: (b -> a -> b) -> b -> Arg a a -> b #

foldl' :: (b -> a -> b) -> b -> Arg a a -> b #

foldr1 :: (a -> a -> a) -> Arg a a -> a #

foldl1 :: (a -> a -> a) -> Arg a a -> a #

toList :: Arg a a -> [a] #

null :: Arg a a -> Bool #

length :: Arg a a -> Int #

elem :: Eq a => a -> Arg a a -> Bool #

maximum :: Ord a => Arg a a -> a #

minimum :: Ord a => Arg a a -> a #

sum :: Num a => Arg a a -> a #

product :: Num a => Arg a a -> a #

Foldable (Proxy *) 

Methods

fold :: Monoid m => Proxy * m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy * a -> m #

foldr :: (a -> b -> b) -> b -> Proxy * a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy * a -> b #

foldl :: (b -> a -> b) -> b -> Proxy * a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy * a -> b #

foldr1 :: (a -> a -> a) -> Proxy * a -> a #

foldl1 :: (a -> a -> a) -> Proxy * a -> a #

toList :: Proxy * a -> [a] #

null :: Proxy * a -> Bool #

length :: Proxy * a -> Int #

elem :: Eq a => a -> Proxy * a -> Bool #

maximum :: Ord a => Proxy * a -> a #

minimum :: Ord a => Proxy * a -> a #

sum :: Num a => Proxy * a -> a #

product :: Num a => Proxy * a -> a #

Foldable f => Foldable (Cofree f) 

Methods

fold :: Monoid m => Cofree f m -> m #

foldMap :: Monoid m => (a -> m) -> Cofree f a -> m #

foldr :: (a -> b -> b) -> b -> Cofree f a -> b #

foldr' :: (a -> b -> b) -> b -> Cofree f a -> b #

foldl :: (b -> a -> b) -> b -> Cofree f a -> b #

foldl' :: (b -> a -> b) -> b -> Cofree f a -> b #

foldr1 :: (a -> a -> a) -> Cofree f a -> a #

foldl1 :: (a -> a -> a) -> Cofree f a -> a #

toList :: Cofree f a -> [a] #

null :: Cofree f a -> Bool #

length :: Cofree f a -> Int #

elem :: Eq a => a -> Cofree f a -> Bool #

maximum :: Ord a => Cofree f a -> a #

minimum :: Ord a => Cofree f a -> a #

sum :: Num a => Cofree f a -> a #

product :: Num a => Cofree f a -> a #

Foldable f => Foldable (Yoneda f) 

Methods

fold :: Monoid m => Yoneda f m -> m #

foldMap :: Monoid m => (a -> m) -> Yoneda f a -> m #

foldr :: (a -> b -> b) -> b -> Yoneda f a -> b #

foldr' :: (a -> b -> b) -> b -> Yoneda f a -> b #

foldl :: (b -> a -> b) -> b -> Yoneda f a -> b #

foldl' :: (b -> a -> b) -> b -> Yoneda f a -> b #

foldr1 :: (a -> a -> a) -> Yoneda f a -> a #

foldl1 :: (a -> a -> a) -> Yoneda f a -> a #

toList :: Yoneda f a -> [a] #

null :: Yoneda f a -> Bool #

length :: Yoneda f a -> Int #

elem :: Eq a => a -> Yoneda f a -> Bool #

maximum :: Ord a => Yoneda f a -> a #

minimum :: Ord a => Yoneda f a -> a #

sum :: Num a => Yoneda f a -> a #

product :: Num a => Yoneda f a -> a #

Foldable (Level i) 

Methods

fold :: Monoid m => Level i m -> m #

foldMap :: Monoid m => (a -> m) -> Level i a -> m #

foldr :: (a -> b -> b) -> b -> Level i a -> b #

foldr' :: (a -> b -> b) -> b -> Level i a -> b #

foldl :: (b -> a -> b) -> b -> Level i a -> b #

foldl' :: (b -> a -> b) -> b -> Level i a -> b #

foldr1 :: (a -> a -> a) -> Level i a -> a #

foldl1 :: (a -> a -> a) -> Level i a -> a #

toList :: Level i a -> [a] #

null :: Level i a -> Bool #

length :: Level i a -> Int #

elem :: Eq a => a -> Level i a -> Bool #

maximum :: Ord a => Level i a -> a #

minimum :: Ord a => Level i a -> a #

sum :: Num a => Level i a -> a #

product :: Num a => Level i a -> a #

Foldable f => Foldable (ListT f) 

Methods

fold :: Monoid m => ListT f m -> m #

foldMap :: Monoid m => (a -> m) -> ListT f a -> m #

foldr :: (a -> b -> b) -> b -> ListT f a -> b #

foldr' :: (a -> b -> b) -> b -> ListT f a -> b #

foldl :: (b -> a -> b) -> b -> ListT f a -> b #

foldl' :: (b -> a -> b) -> b -> ListT f a -> b #

foldr1 :: (a -> a -> a) -> ListT f a -> a #

foldl1 :: (a -> a -> a) -> ListT f a -> a #

toList :: ListT f a -> [a] #

null :: ListT f a -> Bool #

length :: ListT f a -> Int #

elem :: Eq a => a -> ListT f a -> Bool #

maximum :: Ord a => ListT f a -> a #

minimum :: Ord a => ListT f a -> a #

sum :: Num a => ListT f a -> a #

product :: Num a => ListT f a -> a #

Foldable f => Foldable (MaybeT f) 

Methods

fold :: Monoid m => MaybeT f m -> m #

foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m #

foldr :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldl :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldr1 :: (a -> a -> a) -> MaybeT f a -> a #

foldl1 :: (a -> a -> a) -> MaybeT f a -> a #

toList :: MaybeT f a -> [a] #

null :: MaybeT f a -> Bool #

length :: MaybeT f a -> Int #

elem :: Eq a => a -> MaybeT f a -> Bool #

maximum :: Ord a => MaybeT f a -> a #

minimum :: Ord a => MaybeT f a -> a #

sum :: Num a => MaybeT f a -> a #

product :: Num a => MaybeT f a -> a #

Foldable (LHashMap k) # 

Methods

fold :: Monoid m => LHashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> LHashMap k a -> m #

foldr :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldl :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldr1 :: (a -> a -> a) -> LHashMap k a -> a #

foldl1 :: (a -> a -> a) -> LHashMap k a -> a #

toList :: LHashMap k a -> [a] #

null :: LHashMap k a -> Bool #

length :: LHashMap k a -> Int #

elem :: Eq a => a -> LHashMap k a -> Bool #

maximum :: Ord a => LHashMap k a -> a #

minimum :: Ord a => LHashMap k a -> a #

sum :: Num a => LHashMap k a -> a #

product :: Num a => LHashMap k a -> a #

Foldable (K1 i c) 

Methods

fold :: Monoid m => K1 i c m -> m #

foldMap :: Monoid m => (a -> m) -> K1 i c a -> m #

foldr :: (a -> b -> b) -> b -> K1 i c a -> b #

foldr' :: (a -> b -> b) -> b -> K1 i c a -> b #

foldl :: (b -> a -> b) -> b -> K1 i c a -> b #

foldl' :: (b -> a -> b) -> b -> K1 i c a -> b #

foldr1 :: (a -> a -> a) -> K1 i c a -> a #

foldl1 :: (a -> a -> a) -> K1 i c a -> a #

toList :: K1 i c a -> [a] #

null :: K1 i c a -> Bool #

length :: K1 i c a -> Int #

elem :: Eq a => a -> K1 i c a -> Bool #

maximum :: Ord a => K1 i c a -> a #

minimum :: Ord a => K1 i c a -> a #

sum :: Num a => K1 i c a -> a #

product :: Num a => K1 i c a -> a #

(Foldable f, Foldable g) => Foldable ((:+:) f g) 

Methods

fold :: Monoid m => (f :+: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a #

toList :: (f :+: g) a -> [a] #

null :: (f :+: g) a -> Bool #

length :: (f :+: g) a -> Int #

elem :: Eq a => a -> (f :+: g) a -> Bool #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

(Foldable f, Foldable g) => Foldable ((:*:) f g) 

Methods

fold :: Monoid m => (f :*: g) m -> m #

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

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

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

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

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

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Foldable f, Foldable g) => Foldable ((:.:) f g) 

Methods

fold :: Monoid m => (f :.: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :.: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :.: g) a -> a #

toList :: (f :.: g) a -> [a] #

null :: (f :.: g) a -> Bool #

length :: (f :.: g) a -> Int #

elem :: Eq a => a -> (f :.: g) a -> Bool #

maximum :: Ord a => (f :.: g) a -> a #

minimum :: Ord a => (f :.: g) a -> a #

sum :: Num a => (f :.: g) a -> a #

product :: Num a => (f :.: g) a -> a #

Foldable (Const * m) 

Methods

fold :: Monoid m => Const * m m -> m #

foldMap :: Monoid m => (a -> m) -> Const * m a -> m #

foldr :: (a -> b -> b) -> b -> Const * m a -> b #

foldr' :: (a -> b -> b) -> b -> Const * m a -> b #

foldl :: (b -> a -> b) -> b -> Const * m a -> b #

foldl' :: (b -> a -> b) -> b -> Const * m a -> b #

foldr1 :: (a -> a -> a) -> Const * m a -> a #

foldl1 :: (a -> a -> a) -> Const * m a -> a #

toList :: Const * m a -> [a] #

null :: Const * m a -> Bool #

length :: Const * m a -> Int #

elem :: Eq a => a -> Const * m a -> Bool #

maximum :: Ord a => Const * m a -> a #

minimum :: Ord a => Const * m a -> a #

sum :: Num a => Const * m a -> a #

product :: Num a => Const * m a -> a #

Bifoldable p => Foldable (Join * p) 

Methods

fold :: Monoid m => Join * p m -> m #

foldMap :: Monoid m => (a -> m) -> Join * p a -> m #

foldr :: (a -> b -> b) -> b -> Join * p a -> b #

foldr' :: (a -> b -> b) -> b -> Join * p a -> b #

foldl :: (b -> a -> b) -> b -> Join * p a -> b #

foldl' :: (b -> a -> b) -> b -> Join * p a -> b #

foldr1 :: (a -> a -> a) -> Join * p a -> a #

foldl1 :: (a -> a -> a) -> Join * p a -> a #

toList :: Join * p a -> [a] #

null :: Join * p a -> Bool #

length :: Join * p a -> Int #

elem :: Eq a => a -> Join * p a -> Bool #

maximum :: Ord a => Join * p a -> a #

minimum :: Ord a => Join * p a -> a #

sum :: Num a => Join * p a -> a #

product :: Num a => Join * p a -> a #

Foldable f => Foldable (IdentityT * f) 

Methods

fold :: Monoid m => IdentityT * f m -> m #

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

foldr :: (a -> b -> b) -> b -> IdentityT * f a -> b #

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

foldl :: (b -> a -> b) -> b -> IdentityT * f a -> b #

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

foldr1 :: (a -> a -> a) -> IdentityT * f a -> a #

foldl1 :: (a -> a -> a) -> IdentityT * f a -> a #

toList :: IdentityT * f a -> [a] #

null :: IdentityT * f a -> Bool #

length :: IdentityT * f a -> Int #

elem :: Eq a => a -> IdentityT * f a -> Bool #

maximum :: Ord a => IdentityT * f a -> a #

minimum :: Ord a => IdentityT * f a -> a #

sum :: Num a => IdentityT * f a -> a #

product :: Num a => IdentityT * f a -> a #

Foldable f => Foldable (FreeF f a) 

Methods

fold :: Monoid m => FreeF f a m -> m #

foldMap :: Monoid m => (a -> m) -> FreeF f a a -> m #

foldr :: (a -> b -> b) -> b -> FreeF f a a -> b #

foldr' :: (a -> b -> b) -> b -> FreeF f a a -> b #

foldl :: (b -> a -> b) -> b -> FreeF f a a -> b #

foldl' :: (b -> a -> b) -> b -> FreeF f a a -> b #

foldr1 :: (a -> a -> a) -> FreeF f a a -> a #

foldl1 :: (a -> a -> a) -> FreeF f a a -> a #

toList :: FreeF f a a -> [a] #

null :: FreeF f a a -> Bool #

length :: FreeF f a a -> Int #

elem :: Eq a => a -> FreeF f a a -> Bool #

maximum :: Ord a => FreeF f a a -> a #

minimum :: Ord a => FreeF f a a -> a #

sum :: Num a => FreeF f a a -> a #

product :: Num a => FreeF f a a -> a #

(Foldable m, Foldable f) => Foldable (FreeT f m) 

Methods

fold :: Monoid m => FreeT f m m -> m #

foldMap :: Monoid m => (a -> m) -> FreeT f m a -> m #

foldr :: (a -> b -> b) -> b -> FreeT f m a -> b #

foldr' :: (a -> b -> b) -> b -> FreeT f m a -> b #

foldl :: (b -> a -> b) -> b -> FreeT f m a -> b #

foldl' :: (b -> a -> b) -> b -> FreeT f m a -> b #

foldr1 :: (a -> a -> a) -> FreeT f m a -> a #

foldl1 :: (a -> a -> a) -> FreeT f m a -> a #

toList :: FreeT f m a -> [a] #

null :: FreeT f m a -> Bool #

length :: FreeT f m a -> Int #

elem :: Eq a => a -> FreeT f m a -> Bool #

maximum :: Ord a => FreeT f m a -> a #

minimum :: Ord a => FreeT f m a -> a #

sum :: Num a => FreeT f m a -> a #

product :: Num a => FreeT f m a -> a #

Foldable f => Foldable (Backwards * f)

Derived instance.

Methods

fold :: Monoid m => Backwards * f m -> m #

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

foldr :: (a -> b -> b) -> b -> Backwards * f a -> b #

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

foldl :: (b -> a -> b) -> b -> Backwards * f a -> b #

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

foldr1 :: (a -> a -> a) -> Backwards * f a -> a #

foldl1 :: (a -> a -> a) -> Backwards * f a -> a #

toList :: Backwards * f a -> [a] #

null :: Backwards * f a -> Bool #

length :: Backwards * f a -> Int #

elem :: Eq a => a -> Backwards * f a -> Bool #

maximum :: Ord a => Backwards * f a -> a #

minimum :: Ord a => Backwards * f a -> a #

sum :: Num a => Backwards * f a -> a #

product :: Num a => Backwards * f a -> a #

Foldable f => Foldable (ErrorT e f) 

Methods

fold :: Monoid m => ErrorT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m #

foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldr1 :: (a -> a -> a) -> ErrorT e f a -> a #

foldl1 :: (a -> a -> a) -> ErrorT e f a -> a #

toList :: ErrorT e f a -> [a] #

null :: ErrorT e f a -> Bool #

length :: ErrorT e f a -> Int #

elem :: Eq a => a -> ErrorT e f a -> Bool #

maximum :: Ord a => ErrorT e f a -> a #

minimum :: Ord a => ErrorT e f a -> a #

sum :: Num a => ErrorT e f a -> a #

product :: Num a => ErrorT e f a -> a #

Foldable f => Foldable (AlongsideLeft f b) 

Methods

fold :: Monoid m => AlongsideLeft f b m -> m #

foldMap :: Monoid m => (a -> m) -> AlongsideLeft f b a -> m #

foldr :: (a -> b -> b) -> b -> AlongsideLeft f b a -> b #

foldr' :: (a -> b -> b) -> b -> AlongsideLeft f b a -> b #

foldl :: (b -> a -> b) -> b -> AlongsideLeft f b a -> b #

foldl' :: (b -> a -> b) -> b -> AlongsideLeft f b a -> b #

foldr1 :: (a -> a -> a) -> AlongsideLeft f b a -> a #

foldl1 :: (a -> a -> a) -> AlongsideLeft f b a -> a #

toList :: AlongsideLeft f b a -> [a] #

null :: AlongsideLeft f b a -> Bool #

length :: AlongsideLeft f b a -> Int #

elem :: Eq a => a -> AlongsideLeft f b a -> Bool #

maximum :: Ord a => AlongsideLeft f b a -> a #

minimum :: Ord a => AlongsideLeft f b a -> a #

sum :: Num a => AlongsideLeft f b a -> a #

product :: Num a => AlongsideLeft f b a -> a #

Foldable f => Foldable (AlongsideRight f a) 

Methods

fold :: Monoid m => AlongsideRight f a m -> m #

foldMap :: Monoid m => (a -> m) -> AlongsideRight f a a -> m #

foldr :: (a -> b -> b) -> b -> AlongsideRight f a a -> b #

foldr' :: (a -> b -> b) -> b -> AlongsideRight f a a -> b #

foldl :: (b -> a -> b) -> b -> AlongsideRight f a a -> b #

foldl' :: (b -> a -> b) -> b -> AlongsideRight f a a -> b #

foldr1 :: (a -> a -> a) -> AlongsideRight f a a -> a #

foldl1 :: (a -> a -> a) -> AlongsideRight f a a -> a #

toList :: AlongsideRight f a a -> [a] #

null :: AlongsideRight f a a -> Bool #

length :: AlongsideRight f a a -> Int #

elem :: Eq a => a -> AlongsideRight f a a -> Bool #

maximum :: Ord a => AlongsideRight f a a -> a #

minimum :: Ord a => AlongsideRight f a a -> a #

sum :: Num a => AlongsideRight f a a -> a #

product :: Num a => AlongsideRight f a a -> a #

Foldable f => Foldable (ExceptT e f) 

Methods

fold :: Monoid m => ExceptT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m #

foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldr1 :: (a -> a -> a) -> ExceptT e f a -> a #

foldl1 :: (a -> a -> a) -> ExceptT e f a -> a #

toList :: ExceptT e f a -> [a] #

null :: ExceptT e f a -> Bool #

length :: ExceptT e f a -> Int #

elem :: Eq a => a -> ExceptT e f a -> Bool #

maximum :: Ord a => ExceptT e f a -> a #

minimum :: Ord a => ExceptT e f a -> a #

sum :: Num a => ExceptT e f a -> a #

product :: Num a => ExceptT e f a -> a #

Foldable f => Foldable (WriterT w f) 

Methods

fold :: Monoid m => WriterT w f m -> m #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a #

toList :: WriterT w f a -> [a] #

null :: WriterT w f a -> Bool #

length :: WriterT w f a -> Int #

elem :: Eq a => a -> WriterT w f a -> Bool #

maximum :: Ord a => WriterT w f a -> a #

minimum :: Ord a => WriterT w f a -> a #

sum :: Num a => WriterT w f a -> a #

product :: Num a => WriterT w f a -> a #

Foldable f => Foldable (WriterT w f) 

Methods

fold :: Monoid m => WriterT w f m -> m #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a #

toList :: WriterT w f a -> [a] #

null :: WriterT w f a -> Bool #

length :: WriterT w f a -> Int #

elem :: Eq a => a -> WriterT w f a -> Bool #

maximum :: Ord a => WriterT w f a -> a #

minimum :: Ord a => WriterT w f a -> a #

sum :: Num a => WriterT w f a -> a #

product :: Num a => WriterT w f a -> a #

Foldable (Forget r a) 

Methods

fold :: Monoid m => Forget r a m -> m #

foldMap :: Monoid m => (a -> m) -> Forget r a a -> m #

foldr :: (a -> b -> b) -> b -> Forget r a a -> b #

foldr' :: (a -> b -> b) -> b -> Forget r a a -> b #

foldl :: (b -> a -> b) -> b -> Forget r a a -> b #

foldl' :: (b -> a -> b) -> b -> Forget r a a -> b #

foldr1 :: (a -> a -> a) -> Forget r a a -> a #

foldl1 :: (a -> a -> a) -> Forget r a a -> a #

toList :: Forget r a a -> [a] #

null :: Forget r a a -> Bool #

length :: Forget r a a -> Int #

elem :: Eq a => a -> Forget r a a -> Bool #

maximum :: Ord a => Forget r a a -> a #

minimum :: Ord a => Forget r a a -> a #

sum :: Num a => Forget r a a -> a #

product :: Num a => Forget r a a -> a #

Foldable (Tagged k s) 

Methods

fold :: Monoid m => Tagged k s m -> m #

foldMap :: Monoid m => (a -> m) -> Tagged k s a -> m #

foldr :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldr' :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldl :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldl' :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldr1 :: (a -> a -> a) -> Tagged k s a -> a #

foldl1 :: (a -> a -> a) -> Tagged k s a -> a #

toList :: Tagged k s a -> [a] #

null :: Tagged k s a -> Bool #

length :: Tagged k s a -> Int #

elem :: Eq a => a -> Tagged k s a -> Bool #

maximum :: Ord a => Tagged k s a -> a #

minimum :: Ord a => Tagged k s a -> a #

sum :: Num a => Tagged k s a -> a #

product :: Num a => Tagged k s a -> a #

Foldable f => Foldable (Reverse * f)

Fold from right to left.

Methods

fold :: Monoid m => Reverse * f m -> m #

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

foldr :: (a -> b -> b) -> b -> Reverse * f a -> b #

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

foldl :: (b -> a -> b) -> b -> Reverse * f a -> b #

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

foldr1 :: (a -> a -> a) -> Reverse * f a -> a #

foldl1 :: (a -> a -> a) -> Reverse * f a -> a #

toList :: Reverse * f a -> [a] #

null :: Reverse * f a -> Bool #

length :: Reverse * f a -> Int #

elem :: Eq a => a -> Reverse * f a -> Bool #

maximum :: Ord a => Reverse * f a -> a #

minimum :: Ord a => Reverse * f a -> a #

sum :: Num a => Reverse * f a -> a #

product :: Num a => Reverse * f a -> a #

Foldable (Constant * a) 

Methods

fold :: Monoid m => Constant * a m -> m #

foldMap :: Monoid m => (a -> m) -> Constant * a a -> m #

foldr :: (a -> b -> b) -> b -> Constant * a a -> b #

foldr' :: (a -> b -> b) -> b -> Constant * a a -> b #

foldl :: (b -> a -> b) -> b -> Constant * a a -> b #

foldl' :: (b -> a -> b) -> b -> Constant * a a -> b #

foldr1 :: (a -> a -> a) -> Constant * a a -> a #

foldl1 :: (a -> a -> a) -> Constant * a a -> a #

toList :: Constant * a a -> [a] #

null :: Constant * a a -> Bool #

length :: Constant * a a -> Int #

elem :: Eq a => a -> Constant * a a -> Bool #

maximum :: Ord a => Constant * a a -> a #

minimum :: Ord a => Constant * a a -> a #

sum :: Num a => Constant * a a -> a #

product :: Num a => Constant * a a -> a #

Foldable f => Foldable (M1 i c f) 

Methods

fold :: Monoid m => M1 i c f m -> m #

foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m #

foldr :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldl :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldr1 :: (a -> a -> a) -> M1 i c f a -> a #

foldl1 :: (a -> a -> a) -> M1 i c f a -> a #

toList :: M1 i c f a -> [a] #

null :: M1 i c f a -> Bool #

length :: M1 i c f a -> Int #

elem :: Eq a => a -> M1 i c f a -> Bool #

maximum :: Ord a => M1 i c f a -> a #

minimum :: Ord a => M1 i c f a -> a #

sum :: Num a => M1 i c f a -> a #

product :: Num a => M1 i c f a -> a #

(Foldable f, Foldable g) => Foldable (Sum * f g) 

Methods

fold :: Monoid m => Sum * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Sum * f g a -> m #

foldr :: (a -> b -> b) -> b -> Sum * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Sum * f g a -> b #

foldl :: (b -> a -> b) -> b -> Sum * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Sum * f g a -> b #

foldr1 :: (a -> a -> a) -> Sum * f g a -> a #

foldl1 :: (a -> a -> a) -> Sum * f g a -> a #

toList :: Sum * f g a -> [a] #

null :: Sum * f g a -> Bool #

length :: Sum * f g a -> Int #

elem :: Eq a => a -> Sum * f g a -> Bool #

maximum :: Ord a => Sum * f g a -> a #

minimum :: Ord a => Sum * f g a -> a #

sum :: Num a => Sum * f g a -> a #

product :: Num a => Sum * f g a -> a #

(Foldable f, Foldable g) => Foldable (Product * f g) 

Methods

fold :: Monoid m => Product * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Product * f g a -> m #

foldr :: (a -> b -> b) -> b -> Product * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Product * f g a -> b #

foldl :: (b -> a -> b) -> b -> Product * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Product * f g a -> b #

foldr1 :: (a -> a -> a) -> Product * f g a -> a #

foldl1 :: (a -> a -> a) -> Product * f g a -> a #

toList :: Product * f g a -> [a] #

null :: Product * f g a -> Bool #

length :: Product * f g a -> Int #

elem :: Eq a => a -> Product * f g a -> Bool #

maximum :: Ord a => Product * f g a -> a #

minimum :: Ord a => Product * f g a -> a #

sum :: Num a => Product * f g a -> a #

product :: Num a => Product * f g a -> a #

Foldable (Magma i t b) 

Methods

fold :: Monoid m => Magma i t b m -> m #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m #

foldr :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldr' :: (a -> b -> b) -> b -> Magma i t b a -> b #

foldl :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldl' :: (b -> a -> b) -> b -> Magma i t b a -> b #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a #

toList :: Magma i t b a -> [a] #

null :: Magma i t b a -> Bool #

length :: Magma i t b a -> Int #

elem :: Eq a => a -> Magma i t b a -> Bool #

maximum :: Ord a => Magma i t b a -> a #

minimum :: Ord a => Magma i t b a -> a #

sum :: Num a => Magma i t b a -> a #

product :: Num a => Magma i t b a -> a #

(Foldable f, Foldable g) => Foldable (Compose * * f g) 

Methods

fold :: Monoid m => Compose * * f g m -> m #

foldMap :: Monoid m => (a -> m) -> Compose * * f g a -> m #

foldr :: (a -> b -> b) -> b -> Compose * * f g a -> b #

foldr' :: (a -> b -> b) -> b -> Compose * * f g a -> b #

foldl :: (b -> a -> b) -> b -> Compose * * f g a -> b #

foldl' :: (b -> a -> b) -> b -> Compose * * f g a -> b #

foldr1 :: (a -> a -> a) -> Compose * * f g a -> a #

foldl1 :: (a -> a -> a) -> Compose * * f g a -> a #

toList :: Compose * * f g a -> [a] #

null :: Compose * * f g a -> Bool #

length :: Compose * * f g a -> Int #

elem :: Eq a => a -> Compose * * f g a -> Bool #

maximum :: Ord a => Compose * * f g a -> a #

minimum :: Ord a => Compose * * f g a -> a #

sum :: Num a => Compose * * f g a -> a #

product :: Num a => Compose * * f g a -> a #

Bifoldable p => Foldable (WrappedBifunctor * * p a) 

Methods

fold :: Monoid m => WrappedBifunctor * * p a m -> m #

foldMap :: Monoid m => (a -> m) -> WrappedBifunctor * * p a a -> m #

foldr :: (a -> b -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldr' :: (a -> b -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldl :: (b -> a -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldl' :: (b -> a -> b) -> b -> WrappedBifunctor * * p a a -> b #

foldr1 :: (a -> a -> a) -> WrappedBifunctor * * p a a -> a #

foldl1 :: (a -> a -> a) -> WrappedBifunctor * * p a a -> a #

toList :: WrappedBifunctor * * p a a -> [a] #

null :: WrappedBifunctor * * p a a -> Bool #

length :: WrappedBifunctor * * p a a -> Int #

elem :: Eq a => a -> WrappedBifunctor * * p a a -> Bool #

maximum :: Ord a => WrappedBifunctor * * p a a -> a #

minimum :: Ord a => WrappedBifunctor * * p a a -> a #

sum :: Num a => WrappedBifunctor * * p a a -> a #

product :: Num a => WrappedBifunctor * * p a 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 #

Bifoldable p => Foldable (Flip * * p a) 

Methods

fold :: Monoid m => Flip * * p a m -> m #

foldMap :: Monoid m => (a -> m) -> Flip * * p a a -> m #

foldr :: (a -> b -> b) -> b -> Flip * * p a a -> b #

foldr' :: (a -> b -> b) -> b -> Flip * * p a a -> b #

foldl :: (b -> a -> b) -> b -> Flip * * p a a -> b #

foldl' :: (b -> a -> b) -> b -> Flip * * p a a -> b #

foldr1 :: (a -> a -> a) -> Flip * * p a a -> a #

foldl1 :: (a -> a -> a) -> Flip * * p a a -> a #

toList :: Flip * * p a a -> [a] #

null :: Flip * * p a a -> Bool #

length :: Flip * * p a a -> Int #

elem :: Eq a => a -> Flip * * p a a -> Bool #

maximum :: Ord a => Flip * * p a a -> a #

minimum :: Ord a => Flip * * p a a -> a #

sum :: Num a => Flip * * p a a -> a #

product :: Num a => Flip * * p a 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 #

(Foldable f, Bifoldable p) => Foldable (Tannen * * * f p a) 

Methods

fold :: Monoid m => Tannen * * * f p a m -> m #

foldMap :: Monoid m => (a -> m) -> Tannen * * * f p a a -> m #

foldr :: (a -> b -> b) -> b -> Tannen * * * f p a a -> b #

foldr' :: (a -> b -> b) -> b -> Tannen * * * f p a a -> b #

foldl :: (b -> a -> b) -> b -> Tannen * * * f p a a -> b #

foldl' :: (b -> a -> b) -> b -> Tannen * * * f p a a -> b #

foldr1 :: (a -> a -> a) -> Tannen * * * f p a a -> a #

foldl1 :: (a -> a -> a) -> Tannen * * * f p a a -> a #

toList :: Tannen * * * f p a a -> [a] #

null :: Tannen * * * f p a a -> Bool #

length :: Tannen * * * f p a a -> Int #

elem :: Eq a => a -> Tannen * * * f p a a -> Bool #

maximum :: Ord a => Tannen * * * f p a a -> a #

minimum :: Ord a => Tannen * * * f p a a -> a #

sum :: Num a => Tannen * * * f p a a -> a #

product :: Num a => Tannen * * * f p a a -> a #

(Bifoldable p, Foldable g) => Foldable (Biff * k * * p f g a) 

Methods

fold :: Monoid m => Biff * k * * p f g a m -> m #

foldMap :: Monoid m => (a -> m) -> Biff * k * * p f g a a -> m #

foldr :: (a -> b -> b) -> b -> Biff * k * * p f g a a -> b #

foldr' :: (a -> b -> b) -> b -> Biff * k * * p f g a a -> b #

foldl :: (b -> a -> b) -> b -> Biff * k * * p f g a a -> b #

foldl' :: (b -> a -> b) -> b -> Biff * k * * p f g a a -> b #

foldr1 :: (a -> a -> a) -> Biff * k * * p f g a a -> a #

foldl1 :: (a -> a -> a) -> Biff * k * * p f g a a -> a #

toList :: Biff * k * * p f g a a -> [a] #

null :: Biff * k * * p f g a a -> Bool #

length :: Biff * k * * p f g a a -> Int #

elem :: Eq a => a -> Biff * k * * p f g a a -> Bool #

maximum :: Ord a => Biff * k * * p f g a a -> a #

minimum :: Ord a => Biff * k * * p f g a a -> a #

sum :: Num a => Biff * k * * p f g a a -> a #

product :: Num a => Biff * k * * p f g a a -> a #

Special biased folds

foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

Folding actions

Applicative actions

traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () #

Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see traverse.

for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () #

for_ is traverse_ with its arguments flipped. For a version that doesn't ignore the results see for.

>>> for_ [1..4] print
1
2
3
4

sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f () #

Evaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequenceA.

asum :: (Foldable t, Alternative f) => t (f a) -> f a #

The sum of a collection of actions, generalizing concat.

Monadic actions

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM.

As of base 4.8.0.0, mapM_ is just traverse_, specialized to Monad.

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () #

forM_ is mapM_ with its arguments flipped. For a version that doesn't ignore the results see forM.

As of base 4.8.0.0, forM_ is just for_, specialized to Monad.

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequence.

As of base 4.8.0.0, sequence_ is just sequenceA_, specialized to Monad.

msum :: (Foldable t, MonadPlus m) => t (m a) -> m a #

The sum of a collection of actions, generalizing concat. As of base 4.8.0.0, msum is just asum, specialized to MonadPlus.

Specialized folds

concat :: Monoid a => [a] -> a Source #

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #

Map a function over all the elements of a container and concatenate the resulting lists.

and :: Foldable t => t Bool -> Bool #

and returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end.

or :: Foldable t => t Bool -> Bool #

or returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end.

any :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether any element of the structure satisfies the predicate.

all :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether all elements of the structure satisfy the predicate.

maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The largest element of a non-empty structure with respect to the given comparison function.

minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The least element of a non-empty structure with respect to the given comparison function.

Searches

notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 #

notElem is the negation of elem.

find :: Foldable t => (a -> Bool) -> t a -> Maybe a #

The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

newtype AList k v Source #

Constructors

AList 

Fields

Instances

Eq k => DictLike AList k Source # 

Methods

insert :: k -> v -> AList k v -> AList k v Source #

delete :: k -> AList k v -> AList k v Source #

adjust :: k -> (v -> v) -> AList k v -> AList k v Source #

pairs :: AList k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> AList k v Source #

keys :: AList k v -> [k] Source #

elems :: AList k v -> [v] Source #

singletonMap :: k -> v -> AList k v Source #

member :: k -> AList k v -> Bool Source #

Functor (AList k) Source # 

Methods

fmap :: (a -> b) -> AList k a -> AList k b #

(<$) :: a -> AList k b -> AList k a #

Eq k => Lookup (AList k) k Source # 

Methods

lookup :: k -> AList k v -> Maybe v Source #

lookupDef :: v -> k -> AList k v -> v Source #

(Eq v, Eq k) => Eq (AList k v) Source # 

Methods

(==) :: AList k v -> AList k v -> Bool #

(/=) :: AList k v -> AList k v -> Bool #

(Ord v, Ord k) => Ord (AList k v) Source # 

Methods

compare :: AList k v -> AList k v -> Ordering #

(<) :: AList k v -> AList k v -> Bool #

(<=) :: AList k v -> AList k v -> Bool #

(>) :: AList k v -> AList k v -> Bool #

(>=) :: AList k v -> AList k v -> Bool #

max :: AList k v -> AList k v -> AList k v #

min :: AList k v -> AList k v -> AList k v #

(Read v, Read k) => Read (AList k v) Source # 
(Show v, Show k) => Show (AList k v) Source # 

Methods

showsPrec :: Int -> AList k v -> ShowS #

show :: AList k v -> String #

showList :: [AList k v] -> ShowS #

Generic (AList k v) Source # 

Associated Types

type Rep (AList k v) :: * -> * #

Methods

from :: AList k v -> Rep (AList k v) x #

to :: Rep (AList k v) x -> AList k v #

type Rep (AList k v) Source # 
type Rep (AList k v) = D1 (MetaData "AList" "Praglude" "praglude-0.4.1.0-BLXNdjdSv7p88iOSQlPkxw" True) (C1 (MetaCons "AList" PrefixI True) (S1 (MetaSel (Just Symbol "unAList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(k, v)])))

data LHashMap k v Source #

A lazy hash map. Because HashMap is actually the exact same type as HashMap, we wrap it in a newtype so that we can tie laziness into the type itself (similar to how it works for Text and ByteString).

Instances

(Eq k, Hashable k) => DictLike LHashMap k Source # 

Methods

insert :: k -> v -> LHashMap k v -> LHashMap k v Source #

delete :: k -> LHashMap k v -> LHashMap k v Source #

adjust :: k -> (v -> v) -> LHashMap k v -> LHashMap k v Source #

pairs :: LHashMap k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> LHashMap k v Source #

keys :: LHashMap k v -> [k] Source #

elems :: LHashMap k v -> [v] Source #

singletonMap :: k -> v -> LHashMap k v Source #

member :: k -> LHashMap k v -> Bool Source #

Functor (LHashMap k) Source # 

Methods

fmap :: (a -> b) -> LHashMap k a -> LHashMap k b #

(<$) :: a -> LHashMap k b -> LHashMap k a #

Foldable (LHashMap k) Source # 

Methods

fold :: Monoid m => LHashMap k m -> m #

foldMap :: Monoid m => (a -> m) -> LHashMap k a -> m #

foldr :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldr' :: (a -> b -> b) -> b -> LHashMap k a -> b #

foldl :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldl' :: (b -> a -> b) -> b -> LHashMap k a -> b #

foldr1 :: (a -> a -> a) -> LHashMap k a -> a #

foldl1 :: (a -> a -> a) -> LHashMap k a -> a #

toList :: LHashMap k a -> [a] #

null :: LHashMap k a -> Bool #

length :: LHashMap k a -> Int #

elem :: Eq a => a -> LHashMap k a -> Bool #

maximum :: Ord a => LHashMap k a -> a #

minimum :: Ord a => LHashMap k a -> a #

sum :: Num a => LHashMap k a -> a #

product :: Num a => LHashMap k a -> a #

Traversable (LHashMap k) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> LHashMap k a -> f (LHashMap k b) #

sequenceA :: Applicative f => LHashMap k (f a) -> f (LHashMap k a) #

mapM :: Monad m => (a -> m b) -> LHashMap k a -> m (LHashMap k b) #

sequence :: Monad m => LHashMap k (m a) -> m (LHashMap k a) #

Filterable (LHashMap k) Source # 

Methods

filter :: (v -> Bool) -> LHashMap k v -> LHashMap k v Source #

(Eq k, Hashable k) => Lookup (LHashMap k) k Source # 

Methods

lookup :: k -> LHashMap k v -> Maybe v Source #

lookupDef :: v -> k -> LHashMap k v -> v Source #

(Eq v, Eq k) => Eq (LHashMap k v) Source # 

Methods

(==) :: LHashMap k v -> LHashMap k v -> Bool #

(/=) :: LHashMap k v -> LHashMap k v -> Bool #

(Hashable k, Eq k, Data v, Data k) => Data (LHashMap k v) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LHashMap k v -> c (LHashMap k v) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LHashMap k v) #

toConstr :: LHashMap k v -> Constr #

dataTypeOf :: LHashMap k v -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (LHashMap k v)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LHashMap k v)) #

gmapT :: (forall b. Data b => b -> b) -> LHashMap k v -> LHashMap k v #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHashMap k v -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHashMap k v -> r #

gmapQ :: (forall d. Data d => d -> u) -> LHashMap k v -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LHashMap k v -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LHashMap k v -> m (LHashMap k v) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LHashMap k v -> m (LHashMap k v) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LHashMap k v -> m (LHashMap k v) #

(Read v, Read k, Hashable k, Eq k) => Read (LHashMap k v) Source # 
(Show v, Show k) => Show (LHashMap k v) Source # 

Methods

showsPrec :: Int -> LHashMap k v -> ShowS #

show :: LHashMap k v -> String #

showList :: [LHashMap k v] -> ShowS #

Generic (LHashMap k v) Source # 

Associated Types

type Rep (LHashMap k v) :: * -> * #

Methods

from :: LHashMap k v -> Rep (LHashMap k v) x #

to :: Rep (LHashMap k v) x -> LHashMap k v #

(Hashable k, Eq k) => Semigroup (LHashMap k v) Source # 

Methods

(<>) :: LHashMap k v -> LHashMap k v -> LHashMap k v #

sconcat :: NonEmpty (LHashMap k v) -> LHashMap k v #

stimes :: Integral b => b -> LHashMap k v -> LHashMap k v #

(Hashable k, Eq k) => Monoid (LHashMap k v) Source # 

Methods

mempty :: LHashMap k v #

mappend :: LHashMap k v -> LHashMap k v -> LHashMap k v #

mconcat :: [LHashMap k v] -> LHashMap k v #

(NFData v, NFData k) => NFData (LHashMap k v) Source # 

Methods

rnf :: LHashMap k v -> () #

(Eq k, Hashable k) => SetLike (LHashMap k v) (k, v) Source # 

Methods

conj :: (k, v) -> LHashMap k v -> LHashMap k v Source #

remove :: (k, v) -> LHashMap k v -> LHashMap k v Source #

nullSet :: LHashMap k v -> Bool Source #

items :: LHashMap k v -> [(k, v)] Source #

fromItems :: [(k, v)] -> LHashMap k v Source #

singleton :: (k, v) -> LHashMap k v Source #

size :: LHashMap k v -> Int Source #

type Rep (LHashMap k v) Source # 
type Rep (LHashMap k v) = D1 (MetaData "LHashMap" "Praglude" "praglude-0.4.1.0-BLXNdjdSv7p88iOSQlPkxw" True) (C1 (MetaCons "LHashMap" PrefixI True) (S1 (MetaSel (Just Symbol "unLHashMap") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (HashMap k v))))

data Map k a :: * -> * -> * #

A Map from keys k to values a.

Instances

(Eq k, Ord k) => DictLike Map k Source # 

Methods

insert :: k -> v -> Map k v -> Map k v Source #

delete :: k -> Map k v -> Map k v Source #

adjust :: k -> (v -> v) -> Map k v -> Map k v Source #

pairs :: Map k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> Map k v Source #

keys :: Map k v -> [k] Source #

elems :: Map k v -> [v] Source #

singletonMap :: k -> v -> Map k v Source #

member :: k -> Map k v -> Bool Source #

FunctorWithIndex k (Map k) 

Methods

imap :: (k -> a -> b) -> Map k a -> Map k b #

imapped :: (Indexable k p, Settable f) => p a (f b) -> Map k a -> f (Map k b) #

FoldableWithIndex k (Map k) 

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> Map k a -> m #

ifolded :: (Indexable k p, Contravariant f, Applicative f) => p a (f a) -> Map k a -> f (Map k a) #

ifoldr :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl :: (k -> b -> a -> b) -> b -> Map k a -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> Map k a -> b #

TraversableWithIndex k (Map k) 

Methods

itraverse :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) #

itraversed :: (Indexable k p, Applicative f) => p a (f b) -> Map k a -> f (Map k b) #

Ord k => TraverseMin k (Map k) 

Methods

traverseMin :: (Indexable k p, Applicative f) => p v (f v) -> Map k v -> f (Map k v) #

Ord k => TraverseMax k (Map k) 

Methods

traverseMax :: (Indexable k p, Applicative f) => p v (f v) -> Map k v -> f (Map k v) #

Functor (Map k) 

Methods

fmap :: (a -> b) -> Map k a -> Map k b #

(<$) :: a -> Map k b -> Map k a #

Foldable (Map k) 

Methods

fold :: Monoid m => Map k m -> m #

foldMap :: Monoid m => (a -> m) -> Map k a -> m #

foldr :: (a -> b -> b) -> b -> Map k a -> b #

foldr' :: (a -> b -> b) -> b -> Map k a -> b #

foldl :: (b -> a -> b) -> b -> Map k a -> b #

foldl' :: (b -> a -> b) -> b -> Map k a -> b #

foldr1 :: (a -> a -> a) -> Map k a -> a #

foldl1 :: (a -> a -> a) -> Map k a -> a #

toList :: Map k a -> [a] #

null :: Map k a -> Bool #

length :: Map k a -> Int #

elem :: Eq a => a -> Map k a -> Bool #

maximum :: Ord a => Map k a -> a #

minimum :: Ord a => Map k a -> a #

sum :: Num a => Map k a -> a #

product :: Num a => Map k a -> a #

Traversable (Map k) 

Methods

traverse :: Applicative f => (a -> f b) -> Map k a -> f (Map k b) #

sequenceA :: Applicative f => Map k (f a) -> f (Map k a) #

mapM :: Monad m => (a -> m b) -> Map k a -> m (Map k b) #

sequence :: Monad m => Map k (m a) -> m (Map k a) #

Ord k => Apply (Map k)

A Map is not Applicative, but it is an instance of Apply

Methods

(<.>) :: Map k (a -> b) -> Map k a -> Map k b #

(.>) :: Map k a -> Map k b -> Map k b #

(<.) :: Map k a -> Map k b -> Map k a #

Ord k => Bind (Map k)

A Map is not a Monad, but it is an instance of Bind

Methods

(>>-) :: Map k a -> (a -> Map k b) -> Map k b #

join :: Map k (Map k a) -> Map k a #

Filterable (Map k) Source # 

Methods

filter :: (v -> Bool) -> Map k v -> Map k v Source #

(Eq k, Ord k) => Lookup (Map k) k Source # 

Methods

lookup :: k -> Map k v -> Maybe v Source #

lookupDef :: v -> k -> Map k v -> v Source #

Ord k => IsList (Map k v) 

Associated Types

type Item (Map k v) :: * #

Methods

fromList :: [Item (Map k v)] -> Map k v #

fromListN :: Int -> [Item (Map k v)] -> Map k v #

toList :: Map k v -> [Item (Map k v)] #

(Eq k, Eq a) => Eq (Map k a) 

Methods

(==) :: Map k a -> Map k a -> Bool #

(/=) :: Map k a -> Map k a -> Bool #

(Data k, Data a, Ord k) => Data (Map k a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Map k a -> c (Map k a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Map k a) #

toConstr :: Map k a -> Constr #

dataTypeOf :: Map k a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Map k a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Map k a)) #

gmapT :: (forall b. Data b => b -> b) -> Map k a -> Map k a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Map k a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Map k a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) #

(Ord k, Ord v) => Ord (Map k v) 

Methods

compare :: Map k v -> Map k v -> Ordering #

(<) :: Map k v -> Map k v -> Bool #

(<=) :: Map k v -> Map k v -> Bool #

(>) :: Map k v -> Map k v -> Bool #

(>=) :: Map k v -> Map k v -> Bool #

max :: Map k v -> Map k v -> Map k v #

min :: Map k v -> Map k v -> Map k v #

(Ord k, Read k, Read e) => Read (Map k e) 

Methods

readsPrec :: Int -> ReadS (Map k e) #

readList :: ReadS [Map k e] #

readPrec :: ReadPrec (Map k e) #

readListPrec :: ReadPrec [Map k e] #

(Show k, Show a) => Show (Map k a) 

Methods

showsPrec :: Int -> Map k a -> ShowS #

show :: Map k a -> String #

showList :: [Map k a] -> ShowS #

Ord k => Semigroup (Map k v) 

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

Ord k => Monoid (Map k v) 

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

(NFData k, NFData a) => NFData (Map k a) 

Methods

rnf :: Map k a -> () #

Ord k => Ixed (Map k a) 

Methods

ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) #

Ord k => At (Map k a) 

Methods

at :: Index (Map k a) -> Lens' (Map k a) (Maybe (IxValue (Map k a))) #

AsEmpty (Map k a) 

Methods

_Empty :: Prism' (Map k a) () #

Ord k => Wrapped (Map k a) 

Associated Types

type Unwrapped (Map k a) :: * #

Methods

_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) #

((~) * t (Map k' a'), Ord k) => Rewrapped (Map k a) t

Use wrapping fromList. unwrapping returns a sorted list.

(Eq k, Ord k) => SetLike (Map k v) (k, v) Source # 

Methods

conj :: (k, v) -> Map k v -> Map k v Source #

remove :: (k, v) -> Map k v -> Map k v Source #

nullSet :: Map k v -> Bool Source #

items :: Map k v -> [(k, v)] Source #

fromItems :: [(k, v)] -> Map k v Source #

singleton :: (k, v) -> Map k v Source #

size :: Map k v -> Int Source #

(~) * c d => Each (Map c a) (Map d b) a b
each :: Traversal (Map c a) (Map c b) a b

Methods

each :: Traversal (Map c a) (Map d b) a b #

type Item (Map k v) 
type Item (Map k v) = (k, v)
type Index (Map k a) 
type Index (Map k a) = k
type IxValue (Map k a) 
type IxValue (Map k a) = a
type Unwrapped (Map k a) 
type Unwrapped (Map k a) = [(k, a)]

data Set a :: * -> * #

A set of values a.

Instances

Foldable Set 

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Filterable Set Source # 

Methods

filter :: (v -> Bool) -> Set v -> Set v Source #

Ord a => IsList (Set a) 

Associated Types

type Item (Set a) :: * #

Methods

fromList :: [Item (Set a)] -> Set a #

fromListN :: Int -> [Item (Set a)] -> Set a #

toList :: Set a -> [Item (Set a)] #

Eq a => Eq (Set a) 

Methods

(==) :: Set a -> Set a -> Bool #

(/=) :: Set a -> Set a -> Bool #

(Data a, Ord a) => Data (Set a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Set a -> c (Set a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Set a) #

toConstr :: Set a -> Constr #

dataTypeOf :: Set a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Set a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Set a)) #

gmapT :: (forall b. Data b => b -> b) -> Set a -> Set a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Set a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Set a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) #

Ord a => Ord (Set a) 

Methods

compare :: Set a -> Set a -> Ordering #

(<) :: Set a -> Set a -> Bool #

(<=) :: Set a -> Set a -> Bool #

(>) :: Set a -> Set a -> Bool #

(>=) :: Set a -> Set a -> Bool #

max :: Set a -> Set a -> Set a #

min :: Set a -> Set a -> Set a #

(Read a, Ord a) => Read (Set a) 
Show a => Show (Set a) 

Methods

showsPrec :: Int -> Set a -> ShowS #

show :: Set a -> String #

showList :: [Set a] -> ShowS #

Ord a => Semigroup (Set a) 

Methods

(<>) :: Set a -> Set a -> Set a #

sconcat :: NonEmpty (Set a) -> Set a #

stimes :: Integral b => b -> Set a -> Set a #

Ord a => Monoid (Set a) 

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

NFData a => NFData (Set a) 

Methods

rnf :: Set a -> () #

Ord a => Contains (Set a) 

Methods

contains :: Index (Set a) -> Lens' (Set a) Bool #

Ord k => Ixed (Set k) 

Methods

ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) #

Ord k => At (Set k) 

Methods

at :: Index (Set k) -> Lens' (Set k) (Maybe (IxValue (Set k))) #

AsEmpty (Set a) 

Methods

_Empty :: Prism' (Set a) () #

Ord a => Wrapped (Set a) 

Associated Types

type Unwrapped (Set a) :: * #

Methods

_Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) #

((~) * t (Set a'), Ord a) => Rewrapped (Set a) t

Use wrapping fromList. unwrapping returns a sorted list.

(Eq v, Ord v) => SetLike (Set v) v Source # 

Methods

conj :: v -> Set v -> Set v Source #

remove :: v -> Set v -> Set v Source #

nullSet :: Set v -> Bool Source #

items :: Set v -> [v] Source #

fromItems :: [v] -> Set v Source #

singleton :: v -> Set v Source #

size :: Set v -> Int Source #

type Item (Set a) 
type Item (Set a) = a
type Index (Set a) 
type Index (Set a) = a
type IxValue (Set k) 
type IxValue (Set k) = ()
type Unwrapped (Set a) 
type Unwrapped (Set a) = [a]

data Vector a :: * -> * #

Boxed vectors, supporting efficient slicing.

Instances

Monad Vector 

Methods

(>>=) :: Vector a -> (a -> Vector b) -> Vector b #

(>>) :: Vector a -> Vector b -> Vector b #

return :: a -> Vector a #

fail :: String -> Vector a #

Functor Vector 

Methods

fmap :: (a -> b) -> Vector a -> Vector b #

(<$) :: a -> Vector b -> Vector a #

Applicative Vector 

Methods

pure :: a -> Vector a #

(<*>) :: Vector (a -> b) -> Vector a -> Vector b #

(*>) :: Vector a -> Vector b -> Vector b #

(<*) :: Vector a -> Vector b -> Vector a #

Foldable Vector 

Methods

fold :: Monoid m => Vector m -> m #

foldMap :: Monoid m => (a -> m) -> Vector a -> m #

foldr :: (a -> b -> b) -> b -> Vector a -> b #

foldr' :: (a -> b -> b) -> b -> Vector a -> b #

foldl :: (b -> a -> b) -> b -> Vector a -> b #

foldl' :: (b -> a -> b) -> b -> Vector a -> b #

foldr1 :: (a -> a -> a) -> Vector a -> a #

foldl1 :: (a -> a -> a) -> Vector a -> a #

toList :: Vector a -> [a] #

null :: Vector a -> Bool #

length :: Vector a -> Int #

elem :: Eq a => a -> Vector a -> Bool #

maximum :: Ord a => Vector a -> a #

minimum :: Ord a => Vector a -> a #

sum :: Num a => Vector a -> a #

product :: Num a => Vector a -> a #

Traversable Vector 

Methods

traverse :: Applicative f => (a -> f b) -> Vector a -> f (Vector b) #

sequenceA :: Applicative f => Vector (f a) -> f (Vector a) #

mapM :: Monad m => (a -> m b) -> Vector a -> m (Vector b) #

sequence :: Monad m => Vector (m a) -> m (Vector a) #

Alternative Vector 

Methods

empty :: Vector a #

(<|>) :: Vector a -> Vector a -> Vector a #

some :: Vector a -> Vector [a] #

many :: Vector a -> Vector [a] #

MonadPlus Vector 

Methods

mzero :: Vector a #

mplus :: Vector a -> Vector a -> Vector a #

Filterable Vector Source # 

Methods

filter :: (v -> Bool) -> Vector v -> Vector v Source #

Vector Vector a 

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) a -> m (Vector a) #

basicUnsafeThaw :: PrimMonad m => Vector a -> m (Mutable Vector (PrimState m) a) #

basicLength :: Vector a -> Int #

basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a #

basicUnsafeIndexM :: Monad m => Vector a -> Int -> m a #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) a -> Vector a -> m () #

elemseq :: Vector a -> a -> b -> b #

FunctorWithIndex Int Vector 

Methods

imap :: (Int -> a -> b) -> Vector a -> Vector b #

imapped :: (Indexable Int p, Settable f) => p a (f b) -> Vector a -> f (Vector b) #

FoldableWithIndex Int Vector 

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> Vector a -> m #

ifolded :: (Indexable Int p, Contravariant f, Applicative f) => p a (f a) -> Vector a -> f (Vector a) #

ifoldr :: (Int -> a -> b -> b) -> b -> Vector a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> Vector a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> Vector a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> Vector a -> b #

TraversableWithIndex Int Vector 

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> Vector a -> f (Vector b) #

itraversed :: (Indexable Int p, Applicative f) => p a (f b) -> Vector a -> f (Vector b) #

Lookup Vector Int Source # 

Methods

lookup :: Int -> Vector v -> Maybe v Source #

lookupDef :: v -> Int -> Vector v -> v Source #

IsList (Vector a) 

Associated Types

type Item (Vector a) :: * #

Methods

fromList :: [Item (Vector a)] -> Vector a #

fromListN :: Int -> [Item (Vector a)] -> Vector a #

toList :: Vector a -> [Item (Vector a)] #

Eq a => Eq (Vector a) 

Methods

(==) :: Vector a -> Vector a -> Bool #

(/=) :: Vector a -> Vector a -> Bool #

Data a => Data (Vector a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) #

toConstr :: Vector a -> Constr #

dataTypeOf :: Vector a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) #

gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

Ord a => Ord (Vector a) 

Methods

compare :: Vector a -> Vector a -> Ordering #

(<) :: Vector a -> Vector a -> Bool #

(<=) :: Vector a -> Vector a -> Bool #

(>) :: Vector a -> Vector a -> Bool #

(>=) :: Vector a -> Vector a -> Bool #

max :: Vector a -> Vector a -> Vector a #

min :: Vector a -> Vector a -> Vector a #

Read a => Read (Vector a) 
Show a => Show (Vector a) 

Methods

showsPrec :: Int -> Vector a -> ShowS #

show :: Vector a -> String #

showList :: [Vector a] -> ShowS #

Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

NFData a => NFData (Vector a) 

Methods

rnf :: Vector a -> () #

Ixed (Vector a) 

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

AsEmpty (Vector a) 

Methods

_Empty :: Prism' (Vector a) () #

Wrapped (Vector a) 

Associated Types

type Unwrapped (Vector a) :: * #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Reversing (Vector a) 

Methods

reversing :: Vector a -> Vector a #

(~) * t (Vector a') => Rewrapped (Vector a) t 
Eq a => SetLike (Vector a) a Source # 

Methods

conj :: a -> Vector a -> Vector a Source #

remove :: a -> Vector a -> Vector a Source #

nullSet :: Vector a -> Bool Source #

items :: Vector a -> [a] Source #

fromItems :: [a] -> Vector a Source #

singleton :: a -> Vector a Source #

size :: Vector a -> Int Source #

ListLike (Vector a) a Source # 

Methods

intersperse :: a -> Vector a -> Vector a Source #

take :: Int -> Vector a -> Vector a Source #

takeEnd :: Int -> Vector a -> Vector a Source #

drop :: Int -> Vector a -> Vector a Source #

dropEnd :: Int -> Vector a -> Vector a Source #

slice :: Int -> Int -> Vector a -> Vector a Source #

listLength :: Vector a -> Int Source #

Cons (Vector a) (Vector b) a b 

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

Snoc (Vector a) (Vector b) a b 

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

Each (Vector a) (Vector b) a b
each :: Traversal (Vector a) (Vector b) a b

Methods

each :: Traversal (Vector a) (Vector b) a b #

type Mutable Vector 
type Item (Vector a) 
type Item (Vector a) = a
type Index (Vector a) 
type Index (Vector a) = Int
type IxValue (Vector a) 
type IxValue (Vector a) = a
type Unwrapped (Vector a) 
type Unwrapped (Vector a) = [a]

class Hashable a where #

The class of types that can be converted to a hash value.

Minimal implementation: hashWithSalt.

Methods

hashWithSalt :: Int -> a -> Int infixl 0 #

Return a hash value for the argument, using the given salt.

The general contract of hashWithSalt is:

  • If two values are equal according to the == method, then applying the hashWithSalt method on each of the two values must produce the same integer result if the same salt is used in each case.
  • It is not required that if two values are unequal according to the == method, then applying the hashWithSalt method on each of the two values must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal values may improve the performance of hashing-based data structures.
  • This method can be used to compute different hash values for the same input by providing a different salt in each application of the method. This implies that any instance that defines hashWithSalt must make use of the salt in its implementation.

hash :: a -> Int #

Like hashWithSalt, but no salt is used. The default implementation uses hashWithSalt with some default salt. Instances might want to implement this method to provide a more efficient implementation than the default implementation.

Instances

Hashable Bool 

Methods

hashWithSalt :: Int -> Bool -> Int #

hash :: Bool -> Int #

Hashable Char 

Methods

hashWithSalt :: Int -> Char -> Int #

hash :: Char -> Int #

Hashable Double 

Methods

hashWithSalt :: Int -> Double -> Int #

hash :: Double -> Int #

Hashable Float 

Methods

hashWithSalt :: Int -> Float -> Int #

hash :: Float -> Int #

Hashable Int 

Methods

hashWithSalt :: Int -> Int -> Int #

hash :: Int -> Int #

Hashable Int8 

Methods

hashWithSalt :: Int -> Int8 -> Int #

hash :: Int8 -> Int #

Hashable Int16 

Methods

hashWithSalt :: Int -> Int16 -> Int #

hash :: Int16 -> Int #

Hashable Int32 

Methods

hashWithSalt :: Int -> Int32 -> Int #

hash :: Int32 -> Int #

Hashable Int64 

Methods

hashWithSalt :: Int -> Int64 -> Int #

hash :: Int64 -> Int #

Hashable Integer 

Methods

hashWithSalt :: Int -> Integer -> Int #

hash :: Integer -> Int #

Hashable Ordering 

Methods

hashWithSalt :: Int -> Ordering -> Int #

hash :: Ordering -> Int #

Hashable Word 

Methods

hashWithSalt :: Int -> Word -> Int #

hash :: Word -> Int #

Hashable Word8 

Methods

hashWithSalt :: Int -> Word8 -> Int #

hash :: Word8 -> Int #

Hashable Word16 

Methods

hashWithSalt :: Int -> Word16 -> Int #

hash :: Word16 -> Int #

Hashable Word32 

Methods

hashWithSalt :: Int -> Word32 -> Int #

hash :: Word32 -> Int #

Hashable Word64 

Methods

hashWithSalt :: Int -> Word64 -> Int #

hash :: Word64 -> Int #

Hashable TypeRep 

Methods

hashWithSalt :: Int -> TypeRep -> Int #

hash :: TypeRep -> Int #

Hashable () 

Methods

hashWithSalt :: Int -> () -> Int #

hash :: () -> Int #

Hashable ByteString 
Hashable Scientific 
Hashable ByteString 
Hashable Text 

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

Hashable Value 

Methods

hashWithSalt :: Int -> Value -> Int #

hash :: Value -> Int #

Hashable Text 

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

Hashable BigNat 

Methods

hashWithSalt :: Int -> BigNat -> Int #

hash :: BigNat -> Int #

Hashable Natural 

Methods

hashWithSalt :: Int -> Natural -> Int #

hash :: Natural -> Int #

Hashable Void 

Methods

hashWithSalt :: Int -> Void -> Int #

hash :: Void -> Int #

Hashable Version 

Methods

hashWithSalt :: Int -> Version -> Int #

hash :: Version -> Int #

Hashable Unique 

Methods

hashWithSalt :: Int -> Unique -> Int #

hash :: Unique -> Int #

Hashable ThreadId 

Methods

hashWithSalt :: Int -> ThreadId -> Int #

hash :: ThreadId -> Int #

Hashable WordPtr 

Methods

hashWithSalt :: Int -> WordPtr -> Int #

hash :: WordPtr -> Int #

Hashable IntPtr 

Methods

hashWithSalt :: Int -> IntPtr -> Int #

hash :: IntPtr -> Int #

Hashable ShortByteString 
Hashable a => Hashable [a] 

Methods

hashWithSalt :: Int -> [a] -> Int #

hash :: [a] -> Int #

Hashable a => Hashable (Maybe a) 

Methods

hashWithSalt :: Int -> Maybe a -> Int #

hash :: Maybe a -> Int #

Hashable a => Hashable (Ratio a) 

Methods

hashWithSalt :: Int -> Ratio a -> Int #

hash :: Ratio a -> Int #

Hashable (Ptr a) 

Methods

hashWithSalt :: Int -> Ptr a -> Int #

hash :: Ptr a -> Int #

Hashable (FunPtr a) 

Methods

hashWithSalt :: Int -> FunPtr a -> Int #

hash :: FunPtr a -> Int #

Hashable a => Hashable (Identity a) 

Methods

hashWithSalt :: Int -> Identity a -> Int #

hash :: Identity a -> Int #

Hashable a => Hashable (Min a) 

Methods

hashWithSalt :: Int -> Min a -> Int #

hash :: Min a -> Int #

Hashable a => Hashable (Max a) 

Methods

hashWithSalt :: Int -> Max a -> Int #

hash :: Max a -> Int #

Hashable a => Hashable (First a) 

Methods

hashWithSalt :: Int -> First a -> Int #

hash :: First a -> Int #

Hashable a => Hashable (Last a) 

Methods

hashWithSalt :: Int -> Last a -> Int #

hash :: Last a -> Int #

Hashable a => Hashable (WrappedMonoid a) 
Hashable a => Hashable (Option a) 

Methods

hashWithSalt :: Int -> Option a -> Int #

hash :: Option a -> Int #

Hashable a => Hashable (NonEmpty a) 

Methods

hashWithSalt :: Int -> NonEmpty a -> Int #

hash :: NonEmpty a -> Int #

Hashable (Fixed a) 

Methods

hashWithSalt :: Int -> Fixed a -> Int #

hash :: Fixed a -> Int #

Hashable (StableName a) 

Methods

hashWithSalt :: Int -> StableName a -> Int #

hash :: StableName a -> Int #

Hashable (Hashed a) 

Methods

hashWithSalt :: Int -> Hashed a -> Int #

hash :: Hashed a -> Int #

Hashable a => Hashable (HashSet a) 

Methods

hashWithSalt :: Int -> HashSet a -> Int #

hash :: HashSet a -> Int #

(Hashable a, Hashable b) => Hashable (Either a b) 

Methods

hashWithSalt :: Int -> Either a b -> Int #

hash :: Either a b -> Int #

(Hashable a1, Hashable a2) => Hashable (a1, a2) 

Methods

hashWithSalt :: Int -> (a1, a2) -> Int #

hash :: (a1, a2) -> Int #

(Hashable k, Hashable v) => Hashable (HashMap k v) 

Methods

hashWithSalt :: Int -> HashMap k v -> Int #

hash :: HashMap k v -> Int #

(Hashable a, Hashable b) => Hashable (Arg a b) 

Methods

hashWithSalt :: Int -> Arg a b -> Int #

hash :: Arg a b -> Int #

Hashable (Proxy * a) 

Methods

hashWithSalt :: Int -> Proxy * a -> Int #

hash :: Proxy * a -> Int #

(Hashable a1, Hashable a2, Hashable a3) => Hashable (a1, a2, a3) 

Methods

hashWithSalt :: Int -> (a1, a2, a3) -> Int #

hash :: (a1, a2, a3) -> Int #

Hashable a => Hashable (Const * a b) 

Methods

hashWithSalt :: Int -> Const * a b -> Int #

hash :: Const * a b -> Int #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4) => Hashable (a1, a2, a3, a4) 

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4) -> Int #

hash :: (a1, a2, a3, a4) -> Int #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Sum * f g a) 

Methods

hashWithSalt :: Int -> Sum * f g a -> Int #

hash :: Sum * f g a -> Int #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Product * f g a) 

Methods

hashWithSalt :: Int -> Product * f g a -> Int #

hash :: Product * f g a -> Int #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5) => Hashable (a1, a2, a3, a4, a5) 

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5) -> Int #

hash :: (a1, a2, a3, a4, a5) -> Int #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Compose * * f g a)

In general, hash (Compose x) ≠ hash x. However, hashWithSalt satisfies its variant of this equivalence.

Methods

hashWithSalt :: Int -> Compose * * f g a -> Int #

hash :: Compose * * f g a -> Int #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6) => Hashable (a1, a2, a3, a4, a5, a6) 

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5, a6) -> Int #

hash :: (a1, a2, a3, a4, a5, a6) -> Int #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6, Hashable a7) => Hashable (a1, a2, a3, a4, a5, a6, a7) 

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5, a6, a7) -> Int #

hash :: (a1, a2, a3, a4, a5, a6, a7) -> Int #

class Lookup m k | m -> k where Source #

Things that support keyed element lookup.

Minimal complete definition

lookup

Methods

lookup :: k -> m v -> Maybe v Source #

lookupDef :: v -> k -> m v -> v Source #

Instances

Lookup [] Int Source # 

Methods

lookup :: Int -> [v] -> Maybe v Source #

lookupDef :: v -> Int -> [v] -> v Source #

Lookup Vector Int Source # 

Methods

lookup :: Int -> Vector v -> Maybe v Source #

lookupDef :: v -> Int -> Vector v -> v Source #

(Eq k, Hashable k) => Lookup (HashMap k) k Source # 

Methods

lookup :: k -> HashMap k v -> Maybe v Source #

lookupDef :: v -> k -> HashMap k v -> v Source #

(Eq k, Ord k) => Lookup (Map k) k Source # 

Methods

lookup :: k -> Map k v -> Maybe v Source #

lookupDef :: v -> k -> Map k v -> v Source #

Eq k => Lookup (AList k) k Source # 

Methods

lookup :: k -> AList k v -> Maybe v Source #

lookupDef :: v -> k -> AList k v -> v Source #

(Eq k, Hashable k) => Lookup (LHashMap k) k Source # 

Methods

lookup :: k -> LHashMap k v -> Maybe v Source #

lookupDef :: v -> k -> LHashMap k v -> v Source #

class ListLike m a | m -> a where Source #

Minimal complete definition

intersperse, take, drop, listLength

Methods

intersperse :: a -> m -> m Source #

take :: Int -> m -> m Source #

takeEnd :: Int -> m -> m Source #

drop :: Int -> m -> m Source #

dropEnd :: Int -> m -> m Source #

slice :: Int -> Int -> m -> m Source #

listLength :: m -> Int Source #

Instances

ListLike LText Char Source # 
ListLike Text Char Source # 
ListLike [a] a Source # 

Methods

intersperse :: a -> [a] -> [a] Source #

take :: Int -> [a] -> [a] Source #

takeEnd :: Int -> [a] -> [a] Source #

drop :: Int -> [a] -> [a] Source #

dropEnd :: Int -> [a] -> [a] Source #

slice :: Int -> Int -> [a] -> [a] Source #

listLength :: [a] -> Int Source #

ListLike (Vector a) a Source # 

Methods

intersperse :: a -> Vector a -> Vector a Source #

take :: Int -> Vector a -> Vector a Source #

takeEnd :: Int -> Vector a -> Vector a Source #

drop :: Int -> Vector a -> Vector a Source #

dropEnd :: Int -> Vector a -> Vector a Source #

slice :: Int -> Int -> Vector a -> Vector a Source #

listLength :: Vector a -> Int Source #

class DictLike m k where Source #

Things that behave like key-value dictionaries.

Minimal complete definition

insert, delete, adjust, pairs, fromPairs, singletonMap, member

Methods

insert :: k -> v -> m k v -> m k v Source #

Add or overwrite an element at a key.

delete :: k -> m k v -> m k v Source #

Delete by key

adjust :: k -> (v -> v) -> m k v -> m k v Source #

Modify an element at a key

pairs :: m k v -> [(k, v)] Source #

Convert to an association list (list of key/value pairs)

fromPairs :: [(k, v)] -> m k v Source #

Convert from an association list (list of key/value pairs)

keys :: m k v -> [k] Source #

Get the keys, discard the values

elems :: m k v -> [v] Source #

Get the values, discard the keys

singletonMap :: k -> v -> m k v Source #

Create a singleton dictionary (just one key-value pair)

member :: k -> m k v -> Bool Source #

Test whether the dictionary contains a given key

Instances

(Eq k, Hashable k) => DictLike HashMap k Source # 

Methods

insert :: k -> v -> HashMap k v -> HashMap k v Source #

delete :: k -> HashMap k v -> HashMap k v Source #

adjust :: k -> (v -> v) -> HashMap k v -> HashMap k v Source #

pairs :: HashMap k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> HashMap k v Source #

keys :: HashMap k v -> [k] Source #

elems :: HashMap k v -> [v] Source #

singletonMap :: k -> v -> HashMap k v Source #

member :: k -> HashMap k v -> Bool Source #

(Eq k, Ord k) => DictLike Map k Source # 

Methods

insert :: k -> v -> Map k v -> Map k v Source #

delete :: k -> Map k v -> Map k v Source #

adjust :: k -> (v -> v) -> Map k v -> Map k v Source #

pairs :: Map k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> Map k v Source #

keys :: Map k v -> [k] Source #

elems :: Map k v -> [v] Source #

singletonMap :: k -> v -> Map k v Source #

member :: k -> Map k v -> Bool Source #

Eq k => DictLike AList k Source # 

Methods

insert :: k -> v -> AList k v -> AList k v Source #

delete :: k -> AList k v -> AList k v Source #

adjust :: k -> (v -> v) -> AList k v -> AList k v Source #

pairs :: AList k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> AList k v Source #

keys :: AList k v -> [k] Source #

elems :: AList k v -> [v] Source #

singletonMap :: k -> v -> AList k v Source #

member :: k -> AList k v -> Bool Source #

(Eq k, Hashable k) => DictLike LHashMap k Source # 

Methods

insert :: k -> v -> LHashMap k v -> LHashMap k v Source #

delete :: k -> LHashMap k v -> LHashMap k v Source #

adjust :: k -> (v -> v) -> LHashMap k v -> LHashMap k v Source #

pairs :: LHashMap k v -> [(k, v)] Source #

fromPairs :: [(k, v)] -> LHashMap k v Source #

keys :: LHashMap k v -> [k] Source #

elems :: LHashMap k v -> [v] Source #

singletonMap :: k -> v -> LHashMap k v Source #

member :: k -> LHashMap k v -> Bool Source #

class SetLike m v | m -> v where Source #

Things that behave like sets.

Minimal complete definition

conj, remove, items, fromItems, singleton

Methods

conj :: v -> m -> m Source #

Conjoin: add an element to a set. For ordered sets, the end at which the new element is inserted is unspecified.

remove :: v -> m -> m Source #

Remove all occurrences of the element from the set.

nullSet :: m -> Bool Source #

Test if the set is empty.

items :: m -> [v] Source #

Convert the set to a list of elements. The ordering is unspecified.

fromItems :: [v] -> m Source #

Create a set from a list of elements. Duplicate list elements may be skipped at the implementation's discretion.

singleton :: v -> m Source #

Create a singleton (one-element) set.

size :: m -> Int Source #

Get the number of elements in the set.

Instances

Eq a => SetLike [a] a Source # 

Methods

conj :: a -> [a] -> [a] Source #

remove :: a -> [a] -> [a] Source #

nullSet :: [a] -> Bool Source #

items :: [a] -> [a] Source #

fromItems :: [a] -> [a] Source #

singleton :: a -> [a] Source #

size :: [a] -> Int Source #

(Eq v, Ord v) => SetLike (Set v) v Source # 

Methods

conj :: v -> Set v -> Set v Source #

remove :: v -> Set v -> Set v Source #

nullSet :: Set v -> Bool Source #

items :: Set v -> [v] Source #

fromItems :: [v] -> Set v Source #

singleton :: v -> Set v Source #

size :: Set v -> Int Source #

Eq a => SetLike (Vector a) a Source # 

Methods

conj :: a -> Vector a -> Vector a Source #

remove :: a -> Vector a -> Vector a Source #

nullSet :: Vector a -> Bool Source #

items :: Vector a -> [a] Source #

fromItems :: [a] -> Vector a Source #

singleton :: a -> Vector a Source #

size :: Vector a -> Int Source #

(Eq v, Hashable v) => SetLike (HashSet v) v Source # 

Methods

conj :: v -> HashSet v -> HashSet v Source #

remove :: v -> HashSet v -> HashSet v Source #

nullSet :: HashSet v -> Bool Source #

items :: HashSet v -> [v] Source #

fromItems :: [v] -> HashSet v Source #

singleton :: v -> HashSet v Source #

size :: HashSet v -> Int Source #

(Eq k, Ord k) => SetLike (Map k v) (k, v) Source # 

Methods

conj :: (k, v) -> Map k v -> Map k v Source #

remove :: (k, v) -> Map k v -> Map k v Source #

nullSet :: Map k v -> Bool Source #

items :: Map k v -> [(k, v)] Source #

fromItems :: [(k, v)] -> Map k v Source #

singleton :: (k, v) -> Map k v Source #

size :: Map k v -> Int Source #

(Eq k, Hashable k) => SetLike (LHashMap k v) (k, v) Source # 

Methods

conj :: (k, v) -> LHashMap k v -> LHashMap k v Source #

remove :: (k, v) -> LHashMap k v -> LHashMap k v Source #

nullSet :: LHashMap k v -> Bool Source #

items :: LHashMap k v -> [(k, v)] Source #

fromItems :: [(k, v)] -> LHashMap k v Source #

singleton :: (k, v) -> LHashMap k v Source #

size :: LHashMap k v -> Int Source #

(Eq k, Hashable k) => SetLike (HashMap k v) (k, v) Source # 

Methods

conj :: (k, v) -> HashMap k v -> HashMap k v Source #

remove :: (k, v) -> HashMap k v -> HashMap k v Source #

nullSet :: HashMap k v -> Bool Source #

items :: HashMap k v -> [(k, v)] Source #

fromItems :: [(k, v)] -> HashMap k v Source #

singleton :: (k, v) -> HashMap k v Source #

size :: HashMap k v -> Int Source #

class Filterable m where Source #

Things that can be filtered

Minimal complete definition

filter

Methods

filter :: (v -> Bool) -> m v -> m v Source #

Filter the set to retain only the elements that match the predicate.

Instances

Filterable [] Source # 

Methods

filter :: (v -> Bool) -> [v] -> [v] Source #

Filterable Set Source # 

Methods

filter :: (v -> Bool) -> Set v -> Set v Source #

Filterable Vector Source # 

Methods

filter :: (v -> Bool) -> Vector v -> Vector v Source #

Filterable HashSet Source # 

Methods

filter :: (v -> Bool) -> HashSet v -> HashSet v Source #

Filterable (Map k) Source # 

Methods

filter :: (v -> Bool) -> Map k v -> Map k v Source #

Filterable (LHashMap k) Source # 

Methods

filter :: (v -> Bool) -> LHashMap k v -> LHashMap k v Source #

Filterable (HashMap k) Source # 

Methods

filter :: (v -> Bool) -> HashMap k v -> HashMap k v Source #

cull :: Filterable m => (v -> Bool) -> m v -> m v Source #

startsWith :: (Eq a, ListLike a e) => a -> a -> Bool Source #

endsWith :: (Eq a, ListLike a e) => a -> a -> Bool Source #

intercalate :: (Monoid a, Foldable m, ListLike (m a) a) => a -> m a -> a Source #

JSON

class ToJSON a where #

A type that can be converted to JSON.

An example type and instance:

-- Allow ourselves to write Text literals.
{-# LANGUAGE OverloadedStrings #-}

data Coord = Coord { x :: Double, y :: Double }

instance ToJSON Coord where
  toJSON (Coord x y) = object ["x" .= x, "y" .= y]

  toEncoding (Coord x y) = pairs ("x" .= x <> "y" .= y)

Instead of manually writing your ToJSON instance, there are two options to do it automatically:

  • Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so will probably be more efficient than the following two options:
  • The compiler can provide a default generic implementation for toJSON.

To use the second, simply add a deriving Generic clause to your datatype and declare a ToJSON instance for your datatype without giving definitions for toJSON or toEncoding.

For example, the previous example can be simplified to a more minimal instance:

{-# LANGUAGE DeriveGeneric #-}

import GHC.Generics

data Coord = Coord { x :: Double, y :: Double } deriving Generic

instance ToJSON Coord where
    toEncoding = genericToEncoding defaultOptions

Why do we provide an implementation for toEncoding here? The toEncoding function is a relatively new addition to this class. To allow users of older versions of this library to upgrade without having to edit all of their instances or encounter surprising incompatibilities, the default implementation of toEncoding uses toJSON. This produces correct results, but since it performs an intermediate conversion to a Value, it will be less efficient than directly emitting an Encoding. Our one-liner definition of toEncoding above bypasses the intermediate Value.

If DefaultSignatures doesn't give exactly the results you want, you can customize the generic encoding with only a tiny amount of effort, using genericToJSON and genericToEncoding with your preferred Options:

instance ToJSON Coord where
    toJSON     = genericToJSON defaultOptions
    toEncoding = genericToEncoding defaultOptions

Methods

toJSON :: a -> Value #

Convert a Haskell value to a JSON-friendly intermediate type.

toEncoding :: a -> Encoding #

Encode a Haskell value as JSON.

The default implementation of this method creates an intermediate Value using toJSON. This provides source-level compatibility for people upgrading from older versions of this library, but obviously offers no performance advantage.

To benefit from direct encoding, you must provide an implementation for this method. The easiest way to do so is by having your types implement Generic using the DeriveGeneric extension, and then have GHC generate a method body as follows.

instance ToJSON Coord where
    toEncoding = genericToEncoding defaultOptions

class FromJSON a where #

A type that can be converted from JSON, with the possibility of failure.

In many cases, you can get the compiler to generate parsing code for you (see below). To begin, let's cover writing an instance by hand.

There are various reasons a conversion could fail. For example, an Object could be missing a required key, an Array could be of the wrong size, or a value could be of an incompatible type.

The basic ways to signal a failed conversion are as follows:

  • empty and mzero work, but are terse and uninformative
  • fail yields a custom error message
  • typeMismatch produces an informative message for cases when the value encountered is not of the expected type

An example type and instance:

-- Allow ourselves to write Text literals.
{-# LANGUAGE OverloadedStrings #-}

data Coord = Coord { x :: Double, y :: Double }

instance FromJSON Coord where
  parseJSON (Object v) = Coord    <$>
                         v .: "x" <*>
                         v .: "y"

  -- We do not expect a non-Object value here.
  -- We could use mzero to fail, but typeMismatch
  -- gives a much more informative error message.
  parseJSON invalid    = typeMismatch "Coord" invalid

Instead of manually writing your FromJSON instance, there are two options to do it automatically:

  • Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so will probably be more efficient than the following two options:
  • The compiler can provide a default generic implementation for parseJSON.

To use the second, simply add a deriving Generic clause to your datatype and declare a FromJSON instance for your datatype without giving a definition for parseJSON.

For example, the previous example can be simplified to just:

{-# LANGUAGE DeriveGeneric #-}

import GHC.Generics

data Coord = Coord { x :: Double, y :: Double } deriving Generic

instance FromJSON Coord

If DefaultSignatures doesn't give exactly the results you want, you can customize the generic decoding with only a tiny amount of effort, using genericParseJSON with your preferred Options:

instance FromJSON Coord where
    parseJSON = genericParseJSON defaultOptions

Methods

parseJSON :: Value -> Parser a #

data Value :: * #

A JSON value represented as a Haskell value.

Instances

Eq Value 

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Data Value 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Value -> c Value #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Value #

toConstr :: Value -> Constr #

dataTypeOf :: Value -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Value) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Value) #

gmapT :: (forall b. Data b => b -> b) -> Value -> Value #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r #

gmapQ :: (forall d. Data d => d -> u) -> Value -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Value -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Value -> m Value #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value #

Read Value 
Show Value 

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

IsString Value 

Methods

fromString :: String -> Value #

Lift Value 

Methods

lift :: Value -> Q Exp #

NFData Value 

Methods

rnf :: Value -> () #

Hashable Value 

Methods

hashWithSalt :: Int -> Value -> Int #

hash :: Value -> Int #

object :: [Pair] -> Value #

Create a Value from a list of name/value Pairs. If duplicate keys arise, earlier keys and their associated values win.

deriveJSON #

Arguments

:: Options

Encoding options.

-> Name

Name of the type for which to generate ToJSON and FromJSON instances.

-> Q [Dec] 

Generates both ToJSON and FromJSON instance declarations for the given data type or data family instance constructor.

This is a convienience function which is equivalent to calling both deriveToJSON and deriveFromJSON.

(~>) :: ToJSON a => Text -> a -> (Text, Value) Source #

Base-64

Concurrency And Exception Handling

class (Typeable * e, Show e) => Exception e where #

Any type that you wish to throw or catch as an exception must be an instance of the Exception class. The simplest case is a new exception type directly below the root:

data MyException = ThisException | ThatException
    deriving (Show, Typeable)

instance Exception MyException

The default method definitions in the Exception class do what we need in this case. You can now throw and catch ThisException and ThatException as exceptions:

*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException

In more complicated examples, you may wish to define a whole hierarchy of exceptions:

---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler

data SomeCompilerException = forall e . Exception e => SomeCompilerException e
    deriving Typeable

instance Show SomeCompilerException where
    show (SomeCompilerException e) = show e

instance Exception SomeCompilerException

compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException

compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
    SomeCompilerException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler

data SomeFrontendException = forall e . Exception e => SomeFrontendException e
    deriving Typeable

instance Show SomeFrontendException where
    show (SomeFrontendException e) = show e

instance Exception SomeFrontendException where
    toException = compilerExceptionToException
    fromException = compilerExceptionFromException

frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException

frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
    SomeFrontendException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception

data MismatchedParentheses = MismatchedParentheses
    deriving (Typeable, Show)

instance Exception MismatchedParentheses where
    toException   = frontendExceptionToException
    fromException = frontendExceptionFromException

We can now catch a MismatchedParentheses exception as MismatchedParentheses, SomeFrontendException or SomeCompilerException, but not other types, e.g. IOException:

*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses

Methods

toException :: e -> SomeException #

fromException :: SomeException -> Maybe e #

displayException :: e -> String #

Render this exception value in a human-friendly manner.

Default implementation: show.

Since: 4.8.0.0

Instances

Exception Void 
Exception PatternMatchFail 
Exception RecSelError 
Exception RecConError 
Exception RecUpdError 
Exception NoMethodError 
Exception TypeError 
Exception NonTermination 
Exception NestedAtomically 
Exception BlockedIndefinitelyOnMVar 
Exception BlockedIndefinitelyOnSTM 
Exception Deadlock 
Exception AllocationLimitExceeded 
Exception AssertionFailed 
Exception SomeAsyncException 
Exception AsyncException 
Exception ArrayException 
Exception ExitCode 
Exception IOException 
Exception ErrorCall 
Exception ArithException 
Exception SomeException 

threadDelay :: Int -> IO () #

Suspends the current thread for a given number of microseconds (GHC only).

There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.

forkIO :: IO () -> IO ThreadId #

Creates a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread.

The new thread will be a lightweight, unbound thread. Foreign calls made by this thread are not guaranteed to be made by any particular OS thread; if you need foreign calls to be made by a particular OS thread, then use forkOS instead.

The new thread inherits the masked state of the parent (see mask).

The newly created thread has an exception handler that discards the exceptions BlockedIndefinitelyOnMVar, BlockedIndefinitelyOnSTM, and ThreadKilled, and passes all other exceptions to the uncaught exception handler.

bracket #

Arguments

:: IO a

computation to run first ("acquire resource")

-> (a -> IO b)

computation to run last ("release resource")

-> (a -> IO c)

computation to run in-between

-> IO c 

When you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use bracket, because bracket will install the necessary exception handler to release the resource in the event that an exception is raised during the computation. If an exception is raised, then bracket will re-raise the exception (after performing the release).

A common example is opening a file:

bracket
  (openFile "filename" ReadMode)
  (hClose)
  (\fileHandle -> do { ... })

The arguments to bracket are in this order so that we can partially apply it, e.g.:

withFile name mode = bracket (openFile name mode) hClose

bracket_ :: IO a -> IO b -> IO c -> IO c #

A variant of bracket where the return value from the first computation is not required.

throw :: Exception e => e -> a #

Throw an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad.

catch #

Arguments

:: Exception e 
=> IO a

The computation to run

-> (e -> IO a)

Handler to invoke if an exception is raised

-> IO a 

This is the simplest of the exception-catching functions. It takes a single argument, runs it, and if an exception is raised the "handler" is executed, with the value of the exception passed as an argument. Otherwise, the result is returned as normal. For example:

  catch (readFile f)
        (\e -> do let err = show (e :: IOException)
                  hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err)
                  return "")

Note that we have to give a type signature to e, or the program will not typecheck as the type is ambiguous. While it is possible to catch exceptions of any type, see the section "Catching all exceptions" (in Control.Exception) for an explanation of the problems with doing so.

For catching exceptions in pure (non-IO) expressions, see the function evaluate.

Note that due to Haskell's unspecified evaluation order, an expression may throw one of several possible exceptions: consider the expression (error "urk") + (1 `div` 0). Does the expression throw ErrorCall "urk", or DivideByZero?

The answer is "it might throw either"; the choice is non-deterministic. If you are catching any type of exception then you might catch either. If you are calling catch with type IO Int -> (ArithException -> IO Int) -> IO Int then the handler may get run with DivideByZero as an argument, or an ErrorCall "urk" exception may be propogated further up. If you call it again, you might get a the opposite behaviour. This is ok, because catch is an IO computation.

catches :: IO a -> [Handler a] -> IO a #

Sometimes you want to catch two different sorts of exception. You could do something like

f = expr `catch` \ (ex :: ArithException) -> handleArith ex
         `catch` \ (ex :: IOException)    -> handleIO    ex

However, there are a couple of problems with this approach. The first is that having two exception handlers is inefficient. However, the more serious issue is that the second exception handler will catch exceptions in the first, e.g. in the example above, if handleArith throws an IOException then the second exception handler will catch it.

Instead, we provide a function catches, which would be used thus:

f = expr `catches` [Handler (\ (ex :: ArithException) -> handleArith ex),
                    Handler (\ (ex :: IOException)    -> handleIO    ex)]

Generics

class Generic a #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

Minimal complete definition

from, to

Instances

Generic Bool 

Associated Types

type Rep Bool :: * -> * #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

Generic Ordering 

Associated Types

type Rep Ordering :: * -> * #

Methods

from :: Ordering -> Rep Ordering x #

to :: Rep Ordering x -> Ordering #

Generic Exp 

Associated Types

type Rep Exp :: * -> * #

Methods

from :: Exp -> Rep Exp x #

to :: Rep Exp x -> Exp #

Generic Match 

Associated Types

type Rep Match :: * -> * #

Methods

from :: Match -> Rep Match x #

to :: Rep Match x -> Match #

Generic Clause 

Associated Types

type Rep Clause :: * -> * #

Methods

from :: Clause -> Rep Clause x #

to :: Rep Clause x -> Clause #

Generic Pat 

Associated Types

type Rep Pat :: * -> * #

Methods

from :: Pat -> Rep Pat x #

to :: Rep Pat x -> Pat #

Generic Type 

Associated Types

type Rep Type :: * -> * #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Generic Dec 

Associated Types

type Rep Dec :: * -> * #

Methods

from :: Dec -> Rep Dec x #

to :: Rep Dec x -> Dec #

Generic Name 

Associated Types

type Rep Name :: * -> * #

Methods

from :: Name -> Rep Name x #

to :: Rep Name x -> Name #

Generic FunDep 

Associated Types

type Rep FunDep :: * -> * #

Methods

from :: FunDep -> Rep FunDep x #

to :: Rep FunDep x -> FunDep #

Generic TyVarBndr 

Associated Types

type Rep TyVarBndr :: * -> * #

Generic InjectivityAnn 

Associated Types

type Rep InjectivityAnn :: * -> * #

Generic Overlap 

Associated Types

type Rep Overlap :: * -> * #

Methods

from :: Overlap -> Rep Overlap x #

to :: Rep Overlap x -> Overlap #

Generic () 

Associated Types

type Rep () :: * -> * #

Methods

from :: () -> Rep () x #

to :: Rep () x -> () #

Generic Con 

Associated Types

type Rep Con :: * -> * #

Methods

from :: Con -> Rep Con x #

to :: Rep Con x -> Con #

Generic Void 

Associated Types

type Rep Void :: * -> * #

Methods

from :: Void -> Rep Void x #

to :: Rep Void x -> Void #

Generic Version 

Associated Types

type Rep Version :: * -> * #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Generic ExitCode 

Associated Types

type Rep ExitCode :: * -> * #

Methods

from :: ExitCode -> Rep ExitCode x #

to :: Rep ExitCode x -> ExitCode #

Generic All 

Associated Types

type Rep All :: * -> * #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Generic Any 

Associated Types

type Rep Any :: * -> * #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Generic Fixity 

Associated Types

type Rep Fixity :: * -> * #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic Associativity 

Associated Types

type Rep Associativity :: * -> * #

Generic SourceUnpackedness 
Generic SourceStrictness 
Generic DecidedStrictness 
Generic ModName 

Associated Types

type Rep ModName :: * -> * #

Methods

from :: ModName -> Rep ModName x #

to :: Rep ModName x -> ModName #

Generic PkgName 

Associated Types

type Rep PkgName :: * -> * #

Methods

from :: PkgName -> Rep PkgName x #

to :: Rep PkgName x -> PkgName #

Generic Module 

Associated Types

type Rep Module :: * -> * #

Methods

from :: Module -> Rep Module x #

to :: Rep Module x -> Module #

Generic OccName 

Associated Types

type Rep OccName :: * -> * #

Methods

from :: OccName -> Rep OccName x #

to :: Rep OccName x -> OccName #

Generic NameFlavour 

Associated Types

type Rep NameFlavour :: * -> * #

Generic NameSpace 

Associated Types

type Rep NameSpace :: * -> * #

Generic Loc 

Associated Types

type Rep Loc :: * -> * #

Methods

from :: Loc -> Rep Loc x #

to :: Rep Loc x -> Loc #

Generic Info 

Associated Types

type Rep Info :: * -> * #

Methods

from :: Info -> Rep Info x #

to :: Rep Info x -> Info #

Generic ModuleInfo 

Associated Types

type Rep ModuleInfo :: * -> * #

Generic Fixity 

Associated Types

type Rep Fixity :: * -> * #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic FixityDirection 
Generic Lit 

Associated Types

type Rep Lit :: * -> * #

Methods

from :: Lit -> Rep Lit x #

to :: Rep Lit x -> Lit #

Generic Body 

Associated Types

type Rep Body :: * -> * #

Methods

from :: Body -> Rep Body x #

to :: Rep Body x -> Body #

Generic Guard 

Associated Types

type Rep Guard :: * -> * #

Methods

from :: Guard -> Rep Guard x #

to :: Rep Guard x -> Guard #

Generic Stmt 

Associated Types

type Rep Stmt :: * -> * #

Methods

from :: Stmt -> Rep Stmt x #

to :: Rep Stmt x -> Stmt #

Generic Range 

Associated Types

type Rep Range :: * -> * #

Methods

from :: Range -> Rep Range x #

to :: Rep Range x -> Range #

Generic TypeFamilyHead 

Associated Types

type Rep TypeFamilyHead :: * -> * #

Generic TySynEqn 

Associated Types

type Rep TySynEqn :: * -> * #

Methods

from :: TySynEqn -> Rep TySynEqn x #

to :: Rep TySynEqn x -> TySynEqn #

Generic FamFlavour 

Associated Types

type Rep FamFlavour :: * -> * #

Generic Foreign 

Associated Types

type Rep Foreign :: * -> * #

Methods

from :: Foreign -> Rep Foreign x #

to :: Rep Foreign x -> Foreign #

Generic Callconv 

Associated Types

type Rep Callconv :: * -> * #

Methods

from :: Callconv -> Rep Callconv x #

to :: Rep Callconv x -> Callconv #

Generic Safety 

Associated Types

type Rep Safety :: * -> * #

Methods

from :: Safety -> Rep Safety x #

to :: Rep Safety x -> Safety #

Generic Pragma 

Associated Types

type Rep Pragma :: * -> * #

Methods

from :: Pragma -> Rep Pragma x #

to :: Rep Pragma x -> Pragma #

Generic Inline 

Associated Types

type Rep Inline :: * -> * #

Methods

from :: Inline -> Rep Inline x #

to :: Rep Inline x -> Inline #

Generic RuleMatch 

Associated Types

type Rep RuleMatch :: * -> * #

Generic Phases 

Associated Types

type Rep Phases :: * -> * #

Methods

from :: Phases -> Rep Phases x #

to :: Rep Phases x -> Phases #

Generic RuleBndr 

Associated Types

type Rep RuleBndr :: * -> * #

Methods

from :: RuleBndr -> Rep RuleBndr x #

to :: Rep RuleBndr x -> RuleBndr #

Generic AnnTarget 

Associated Types

type Rep AnnTarget :: * -> * #

Generic SourceUnpackedness 
Generic SourceStrictness 
Generic DecidedStrictness 
Generic Bang 

Associated Types

type Rep Bang :: * -> * #

Methods

from :: Bang -> Rep Bang x #

to :: Rep Bang x -> Bang #

Generic FamilyResultSig 
Generic TyLit 

Associated Types

type Rep TyLit :: * -> * #

Methods

from :: TyLit -> Rep TyLit x #

to :: Rep TyLit x -> TyLit #

Generic Role 

Associated Types

type Rep Role :: * -> * #

Methods

from :: Role -> Rep Role x #

to :: Rep Role x -> Role #

Generic AnnLookup 

Associated Types

type Rep AnnLookup :: * -> * #

Generic [a] 

Associated Types

type Rep [a] :: * -> * #

Methods

from :: [a] -> Rep [a] x #

to :: Rep [a] x -> [a] #

Generic (Maybe a) 

Associated Types

type Rep (Maybe a) :: * -> * #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Generic (V1 p) 

Associated Types

type Rep (V1 p) :: * -> * #

Methods

from :: V1 p -> Rep (V1 p) x #

to :: Rep (V1 p) x -> V1 p #

Generic (U1 p) 

Associated Types

type Rep (U1 p) :: * -> * #

Methods

from :: U1 p -> Rep (U1 p) x #

to :: Rep (U1 p) x -> U1 p #

Generic (Par1 p) 

Associated Types

type Rep (Par1 p) :: * -> * #

Methods

from :: Par1 p -> Rep (Par1 p) x #

to :: Rep (Par1 p) x -> Par1 p #

Generic (Identity a) 

Associated Types

type Rep (Identity a) :: * -> * #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Generic (Min a) 

Associated Types

type Rep (Min a) :: * -> * #

Methods

from :: Min a -> Rep (Min a) x #

to :: Rep (Min a) x -> Min a #

Generic (Max a) 

Associated Types

type Rep (Max a) :: * -> * #

Methods

from :: Max a -> Rep (Max a) x #

to :: Rep (Max a) x -> Max a #

Generic (First a) 

Associated Types

type Rep (First a) :: * -> * #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 

Associated Types

type Rep (Last a) :: * -> * #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (WrappedMonoid m) 

Associated Types

type Rep (WrappedMonoid m) :: * -> * #

Generic (Option a) 

Associated Types

type Rep (Option a) :: * -> * #

Methods

from :: Option a -> Rep (Option a) x #

to :: Rep (Option a) x -> Option a #

Generic (NonEmpty a) 

Associated Types

type Rep (NonEmpty a) :: * -> * #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Generic (Complex a) 

Associated Types

type Rep (Complex a) :: * -> * #

Methods

from :: Complex a -> Rep (Complex a) x #

to :: Rep (Complex a) x -> Complex a #

Generic (ZipList a) 

Associated Types

type Rep (ZipList a) :: * -> * #

Methods

from :: ZipList a -> Rep (ZipList a) x #

to :: Rep (ZipList a) x -> ZipList a #

Generic (Dual a) 

Associated Types

type Rep (Dual a) :: * -> * #

Methods

from :: Dual a -> Rep (Dual a) x #

to :: Rep (Dual a) x -> Dual a #

Generic (Endo a) 

Associated Types

type Rep (Endo a) :: * -> * #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Generic (Sum a) 

Associated Types

type Rep (Sum a) :: * -> * #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

Generic (Product a) 

Associated Types

type Rep (Product a) :: * -> * #

Methods

from :: Product a -> Rep (Product a) x #

to :: Rep (Product a) x -> Product a #

Generic (First a) 

Associated Types

type Rep (First a) :: * -> * #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 

Associated Types

type Rep (Last a) :: * -> * #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (Either a b) 

Associated Types

type Rep (Either a b) :: * -> * #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

Generic (Rec1 f p) 

Associated Types

type Rep (Rec1 f p) :: * -> * #

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x #

to :: Rep (Rec1 f p) x -> Rec1 f p #

Generic (URec Char p) 

Associated Types

type Rep (URec Char p) :: * -> * #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

Generic (URec Double p) 

Associated Types

type Rep (URec Double p) :: * -> * #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

Generic (URec Float p) 

Associated Types

type Rep (URec Float p) :: * -> * #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

Generic (URec Int p) 

Associated Types

type Rep (URec Int p) :: * -> * #

Methods

from :: URec Int p -> Rep (URec Int p) x #

to :: Rep (URec Int p) x -> URec Int p #

Generic (URec Word p) 

Associated Types

type Rep (URec Word p) :: * -> * #

Methods

from :: URec Word p -> Rep (URec Word p) x #

to :: Rep (URec Word p) x -> URec Word p #

Generic (URec (Ptr ()) p) 

Associated Types

type Rep (URec (Ptr ()) p) :: * -> * #

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #

Generic (a, b) 

Associated Types

type Rep (a, b) :: * -> * #

Methods

from :: (a, b) -> Rep (a, b) x #

to :: Rep (a, b) x -> (a, b) #

Generic (Arg a b) 

Associated Types

type Rep (Arg a b) :: * -> * #

Methods

from :: Arg a b -> Rep (Arg a b) x #

to :: Rep (Arg a b) x -> Arg a b #

Generic (WrappedMonad m a) 

Associated Types

type Rep (WrappedMonad m a) :: * -> * #

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #

Generic (Proxy k t) 

Associated Types

type Rep (Proxy k t) :: * -> * #

Methods

from :: Proxy k t -> Rep (Proxy k t) x #

to :: Rep (Proxy k t) x -> Proxy k t #

Generic (AList k v) # 

Associated Types

type Rep (AList k v) :: * -> * #

Methods

from :: AList k v -> Rep (AList k v) x #

to :: Rep (AList k v) x -> AList k v #

Generic (LHashMap k v) # 

Associated Types

type Rep (LHashMap k v) :: * -> * #

Methods

from :: LHashMap k v -> Rep (LHashMap k v) x #

to :: Rep (LHashMap k v) x -> LHashMap k v #

Generic (K1 i c p) 

Associated Types

type Rep (K1 i c p) :: * -> * #

Methods

from :: K1 i c p -> Rep (K1 i c p) x #

to :: Rep (K1 i c p) x -> K1 i c p #

Generic ((:+:) f g p) 

Associated Types

type Rep ((:+:) f g p) :: * -> * #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x #

to :: Rep ((f :+: g) p) x -> (f :+: g) p #

Generic ((:*:) f g p) 

Associated Types

type Rep ((:*:) f g p) :: * -> * #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x #

to :: Rep ((f :*: g) p) x -> (f :*: g) p #

Generic ((:.:) f g p) 

Associated Types

type Rep ((:.:) f g p) :: * -> * #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x #

to :: Rep ((f :.: g) p) x -> (f :.: g) p #

Generic (a, b, c) 

Associated Types

type Rep (a, b, c) :: * -> * #

Methods

from :: (a, b, c) -> Rep (a, b, c) x #

to :: Rep (a, b, c) x -> (a, b, c) #

Generic (WrappedArrow a b c) 

Associated Types

type Rep (WrappedArrow a b c) :: * -> * #

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #

Generic (Const k a b) 

Associated Types

type Rep (Const k a b) :: * -> * #

Methods

from :: Const k a b -> Rep (Const k a b) x #

to :: Rep (Const k a b) x -> Const k a b #

Generic (Alt k f a) 

Associated Types

type Rep (Alt k f a) :: * -> * #

Methods

from :: Alt k f a -> Rep (Alt k f a) x #

to :: Rep (Alt k f a) x -> Alt k f a #

Generic (Join k p a) 

Associated Types

type Rep (Join k p a) :: * -> * #

Methods

from :: Join k p a -> Rep (Join k p a) x #

to :: Rep (Join k p a) x -> Join k p a #

Generic (Tagged k s b) 

Associated Types

type Rep (Tagged k s b) :: * -> * #

Methods

from :: Tagged k s b -> Rep (Tagged k s b) x #

to :: Rep (Tagged k s b) x -> Tagged k s b #

Generic (M1 i c f p) 

Associated Types

type Rep (M1 i c f p) :: * -> * #

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x #

to :: Rep (M1 i c f p) x -> M1 i c f p #

Generic (a, b, c, d) 

Associated Types

type Rep (a, b, c, d) :: * -> * #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x #

to :: Rep (a, b, c, d) x -> (a, b, c, d) #

Generic (Sum k f g a) 

Associated Types

type Rep (Sum k f g a) :: * -> * #

Methods

from :: Sum k f g a -> Rep (Sum k f g a) x #

to :: Rep (Sum k f g a) x -> Sum k f g a #

Generic (Product k f g a) 

Associated Types

type Rep (Product k f g a) :: * -> * #

Methods

from :: Product k f g a -> Rep (Product k f g a) x #

to :: Rep (Product k f g a) x -> Product k f g a #

Generic (a, b, c, d, e) 

Associated Types

type Rep (a, b, c, d, e) :: * -> * #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) #

Generic (Compose k1 k f g a) 

Associated Types

type Rep (Compose k1 k f g a) :: * -> * #

Methods

from :: Compose k1 k f g a -> Rep (Compose k1 k f g a) x #

to :: Rep (Compose k1 k f g a) x -> Compose k1 k f g a #

Generic (WrappedBifunctor k1 k p a b) 

Associated Types

type Rep (WrappedBifunctor k1 k p a b) :: * -> * #

Methods

from :: WrappedBifunctor k1 k p a b -> Rep (WrappedBifunctor k1 k p a b) x #

to :: Rep (WrappedBifunctor k1 k p a b) x -> WrappedBifunctor k1 k p a b #

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 #

Generic (Flip k k1 p a b) 

Associated Types

type Rep (Flip k k1 p a b) :: * -> * #

Methods

from :: Flip k k1 p a b -> Rep (Flip k k1 p a b) x #

to :: Rep (Flip k k1 p a b) x -> Flip k k1 p a b #

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 #

Generic (a, b, c, d, e, f) 

Associated Types

type Rep (a, b, c, d, e, f) :: * -> * #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) #

Generic (Product k1 k f g a b) 

Associated Types

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

Methods

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

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

Generic (Sum k1 k p q a b) 

Associated Types

type Rep (Sum k1 k p q a b) :: * -> * #

Methods

from :: Sum k1 k p q a b -> Rep (Sum k1 k p q a b) x #

to :: Rep (Sum k1 k p q a b) x -> Sum k1 k p q a b #

Generic (a, b, c, d, e, f, g) 

Associated Types

type Rep (a, b, c, d, e, f, g) :: * -> * #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) #

Generic (Tannen k2 k1 k f p a b) 

Associated Types

type Rep (Tannen k2 k1 k f p a b) :: * -> * #

Methods

from :: Tannen k2 k1 k f p a b -> Rep (Tannen k2 k1 k f p a b) x #

to :: Rep (Tannen k2 k1 k f p a b) x -> Tannen k2 k1 k f p a b #

Generic (Biff k3 k2 k1 k p f g a b) 

Associated Types

type Rep (Biff k3 k2 k1 k p f g a b) :: * -> * #

Methods

from :: Biff k3 k2 k1 k p f g a b -> Rep (Biff k3 k2 k1 k p f g a b) x #

to :: Rep (Biff k3 k2 k1 k p f g a b) x -> Biff k3 k2 k1 k p f g a b #

Functions

chain :: Traversable t => t (a -> a) -> a -> a Source #

id :: a -> a #

Identity function.

const :: a -> b -> a #

const x is a unary function which evaluates to x for all inputs.

For instance,

>>> map (const 42) [0..3]
[42,42,42,42]

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9 #

Function composition.

flip :: (a -> b -> c) -> b -> a -> c #

flip f takes its (first) two arguments in the reverse order of f.

($) :: (a -> b) -> a -> b infixr 0 #

Application operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:

    f $ g $ h x  =  f (g (h x))

It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs.

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

Since: 4.8.0.0

fix :: (a -> a) -> a #

fix f is the least fixed point of the function f, i.e. the least defined x such that f x = x.

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 #

(*) `on` f = \x y -> f x * f y.

Typical usage: sortBy (compare `on` fst).

Algebraic properties:

  • (*) `on` id = (*) (if (*) ∉ {⊥, const ⊥})
  • ((*) `on` f) `on` g = (*) `on` (f . g)
  • flip on f . flip on g = flip on (g . f)

Date and Time

newtype Day :: * #

The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.

Instances

Enum Day 

Methods

succ :: Day -> Day #

pred :: Day -> Day #

toEnum :: Int -> Day #

fromEnum :: Day -> Int #

enumFrom :: Day -> [Day] #

enumFromThen :: Day -> Day -> [Day] #

enumFromTo :: Day -> Day -> [Day] #

enumFromThenTo :: Day -> Day -> Day -> [Day] #

Eq Day 

Methods

(==) :: Day -> Day -> Bool #

(/=) :: Day -> Day -> Bool #

Data Day 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day #

toConstr :: Day -> Constr #

dataTypeOf :: Day -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Day) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) #

gmapT :: (forall b. Data b => b -> b) -> Day -> Day #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r #

gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day #

Ord Day 

Methods

compare :: Day -> Day -> Ordering #

(<) :: Day -> Day -> Bool #

(<=) :: Day -> Day -> Bool #

(>) :: Day -> Day -> Bool #

(>=) :: Day -> Day -> Bool #

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

Ix Day 

Methods

range :: (Day, Day) -> [Day] #

index :: (Day, Day) -> Day -> Int #

unsafeIndex :: (Day, Day) -> Day -> Int

inRange :: (Day, Day) -> Day -> Bool #

rangeSize :: (Day, Day) -> Int #

unsafeRangeSize :: (Day, Day) -> Int

NFData Day 

Methods

rnf :: Day -> () #

FormatTime Day 
ParseTime Day 

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Day #

data TimeOfDay :: * #

Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.

Constructors

TimeOfDay 

Fields

  • todHour :: Int

    range 0 - 23

  • todMin :: Int

    range 0 - 59

  • todSec :: Pico

    Note that 0 <= todSec < 61, accomodating leap seconds. Any local minute may have a leap second, since leap seconds happen in all zones simultaneously

Instances

Eq TimeOfDay 
Data TimeOfDay 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeOfDay -> c TimeOfDay #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeOfDay #

toConstr :: TimeOfDay -> Constr #

dataTypeOf :: TimeOfDay -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TimeOfDay) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeOfDay) #

gmapT :: (forall b. Data b => b -> b) -> TimeOfDay -> TimeOfDay #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r #

gmapQ :: (forall d. Data d => d -> u) -> TimeOfDay -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeOfDay -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay #

Ord TimeOfDay 
Show TimeOfDay 
NFData TimeOfDay 

Methods

rnf :: TimeOfDay -> () #

FormatTime TimeOfDay 
ParseTime TimeOfDay 

data UTCTime :: * #

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime 

Fields

Instances

Eq UTCTime 

Methods

(==) :: UTCTime -> UTCTime -> Bool #

(/=) :: UTCTime -> UTCTime -> Bool #

Data UTCTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime #

toConstr :: UTCTime -> Constr #

dataTypeOf :: UTCTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime) #

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime #

Ord UTCTime 
NFData UTCTime 

Methods

rnf :: UTCTime -> () #

FormatTime UTCTime 
ParseTime UTCTime 

data LocalTime :: * #

A simple day and time aggregate, where the day is of the specified parameter, and the time is a TimeOfDay. Conversion of this (as local civil time) to UTC depends on the time zone. Conversion of this (as local mean time) to UT1 depends on the longitude.

Constructors

LocalTime 

Instances

Eq LocalTime 
Data LocalTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LocalTime -> c LocalTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LocalTime #

toConstr :: LocalTime -> Constr #

dataTypeOf :: LocalTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c LocalTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LocalTime) #

gmapT :: (forall b. Data b => b -> b) -> LocalTime -> LocalTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> LocalTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LocalTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime #

Ord LocalTime 
Show LocalTime 
NFData LocalTime 

Methods

rnf :: LocalTime -> () #

FormatTime LocalTime 
ParseTime LocalTime 

data TimeZone :: * #

A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.

Constructors

TimeZone 

Fields

Instances

Eq TimeZone 
Data TimeZone 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeZone -> c TimeZone #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeZone #

toConstr :: TimeZone -> Constr #

dataTypeOf :: TimeZone -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TimeZone) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeZone) #

gmapT :: (forall b. Data b => b -> b) -> TimeZone -> TimeZone #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r #

gmapQ :: (forall d. Data d => d -> u) -> TimeZone -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeZone -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone #

Ord TimeZone 
Show TimeZone 
NFData TimeZone 

Methods

rnf :: TimeZone -> () #

FormatTime TimeZone 
ParseTime TimeZone 

data ZonedTime :: * #

A local time together with a TimeZone.

Instances

Data ZonedTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZonedTime -> c ZonedTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ZonedTime #

toConstr :: ZonedTime -> Constr #

dataTypeOf :: ZonedTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ZonedTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ZonedTime) #

gmapT :: (forall b. Data b => b -> b) -> ZonedTime -> ZonedTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> ZonedTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZonedTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

Show ZonedTime 
NFData ZonedTime 

Methods

rnf :: ZonedTime -> () #

FormatTime ZonedTime 
ParseTime ZonedTime 

data TimeLocale :: * #

Constructors

TimeLocale 

Fields

data DiffTime :: * #

This is a length of time, as measured by a clock. Conversion functions will treat it as seconds. It has a precision of 10^-12 s.

Instances

Enum DiffTime 
Eq DiffTime 
Fractional DiffTime 
Data DiffTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime #

toConstr :: DiffTime -> Constr #

dataTypeOf :: DiffTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) #

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime #

Num DiffTime 
Ord DiffTime 
Real DiffTime 
RealFrac DiffTime 

Methods

properFraction :: Integral b => DiffTime -> (b, DiffTime) #

truncate :: Integral b => DiffTime -> b #

round :: Integral b => DiffTime -> b #

ceiling :: Integral b => DiffTime -> b #

floor :: Integral b => DiffTime -> b #

Show DiffTime 
NFData DiffTime 

Methods

rnf :: DiffTime -> () #

data NominalDiffTime :: * #

This is a length of time, as measured by UTC. Conversion functions will treat it as seconds. It has a precision of 10^-12 s. It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

Instances

Enum NominalDiffTime 
Eq NominalDiffTime 
Fractional NominalDiffTime 
Data NominalDiffTime 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime #

toConstr :: NominalDiffTime -> Constr #

dataTypeOf :: NominalDiffTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) #

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime #

Num NominalDiffTime 
Ord NominalDiffTime 
Real NominalDiffTime 
RealFrac NominalDiffTime 
Show NominalDiffTime 
NFData NominalDiffTime 

Methods

rnf :: NominalDiffTime -> () #

secondsToDiffTime :: Integer -> DiffTime #

Create a DiffTime which represents an integral number of seconds.

picosecondsToDiffTime :: Integer -> DiffTime #

Create a DiffTime from a number of picoseconds.

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime #

addUTCTime a b = a + b

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime #

diffUTCTime a b = a - b

getCurrentTime :: IO UTCTime #

Get the current UTC time from the system clock.

defaultTimeLocale :: TimeLocale #

Locale representing American usage.

knownTimeZones contains only the ten time-zones mentioned in RFC 822 sec. 5: "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT". Note that the parsing functions will regardless parse single-letter military time-zones and +HHMM format.

toGregorian :: Day -> (Integer, Int, Int) #

convert to proleptic Gregorian calendar. First element of result is year, second month number (1-12), third day (1-31).

fromGregorian :: Integer -> Int -> Int -> Day #

convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31). Invalid values will be clipped to the correct range, month first, then day.

formatTime :: FormatTime t => TimeLocale -> String -> t -> String #

Substitute various time-related information for each %-code in the string, as per formatCharacter.

For all types (note these three are done here, not by formatCharacter):

%%
%
%t
tab
%n
newline

glibc-style modifiers can be used before the letter (here marked as z):

%-z
no padding
%_z
pad with spaces
%0z
pad with zeros
%^z
convert to upper case
%#z
convert to lower case (consistently, unlike glibc)

For TimeZone (and ZonedTime and UTCTime):

%z
timezone offset in the format -HHMM.
%Z
timezone name

For LocalTime (and ZonedTime and UTCTime and UniversalTime):

%c
as dateTimeFmt locale (e.g. %a %b %e %H:%M:%S %Z %Y)

For TimeOfDay (and LocalTime and ZonedTime and UTCTime and UniversalTime):

%R
same as %H:%M
%T
same as %H:%M:%S
%X
as timeFmt locale (e.g. %H:%M:%S)
%r
as time12Fmt locale (e.g. %I:%M:%S %p)
%P
day-half of day from (amPm locale), converted to lowercase, am, pm
%p
day-half of day from (amPm locale), AM, PM
%H
hour of day (24-hour), 0-padded to two chars, 00 - 23
%k
hour of day (24-hour), space-padded to two chars, 0 - 23
%I
hour of day-half (12-hour), 0-padded to two chars, 01 - 12
%l
hour of day-half (12-hour), space-padded to two chars, 1 - 12
%M
minute of hour, 0-padded to two chars, 00 - 59
%S
second of minute (without decimal part), 0-padded to two chars, 00 - 60
%q
picosecond of second, 0-padded to twelve chars, 000000000000 - 999999999999.
%Q
decimal point and fraction of second, up to 12 second decimals, without trailing zeros. For a whole number of seconds, %Q produces the empty string.

For UTCTime and ZonedTime:

%s
number of whole seconds since the Unix epoch. For times before the Unix epoch, this is a negative number. Note that in %s.%q and %s%Q the decimals are positive, not negative. For example, 0.9 seconds before the Unix epoch is formatted as -1.1 with %s%Q.

For Day (and LocalTime and ZonedTime and UTCTime and UniversalTime):

%D
same as %m/%d/%y
%F
same as %Y-%m-%d
%x
as dateFmt locale (e.g. %m/%d/%y)
%Y
year, no padding. Note %0Y and %_Y pad to four chars
%y
year of century, 0-padded to two chars, 00 - 99
%C
century, no padding. Note %0C and %_C pad to two chars
%B
month name, long form (fst from months locale), January - December
%b, %h
month name, short form (snd from months locale), Jan - Dec
%m
month of year, 0-padded to two chars, 01 - 12
%d
day of month, 0-padded to two chars, 01 - 31
%e
day of month, space-padded to two chars, 1 - 31
%j
day of year, 0-padded to three chars, 001 - 366
%G
year for Week Date format, no padding. Note %0G and %_G pad to four chars
%g
year of century for Week Date format, 0-padded to two chars, 00 - 99
%f
century for Week Date format, no padding. Note %0f and %_f pad to two chars
%V
week of year for Week Date format, 0-padded to two chars, 01 - 53
%u
day of week for Week Date format, 1 - 7
%a
day of week, short form (snd from wDays locale), Sun - Sat
%A
day of week, long form (fst from wDays locale), Sunday - Saturday
%U
week of year where weeks start on Sunday (as sundayStartWeek), 0-padded to two chars, 00 - 53
%w
day of week number, 0 (= Sunday) - 6 (= Saturday)
%W
week of year where weeks start on Monday (as mondayStartWeek), 0-padded to two chars, 00 - 53