papa-base-export-0.4: Prelude with only useful functions

Papa.Base.Export.Prelude

Synopsis

# Documentation

class Applicative m => Monad (m :: * -> *) #

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:

• return a >>= k  =  k a
• m >>= return  =  m
• m >>= (\x -> k x >>= h)  =  (m >>= k) >>= h

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

• pure = return
• (<*>) = ap

The above laws imply:

• fmap f xs  =  xs >>= return . f
• (>>) = (*>)

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

(>>=)

Instances

 Monad [] Since: 2.1 Methods(>>=) :: [a] -> (a -> [b]) -> [b] #(>>) :: [a] -> [b] -> [b] #return :: a -> [a] #fail :: String -> [a] # Since: 2.1 Methods(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #(>>) :: Maybe a -> Maybe b -> Maybe b #return :: a -> Maybe a #fail :: String -> Maybe a # Since: 2.1 Methods(>>=) :: IO a -> (a -> IO b) -> IO b #(>>) :: IO a -> IO b -> IO b #return :: a -> IO a #fail :: String -> IO a # Since: 4.9.0.0 Methods(>>=) :: Min a -> (a -> Min b) -> Min b #(>>) :: Min a -> Min b -> Min b #return :: a -> Min a #fail :: String -> Min a # Since: 4.9.0.0 Methods(>>=) :: Max a -> (a -> Max b) -> Max b #(>>) :: Max a -> Max b -> Max b #return :: a -> Max a #fail :: String -> Max a # Since: 4.9.0.0 Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a #fail :: String -> First a # Since: 4.9.0.0 Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a #fail :: String -> Last a # Since: 4.9.0.0 Methods(>>=) :: Option a -> (a -> Option b) -> Option b #(>>) :: Option a -> Option b -> Option b #return :: a -> Option a #fail :: String -> Option a # Since: 4.9.0.0 Methods(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #return :: a -> NonEmpty a #fail :: String -> NonEmpty a # Since: 4.8.0.0 Methods(>>=) :: Dual a -> (a -> Dual b) -> Dual b #(>>) :: Dual a -> Dual b -> Dual b #return :: a -> Dual a #fail :: String -> Dual a # Since: 4.8.0.0 Methods(>>=) :: Sum a -> (a -> Sum b) -> Sum b #(>>) :: Sum a -> Sum b -> Sum b #return :: a -> Sum a #fail :: String -> Sum a # Since: 4.8.0.0 Methods(>>=) :: Product a -> (a -> Product b) -> Product b #(>>) :: Product a -> Product b -> Product b #return :: a -> Product a #fail :: String -> Product a # Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a #fail :: String -> First a # Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a #fail :: String -> Last a # Monad (Either e) Since: 4.4.0.0 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 # Monoid a => Monad ((,) a) Since: 4.9.0.0 Methods(>>=) :: (a, a) -> (a -> (a, b)) -> (a, b) #(>>) :: (a, a) -> (a, b) -> (a, b) #return :: a -> (a, a) #fail :: String -> (a, 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 # 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 ((->) LiftedRep LiftedRep r) Since: 2.1 Methods(>>=) :: (LiftedRep -> LiftedRep) r a -> (a -> (LiftedRep -> LiftedRep) r b) -> (LiftedRep -> LiftedRep) r b #(>>) :: (LiftedRep -> LiftedRep) r a -> (LiftedRep -> LiftedRep) r b -> (LiftedRep -> LiftedRep) r b #return :: a -> (LiftedRep -> LiftedRep) r a #fail :: String -> (LiftedRep -> LiftedRep) r a #

encodeFloat :: RealFloat a => Integer -> Int -> a #

encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, uncurry encodeFloat (decodeFloat x) = x. encodeFloat m n is one of the two closest representable floating-point numbers to m*b^^n (or ±Infinity if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction.

($) :: (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. 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 Methods mempty :: a # Identity of mappend Instances  Since: 2.1 Methodsmconcat :: [Ordering] -> Ordering # Monoid () Since: 2.1 Methodsmempty :: () #mappend :: () -> () -> () #mconcat :: [()] -> () # Since: 2.1 Methodsmappend :: All -> All -> All #mconcat :: [All] -> All # Since: 2.1 Methodsmappend :: Any -> Any -> Any #mconcat :: [Any] -> Any # Monoid [a] Since: 2.1 Methodsmempty :: [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 used to be no "Semigroup" typeclass providing just mappend, we use Monoid instead.Since: 2.1 Methodsmempty :: Maybe a #mappend :: Maybe a -> Maybe a -> Maybe a #mconcat :: [Maybe a] -> Maybe a # Monoid a => Monoid (IO a) Since: 4.9.0.0 Methodsmempty :: IO a #mappend :: IO a -> IO a -> IO a #mconcat :: [IO a] -> IO a # (Ord a, Bounded a) => Monoid (Min a) Since: 4.9.0.0 Methodsmempty :: Min a #mappend :: Min a -> Min a -> Min a #mconcat :: [Min a] -> Min a # (Ord a, Bounded a) => Monoid (Max a) Since: 4.9.0.0 Methodsmempty :: Max a #mappend :: Max a -> Max a -> Max a #mconcat :: [Max a] -> Max a # Monoid m => Monoid (WrappedMonoid m) Since: 4.9.0.0 Methodsmconcat :: [WrappedMonoid m] -> WrappedMonoid m # Semigroup a => Monoid (Option a) Since: 4.9.0.0 Methodsmappend :: Option a -> Option a -> Option a #mconcat :: [Option a] -> Option a # Monoid a => Monoid (Dual a) Since: 2.1 Methodsmempty :: Dual a #mappend :: Dual a -> Dual a -> Dual a #mconcat :: [Dual a] -> Dual a # Monoid (Endo a) Since: 2.1 Methodsmempty :: Endo a #mappend :: Endo a -> Endo a -> Endo a #mconcat :: [Endo a] -> Endo a # Num a => Monoid (Sum a) Since: 2.1 Methodsmempty :: Sum a #mappend :: Sum a -> Sum a -> Sum a #mconcat :: [Sum a] -> Sum a # Num a => Monoid (Product a) Since: 2.1 Methodsmappend :: Product a -> Product a -> Product a #mconcat :: [Product a] -> Product a # Monoid (First a) Since: 2.1 Methodsmempty :: First a #mappend :: First a -> First a -> First a #mconcat :: [First a] -> First a # Monoid (Last a) Since: 2.1 Methodsmempty :: Last a #mappend :: Last a -> Last a -> Last a #mconcat :: [Last a] -> Last a # Monoid b => Monoid (a -> b) Since: 2.1 Methodsmempty :: a -> b #mappend :: (a -> b) -> (a -> b) -> a -> b #mconcat :: [a -> b] -> a -> b # (Monoid a, Monoid b) => Monoid (a, b) Since: 2.1 Methodsmempty :: (a, b) #mappend :: (a, b) -> (a, b) -> (a, b) #mconcat :: [(a, b)] -> (a, b) # (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) Since: 2.1 Methodsmempty :: (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) Methodsmempty :: 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) Since: 4.8.0.0 Methodsmempty :: Alt * f a #mappend :: Alt * f a -> Alt * f a -> Alt * f a #mconcat :: [Alt * f a] -> Alt * f a # (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) Since: 2.1 Methodsmempty :: (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) Since: 2.1 Methodsmempty :: (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) # (&&) :: Bool -> Bool -> Bool infixr 3 # Boolean "and" class Num a where # Basic numeric class. Minimal complete definition (+), (*), abs, signum, fromInteger, (negate | (-)) Methods (+) :: a -> a -> a infixl 6 # (-) :: a -> a -> a infixl 6 # (*) :: a -> a -> a infixl 7 # negate :: a -> a # Unary negation. abs :: a -> a # Absolute value. signum :: a -> a # Sign of a number. The functions abs and signum should satisfy the law: abs x * signum x == x For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive). fromInteger :: Integer -> a # Conversion from an Integer. An integer literal represents the application of the function fromInteger to the appropriate value of type Integer, so such literals have type (Num a) => a. Instances  Since: 2.1 Methods(+) :: Int -> Int -> Int #(-) :: Int -> Int -> Int #(*) :: Int -> Int -> Int #negate :: Int -> Int #abs :: Int -> Int #signum :: Int -> Int # Since: 2.1 Methods(+) :: Int8 -> Int8 -> Int8 #(-) :: Int8 -> Int8 -> Int8 #(*) :: Int8 -> Int8 -> Int8 #negate :: Int8 -> Int8 #abs :: Int8 -> Int8 #signum :: Int8 -> Int8 # Since: 2.1 Methods(+) :: Int16 -> Int16 -> Int16 #(-) :: Int16 -> Int16 -> Int16 #(*) :: Int16 -> Int16 -> Int16 #abs :: Int16 -> Int16 # Since: 2.1 Methods(+) :: Int32 -> Int32 -> Int32 #(-) :: Int32 -> Int32 -> Int32 #(*) :: Int32 -> Int32 -> Int32 #abs :: Int32 -> Int32 # Since: 2.1 Methods(+) :: Int64 -> Int64 -> Int64 #(-) :: Int64 -> Int64 -> Int64 #(*) :: Int64 -> Int64 -> Int64 #abs :: Int64 -> Int64 # Since: 2.1 Methods Since: 2.1 Methods(+) :: Word -> Word -> Word #(-) :: Word -> Word -> Word #(*) :: Word -> Word -> Word #negate :: Word -> Word #abs :: Word -> Word #signum :: Word -> Word # Integral a => Num (Ratio a) Since: 2.0.1 Methods(+) :: Ratio a -> Ratio a -> Ratio a #(-) :: Ratio a -> Ratio a -> Ratio a #(*) :: Ratio a -> Ratio a -> Ratio a #negate :: Ratio a -> Ratio a #abs :: Ratio a -> Ratio a #signum :: Ratio a -> Ratio a # Num a => Num (Min a) Since: 4.9.0.0 Methods(+) :: Min a -> Min a -> Min a #(-) :: Min a -> Min a -> Min a #(*) :: Min a -> Min a -> Min a #negate :: Min a -> Min a #abs :: Min a -> Min a #signum :: Min a -> Min a # Num a => Num (Max a) Since: 4.9.0.0 Methods(+) :: Max a -> Max a -> Max a #(-) :: Max a -> Max a -> Max a #(*) :: Max a -> Max a -> Max a #negate :: Max a -> Max a #abs :: Max a -> Max a #signum :: Max a -> Max 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 # 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 # 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 # 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 # (*) :: Num a => a -> a -> a infixl 7 # 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 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  Methodscompare :: Bool -> Bool -> Ordering #(<) :: Bool -> Bool -> Bool #(<=) :: Bool -> Bool -> Bool #(>) :: Bool -> Bool -> Bool #(>=) :: Bool -> Bool -> Bool #max :: Bool -> Bool -> Bool #min :: Bool -> Bool -> Bool # Methodscompare :: Char -> Char -> Ordering #(<) :: Char -> Char -> Bool #(<=) :: Char -> Char -> Bool #(>) :: Char -> Char -> Bool #(>=) :: Char -> Char -> Bool #max :: Char -> Char -> Char #min :: Char -> Char -> Char # Methods(<) :: Double -> Double -> Bool #(<=) :: Double -> Double -> Bool #(>) :: Double -> Double -> Bool #(>=) :: Double -> Double -> Bool #max :: Double -> Double -> Double #min :: Double -> Double -> Double # Methods(<) :: Float -> Float -> Bool #(<=) :: Float -> Float -> Bool #(>) :: Float -> Float -> Bool #(>=) :: Float -> Float -> Bool #max :: Float -> Float -> Float #min :: Float -> Float -> Float # Methodscompare :: Int -> Int -> Ordering #(<) :: Int -> Int -> Bool #(<=) :: Int -> Int -> Bool #(>) :: Int -> Int -> Bool #(>=) :: Int -> Int -> Bool #max :: Int -> Int -> Int #min :: Int -> Int -> Int # Since: 2.1 Methodscompare :: Int8 -> Int8 -> Ordering #(<) :: Int8 -> Int8 -> Bool #(<=) :: Int8 -> Int8 -> Bool #(>) :: Int8 -> Int8 -> Bool #(>=) :: Int8 -> Int8 -> Bool #max :: Int8 -> Int8 -> Int8 #min :: Int8 -> Int8 -> Int8 # Since: 2.1 Methods(<) :: Int16 -> Int16 -> Bool #(<=) :: Int16 -> Int16 -> Bool #(>) :: Int16 -> Int16 -> Bool #(>=) :: Int16 -> Int16 -> Bool #max :: Int16 -> Int16 -> Int16 #min :: Int16 -> Int16 -> Int16 # Since: 2.1 Methods(<) :: Int32 -> Int32 -> Bool #(<=) :: Int32 -> Int32 -> Bool #(>) :: Int32 -> Int32 -> Bool #(>=) :: Int32 -> Int32 -> Bool #max :: Int32 -> Int32 -> Int32 #min :: Int32 -> Int32 -> Int32 # Since: 2.1 Methods(<) :: Int64 -> Int64 -> Bool #(<=) :: Int64 -> Int64 -> Bool #(>) :: Int64 -> Int64 -> Bool #(>=) :: Int64 -> Int64 -> Bool #max :: Int64 -> Int64 -> Int64 #min :: Int64 -> Int64 -> Int64 # Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Methods(<) :: Ordering -> Ordering -> Bool #(>) :: Ordering -> Ordering -> Bool # Methodscompare :: Word -> Word -> Ordering #(<) :: Word -> Word -> Bool #(<=) :: Word -> Word -> Bool #(>) :: Word -> Word -> Bool #(>=) :: Word -> Word -> Bool #max :: Word -> Word -> Word #min :: Word -> Word -> Word # Ord () Methodscompare :: () -> () -> Ordering #(<) :: () -> () -> Bool #(<=) :: () -> () -> Bool #(>) :: () -> () -> Bool #(>=) :: () -> () -> Bool #max :: () -> () -> () #min :: () -> () -> () # Methods(<) :: TyCon -> TyCon -> Bool #(<=) :: TyCon -> TyCon -> Bool #(>) :: TyCon -> TyCon -> Bool #(>=) :: TyCon -> TyCon -> Bool #max :: TyCon -> TyCon -> TyCon #min :: TyCon -> TyCon -> TyCon # Methods(<) :: BigNat -> BigNat -> Bool #(<=) :: BigNat -> BigNat -> Bool #(>) :: BigNat -> BigNat -> Bool #(>=) :: BigNat -> BigNat -> Bool #max :: BigNat -> BigNat -> BigNat #min :: BigNat -> BigNat -> BigNat # Since: 4.8.0.0 Methodscompare :: Void -> Void -> Ordering #(<) :: Void -> Void -> Bool #(<=) :: Void -> Void -> Bool #(>) :: Void -> Void -> Bool #(>=) :: Void -> Void -> Bool #max :: Void -> Void -> Void #min :: Void -> Void -> Void # Methods Methods Methods(<) :: ExitCode -> ExitCode -> Bool #(>) :: ExitCode -> ExitCode -> Bool # Methodscompare :: All -> All -> Ordering #(<) :: All -> All -> Bool #(<=) :: All -> All -> Bool #(>) :: All -> All -> Bool #(>=) :: All -> All -> Bool #max :: All -> All -> All #min :: All -> All -> All # Methodscompare :: Any -> Any -> Ordering #(<) :: Any -> Any -> Bool #(<=) :: Any -> Any -> Bool #(>) :: Any -> Any -> Bool #(>=) :: Any -> Any -> Bool #max :: Any -> Any -> Any #min :: Any -> Any -> Any # Methods Ord a => Ord [a] Methodscompare :: [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) Methodscompare :: 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) Since: 2.0.1 Methodscompare :: 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 a => Ord (Min a) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Methods(<) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(>) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # Ord a => Ord (Option a) Methodscompare :: 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) Methodscompare :: 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 a => Ord (ZipList a) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Methodscompare :: 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) Since: 4.6.0.0 Methodscompare :: 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 b, Ord a) => Ord (Either a b) Methodscompare :: 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 a, Ord b) => Ord (a, b) Methodscompare :: (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 a => Ord (Arg a b) Since: 4.9.0.0 Methodscompare :: 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 a, Ord b, Ord c) => Ord (a, b, c) Methodscompare :: (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) Methodscompare :: 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) Methodscompare :: 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 a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) Methodscompare :: (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) # (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) Methodscompare :: (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) # (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) Methodscompare :: (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 a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) Methodscompare :: (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 a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) Methodscompare :: (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) Methodscompare :: (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 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) Methodscompare :: (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) Methodscompare :: (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) Methodscompare :: (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) Methodscompare :: (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) Methodscompare :: (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) Methodscompare :: (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) # max :: Ord a => a -> a -> a # sequenceA :: Traversable t => forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a) # Evaluate each action in the structure from left to right, and and collect the results. For a version that ignores the results see sequenceA_. (**) :: Floating a => a -> a -> a infixr 8 # data Ordering :: * # Constructors  LT EQ GT Instances  Since: 2.1 Methods Since: 2.1 MethodsenumFrom :: Ordering -> [Ordering] #enumFromTo :: Ordering -> Ordering -> [Ordering] # Methods Methods(<) :: Ordering -> Ordering -> Bool #(>) :: Ordering -> Ordering -> Bool # Since: 2.1 Methods MethodsshowList :: [Ordering] -> ShowS # Since: 4.9.0.0 Methodsstimes :: Integral b => b -> Ordering -> Ordering # Since: 2.1 Methodsmconcat :: [Ordering] -> Ordering # Arbitrary-precision rational numbers, represented as a ratio of two Integer values. A rational number may be constructed using the % operator. show :: Show a => a -> String # A specialised variant of showsPrec, using precedence context zero, and returning an ordinary String. (+) :: Num a => a -> a -> a infixl 6 # even :: Integral a => a -> Bool # 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 ""  exp :: Floating a => a -> a # (-) :: Num a => a -> a -> a infixl 6 # class (Num a, Ord a) => Real a where # Minimal complete definition toRational Methods toRational :: a -> Rational # the rational equivalent of its real argument with full precision Instances  Since: 2.0.1 Methods Since: 2.1 Methods Since: 2.1 Methods Since: 2.1 Methods Since: 2.1 Methods Since: 2.0.1 Methods Since: 2.1 Methods Integral a => Real (Ratio a) Since: 2.0.1 MethodstoRational :: Ratio a -> Rational # Real a => Real (Const k a b) MethodstoRational :: Const k a b -> Rational # exponent :: RealFloat a => a -> Int # exponent corresponds to the second component of decodeFloat. exponent 0 = 0 and for finite nonzero x, exponent x = snd (decodeFloat x) + floatDigits x. If x is a finite floating-point number, it is equal in value to significand x * b ^^ exponent x, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values. mempty :: Monoid a => a # Identity of mappend showParen :: Bool -> ShowS -> ShowS # utility function that surrounds the inner show function with parentheses when the Bool parameter is True. class (RealFrac a, Floating a) => RealFloat a where # Efficient, machine-independent access to the components of a floating-point number. Minimal complete definition Methods floatRadix :: a -> Integer # a constant function, returning the radix of the representation (often 2) floatDigits :: a -> Int # a constant function, returning the number of digits of floatRadix in the significand floatRange :: a -> (Int, Int) # a constant function, returning the lowest and highest values the exponent may assume decodeFloat :: a -> (Integer, Int) # The function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). If decodeFloat x yields (m,n), then x is equal in value to m*b^^n, where b is the floating-point radix, and furthermore, either m and n are both zero or else b^(d-1) <= abs m < b^d, where d is the value of floatDigits x. In particular, decodeFloat 0 = (0,0). If the type contains a negative zero, also decodeFloat (-0.0) = (0,0). The result of decodeFloat x is unspecified if either of isNaN x or isInfinite x is True. encodeFloat :: Integer -> Int -> a # encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, uncurry encodeFloat (decodeFloat x) = x. encodeFloat m n is one of the two closest representable floating-point numbers to m*b^^n (or ±Infinity if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction. exponent :: a -> Int # exponent corresponds to the second component of decodeFloat. exponent 0 = 0 and for finite nonzero x, exponent x = snd (decodeFloat x) + floatDigits x. If x is a finite floating-point number, it is equal in value to significand x * b ^^ exponent x, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values. significand :: a -> a # The first component of decodeFloat, scaled to lie in the open interval (-1,1), either 0.0 or of absolute value >= 1/b, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values. scaleFloat :: Int -> a -> a # multiplies a floating-point number by an integer power of the radix isNaN :: a -> Bool # True if the argument is an IEEE "not-a-number" (NaN) value isInfinite :: a -> Bool # True if the argument is an IEEE infinity or negative infinity isDenormalized :: a -> Bool # True if the argument is too small to be represented in normalized format isNegativeZero :: a -> Bool # True if the argument is an IEEE negative zero isIEEE :: a -> Bool # True if the argument is an IEEE floating point number atan2 :: a -> a -> a # a version of arctangent taking two real floating-point arguments. For real floating x and y, atan2 y x computes the angle (from the positive x-axis) of the vector from the origin to the point (x,y). atan2 y x returns a value in the range [-pi, pi]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. atan2 y 1, with y in a type that is RealFloat, should return the same value as atan y. A default definition of atan2 is provided, but implementors can provide a more accurate implementation. Instances  Since: 2.1 MethodsfloatRange :: Double -> (Int, Int) #decodeFloat :: Double -> (Integer, Int) #isNaN :: Double -> Bool #atan2 :: Double -> Double -> Double # Since: 2.1 MethodsfloatRange :: Float -> (Int, Int) #decodeFloat :: Float -> (Integer, Int) #scaleFloat :: Int -> Float -> Float #isNaN :: Float -> Bool #isIEEE :: Float -> Bool #atan2 :: Float -> Float -> Float # RealFloat a => RealFloat (Const k a b) MethodsfloatRadix :: 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 # min :: Ord a => a -> a -> a # (/) :: Fractional a => a -> a -> a infixl 7 # fractional division filter :: (a -> Bool) -> [a] -> [a] # filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., filter p xs = [ x | x <- xs, p x] shows :: Show a => a -> ShowS # equivalent to showsPrec with a precedence of 0. (/=) :: Eq a => a -> a -> Bool infix 4 # Arguments  :: Show a => Int the operator precedence of the enclosing context (a number from 0 to 11). Function application has precedence 10. -> a the value to be converted to a String -> ShowS Convert a value to a readable String. showsPrec should satisfy the law showsPrec d x r ++ s == showsPrec d x (r ++ s) Derived instances of Read and Show satisfy the following: • (x,"") is an element of (readsPrec d (showsPrec d x "")). That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with. (<) :: Ord a => a -> a -> Bool infix 4 # class Show a where # Conversion of values to readable Strings. Derived instances of Show have the following properties, which are compatible with derived instances of Read: • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used. • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor. • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression. • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration. For example, given the declarations infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a the derived instance of Show is equivalent to instance (Show a) => Show (Tree a) where showsPrec d (Leaf m) = showParen (d > app_prec)$
showString "Leaf " . showsPrec (app_prec+1) m
where app_prec = 10

showsPrec d (u :^: v) = showParen (d > up_prec) $showsPrec (up_prec+1) u . showString " :^: " . showsPrec (up_prec+1) v where up_prec = 5 Note that right-associativity of :^: is ignored. For example, • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)". Minimal complete definition Methods Arguments  :: Int the operator precedence of the enclosing context (a number from 0 to 11). Function application has precedence 10. -> a the value to be converted to a String -> ShowS Convert a value to a readable String. showsPrec should satisfy the law showsPrec d x r ++ s == showsPrec d x (r ++ s) Derived instances of Read and Show satisfy the following: • (x,"") is an element of (readsPrec d (showsPrec d x "")). That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with. show :: a -> String # A specialised variant of showsPrec, using precedence context zero, and returning an ordinary String. Instances  MethodsshowsPrec :: Int -> Bool -> ShowS #show :: Bool -> String #showList :: [Bool] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Char -> ShowS #show :: Char -> String #showList :: [Char] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Int -> ShowS #show :: Int -> String #showList :: [Int] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Int8 -> ShowS #show :: Int8 -> String #showList :: [Int8] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Int16 -> ShowS #show :: Int16 -> String #showList :: [Int16] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Int32 -> ShowS #show :: Int32 -> String #showList :: [Int32] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Int64 -> ShowS #show :: Int64 -> String #showList :: [Int64] -> ShowS # Since: 2.1 MethodsshowList :: [Integer] -> ShowS # MethodsshowList :: [Ordering] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> Word -> ShowS #show :: Word -> String #showList :: [Word] -> ShowS # Since: 4.9.0.0 MethodsshowList :: [CallStack] -> ShowS # Show () MethodsshowsPrec :: Int -> () -> ShowS #show :: () -> String #showList :: [()] -> ShowS # Since: 2.1 MethodsshowsPrec :: Int -> TyCon -> ShowS #show :: TyCon -> String #showList :: [TyCon] -> ShowS # Since: 4.9.0.0 MethodsshowsPrec :: Int -> Module -> ShowS #showList :: [Module] -> ShowS # Since: 4.9.0.0 MethodsshowsPrec :: Int -> TrName -> ShowS #showList :: [TrName] -> ShowS # Since: 4.8.0.0 MethodsshowsPrec :: Int -> Void -> ShowS #show :: Void -> String #showList :: [Void] -> ShowS # Since: 4.1.0.0 Methods Since: 4.1.0.0 Methods Since: 4.1.0.0 MethodsshowList :: [Deadlock] -> ShowS # Since: 4.7.1.0 Methods Since: 4.10.0.0 MethodsshowList :: [CompactionFailed] -> ShowS # Since: 4.1.0.0 MethodsshowList :: [AssertionFailed] -> ShowS # Since: 4.7.0.0 MethodsshowList :: [SomeAsyncException] -> ShowS # Since: 4.1.0.0 MethodsshowList :: [AsyncException] -> ShowS # Since: 4.1.0.0 MethodsshowList :: [ArrayException] -> ShowS # MethodsshowList :: [ExitCode] -> ShowS # Since: 4.1.0.0 MethodsshowList :: [IOErrorType] -> ShowS # MethodsshowList :: [MaskingState] -> ShowS # Since: 4.1.0.0 MethodsshowList :: [IOException] -> ShowS # MethodsshowsPrec :: Int -> All -> ShowS #show :: All -> String #showList :: [All] -> ShowS # MethodsshowsPrec :: Int -> Any -> ShowS #show :: Any -> String #showList :: [Any] -> ShowS # MethodsshowList :: [GeneralCategory] -> ShowS # MethodsshowsPrec :: Int -> SrcLoc -> ShowS #showList :: [SrcLoc] -> ShowS # Show a => Show [a] Since: 2.1 MethodsshowsPrec :: Int -> [a] -> ShowS #show :: [a] -> String #showList :: [[a]] -> ShowS # Show a => Show (Maybe a) MethodsshowsPrec :: Int -> Maybe a -> ShowS #show :: Maybe a -> String #showList :: [Maybe a] -> ShowS # Show a => Show (Ratio a) Since: 2.0.1 MethodsshowsPrec :: Int -> Ratio a -> ShowS #show :: Ratio a -> String #showList :: [Ratio a] -> ShowS # Show a => Show (Min a) MethodsshowsPrec :: Int -> Min a -> ShowS #show :: Min a -> String #showList :: [Min a] -> ShowS # Show a => Show (Max a) MethodsshowsPrec :: Int -> Max a -> ShowS #show :: Max a -> String #showList :: [Max a] -> ShowS # Show a => Show (First a) MethodsshowsPrec :: Int -> First a -> ShowS #show :: First a -> String #showList :: [First a] -> ShowS # Show a => Show (Last a) MethodsshowsPrec :: Int -> Last a -> ShowS #show :: Last a -> String #showList :: [Last a] -> ShowS # Show m => Show (WrappedMonoid m) MethodsshowsPrec :: Int -> WrappedMonoid m -> ShowS #show :: WrappedMonoid m -> String #showList :: [WrappedMonoid m] -> ShowS # Show a => Show (Option a) MethodsshowsPrec :: Int -> Option a -> ShowS #show :: Option a -> String #showList :: [Option a] -> ShowS # Show a => Show (NonEmpty a) MethodsshowsPrec :: Int -> NonEmpty a -> ShowS #show :: NonEmpty a -> String #showList :: [NonEmpty a] -> ShowS # Show a => Show (ZipList a) MethodsshowsPrec :: Int -> ZipList a -> ShowS #show :: ZipList a -> String #showList :: [ZipList a] -> ShowS # Show a => Show (Dual a) MethodsshowsPrec :: Int -> Dual a -> ShowS #show :: Dual a -> String #showList :: [Dual a] -> ShowS # Show a => Show (Sum a) MethodsshowsPrec :: Int -> Sum a -> ShowS #show :: Sum a -> String #showList :: [Sum a] -> ShowS # Show a => Show (Product a) MethodsshowsPrec :: Int -> Product a -> ShowS #show :: Product a -> String #showList :: [Product a] -> ShowS # Show a => Show (First a) MethodsshowsPrec :: Int -> First a -> ShowS #show :: First a -> String #showList :: [First a] -> ShowS # Show a => Show (Last a) MethodsshowsPrec :: Int -> Last a -> ShowS #show :: Last a -> String #showList :: [Last a] -> ShowS # Show a => Show (Down a) MethodsshowsPrec :: Int -> Down a -> ShowS #show :: Down a -> String #showList :: [Down a] -> ShowS # (Show b, Show a) => Show (Either a b) MethodsshowsPrec :: Int -> Either a b -> ShowS #show :: Either a b -> String #showList :: [Either a b] -> ShowS # (Show a, Show b) => Show (a, b) Since: 2.1 MethodsshowsPrec :: Int -> (a, b) -> ShowS #show :: (a, b) -> String #showList :: [(a, b)] -> ShowS # (Show b, Show a) => Show (Arg a b) MethodsshowsPrec :: Int -> Arg a b -> ShowS #show :: Arg a b -> String #showList :: [Arg a b] -> ShowS # (Show a, Show b, Show c) => Show (a, b, c) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c) -> ShowS #show :: (a, b, c) -> String #showList :: [(a, b, c)] -> ShowS # 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 removedSince: 4.8.0.0 MethodsshowsPrec :: Int -> Const k a b -> ShowS #show :: Const k a b -> String #showList :: [Const k a b] -> ShowS # Show (f a) => Show (Alt k f a) MethodsshowsPrec :: Int -> Alt k f a -> ShowS #show :: Alt k f a -> String #showList :: [Alt k f a] -> ShowS # (Show a, Show b, Show c, Show d) => Show (a, b, c, d) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d) -> ShowS #show :: (a, b, c, d) -> String #showList :: [(a, b, c, d)] -> ShowS # (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e) -> ShowS #show :: (a, b, c, d, e) -> String #showList :: [(a, b, c, d, e)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f) -> ShowS #show :: (a, b, c, d, e, f) -> String #showList :: [(a, b, c, d, e, f)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g) -> ShowS #show :: (a, b, c, d, e, f, g) -> String #showList :: [(a, b, c, d, e, f, g)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h) -> ShowS #show :: (a, b, c, d, e, f, g, h) -> String #showList :: [(a, b, c, d, e, f, g, h)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i) -> ShowS #show :: (a, b, c, d, e, f, g, h, i) -> String #showList :: [(a, b, c, d, e, f, g, h, i)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Since: 2.1 MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS # floatDigits :: RealFloat a => a -> Int # a constant function, returning the number of digits of floatRadix in the significand mod :: Integral a => a -> a -> a infixl 7 # integer modulus, satisfying (x div y)*y + (x mod y) == x significand :: RealFloat a => a -> a # The first component of decodeFloat, scaled to lie in the open interval (-1,1), either 0.0 or of absolute value >= 1/b, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values. (<$) :: Functor f => forall a 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.

type ShowS = String -> String #

The shows functions return a function that prepends the output String to an existing String. This allows constant-time concatenation of results using function composition.

floatRadix :: RealFloat a => a -> Integer #

a constant function, returning the radix of the representation (often 2)

negate :: Num a => a -> a #

Unary negation.

signum :: Num a => a -> a #

Sign of a number. The functions abs and signum should satisfy the law:

abs x * signum x == x

For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive).

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 # An infix synonym for fmap. The name of this operator is an allusion to $. Note the similarities between their types:

 ($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas $ is function application, <$> is function application lifted over a Functor.

#### Examples

Convert from a Maybe Int to a Maybe String using show:

>>> show <$> Nothing Nothing >>> show <$> Just 3
Just "3"


Convert from an Either Int Int to an Either Int String using show:

>>> show <$> Left 17 Left 17 >>> show <$> Right 17
Right "17"


Double each element of a list:

>>> (*2) <$> [1,2,3] [2,4,6]  Apply even to the second element of a pair: >>> even <$> (2,2)
(2,True)


floatRange :: RealFloat a => a -> (Int, Int) #

a constant function, returning the lowest and highest values the exponent may assume

not :: Bool -> Bool #

Boolean "not"

sin :: Floating a => a -> a #

class (Functor t, Foldable t) => Traversable (t :: * -> *) where #

Functors representing data structures that can be traversed from left to right.

A definition of traverse must satisfy the following laws:

naturality
t . traverse f = traverse (t . f) for every applicative transformation t
identity
traverse Identity = Identity
composition
traverse (Compose . fmap g . f) = Compose . fmap (traverse g) . traverse f

A definition of sequenceA must satisfy the following laws:

naturality
t . sequenceA = sequenceA . fmap t for every applicative transformation t
identity
sequenceA . fmap Identity = Identity
composition
sequenceA . fmap Compose = Compose . fmap sequenceA . sequenceA

where an applicative transformation is a function

t :: (Applicative f, Applicative g) => f a -> g a

preserving the Applicative operations, i.e.

• t (pure x) = pure x
• t (x <*> y) = t x <*> t y

and the identity functor Identity and composition of functors Compose are defined as

  newtype Identity a = Identity a

instance Functor Identity where
fmap f (Identity x) = Identity (f x)

instance Applicative Identity where
pure x = Identity x
Identity f <*> Identity x = Identity (f x)

newtype Compose f g a = Compose (f (g a))

instance (Functor f, Functor g) => Functor (Compose f g) where
fmap f (Compose x) = Compose (fmap (fmap f) x)

instance (Applicative f, Applicative g) => Applicative (Compose f g) where
pure x = Compose (pure (pure x))
Compose f <*> Compose x = Compose ((<*>) <$> f <*> x) (The naturality law is implied by parametricity.) Instances are similar to Functor, e.g. given a data type data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) a suitable instance would be instance Traversable Tree where traverse f Empty = pure Empty traverse f (Leaf x) = Leaf <$> f x
traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r This is suitable even for abstract types, as the laws for <*> imply a form of associativity. The superclass instances should satisfy the following: • In the Functor instance, fmap should be equivalent to traversal with the identity applicative functor (fmapDefault). • In the Foldable instance, foldMap should be equivalent to traversal with a constant applicative functor (foldMapDefault). Minimal complete definition Methods traverse :: Applicative f => (a -> f b) -> t a -> f (t b) # Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_. sequenceA :: Applicative f => t (f a) -> f (t a) # Evaluate each action in the structure from left to right, and and collect the results. For a version that ignores the results see sequenceA_. Instances  Since: 2.1 Methodstraverse :: Applicative f => (a -> f b) -> [a] -> f [b] #sequenceA :: Applicative f => [f a] -> f [a] #mapM :: Monad m => (a -> m b) -> [a] -> m [b] #sequence :: Monad m => [m a] -> m [a] # Since: 2.1 Methodstraverse :: 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) # Methodstraverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) #sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) #mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) #sequence :: Monad m => Par1 (m a) -> m (Par1 a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) #sequenceA :: Applicative f => Min (f a) -> f (Min a) #mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) #sequence :: Monad m => Min (m a) -> m (Min a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) #sequenceA :: Applicative f => Max (f a) -> f (Max a) #mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) #sequence :: Monad m => Max (m a) -> m (Max a) # Since: 4.9.0.0 Methodstraverse :: 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) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #sequenceA :: Applicative f => Last (f a) -> f (Last a) #mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #sequence :: Monad m => Last (m a) -> m (Last a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) #sequenceA :: Applicative f => Option (f a) -> f (Option a) #mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) #sequence :: Monad m => Option (m a) -> m (Option a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) #sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) #mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) #sequence :: Monad m => ZipList (m a) -> m (ZipList a) # Methodstraverse :: 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) # Since: 4.8.0.0 Methodstraverse :: 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) # Since: 4.8.0.0 Methodstraverse :: 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) # Since: 4.8.0.0 Methodstraverse :: 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) # Since: 4.8.0.0 Methodstraverse :: 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) # Since: 4.8.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #sequenceA :: Applicative f => Last (f a) -> f (Last a) #mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #sequence :: Monad m => Last (m a) -> m (Last a) # Since: 4.7.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Either a a -> f (Either a b) #sequenceA :: Applicative f => Either a (f a) -> f (Either a a) #mapM :: Monad m => (a -> m b) -> Either a a -> m (Either a b) #sequence :: Monad m => Either a (m a) -> m (Either a a) # Methodstraverse :: Applicative f => (a -> f b) -> V1 * a -> f (V1 * b) #sequenceA :: Applicative f => V1 * (f a) -> f (V1 * a) #mapM :: Monad m => (a -> m b) -> V1 * a -> m (V1 * b) #sequence :: Monad m => V1 * (m a) -> m (V1 * a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> U1 * a -> f (U1 * b) #sequenceA :: Applicative f => U1 * (f a) -> f (U1 * a) #mapM :: Monad m => (a -> m b) -> U1 * a -> m (U1 * b) #sequence :: Monad m => U1 * (m a) -> m (U1 * a) # Since: 4.7.0.0 Methodstraverse :: Applicative f => (a -> f b) -> (a, a) -> f (a, b) #sequenceA :: Applicative f => (a, f a) -> f (a, a) #mapM :: Monad m => (a -> m b) -> (a, a) -> m (a, b) #sequence :: Monad m => (a, m a) -> m (a, a) # Ix i => Traversable (Array i) Since: 2.1 Methodstraverse :: Applicative f => (a -> f b) -> Array i a -> f (Array i b) #sequenceA :: Applicative f => Array i (f a) -> f (Array i a) #mapM :: Monad m => (a -> m b) -> Array i a -> m (Array i b) #sequence :: Monad m => Array i (m a) -> m (Array i a) # Since: 4.9.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Arg a a -> f (Arg a b) #sequenceA :: Applicative f => Arg a (f a) -> f (Arg a a) #mapM :: Monad m => (a -> m b) -> Arg a a -> m (Arg a b) #sequence :: Monad m => Arg a (m a) -> m (Arg a a) # Since: 4.7.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Proxy * a -> f (Proxy * b) #sequenceA :: Applicative f => Proxy * (f a) -> f (Proxy * a) #mapM :: Monad m => (a -> m b) -> Proxy * a -> m (Proxy * b) #sequence :: Monad m => Proxy * (m a) -> m (Proxy * a) # Traversable f => Traversable (Rec1 * f) Methodstraverse :: Applicative f => (a -> f b) -> Rec1 * f a -> f (Rec1 * f b) #sequenceA :: Applicative f => Rec1 * f (f a) -> f (Rec1 * f a) #mapM :: Monad m => (a -> m b) -> Rec1 * f a -> m (Rec1 * f b) #sequence :: Monad m => Rec1 * f (m a) -> m (Rec1 * f a) # Methodstraverse :: 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) # Methodstraverse :: Applicative f => (a -> f b) -> URec * Double a -> f (URec * Double b) #sequenceA :: Applicative f => URec * Double (f a) -> f (URec * Double a) #mapM :: Monad m => (a -> m b) -> URec * Double a -> m (URec * Double b) #sequence :: Monad m => URec * Double (m a) -> m (URec * Double a) # Methodstraverse :: Applicative f => (a -> f b) -> URec * Float a -> f (URec * Float b) #sequenceA :: Applicative f => URec * Float (f a) -> f (URec * Float a) #mapM :: Monad m => (a -> m b) -> URec * Float a -> m (URec * Float b) #sequence :: Monad m => URec * Float (m a) -> m (URec * Float a) # Methodstraverse :: Applicative f => (a -> f b) -> URec * Int a -> f (URec * Int b) #sequenceA :: Applicative f => URec * Int (f a) -> f (URec * Int a) #mapM :: Monad m => (a -> m b) -> URec * Int a -> m (URec * Int b) #sequence :: Monad m => URec * Int (m a) -> m (URec * Int a) # Methodstraverse :: Applicative f => (a -> f b) -> URec * Word a -> f (URec * Word b) #sequenceA :: Applicative f => URec * Word (f a) -> f (URec * Word a) #mapM :: Monad m => (a -> m b) -> URec * Word a -> m (URec * Word b) #sequence :: Monad m => URec * Word (m a) -> m (URec * Word a) # Traversable (URec * (Ptr ())) Methodstraverse :: Applicative f => (a -> f b) -> URec * (Ptr ()) a -> f (URec * (Ptr ()) b) #sequenceA :: Applicative f => URec * (Ptr ()) (f a) -> f (URec * (Ptr ()) a) #mapM :: Monad m => (a -> m b) -> URec * (Ptr ()) a -> m (URec * (Ptr ()) b) #sequence :: Monad m => URec * (Ptr ()) (m a) -> m (URec * (Ptr ()) a) # Since: 4.7.0.0 Methodstraverse :: 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) # Traversable (K1 * i c) Methodstraverse :: Applicative f => (a -> f b) -> K1 * i c a -> f (K1 * i c b) #sequenceA :: Applicative f => K1 * i c (f a) -> f (K1 * i c a) #mapM :: Monad m => (a -> m b) -> K1 * i c a -> m (K1 * i c b) #sequence :: Monad m => K1 * i c (m a) -> m (K1 * i c a) # (Traversable f, Traversable g) => Traversable ((:+:) * f g) Methodstraverse :: Applicative f => (a -> f b) -> (* :+: f) g a -> f ((* :+: f) g b) #sequenceA :: Applicative f => (* :+: f) g (f a) -> f ((* :+: f) g a) #mapM :: Monad m => (a -> m b) -> (* :+: f) g a -> m ((* :+: f) g b) #sequence :: Monad m => (* :+: f) g (m a) -> m ((* :+: f) g a) # (Traversable f, Traversable g) => Traversable ((:*:) * f g) Methodstraverse :: Applicative f => (a -> f b) -> (* :*: f) g a -> f ((* :*: f) g b) #sequenceA :: Applicative f => (* :*: f) g (f a) -> f ((* :*: f) g a) #mapM :: Monad m => (a -> m b) -> (* :*: f) g a -> m ((* :*: f) g b) #sequence :: Monad m => (* :*: f) g (m a) -> m ((* :*: f) g a) # Traversable f => Traversable (M1 * i c f) Methodstraverse :: Applicative f => (a -> f b) -> M1 * i c f a -> f (M1 * i c f b) #sequenceA :: Applicative f => M1 * i c f (f a) -> f (M1 * i c f a) #mapM :: Monad m => (a -> m b) -> M1 * i c f a -> m (M1 * i c f b) #sequence :: Monad m => M1 * i c f (m a) -> m (M1 * i c f a) # (Traversable f, Traversable g) => Traversable ((:.:) * * f g) Methodstraverse :: Applicative f => (a -> f b) -> (* :.: *) f g a -> f ((* :.: *) f g b) #sequenceA :: Applicative f => (* :.: *) f g (f a) -> f ((* :.: *) f g a) #mapM :: Monad m => (a -> m b) -> (* :.: *) f g a -> m ((* :.: *) f g b) #sequence :: Monad m => (* :.: *) f g (m a) -> m ((* :.: *) f g a) # floor :: RealFrac a => forall b. Integral b => a -> b # floor x returns the greatest integer not greater than x notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 # notElem is the negation of elem. sinh :: Floating a => a -> a # (<*>) :: Applicative f => forall a b. f (a -> b) -> f a -> f b infixl 4 # Sequential application. A few functors support an implementation of <*> that is more efficient than the default one. fmap :: Functor f => forall a b. (a -> b) -> f a -> f b # null :: Foldable t => forall a. 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. (<=) :: Ord a => a -> a -> Bool infix 4 # data Word :: * # A Word is an unsigned integral type, with the same size as Int. Instances  Since: 2.1 Methods Since: 2.1 Methodssucc :: Word -> Word #pred :: Word -> Word #toEnum :: Int -> Word #fromEnum :: Word -> Int #enumFrom :: Word -> [Word] #enumFromThen :: Word -> Word -> [Word] #enumFromTo :: Word -> Word -> [Word] #enumFromThenTo :: Word -> Word -> Word -> [Word] # Methods(==) :: Word -> Word -> Bool #(/=) :: Word -> Word -> Bool # Since: 2.1 Methodsquot :: Word -> Word -> Word #rem :: Word -> Word -> Word #div :: Word -> Word -> Word #mod :: Word -> Word -> Word #quotRem :: Word -> Word -> (Word, Word) #divMod :: Word -> Word -> (Word, Word) # Since: 2.1 Methods(+) :: Word -> Word -> Word #(-) :: Word -> Word -> Word #(*) :: Word -> Word -> Word #negate :: Word -> Word #abs :: Word -> Word #signum :: Word -> Word # Methodscompare :: Word -> Word -> Ordering #(<) :: Word -> Word -> Bool #(<=) :: Word -> Word -> Bool #(>) :: Word -> Word -> Bool #(>=) :: Word -> Word -> Bool #max :: Word -> Word -> Word #min :: Word -> Word -> Word # Since: 4.5.0.0 Methods Since: 2.1 Methods Since: 2.1 MethodsshowsPrec :: Int -> Word -> ShowS #show :: Word -> String #showList :: [Word] -> ShowS # Methodsfold :: 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 # Methodstraverse :: Applicative f => (a -> f b) -> URec * Word a -> f (URec * Word b) #sequenceA :: Applicative f => URec * Word (f a) -> f (URec * Word a) #mapM :: Monad m => (a -> m b) -> URec * Word a -> m (URec * Word b) #sequence :: Monad m => URec * Word (m a) -> m (URec * Word a) # foldMap :: Foldable t => forall m a. Monoid m => (a -> m) -> t a -> m # Map each element of the structure to a monoid, and combine the results. odd :: Integral a => a -> Bool # span :: (a -> Bool) -> [a] -> ([a], [a]) # span, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list: span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) span (< 9) [1,2,3] == ([1,2,3],[]) span (< 0) [1,2,3] == ([],[1,2,3]) span p xs is equivalent to (takeWhile p xs, dropWhile p xs) (^) :: (Num a, Integral b) => a -> b -> a infixr 8 # raise a number to a non-negative integral power foldl :: Foldable t => forall b a. (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 splitAt :: Int -> [a] -> ([a], [a]) # splitAt n xs returns a tuple where first element is xs prefix of length n and second element is the remainder of the list: splitAt 6 "Hello World!" == ("Hello ","World!") splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5]) splitAt 1 [1,2,3] == ([1],[2,3]) splitAt 3 [1,2,3] == ([1,2,3],[]) splitAt 4 [1,2,3] == ([1,2,3],[]) splitAt 0 [1,2,3] == ([],[1,2,3]) splitAt (-1) [1,2,3] == ([],[1,2,3]) It is equivalent to (take n xs, drop n xs) when n is not _|_ (splitAt _|_ xs = _|_). splitAt is an instance of the more general genericSplitAt, in which n may be of any integral type. (==) :: Eq a => a -> a -> Bool infix 4 # (^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 # raise a number to an integral power otherwise is defined as the value True. It helps to make guards more readable. eg.  f x | x < 0 = ... | otherwise = ... sqrt :: Floating a => a -> a # (>) :: Ord a => a -> a -> Bool infix 4 # abs :: Num a => a -> a # Absolute value. foldr :: Foldable t => forall a b. (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 pi :: Floating a => a # subtract :: Num a => a -> a -> a # the same as flip (-). Because - is treated specially in the Haskell grammar, (- e) is not a section, but an application of prefix negation. However, (subtract exp) is equivalent to the disallowed section. (>=) :: Ord a => a -> a -> Bool infix 4 # acos :: Floating a => a -> a # acosh :: Floating a => a -> a # sum :: Foldable t => forall a. Num a => t a -> a # The sum function computes the sum of the numbers of a structure. all :: Foldable t => (a -> Bool) -> t a -> Bool # Determines whether all elements of the structure satisfy the predicate. fromInteger :: Num a => Integer -> a # Conversion from an Integer. An integer literal represents the application of the function fromInteger to the appropriate value of type Integer, so such literals have type (Num a) => a. product :: Foldable t => forall a. Num a => t a -> a # The product function computes the product of the numbers of a structure. class Functor f => Applicative (f :: * -> *) where # A functor with application, providing operations to • embed pure expressions (pure), and • sequence computations and combine their results (<*> and liftA2). A minimal complete definition must include implementations of pure and of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions: (<*>) = liftA2 id liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

identity
pure id <*> v = v
composition
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
homomorphism
pure f <*> pure x = pure (f x)
interchange
u <*> pure y = pure ($ y) <*> u The other methods have the following default definitions, which may be overridden with equivalent specialized implementations: • u *> v = (id <$ u) <*> v
• u <* v = liftA2 const u v

As a consequence of these laws, the Functor instance for f will satisfy

• fmap f x = pure f <*> x

It may be useful to note that supposing

forall x y. p (q x y) = f x . g y

it follows from the above that

liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If f is also a Monad, it should satisfy

• pure = return
• (<*>) = ap

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 #

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

Instances

Since: 2.1

Methods

pure :: a -> [a] #

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

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

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

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

Since: 2.1

Methods

pure :: a -> Maybe a #

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

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

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

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

Since: 2.1

Methods

pure :: a -> IO a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> Min a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> Max a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> First a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> Last a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> Option a #

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

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

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

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

Since: 4.9.0.0

Methods

pure :: a -> NonEmpty a #

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

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

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

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

f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN # ZipList (zipWithN f xs1 ... xsN) where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example: (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
= ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
= ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: 2.1

Methods

pure :: a -> ZipList a #

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

liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #

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

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

Since: 4.8.0.0

Methods

pure :: a -> Dual a #

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

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

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

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

Since: 4.8.0.0

Methods

pure :: a -> Sum a #

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

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

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

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

Since: 4.8.0.0

Methods

pure :: a -> Product a #

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

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

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

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

Methods

pure :: a -> First a #

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

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

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

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

Methods

pure :: a -> Last a #

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

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

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

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

Since: 3.0

Methods

pure :: a -> Either e a #

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

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

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

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

Monoid a => Applicative ((,) a)

For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:

("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)

Since: 2.1

Methods

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

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

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

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

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

Since: 2.1

Methods

pure :: a -> WrappedMonad m a #

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

Arrow a => Applicative (WrappedArrow a b)

Since: 2.1

Methods

pure :: a -> WrappedArrow a b a #

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

liftA2 :: (a -> b -> c) -> WrappedArrow a b a -> WrappedArrow a b b -> WrappedArrow a b c #

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

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

Monoid m => Applicative (Const * m)

Since: 2.0.1

Methods

pure :: a -> Const * m a #

(<*>) :: Const * m (a -> b) -> Const * m a -> Const * m b #

liftA2 :: (a -> b -> c) -> Const * m a -> Const * m b -> Const * m c #

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

(<*) :: Const * m a -> Const * m b -> Const * m a #

Applicative f => Applicative (Alt * f)

Methods

pure :: a -> Alt * f a #

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

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

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

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

Since: 2.1

Methods

pure :: a -> (LiftedRep -> LiftedRep) a a #

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

liftA2 :: (a -> b -> c) -> (LiftedRep -> LiftedRep) a a -> (LiftedRep -> LiftedRep) a b -> (LiftedRep -> LiftedRep) a c #

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

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

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.

fromIntegral :: (Integral a, Num b) => a -> b #

general coercion from integral types

properFraction :: RealFrac a => forall b. Integral b => a -> (b, a) #

The function properFraction takes a real fractional number x and returns a pair (n,f) such that x = n+f, and:

• n is an integral number with the same sign as x; and
• f is a fraction with the same type and sign as x, and with absolute value less than 1.

The default definitions of the ceiling, floor, truncate and round functions are in terms of properFraction.

take :: Int -> [a] -> [a] #

take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs:

take 5 "Hello World!" == "Hello"
take 3 [1,2,3,4,5] == [1,2,3]
take 3 [1,2] == [1,2]
take 3 [] == []
take (-1) [1,2] == []
take 0 [1,2] == []

It is an instance of the more general genericTake, in which n may be of any integral type.

data Bool :: * #

Constructors

 False True

Instances

 Since: 2.1 Methods Since: 2.1 Methodssucc :: Bool -> Bool #pred :: Bool -> Bool #toEnum :: Int -> Bool #fromEnum :: Bool -> Int #enumFrom :: Bool -> [Bool] #enumFromThen :: Bool -> Bool -> [Bool] #enumFromTo :: Bool -> Bool -> [Bool] #enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] # Methods(==) :: Bool -> Bool -> Bool #(/=) :: Bool -> Bool -> Bool # Methodscompare :: Bool -> Bool -> Ordering #(<) :: Bool -> Bool -> Bool #(<=) :: Bool -> Bool -> Bool #(>) :: Bool -> Bool -> Bool #(>=) :: Bool -> Bool -> Bool #max :: Bool -> Bool -> Bool #min :: Bool -> Bool -> Bool # Since: 2.1 Methods MethodsshowsPrec :: Int -> Bool -> ShowS #show :: Bool -> String #showList :: [Bool] -> ShowS #

any :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether any element of the structure satisfies the predicate.

fromRational :: Fractional a => Rational -> a #

Conversion from a Rational (that is Ratio Integer). A floating literal stands for an application of fromRational to a value of type Rational, so such literals have type (Fractional a) => a.

pure :: Applicative f => forall a. a -> f a #

Lift a value.

takeWhile :: (a -> Bool) -> [a] -> [a] #

takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:

takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
takeWhile (< 9) [1,2,3] == [1,2,3]
takeWhile (< 0) [1,2,3] == []

appendFile :: FilePath -> String -> IO () #

The computation appendFile file str function appends the string str, to the file file.

Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.

main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

putChar :: Char -> IO () #

Write a character to the standard output device (same as hPutChar stdout).

tan :: Floating a => a -> a #

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

 Since: 2.1 Methods Since: 2.1 Methodssucc :: 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] # Methods(==) :: Char -> Char -> Bool #(/=) :: Char -> Char -> Bool # Methodscompare :: Char -> Char -> Ordering #(<) :: Char -> Char -> Bool #(<=) :: Char -> Char -> Bool #(>) :: Char -> Char -> Bool #(>=) :: Char -> Char -> Bool #max :: Char -> Char -> Char #min :: Char -> Char -> Char # Since: 2.1 Methods Since: 2.1 MethodsshowsPrec :: Int -> Char -> ShowS #show :: Char -> String #showList :: [Char] -> ShowS # Methodsfold :: 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 # Methodstraverse :: 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) #

gcd :: Integral a => a -> a -> a #

gcd x y is the non-negative factor of both x and y of which every common factor of x and y is also a factor; for example gcd 4 2 = 2, gcd (-4) 6 = 2, gcd 0 4 = 4. gcd 0 0 = 0. (That is, the common divisor that is "greatest" in the divisibility preordering.)

Note: Since for signed fixed-width integer types, abs minBound < 0, the result may be negative if one of the arguments is minBound (and necessarily is if the other is 0 or minBound) for such types.

putStr :: String -> IO () #

Write a string to the standard output device (same as hPutStr stdout).

tanh :: Floating a => a -> a #

data Double :: * #

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Instances

 Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Since: 2.1 Methodsexp :: Double -> Double #log :: Double -> Double #(**) :: Double -> Double -> Double #sin :: Double -> Double #cos :: Double -> Double #tan :: Double -> Double # Methods(<) :: Double -> Double -> Bool #(<=) :: Double -> Double -> Bool #(>) :: Double -> Double -> Bool #(>=) :: Double -> Double -> Bool #max :: Double -> Double -> Double #min :: Double -> Double -> Double # Since: 2.1 Methods Since: 2.1 MethodsfloatRange :: Double -> (Int, Int) #decodeFloat :: Double -> (Integer, Int) #isNaN :: Double -> Bool #atan2 :: Double -> Double -> Double # Methodsfold :: 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 # Methodstraverse :: Applicative f => (a -> f b) -> URec * Double a -> f (URec * Double b) #sequenceA :: Applicative f => URec * Double (f a) -> f (URec * Double a) #mapM :: Monad m => (a -> m b) -> URec * Double a -> m (URec * Double b) #sequence :: Monad m => URec * Double (m a) -> m (URec * Double a) #

asin :: Floating a => a -> a #

Read a character from the standard input device (same as hGetChar stdin).

putStrLn :: String -> IO () #

The same as putStr, but adds a newline character.

asinh :: Floating a => a -> a #

The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).

quot :: Integral a => a -> a -> a infixl 7 #

integer division truncated toward zero

toInteger :: Integral a => a -> Integer #

conversion to Integer

data Either a b :: * -> * -> * #

The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.

The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").

#### Examples

The type Either String Int is the type of values which can be either a String or an Int. The Left constructor can be used only on Strings, and the Right constructor can be used only on Ints:

>>> let s = Left "foo" :: Either String Int
>>> s
Left "foo"
>>> let n = Right 3 :: Either String Int
>>> n
Right 3
>>> :type s
s :: Either String Int
>>> :type n
n :: Either String Int


The fmap from our Functor instance will ignore Left values, but will apply the supplied function to values contained in a Right:

>>> let s = Left "foo" :: Either String Int
>>> let n = Right 3 :: Either String Int
>>> fmap (*2) s
Left "foo"
>>> fmap (*2) n
Right 6


The Monad instance for Either allows us to chain together multiple actions which may fail, and fail overall if any of the individual steps failed. First we'll write a function that can either parse an Int from a Char, or fail.

>>> import Data.Char ( digitToInt, isDigit )
>>> :{
    let parseEither :: Char -> Either String Int
parseEither c
| isDigit c = Right (digitToInt c)
| otherwise = Left "parse error"
>>> :}


The following should work, since both '1' and '2' can be parsed as Ints.

>>> :{
    let parseMultiple :: Either String Int
parseMultiple = do
x <- parseEither '1'
y <- parseEither '2'
return (x + y)
>>> :}

>>> parseMultiple
Right 3


But the following should fail overall, since the first operation where we attempt to parse 'm' as an Int will fail:

>>> :{
    let parseMultiple :: Either String Int
parseMultiple = do
x <- parseEither 'm'
y <- parseEither '2'
return (x + y)
>>> :}

>>> parseMultiple
Left "parse error"


Constructors

 Left a Right b

Instances

 Monad (Either e) Since: 4.4.0.0 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 # Since: 3.0 Methodsfmap :: (a -> b) -> Either a a -> Either a b #(<\$) :: a -> Either a b -> Either a a # Since: 3.0 Methodspure :: a -> Either e a #(<*>) :: Either e (a -> b) -> Either e a -> Either e b #liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #(*>) :: Either e a -> Either e b -> Either e b #(<*) :: Either e a -> Either e b -> Either e a # Since: 4.7.0.0 Methodsfold :: 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 # Since: 4.7.0.0 Methodstraverse :: Applicative f => (a -> f b) -> Either a a -> f (Either a b) #sequenceA :: Applicative f => Either a (f a) -> f (Either a a) #mapM :: Monad m => (a -> m b) -> Either a a -> m (Either a b) #sequence :: Monad m => Either a (m a) -> m (Either a a) # (Eq b, Eq a) => Eq (Either a b) Methods(==) :: Either a b -> Either a b -> Bool #(/=) :: Either a b -> Either a b -> Bool # (Ord b, Ord a) => Ord (Either a b) Methodscompare :: 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 # (Read b, Read a) => Read (Either a b) MethodsreadsPrec :: Int -> ReadS (Either a b) #readList :: ReadS [Either a b] #readPrec :: ReadPrec (Either a b) #readListPrec :: ReadPrec [Either a b] # (Show b, Show a) => Show (Either a b) MethodsshowsPrec :: Int -> Either a b -> ShowS #show :: Either a b -> String #showList :: [Either a b] -> ShowS # Semigroup (Either a b) Since: 4.9.0.0 Methods(<>) :: Either a b -> Either a b -> Either a b #sconcat :: NonEmpty (Either a b) -> Either a b #stimes :: Integral b => b -> Either a b -> Either a b # type (==) (Either k1 k2) a b type (==) (Either k1 k2) a b = EqEither k1 k2 a b

atan :: Floating a => a -> a #

Read a line from the standard input device (same as hGetLine stdin).

quotRem :: Integral a => a -> a -> (a, a) #

simultaneous quot and rem

toRational :: Real a => a -> Rational #

the rational equivalent of its real argument with full precision

class Enum a #

Class Enum defines operations on sequentially ordered types.

The enumFrom... methods are used in Haskell's translation of arithmetic sequences.

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class Bounded as well as Enum, the following should hold:

• The calls succ maxBound and pred minBound should result in a runtime error.
• fromEnum and toEnum should give a runtime error if the result value is not representable in the result type. For example, toEnum 7 :: Bool is an error.
• enumFrom and enumFromThen should be defined with an implicit bound, thus:
   enumFrom     x   = enumFromTo     x maxBound
enumFromThen x y = enumFromThenTo x y bound
where
| otherwise                = minBound

Minimal complete definition

Instances

 Since: 2.1 Methodssucc :: Bool -> Bool #pred :: Bool -> Bool #toEnum :: Int -> Bool #fromEnum :: Bool -> Int #enumFrom :: Bool -> [Bool] #enumFromThen :: Bool -> Bool -> [Bool] #enumFromTo :: Bool -> Bool -> [Bool] #enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] # Since: 2.1 Methodssucc :: 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] # Since: 2.1 Methodssucc :: Int -> Int #pred :: Int -> Int #toEnum :: Int -> Int #fromEnum :: Int -> Int #enumFrom :: Int -> [Int] #enumFromThen :: Int -> Int -> [Int] #enumFromTo :: Int -> Int -> [Int] #enumFromThenTo :: Int -> Int -> Int -> [Int] # Since: 2.1 Methodssucc :: Int8 -> Int8 #pred :: Int8 -> Int8 #toEnum :: Int -> Int8 #fromEnum :: Int8 -> Int #enumFrom :: Int8 -> [Int8] #enumFromThen :: Int8 -> Int8 -> [Int8] #enumFromTo :: Int8 -> Int8 -> [Int8] #enumFromThenTo :: Int8 -> Int8 -> Int8 -> [Int8] # Since: 2.1 Methodssucc :: Int16 -> Int16 #pred :: Int16 -> Int16 #toEnum :: Int -> Int16 #enumFrom :: Int16 -> [Int16] #enumFromThen :: Int16 -> Int16 -> [Int16] #enumFromTo :: Int16 -> Int16 -> [Int16] #enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] # Since: 2.1 Methodssucc :: Int32 -> Int32 #pred :: Int32 -> Int32 #toEnum :: Int -> Int32 #enumFrom :: Int32 -> [Int32] #enumFromThen :: Int32 -> Int32 -> [Int32] #enumFromTo :: Int32 -> Int32 -> [Int32] #enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] # Since: 2.1 Methodssucc :: Int64 -> Int64 #pred :: Int64 -> Int64 #toEnum :: Int -> Int64 #enumFrom :: Int64 -> [Int64] #enumFromThen :: Int64 -> Int64 -> [Int64] #enumFromTo :: Int64 -> Int64 -> [Int64] #enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] # Since: 2.1 MethodsenumFrom :: Integer -> [Integer] #enumFromThen :: Integer -> Integer -> [Integer] #enumFromTo :: Integer -> Integer -> [Integer] #enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] # Since: 2.1 MethodsenumFrom :: Ordering -> [Ordering] #enumFromTo :: Ordering -> Ordering -> [Ordering] # Since: 2.1 Methodssucc :: Word -> Word #pred :: Word -> Word #toEnum :: Int -> Word #fromEnum :: Word -> Int #enumFrom :: Word -> [Word] #enumFromThen :: Word -> Word -> [Word] #enumFromTo :: Word -> Word -> [Word] #enumFromThenTo :: Word -> Word -> Word -> [Word] # Since: 4.10.0.0 MethodsenumFrom :: VecCount -> [VecCount] #enumFromTo :: VecCount -> VecCount -> [VecCount] # Since: 4.10.0.0 MethodsenumFrom :: VecElem -> [VecElem] #enumFromThen :: VecElem -> VecElem -> [VecElem] #enumFromTo :: VecElem -> VecElem -> [VecElem] #enumFromThenTo :: VecElem -> VecElem -> VecElem -> [VecElem] # Enum () Since: 2.1 Methodssucc :: () -> () #pred :: () -> () #toEnum :: Int -> () #fromEnum :: () -> Int #enumFrom :: () -> [()] #enumFromThen :: () -> () -> [()] #enumFromTo :: () -> () -> [()] #enumFromThenTo :: () -> () -> () -> [()] # Methods Integral a => Enum (Ratio a) Since: 2.0.1 Methodssucc :: Ratio a -> Ratio a #pred :: Ratio a -> Ratio a #toEnum :: Int -> Ratio a #fromEnum :: Ratio a -> Int #enumFrom :: Ratio a -> [Ratio a] #enumFromThen :: Ratio a -> Ratio a -> [Ratio a] #enumFromTo :: Ratio a -> Ratio a -> [Ratio a] #enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] # Enum a => Enum (Min a) Since: 4.9.0.0 Methodssucc :: Min a -> Min a #pred :: Min a -> Min a #toEnum :: Int -> Min a #fromEnum :: Min a -> Int #enumFrom :: Min a -> [Min a] #enumFromThen :: Min a -> Min a -> [Min a] #enumFromTo :: Min a -> Min a -> [Min a] #enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] # Enum a => Enum (Max a) Since: 4.9.0.0 Methodssucc :: Max a -> Max a #pred :: Max a -> Max a #toEnum :: Int -> Max a #fromEnum :: Max a -> Int #enumFrom :: Max a -> [Max a] #enumFromThen :: Max a -> Max a -> [Max a] #enumFromTo :: Max a -> Max a -> [Max a] #enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] # Enum a => Enum (First a) Since: 4.9.0.0 Methodssucc :: 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] # Enum a => Enum (Last a) Since: 4.9.0.0 Methodssucc :: Last a -> Last a #pred :: Last a -> Last a #toEnum :: Int -> Last a #fromEnum :: Last a -> Int #enumFrom :: Last a -> [Last a] #enumFromThen :: Last a -> Last a -> [Last a] #enumFromTo :: Last a -> Last a -> [Last a] #enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] # Enum a => Enum (WrappedMonoid a) Since: 4.9.0.0 MethodsenumFrom :: WrappedMonoid a -> [WrappedMonoid a] #enumFromThen :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] #enumFromTo :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] #enumFromThenTo :: WrappedMonoid a -> WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # Enum a => Enum (Const k a b) Methodssucc :: 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] # Enum (f a) => Enum (Alt k f a) Methodssucc :: 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] #

atan2 :: RealFloat a => a -> a -> a #

a version of arctangent taking two real floating-point arguments. For real floating x and y, atan2 y x computes the angle (from the positive x-axis) of the vector from the origin to the point (x,y). atan2 y x returns a value in the range [-pi, pi]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. atan2 y 1, with y in a type that is RealFloat, should return the same value as atan y. A default definition of atan2 is provided, but implementors can provide a more accurate implementation.

traverse :: Traversable t => forall (f :: * -> *) a b. Applicative f => (a -> f b) -> t a -> f (t b) #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.

class Eq a where #

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

Minimal complete definition: either == or /=.

Minimal complete definition

Methods

(==) :: a -> a -> Bool infix 4 #

(/=) :: a -> a -> Bool infix 4 #

Instances

 Methods(==) :: Bool -> Bool -> Bool #(/=) :: Bool -> Bool -> Bool # Methods(==) :: Char -> Char -> Bool #(/=) :: Char -> Char -> Bool # Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Since: 2.1 Methods(==) :: Int8 -> Int8 -> Bool #(/=) :: Int8 -> Int8 -> Bool # Since: 2.1 Methods(==) :: Int16 -> Int16 -> Bool #(/=) :: Int16 -> Int16 -> Bool # Since: 2.1 Methods(==) :: Int32 -> Int32 -> Bool #(/=) :: Int32 -> Int32 -> Bool # Since: 2.1 Methods(==) :: Int64 -> Int64 -> Bool #(/=) :: Int64 -> Int64 -> Bool # Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Methods Methods(==) :: Word -> Word -> Bool #(/=) :: Word -> Word -> Bool # Eq () Methods(==) :: () -> () -> Bool #(/=) :: () -> () -> Bool # Methods(==) :: TyCon -> TyCon -> Bool #(/=) :: TyCon -> TyCon -> Bool # Methods(==) :: Module -> Module -> Bool #(/=) :: Module -> Module -> Bool # Methods(==) :: TrName -> TrName -> Bool #(/=) :: TrName -> TrName -> Bool # Methods(==) :: BigNat -> BigNat -> Bool #(/=) :: BigNat -> BigNat -> Bool # Since: 4.8.0.0 Methods(==) :: Void -> Void -> Bool #(/=) :: Void -> Void -> Bool # Methods Methods Methods Since: 4.1.0.0 Methods Methods Since: 4.1.0.0 Methods Methods(==) :: All -> All -> Bool #(/=) :: All -> All -> Bool # Methods(==) :: Any -> Any -> Bool #(/=) :: Any -> Any -> Bool # Methods Eq a => Eq [a] Methods(==) :: [a] -> [a] -> Bool #(/=) :: [a] -> [a] -> Bool # Eq a => Eq (Maybe a) Methods(==) :: Maybe a -> Maybe a -> Bool #(/=) :: Maybe a -> Maybe a -> Bool # Eq a => Eq (Ratio a) Methods(==) :: Ratio a -> Ratio a -> Bool #(/=) :: Ratio a -> Ratio a -> Bool # Eq a => Eq (Min a) Methods(==) :: Min a -> Min a -> Bool #(/=) :: Min a -> Min a -> Bool # Eq a => Eq (Max a) Methods(==) :: Max a -> Max a -> Bool #(/=) :: Max a -> Max a -> Bool # Eq a => Eq (First a) Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq m => Eq (WrappedMonoid m) Methods(==) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # Eq a => Eq (Option a) Methods(==) :: Option a -> Option a -> Bool #(/=) :: Option a -> Option a -> Bool # Eq a => Eq (NonEmpty a) Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # Eq a => Eq (ZipList a) Methods(==) :: ZipList a -> ZipList a -> Bool #(/=) :: ZipList a -> ZipList a -> Bool # Eq a => Eq (Dual a) Methods(==) :: Dual a -> Dual a -> Bool #(/=) :: Dual a -> Dual a -> Bool # Eq a => Eq (Sum a) Methods(==) :: Sum a -> Sum a -> Bool #(/=) :: Sum a -> Sum a -> Bool # Eq a => Eq (Product a) Methods(==) :: Product a -> Product a -> Bool #(/=) :: Product a -> Product a -> Bool # Eq a => Eq (First a) Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq a => Eq (Down a) Methods(==) :: Down a -> Down a -> Bool #(/=) :: Down a -> Down a -> Bool # (Eq b, Eq a) => Eq (Either a b) Methods(==) :: Either a b -> Either a b -> Bool #(/=) :: Either a b -> Either a b -> Bool # (Eq a, Eq b) => Eq (a, b) Methods(==) :: (a, b) -> (a, b) -> Bool #(/=) :: (a, b) -> (a, b) -> Bool # Eq a => Eq (Arg a b) Since: 4.9.0.0 Methods(==) :: Arg a b -> Arg a b -> Bool #(/=) :: Arg a b -> Arg a b -> Bool # (Eq a, Eq b, Eq c) => Eq (a, b, c) Methods(==) :: (a, b, c) -> (a, b, c) -> Bool #(/=) :: (a, b, c) -> (a, b, c) -> Bool # 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 # 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 # (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) Methods(==) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) Methods(==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Methods(==) :: (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 # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Methods(==) :: (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 #

atanh :: Floating a => a -> a #

The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.

truncate :: RealFrac a => forall b. Integral b => a -> b #

truncate x returns the integer nearest x between zero and x

break :: (a -> Bool) -> [a] -> ([a], [a]) #

break, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:

break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])

break p is equivalent to span (not . p).

The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.

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

uncurry converts a curried function to a function on pairs.

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.

ceiling :: RealFrac a => forall b. Integral b => a -> b #

ceiling x returns the least integer not less than x

interact :: (String -> String) -> IO () #

The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

data Float :: * #

Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.

Instances

 Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Since: 2.1 Methodspi :: Float #exp :: Float -> Float #log :: Float -> Float #sqrt :: Float -> Float #(**) :: Float -> Float -> Float #logBase :: Float -> Float -> Float #sin :: Float -> Float #cos :: Float -> Float #tan :: Float -> Float #asin :: Float -> Float #acos :: Float -> Float #atan :: Float -> Float #sinh :: Float -> Float #cosh :: Float -> Float #tanh :: Float -> Float #asinh :: Float -> Float #acosh :: Float -> Float #atanh :: Float -> Float #log1p :: Float -> Float #expm1 :: Float -> Float # Methods(<) :: Float -> Float -> Bool #(<=) :: Float -> Float -> Bool #(>) :: Float -> Float -> Bool #(>=) :: Float -> Float -> Bool #max :: Float -> Float -> Float #min :: Float -> Float -> Float # Since: 2.1 Methods Since: 2.1 MethodsfloatRange :: Float -> (Int, Int) #decodeFloat :: Float -> (Integer, Int) #scaleFloat :: Int -> Float -> Float #isNaN :: Float -> Bool #isIEEE :: Float -> Bool #atan2 :: Float -> Float -> Float # Methodsfold :: 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 # Methodstraverse :: Applicative f => (a -> f b) -> URec * Float a -> f (URec * Float b) #sequenceA :: Applicative f => URec * Float (f a) -> f (URec * Float a) #mapM :: Monad m => (a -> m b) -> URec * Float a -> m (URec * Float b) #sequence :: Monad m => URec * Float (m a) -> m (URec * Float a) #

compare :: Ord a => a -> a -> Ordering #

ioError :: IOError -> IO a #

Raise an IOError in the IO monad.

unlines :: [String] -> String #

unlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each.

class Fractional a => Floating a where #

Trigonometric and hyperbolic functions and related functions.

Minimal complete definition

Methods

pi :: a #

exp :: a -> a #

log :: a -> a #

sqrt :: a -> a #

(**) :: a -> a -> a infixr 8 #

logBase :: a -> a -> a #

sin :: a -> a #

cos :: a -> a #

tan :: a -> a #

asin :: a -> a #

acos :: a -> a #

atan :: a -> a #

sinh :: a -> a #

cosh :: a -> a #

tanh :: a -> a #

asinh :: a -> a #

acosh :: a -> a #

atanh :: a -> a #

Instances

 Since: 2.1 Methodsexp :: Double -> Double #log :: Double -> Double #(**) :: Double -> Double -> Double #sin :: Double -> Double #cos :: Double -> Double #tan :: Double -> Double # Since: 2.1 Methodspi :: Float #exp :: Float -> Float #log :: Float -> Float #sqrt :: Float -> Float #(**) :: Float -> Float -> Float #logBase :: Float -> Float -> Float #sin :: Float -> Float #cos :: Float -> Float #tan :: Float -> Float #asin :: Float -> Float #acos :: Float -> Float #atan :: Float -> Float #sinh :: Float -> Float #cosh :: Float -> Float #tanh :: Float -> Float #asinh :: Float -> Float #acosh :: Float -> Float #atanh :: Float -> Float #log1p :: Float -> Float #expm1 :: Float -> Float # Floating a => Floating (Const k a b) Methodspi :: 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 #

isDenormalized :: RealFloat a => a -> Bool #

True if the argument is too small to be represented in normalized format

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

until p f yields the result of applying f until p holds.

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

Methods

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

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

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.

elem :: Eq a => a -> t a -> Bool infix 4 #

Does the element occur in the 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 [] Since: 2.1 Methodsfold :: 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 # Since: 2.1 Methodsfold :: 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 # Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 # Methodsfold :: 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 # Since: 4.8.0.0 Methodsfold :: 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 # Since: 4.8.0.0 Methodsfold :: 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 # Since: 4.8.0.0 Methodsfold :: 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 # Since: 4.8.0.0 Methodsfold :: 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 # Since: 4.8.0.0 Methodsfold :: 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 # Since: 4.7.0.0 Methodsfold :: 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 # Methodsfold :: 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 # Since: 4.9.0.0 Methodsfold :: 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 ((,) a) Since: 4.7.0.0 Methodsfold :: 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 (Array i) Since: 4.8.0.0 Methodsfold :: 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) Since: 4.9.0.0 Methodsfold :: 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 # Since: 4.7.0.0 Methodsfold :: 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 (Rec1 * f) Methodsfold :: 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 # Methodsfold :: 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 # Methodsfold :: 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 # Methodsfold :: 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 # Methodsfold :: 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 # Methodsfold :: 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