ron-0.8: RON

RON.Prelude

Synopsis

Documentation

(++) :: [a] -> [a] -> [a] infixr 5 #

Append two lists, i.e.,

[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]

If the first list is not finite, the result is the first list.

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]

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

zip takes two lists and returns a list of corresponding pairs.

zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]

If one input list is short, excess elements of the longer list are discarded:

zip [1] ['a', 'b'] = [(1, 'a')]
zip [1, 2] ['a'] = [(1, 'a')]

zip is right-lazy:

zip [] _|_ = []
zip _|_ [] = _|_

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

Extract the first component of a pair.

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

Extract the second component of a pair.

otherwise is defined as the value True. It helps to make guards more readable. eg.

 f x | x < 0     = ...
| otherwise = ...

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

map f xs is the list obtained by applying f to each element of xs, i.e.,

map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]

($) :: (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. Note that ($) is levity-polymorphic in its result type, so that foo \$ True where foo :: Bool -> Int# is well-typed

coerce :: Coercible a b => a -> b #

The function coerce allows you to safely convert between values of types that have the same representation with no run-time overhead. In the simplest case you can use it instead of a newtype constructor, to go from the newtype's concrete type to the abstract type. But it also works in more complicated settings, e.g. converting a list of newtypes to a list of concrete types.

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

general coercion from integral types

realToFrac :: (Real a, Fractional b) => a -> b #

general coercion to fractional types

guard :: Alternative f => Bool -> f () #

Conditional failure of Alternative computations. Defined by

guard True  = pure ()
guard False = empty


Examples

Expand

Common uses of guard include conditionally signaling an error in an error monad and conditionally rejecting the current choice in an Alternative-based parser.

As an example of signaling an error in the error monad Maybe, consider a safe division function safeDiv x y that returns Nothing when the denominator y is zero and Just (x div y) otherwise. For example:

>>> safeDiv 4 0
Nothing
>>> safeDiv 4 2
Just 2


A definition of safeDiv using guards, but not guard:

safeDiv :: Int -> Int -> Maybe Int
safeDiv x y | y /= 0    = Just (x div y)
| otherwise = Nothing


A definition of safeDiv using guard and Monad do-notation:

safeDiv :: Int -> Int -> Maybe Int
safeDiv x y = do
guard (y /= 0)
return (x div y)


class Bounded a where #

The Bounded class is used to name the upper and lower limits of a type. Ord is not a superclass of Bounded since types that are not totally ordered may also have upper and lower bounds.

The Bounded class may be derived for any enumeration type; minBound is the first constructor listed in the data declaration and maxBound is the last. Bounded may also be derived for single-constructor datatypes whose constituent types are in Bounded.

Methods

minBound :: a #

maxBound :: a #

Instances
 Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum Methods Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum Methods Bounded () Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: () #maxBound :: () # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Instance detailsDefined in Foreign.Ptr Methods Instance detailsDefined in Foreign.Ptr Methods Since: base-2.1 Instance detailsDefined in GHC.Unicode Methods Source # Instance detailsDefined in RON.Util.Word Methods Source # Instance detailsDefined in RON.Event Methods Bounded a => Bounded (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsminBound :: Min a #maxBound :: Min a # Bounded a => Bounded (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsminBound :: Max a #maxBound :: Max a # Bounded a => Bounded (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Bounded a => Bounded (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Bounded m => Bounded (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Bounded a => Bounded (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methods Bounded a => Bounded (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Bounded a => Bounded (Sum a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsminBound :: Sum a #maxBound :: Sum a # Bounded a => Bounded (Product a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods (Bounded a, Bounded b) => Bounded (a, b) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b) #maxBound :: (a, b) # Bounded (Proxy t) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods (Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c) #maxBound :: (a, b, c) # Bounded a => Bounded (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodsminBound :: Const a b #maxBound :: Const a b # (Applicative f, Bounded a) => Bounded (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid MethodsminBound :: Ap f a #maxBound :: Ap f a # a ~ b => Bounded (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality MethodsminBound :: a :~: b #maxBound :: a :~: b # Bounded b => Bounded (Tagged s b) Instance detailsDefined in Data.Tagged MethodsminBound :: Tagged s b #maxBound :: Tagged s b # (Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d) #maxBound :: (a, b, c, d) # a ~~ b => Bounded (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality MethodsminBound :: a :~~: b #maxBound :: a :~~: b # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e) #maxBound :: (a, b, c, d, e) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f) #maxBound :: (a, b, c, d, e, f) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g) #maxBound :: (a, b, c, d, e, f, g) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h) #maxBound :: (a, b, c, d, e, f, g, h) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i) #maxBound :: (a, b, c, d, e, f, g, h, i) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j) #maxBound :: (a, b, c, d, e, f, g, h, i, j) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Enum a where #

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
bound | fromEnum y >= fromEnum x = maxBound
| otherwise                = minBound

Minimal complete definition

Methods

succ :: a -> a #

the successor of a value. For numeric types, succ adds 1.

pred :: a -> a #

the predecessor of a value. For numeric types, pred subtracts 1.

toEnum :: Int -> a #

Convert from an Int.

fromEnum :: a -> Int #

Convert to an Int. It is implementation-dependent what fromEnum returns when applied to a value that is too large to fit in an Int.

Instances

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.

The Haskell Report defines no laws for Eq. However, == is customarily expected to implement an equivalence relationship where two values comparing equal are indistinguishable by "public" functions, with a "public" function being one not allowing to see implementation details. For example, for a type representing non-normalised natural numbers modulo 100, a "public" function doesn't make the difference between 1 and 201. It is expected to have the following properties:

Reflexivity
x == x = True
Symmetry
x == y = y == x
Transitivity
if x == y && y == z = True, then x == z = True
Substitutivity
if x == y = True and f is a "public" function whose return type is an instance of Eq, then f x == f y = True
Negation
x /= y = not (x == y)

Minimal complete definition: either == or /=.

Minimal complete definition

Methods

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

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

Instances
 Instance detailsDefined in GHC.Classes Methods(==) :: Bool -> Bool -> Bool #(/=) :: Bool -> Bool -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Char -> Char -> Bool #(/=) :: Char -> Char -> Bool # Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Double) False Also note that Double's Eq instance does not satisfy substitutivity:>>> 0 == (-0 :: Double) True >>> recip 0 == recip (-0 :: Double) False  Instance detailsDefined in GHC.Classes Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Float) False Also note that Float's Eq instance does not satisfy substitutivity:>>> 0 == (-0 :: Float) True >>> recip 0 == recip (-0 :: Float) False  Instance detailsDefined in GHC.Classes Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(==) :: Int8 -> Int8 -> Bool #(/=) :: Int8 -> Int8 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(==) :: Int16 -> Int16 -> Bool #(/=) :: Int16 -> Int16 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(==) :: Int32 -> Int32 -> Bool #(/=) :: Int32 -> Int32 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Int Methods(==) :: Int64 -> Int64 -> Bool #(/=) :: Int64 -> Int64 -> Bool # Instance detailsDefined in GHC.Integer.Type Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: base-4.8.0.0 Instance detailsDefined in GHC.Natural Methods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods(==) :: Word -> Word -> Bool #(/=) :: Word -> Word -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Word Methods(==) :: Word8 -> Word8 -> Bool #(/=) :: Word8 -> Word8 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Word Methods(==) :: Word16 -> Word16 -> Bool #(/=) :: Word16 -> Word16 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Word Methods(==) :: Word32 -> Word32 -> Bool #(/=) :: Word32 -> Word32 -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Word Methods(==) :: Word64 -> Word64 -> Bool #(/=) :: Word64 -> Word64 -> Bool # Instance detailsDefined in Data.Typeable.Internal Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Exp -> Exp -> Bool #(/=) :: Exp -> Exp -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Match -> Match -> Bool #(/=) :: Match -> Match -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Clause -> Clause -> Bool #(/=) :: Clause -> Clause -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Pat -> Pat -> Bool #(/=) :: Pat -> Pat -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Type -> Type -> Bool #(/=) :: Type -> Type -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Dec -> Dec -> Bool #(/=) :: Dec -> Dec -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Name -> Name -> Bool #(/=) :: Name -> Name -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: FunDep -> FunDep -> Bool #(/=) :: FunDep -> FunDep -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Overlap -> Overlap -> Bool #(/=) :: Overlap -> Overlap -> Bool # Eq () Instance detailsDefined in GHC.Classes Methods(==) :: () -> () -> Bool #(/=) :: () -> () -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: TyCon -> TyCon -> Bool #(/=) :: TyCon -> TyCon -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: Module -> Module -> Bool #(/=) :: Module -> Module -> Bool # Instance detailsDefined in GHC.Classes Methods(==) :: TrName -> TrName -> Bool #(/=) :: TrName -> TrName -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Con -> Con -> Bool #(/=) :: Con -> Con -> Bool # Instance detailsDefined in Data.ByteString.Internal Methods Instance detailsDefined in Data.ByteString.Lazy.Internal Methods Scientific numbers can be safely compared for equality. No magnitude 10^e is calculated so there's no risk of a blowup in space or time when comparing scientific numbers coming from untrusted sources. Instance detailsDefined in Data.Scientific Methods Instance detailsDefined in Data.Time.Clock.Internal.UTCTime Methods(==) :: UTCTime -> UTCTime -> Bool #(/=) :: UTCTime -> UTCTime -> Bool # Instance detailsDefined in Data.Aeson.Types.Internal Methods Instance detailsDefined in Data.Aeson.Types.Internal Methods(==) :: Value -> Value -> Bool #(/=) :: Value -> Value -> Bool # Instance detailsDefined in Data.Aeson.Types.Internal Methods Instance detailsDefined in Data.Aeson.Types.Internal Methods Instance detailsDefined in Data.Attoparsec.Internal.Types Methods(==) :: Pos -> Pos -> Bool #(/=) :: Pos -> Pos -> Bool # Instance detailsDefined in Data.Attoparsec.Internal.Types Methods(==) :: More -> More -> Bool #(/=) :: More -> More -> Bool # Instance detailsDefined in GHC.Integer.Type Methods(==) :: BigNat -> BigNat -> Bool #(/=) :: BigNat -> BigNat -> Bool # Since: base-4.8.0.0 Instance detailsDefined in Data.Void Methods(==) :: Void -> Void -> Bool #(/=) :: Void -> Void -> Bool # Since: base-4.3.0.0 Instance detailsDefined in GHC.Exts Methods Equality of constructorsSince: base-4.0.0.0 Instance detailsDefined in Data.Data Methods(==) :: Constr -> Constr -> Bool #(/=) :: Constr -> Constr -> Bool # Since: base-4.0.0.0 Instance detailsDefined in Data.Data Methods(==) :: DataRep -> DataRep -> Bool #(/=) :: DataRep -> DataRep -> Bool # Since: base-4.0.0.0 Instance detailsDefined in Data.Data Methods Since: base-4.0.0.0 Instance detailsDefined in Data.Data Methods(==) :: Fixity -> Fixity -> Bool #(/=) :: Fixity -> Fixity -> Bool # Instance detailsDefined in Data.Unique Methods(==) :: Unique -> Unique -> Bool #(/=) :: Unique -> Unique -> Bool # Since: base-2.1 Instance detailsDefined in Data.Version Methods(==) :: Version -> Version -> Bool #(/=) :: Version -> Version -> Bool # Since: base-4.2.0.0 Instance detailsDefined in GHC.Conc.Sync Methods Since: base-4.3.0.0 Instance detailsDefined in GHC.Conc.Sync Methods Since: base-4.3.0.0 Instance detailsDefined in GHC.Conc.Sync Methods Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Exception Methods Since: base-4.2.0.0 Instance detailsDefined in GHC.IO.Exception Methods Instance detailsDefined in GHC.IO.Exception Methods Since: base-4.1.0.0 Instance detailsDefined in GHC.IO.Exception Methods Since: base-4.3.0.0 Instance detailsDefined in GHC.IO Methods Since: base-4.1.0.0 Instance detailsDefined in GHC.IO.Exception Methods Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: All -> All -> Bool #(/=) :: All -> All -> Bool # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Any -> Any -> Bool #(/=) :: Any -> Any -> Bool # Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: Fixity -> Fixity -> Bool #(/=) :: Fixity -> Fixity -> Bool # Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Instance detailsDefined in Foreign.Ptr Methods(==) :: WordPtr -> WordPtr -> Bool #(/=) :: WordPtr -> WordPtr -> Bool # Instance detailsDefined in Foreign.Ptr Methods(==) :: IntPtr -> IntPtr -> Bool #(/=) :: IntPtr -> IntPtr -> Bool # Since: base-4.4.0.0 Instance detailsDefined in GHC.Fingerprint.Type Methods Since: base-2.1 Instance detailsDefined in GHC.Unicode Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Stack.Types Methods(==) :: SrcLoc -> SrcLoc -> Bool #(/=) :: SrcLoc -> SrcLoc -> Bool # Instance detailsDefined in Data.ByteString.Short.Internal Methods Instance detailsDefined in Data.IntSet.Internal Methods(==) :: IntSet -> IntSet -> Bool #(/=) :: IntSet -> IntSet -> Bool # Instance detailsDefined in GHC.LanguageExtensions.Type Methods Instance detailsDefined in GHC.ForeignSrcLang.Type Methods Since: primitive-0.6.3.0 Instance detailsDefined in Data.Primitive.ByteArray Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: ModName -> ModName -> Bool #(/=) :: ModName -> ModName -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: PkgName -> PkgName -> Bool #(/=) :: PkgName -> PkgName -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Module -> Module -> Bool #(/=) :: Module -> Module -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: OccName -> OccName -> Bool #(/=) :: OccName -> OccName -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Loc -> Loc -> Bool #(/=) :: Loc -> Loc -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Info -> Info -> Bool #(/=) :: Info -> Info -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Fixity -> Fixity -> Bool #(/=) :: Fixity -> Fixity -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Lit -> Lit -> Bool #(/=) :: Lit -> Lit -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Body -> Body -> Bool #(/=) :: Body -> Body -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Guard -> Guard -> Bool #(/=) :: Guard -> Guard -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Stmt -> Stmt -> Bool #(/=) :: Stmt -> Stmt -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Range -> Range -> Bool #(/=) :: Range -> Range -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Foreign -> Foreign -> Bool #(/=) :: Foreign -> Foreign -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Safety -> Safety -> Bool #(/=) :: Safety -> Safety -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Pragma -> Pragma -> Bool #(/=) :: Pragma -> Pragma -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Inline -> Inline -> Bool #(/=) :: Inline -> Inline -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Phases -> Phases -> Bool #(/=) :: Phases -> Phases -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Bang -> Bang -> Bool #(/=) :: Bang -> Bang -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: TyLit -> TyLit -> Bool #(/=) :: TyLit -> TyLit -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(==) :: Role -> Role -> Bool #(/=) :: Role -> Role -> Bool # Instance detailsDefined in Language.Haskell.TH.Syntax Methods Instance detailsDefined in Data.Time.LocalTime.Internal.LocalTime Methods Instance detailsDefined in Data.Time.LocalTime.Internal.TimeOfDay Methods Instance detailsDefined in Data.Time.Clock.Internal.UniversalTime Methods Instance detailsDefined in Data.Time.Clock.Internal.NominalDiffTime Methods Instance detailsDefined in Data.Time.Clock.Internal.DiffTime Methods Instance detailsDefined in Data.Time.Calendar.Days Methods(==) :: Day -> Day -> Bool #(/=) :: Day -> Day -> Bool # Eq UnpackedUUID Instance detailsDefined in Data.UUID.Types.Internal Methods(==) :: UnpackedUUID -> UnpackedUUID -> Bool #(/=) :: UnpackedUUID -> UnpackedUUID -> Bool # Instance detailsDefined in Data.UUID.Types.Internal Methods(==) :: UUID -> UUID -> Bool #(/=) :: UUID -> UUID -> Bool # Source # Instance detailsDefined in RON.Error Methods(==) :: Error -> Error -> Bool #(/=) :: Error -> Error -> Bool # Source # Instance detailsDefined in RON.Binary.Types Methods(==) :: Desc -> Desc -> Bool #(/=) :: Desc -> Desc -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word60 -> Word60 -> Bool #(/=) :: Word60 -> Word60 -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word24 -> Word24 -> Bool #(/=) :: Word24 -> Word24 -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word12 -> Word12 -> Bool #(/=) :: Word12 -> Word12 -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word6 -> Word6 -> Bool #(/=) :: Word6 -> Word6 -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word4 -> Word4 -> Bool #(/=) :: Word4 -> Word4 -> Bool # Source # Instance detailsDefined in RON.Util.Word Methods(==) :: Word2 -> Word2 -> Bool #(/=) :: Word2 -> Word2 -> Bool # Source # Instance detailsDefined in RON.UUID Methods Source # Instance detailsDefined in RON.UUID Methods(==) :: UUID -> UUID -> Bool #(/=) :: UUID -> UUID -> Bool # Source # Instance detailsDefined in RON.Types Methods Source # Instance detailsDefined in RON.Types Methods(==) :: OpTerm -> OpTerm -> Bool #(/=) :: OpTerm -> OpTerm -> Bool # Source # Instance detailsDefined in RON.Types Methods Source # Instance detailsDefined in RON.Types Methods Source # Instance detailsDefined in RON.Types Methods(==) :: Op -> Op -> Bool #(/=) :: Op -> Op -> Bool # Source # Instance detailsDefined in RON.Types Methods Source # Instance detailsDefined in RON.Types Methods(==) :: Atom -> Atom -> Bool #(/=) :: Atom -> Atom -> Bool # Eq CodePoint Instance detailsDefined in Data.Text.Encoding Methods(==) :: CodePoint -> CodePoint -> Bool #(/=) :: CodePoint -> CodePoint -> Bool # Eq DecoderState Instance detailsDefined in Data.Text.Encoding Methods(==) :: DecoderState -> DecoderState -> Bool #(/=) :: DecoderState -> DecoderState -> Bool # Source # Instance detailsDefined in RON.Event Methods Source # Instance detailsDefined in RON.Event Methods Source # Instance detailsDefined in RON.Event Methods(==) :: Event -> Event -> Bool #(/=) :: Event -> Event -> Bool # Source # Instance detailsDefined in RON.Event Methods Source # Instance detailsDefined in RON.Event Methods(==) :: Naming -> Naming -> Bool #(/=) :: Naming -> Naming -> Bool # Source # Instance detailsDefined in RON.Event Methods Source # Instance detailsDefined in RON.Event Methods Eq a => Eq [a] Instance detailsDefined in GHC.Classes Methods(==) :: [a] -> [a] -> Bool #(/=) :: [a] -> [a] -> Bool # Eq a => Eq (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Maybe Methods(==) :: Maybe a -> Maybe a -> Bool #(/=) :: Maybe a -> Maybe a -> Bool # Eq a => Eq (Ratio a) Since: base-2.1 Instance detailsDefined in GHC.Real Methods(==) :: Ratio a -> Ratio a -> Bool #(/=) :: Ratio a -> Ratio a -> Bool # Eq (Ptr a) Since: base-2.1 Instance detailsDefined in GHC.Ptr Methods(==) :: Ptr a -> Ptr a -> Bool #(/=) :: Ptr a -> Ptr a -> Bool # Eq (FunPtr a) Instance detailsDefined in GHC.Ptr Methods(==) :: FunPtr a -> FunPtr a -> Bool #(/=) :: FunPtr a -> FunPtr a -> Bool # Eq p => Eq (Par1 p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: Par1 p -> Par1 p -> Bool #(/=) :: Par1 p -> Par1 p -> Bool # Eq a => Eq (IResult a) Instance detailsDefined in Data.Aeson.Types.Internal Methods(==) :: IResult a -> IResult a -> Bool #(/=) :: IResult a -> IResult a -> Bool # Eq a => Eq (Result a) Instance detailsDefined in Data.Aeson.Types.Internal Methods(==) :: Result a -> Result a -> Bool #(/=) :: Result a -> Result a -> Bool # Eq a => Eq (Complex a) Since: base-2.1 Instance detailsDefined in Data.Complex Methods(==) :: Complex a -> Complex a -> Bool #(/=) :: Complex a -> Complex a -> Bool # Eq (Fixed a) Since: base-2.1 Instance detailsDefined in Data.Fixed Methods(==) :: Fixed a -> Fixed a -> Bool #(/=) :: Fixed a -> Fixed a -> Bool # Eq a => Eq (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Min a -> Min a -> Bool #(/=) :: Min a -> Min a -> Bool # Eq a => Eq (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Max a -> Max a -> Bool #(/=) :: Max a -> Max a -> Bool # Eq a => Eq (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq m => Eq (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # Eq a => Eq (Option a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Option a -> Option a -> Bool #(/=) :: Option a -> Option a -> Bool # Eq (StableName a) Since: base-2.1 Instance detailsDefined in GHC.StableName Methods(==) :: StableName a -> StableName a -> Bool #(/=) :: StableName a -> StableName a -> Bool # Eq a => Eq (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods(==) :: ZipList a -> ZipList a -> Bool #(/=) :: ZipList a -> ZipList a -> Bool # Eq a => Eq (Identity a) Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methods(==) :: Identity a -> Identity a -> Bool #(/=) :: Identity a -> Identity a -> Bool # Eq (TVar a) Since: base-4.8.0.0 Instance detailsDefined in GHC.Conc.Sync Methods(==) :: TVar a -> TVar a -> Bool #(/=) :: TVar a -> TVar a -> Bool # Eq (IORef a) ^ Pointer equality.Since: base-4.1.0.0 Instance detailsDefined in GHC.IORef Methods(==) :: IORef a -> IORef a -> Bool #(/=) :: IORef a -> IORef a -> Bool # Eq a => Eq (First a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq a => Eq (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Dual a -> Dual a -> Bool #(/=) :: Dual a -> Dual a -> Bool # Eq a => Eq (Sum a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Sum a -> Sum a -> Bool #(/=) :: Sum a -> Sum a -> Bool # Eq a => Eq (Product a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Product a -> Product a -> Bool #(/=) :: Product a -> Product a -> Bool # Eq a => Eq (Down a) Since: base-4.6.0.0 Instance detailsDefined in Data.Ord Methods(==) :: Down a -> Down a -> Bool #(/=) :: Down a -> Down a -> Bool # Eq a => Eq (NonEmpty a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # Eq a => Eq (IntMap a) Instance detailsDefined in Data.IntMap.Internal Methods(==) :: IntMap a -> IntMap a -> Bool #(/=) :: IntMap a -> IntMap a -> Bool # Eq a => Eq (Tree a) Instance detailsDefined in Data.Tree Methods(==) :: Tree a -> Tree a -> Bool #(/=) :: Tree a -> Tree a -> Bool # Eq a => Eq (Seq a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: Seq a -> Seq a -> Bool #(/=) :: Seq a -> Seq a -> Bool # Eq a => Eq (ViewL a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: ViewL a -> ViewL a -> Bool #(/=) :: ViewL a -> ViewL a -> Bool # Eq a => Eq (ViewR a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: ViewR a -> ViewR a -> Bool #(/=) :: ViewR a -> ViewR a -> Bool # Eq a => Eq (Set a) Instance detailsDefined in Data.Set.Internal Methods(==) :: Set a -> Set a -> Bool #(/=) :: Set a -> Set a -> Bool # Eq a => Eq (DList a) Instance detailsDefined in Data.DList Methods(==) :: DList a -> DList a -> Bool #(/=) :: DList a -> DList a -> Bool # Eq a => Eq (Hashed a) Uses precomputed hash to detect inequality faster Instance detailsDefined in Data.Hashable.Class Methods(==) :: Hashed a -> Hashed a -> Bool #(/=) :: Hashed a -> Hashed a -> Bool # (Eq a, Prim a) => Eq (PrimArray a) Since: primitive-0.6.4.0 Instance detailsDefined in Data.Primitive.PrimArray Methods(==) :: PrimArray a -> PrimArray a -> Bool #(/=) :: PrimArray a -> PrimArray a -> Bool # Eq a => Eq (SmallArray a) Instance detailsDefined in Data.Primitive.SmallArray Methods(==) :: SmallArray a -> SmallArray a -> Bool #(/=) :: SmallArray a -> SmallArray a -> Bool # Eq a => Eq (Array a) Instance detailsDefined in Data.Primitive.Array Methods(==) :: Array a -> Array a -> Bool #(/=) :: Array a -> Array a -> Bool # Eq a => Eq (HashSet a) Instance detailsDefined in Data.HashSet.Base Methods(==) :: HashSet a -> HashSet a -> Bool #(/=) :: HashSet a -> HashSet a -> Bool # (Storable a, Eq a) => Eq (Vector a) Instance detailsDefined in Data.Vector.Storable Methods(==) :: Vector a -> Vector a -> Bool #(/=) :: Vector a -> Vector a -> Bool # (Prim a, Eq a) => Eq (Vector a) Instance detailsDefined in Data.Vector.Primitive Methods(==) :: Vector a -> Vector a -> Bool #(/=) :: Vector a -> Vector a -> Bool # Eq a => Eq (Vector a) Instance detailsDefined in Data.Vector Methods(==) :: Vector a -> Vector a -> Bool #(/=) :: Vector a -> Vector a -> Bool # Source # Instance detailsDefined in RON.Types Methods(==) :: ObjectFrame a -> ObjectFrame a -> Bool #(/=) :: ObjectFrame a -> ObjectFrame a -> Bool # Eq (Object a) Source # Instance detailsDefined in RON.Types Methods(==) :: Object a -> Object a -> Bool #(/=) :: Object a -> Object a -> Bool # (Eq a, Eq b) => Eq (Either a b) Since: base-2.1 Instance detailsDefined in Data.Either Methods(==) :: Either a b -> Either a b -> Bool #(/=) :: Either a b -> Either a b -> Bool # Eq (V1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: V1 p -> V1 p -> Bool #(/=) :: V1 p -> V1 p -> Bool # Eq (U1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: U1 p -> U1 p -> Bool #(/=) :: U1 p -> U1 p -> Bool # Eq (TypeRep a) Since: base-2.1 Instance detailsDefined in Data.Typeable.Internal Methods(==) :: TypeRep a -> TypeRep a -> Bool #(/=) :: TypeRep a -> TypeRep a -> Bool # (Eq a, Eq b) => Eq (a, b) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b) -> (a, b) -> Bool #(/=) :: (a, b) -> (a, b) -> Bool # (Eq k, Eq v) => Eq (HashMap k v) Instance detailsDefined in Data.HashMap.Base Methods(==) :: HashMap k v -> HashMap k v -> Bool #(/=) :: HashMap k v -> HashMap k v -> Bool # (Eq k, Eq a) => Eq (Map k a) Instance detailsDefined in Data.Map.Internal Methods(==) :: Map k a -> Map k a -> Bool #(/=) :: Map k a -> Map k a -> Bool # (Ix i, Eq e) => Eq (Array i e) Since: base-2.1 Instance detailsDefined in GHC.Arr Methods(==) :: Array i e -> Array i e -> Bool #(/=) :: Array i e -> Array i e -> Bool # Eq a => Eq (Arg a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Arg a b -> Arg a b -> Bool #(/=) :: Arg a b -> Arg a b -> Bool # Eq (Proxy s) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods(==) :: Proxy s -> Proxy s -> Bool #(/=) :: Proxy s -> Proxy s -> Bool # (Eq1 m, Eq a) => Eq (ListT m a) Instance detailsDefined in Control.Monad.Trans.List Methods(==) :: ListT m a -> ListT m a -> Bool #(/=) :: ListT m a -> ListT m a -> Bool # Eq (SmallMutableArray s a) Instance detailsDefined in Data.Primitive.SmallArray Methods(==) :: SmallMutableArray s a -> SmallMutableArray s a -> Bool #(/=) :: SmallMutableArray s a -> SmallMutableArray s a -> Bool # Eq (MutableArray s a) Instance detailsDefined in Data.Primitive.Array Methods(==) :: MutableArray s a -> MutableArray s a -> Bool #(/=) :: MutableArray s a -> MutableArray s a -> Bool # (Eq1 m, Eq a) => Eq (MaybeT m a) Instance detailsDefined in Control.Monad.Trans.Maybe Methods(==) :: MaybeT m a -> MaybeT m a -> Bool #(/=) :: MaybeT m a -> MaybeT m a -> Bool # (Eq k, Eq v) => Eq (Leaf k v) Instance detailsDefined in Data.HashMap.Base Methods(==) :: Leaf k v -> Leaf k v -> Bool #(/=) :: Leaf k v -> Leaf k v -> Bool # Eq (f p) => Eq (Rec1 f p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: Rec1 f p -> Rec1 f p -> Bool #(/=) :: Rec1 f p -> Rec1 f p -> Bool # Eq (URec (Ptr ()) p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #(/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # Eq (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Char p -> URec Char p -> Bool #(/=) :: URec Char p -> URec Char p -> Bool # Eq (URec Double p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Double p -> URec Double p -> Bool #(/=) :: URec Double p -> URec Double p -> Bool # Eq (URec Float p) Instance detailsDefined in GHC.Generics Methods(==) :: URec Float p -> URec Float p -> Bool #(/=) :: URec Float p -> URec Float p -> Bool # Eq (URec Int p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Int p -> URec Int p -> Bool #(/=) :: URec Int p -> URec Int p -> Bool # Eq (URec Word p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Word p -> URec Word p -> Bool #(/=) :: URec Word p -> URec Word p -> Bool # (Eq a, Eq b, Eq c) => Eq (a, b, c) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c) -> (a, b, c) -> Bool #(/=) :: (a, b, c) -> (a, b, c) -> Bool # Eq (STArray s i e) Since: base-2.1 Instance detailsDefined in GHC.Arr Methods(==) :: STArray s i e -> STArray s i e -> Bool #(/=) :: STArray s i e -> STArray s i e -> Bool # Eq a => Eq (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(==) :: Const a b -> Const a b -> Bool #(/=) :: Const a b -> Const a b -> Bool # Eq (f a) => Eq (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(==) :: Ap f a -> Ap f a -> Bool #(/=) :: Ap f a -> Ap f a -> Bool # Eq (f a) => Eq (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Alt f a -> Alt f a -> Bool #(/=) :: Alt f a -> Alt f a -> Bool # Eq (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality Methods(==) :: (a :~: b) -> (a :~: b) -> Bool #(/=) :: (a :~: b) -> (a :~: b) -> Bool # (Eq1 f, Eq a) => Eq (IdentityT f a) Instance detailsDefined in Control.Monad.Trans.Identity Methods(==) :: IdentityT f a -> IdentityT f a -> Bool #(/=) :: IdentityT f a -> IdentityT f a -> Bool # (Eq e, Eq1 m, Eq a) => Eq (ErrorT e m a) Instance detailsDefined in Control.Monad.Trans.Error Methods(==) :: ErrorT e m a -> ErrorT e m a -> Bool #(/=) :: ErrorT e m a -> ErrorT e m a -> Bool # (Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a) Instance detailsDefined in Control.Monad.Trans.Except Methods(==) :: ExceptT e m a -> ExceptT e m a -> Bool #(/=) :: ExceptT e m a -> ExceptT e m a -> Bool # (Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy Methods(==) :: WriterT w m a -> WriterT w m a -> Bool #(/=) :: WriterT w m a -> WriterT w m a -> Bool # (Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) Instance detailsDefined in Control.Monad.Trans.Writer.Strict Methods(==) :: WriterT w m a -> WriterT w m a -> Bool #(/=) :: WriterT w m a -> WriterT w m a -> Bool # Eq b => Eq (Tagged s b) Instance detailsDefined in Data.Tagged Methods(==) :: Tagged s b -> Tagged s b -> Bool #(/=) :: Tagged s b -> Tagged s b -> Bool # Eq c => Eq (K1 i c p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: K1 i c p -> K1 i c p -> Bool #(/=) :: K1 i c p -> K1 i c p -> Bool # (Eq (f p), Eq (g p)) => Eq ((f :+: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: (f :+: g) p -> (f :+: g) p -> Bool #(/=) :: (f :+: g) p -> (f :+: g) p -> Bool # (Eq (f p), Eq (g p)) => Eq ((f :*: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: (f :*: g) p -> (f :*: g) p -> Bool #(/=) :: (f :*: g) p -> (f :*: g) p -> Bool # (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methods(==) :: Product f g a -> Product f g a -> Bool #(/=) :: Product f g a -> Product f g a -> Bool # (Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Sum Methods(==) :: Sum f g a -> Sum f g a -> Bool #(/=) :: Sum f g a -> Sum f g a -> Bool # Eq (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality Methods(==) :: (a :~~: b) -> (a :~~: b) -> Bool #(/=) :: (a :~~: b) -> (a :~~: b) -> Bool # Eq (f p) => Eq (M1 i c f p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: M1 i c f p -> M1 i c f p -> Bool #(/=) :: M1 i c f p -> M1 i c f p -> Bool # Eq (f (g p)) => Eq ((f :.: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: (f :.: g) p -> (f :.: g) p -> Bool #(/=) :: (f :.: g) p -> (f :.: g) p -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Compose Methods(==) :: Compose f g a -> Compose f g a -> Bool #(/=) :: Compose f g a -> Compose f g a -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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) Instance detailsDefined in GHC.Classes 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 #

class (Real a, Enum a) => Integral a where #

Integral numbers, supporting integer division.

The Haskell Report defines no laws for Integral. However, Integral instances are customarily expected to define a Euclidean domain and have the following properties for the 'div'/'mod' and 'quot'/'rem' pairs, given suitable Euclidean functions f and g:

• x = y * quot x y + rem x y with rem x y = fromInteger 0 or g (rem x y) < g y
• x = y * div x y + mod x y with mod x y = fromInteger 0 or f (mod x y) < f y

An example of a suitable Euclidean function, for Integer's instance, is abs.

Minimal complete definition

Methods

mod :: a -> a -> a infixl 7 #

integer modulus, satisfying

(x div y)*y + (x mod y) == x
Instances
 Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodsquot :: Int -> Int -> Int #rem :: Int -> Int -> Int #div :: Int -> Int -> Int #mod :: Int -> Int -> Int #quotRem :: Int -> Int -> (Int, Int) #divMod :: Int -> Int -> (Int, Int) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int8 -> Int8 -> Int8 #rem :: Int8 -> Int8 -> Int8 #div :: Int8 -> Int8 -> Int8 #mod :: Int8 -> Int8 -> Int8 #quotRem :: Int8 -> Int8 -> (Int8, Int8) #divMod :: Int8 -> Int8 -> (Int8, Int8) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int16 -> Int16 -> Int16 #rem :: Int16 -> Int16 -> Int16 #div :: Int16 -> Int16 -> Int16 #mod :: Int16 -> Int16 -> Int16 #quotRem :: Int16 -> Int16 -> (Int16, Int16) #divMod :: Int16 -> Int16 -> (Int16, Int16) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int32 -> Int32 -> Int32 #rem :: Int32 -> Int32 -> Int32 #div :: Int32 -> Int32 -> Int32 #mod :: Int32 -> Int32 -> Int32 #quotRem :: Int32 -> Int32 -> (Int32, Int32) #divMod :: Int32 -> Int32 -> (Int32, Int32) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int64 -> Int64 -> Int64 #rem :: Int64 -> Int64 -> Int64 #div :: Int64 -> Int64 -> Int64 #mod :: Int64 -> Int64 -> Int64 #quotRem :: Int64 -> Int64 -> (Int64, Int64) #divMod :: Int64 -> Int64 -> (Int64, Int64) # Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real MethodsquotRem :: Natural -> Natural -> (Natural, Natural) #divMod :: Natural -> Natural -> (Natural, Natural) # Since: base-2.1 Instance detailsDefined in GHC.Real 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: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word8 -> Word8 -> Word8 #rem :: Word8 -> Word8 -> Word8 #div :: Word8 -> Word8 -> Word8 #mod :: Word8 -> Word8 -> Word8 #quotRem :: Word8 -> Word8 -> (Word8, Word8) #divMod :: Word8 -> Word8 -> (Word8, Word8) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word16 -> Word16 -> Word16 #rem :: Word16 -> Word16 -> Word16 #div :: Word16 -> Word16 -> Word16 #mod :: Word16 -> Word16 -> Word16 #quotRem :: Word16 -> Word16 -> (Word16, Word16) #divMod :: Word16 -> Word16 -> (Word16, Word16) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word32 -> Word32 -> Word32 #rem :: Word32 -> Word32 -> Word32 #div :: Word32 -> Word32 -> Word32 #mod :: Word32 -> Word32 -> Word32 #quotRem :: Word32 -> Word32 -> (Word32, Word32) #divMod :: Word32 -> Word32 -> (Word32, Word32) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word64 -> Word64 -> Word64 #rem :: Word64 -> Word64 -> Word64 #div :: Word64 -> Word64 -> Word64 #mod :: Word64 -> Word64 -> Word64 #quotRem :: Word64 -> Word64 -> (Word64, Word64) #divMod :: Word64 -> Word64 -> (Word64, Word64) # Instance detailsDefined in Foreign.Ptr MethodsquotRem :: WordPtr -> WordPtr -> (WordPtr, WordPtr) #divMod :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # Instance detailsDefined in Foreign.Ptr Methodsquot :: IntPtr -> IntPtr -> IntPtr #rem :: IntPtr -> IntPtr -> IntPtr #div :: IntPtr -> IntPtr -> IntPtr #mod :: IntPtr -> IntPtr -> IntPtr #quotRem :: IntPtr -> IntPtr -> (IntPtr, IntPtr) #divMod :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # Integral a => Integral (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methodsquot :: Identity a -> Identity a -> Identity a #rem :: Identity a -> Identity a -> Identity a #div :: Identity a -> Identity a -> Identity a #mod :: Identity a -> Identity a -> Identity a #quotRem :: Identity a -> Identity a -> (Identity a, Identity a) #divMod :: Identity a -> Identity a -> (Identity a, Identity a) # Integral a => Integral (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodsquot :: Const a b -> Const a b -> Const a b #rem :: Const a b -> Const a b -> Const a b #div :: Const a b -> Const a b -> Const a b #mod :: Const a b -> Const a b -> Const a b #quotRem :: Const a b -> Const a b -> (Const a b, Const a b) #divMod :: Const a b -> Const a b -> (Const a b, Const a b) #toInteger :: Const a b -> Integer # Integral a => Integral (Tagged s a) Instance detailsDefined in Data.Tagged Methodsquot :: Tagged s a -> Tagged s a -> Tagged s a #rem :: Tagged s a -> Tagged s a -> Tagged s a #div :: Tagged s a -> Tagged s a -> Tagged s a #mod :: Tagged s a -> Tagged s a -> Tagged s a #quotRem :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) #divMod :: Tagged s a -> Tagged s a -> (Tagged s a, Tagged s a) #toInteger :: Tagged s a -> Integer #

class Applicative m => Monad (m :: Type -> Type) where #

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

Instances of Monad should satisfy the following laws:

• 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

(>>=)

Methods

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

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

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

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

Instances
 Monad [] Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: [a] -> (a -> [b]) -> [b] #(>>) :: [a] -> [b] -> [b] #return :: a -> [a] #fail :: String -> [a] # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #(>>) :: Maybe a -> Maybe b -> Maybe b #return :: a -> Maybe a #fail :: String -> Maybe a # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: IO a -> (a -> IO b) -> IO b #(>>) :: IO a -> IO b -> IO b #return :: a -> IO a #fail :: String -> IO a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b #(>>) :: Par1 a -> Par1 b -> Par1 b #return :: a -> Par1 a #fail :: String -> Par1 a # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(>>=) :: Q a -> (a -> Q b) -> Q b #(>>) :: Q a -> Q b -> Q b #return :: a -> Q a #fail :: String -> Q a # Instance detailsDefined in Data.Aeson.Types.Internal Methods(>>=) :: IResult a -> (a -> IResult b) -> IResult b #(>>) :: IResult a -> IResult b -> IResult b #return :: a -> IResult a #fail :: String -> IResult a # Instance detailsDefined in Data.Aeson.Types.Internal Methods(>>=) :: Result a -> (a -> Result b) -> Result b #(>>) :: Result a -> Result b -> Result b #return :: a -> Result a #fail :: String -> Result a # Instance detailsDefined in Data.Aeson.Types.Internal Methods(>>=) :: Parser a -> (a -> Parser b) -> Parser b #(>>) :: Parser a -> Parser b -> Parser b #return :: a -> Parser a #fail :: String -> Parser a # Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methods(>>=) :: Complex a -> (a -> Complex b) -> Complex b #(>>) :: Complex a -> Complex b -> Complex b #return :: a -> Complex a #fail :: String -> Complex a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Min a -> (a -> Min b) -> Min b #(>>) :: Min a -> Min b -> Min b #return :: a -> Min a #fail :: String -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Max a -> (a -> Max b) -> Max b #(>>) :: Max a -> Max b -> Max b #return :: a -> Max a #fail :: String -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a #fail :: String -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a #fail :: String -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Option a -> (a -> Option b) -> Option b #(>>) :: Option a -> Option b -> Option b #return :: a -> Option a #fail :: String -> Option a # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methods(>>=) :: Identity a -> (a -> Identity b) -> Identity b #(>>) :: Identity a -> Identity b -> Identity b #return :: a -> Identity a #fail :: String -> Identity a # Since: base-4.3.0.0 Instance detailsDefined in GHC.Conc.Sync Methods(>>=) :: STM a -> (a -> STM b) -> STM b #(>>) :: STM a -> STM b -> STM b #return :: a -> STM a #fail :: String -> STM a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a #fail :: String -> First a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a #fail :: String -> Last a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Dual a -> (a -> Dual b) -> Dual b #(>>) :: Dual a -> Dual b -> Dual b #return :: a -> Dual a #fail :: String -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Sum a -> (a -> Sum b) -> Sum b #(>>) :: Sum a -> Sum b -> Sum b #return :: a -> Sum a #fail :: String -> Sum a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Product a -> (a -> Product b) -> Product b #(>>) :: Product a -> Product b -> Product b #return :: a -> Product a #fail :: String -> Product a # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(>>=) :: Down a -> (a -> Down b) -> Down b #(>>) :: Down a -> Down b -> Down b #return :: a -> Down a #fail :: String -> Down a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #return :: a -> NonEmpty a #fail :: String -> NonEmpty a # Instance detailsDefined in Data.Binary.Put Methods(>>=) :: PutM a -> (a -> PutM b) -> PutM b #(>>) :: PutM a -> PutM b -> PutM b #return :: a -> PutM a #fail :: String -> PutM a # Instance detailsDefined in Data.Binary.Get.Internal Methods(>>=) :: Get a -> (a -> Get b) -> Get b #(>>) :: Get a -> Get b -> Get b #return :: a -> Get a #fail :: String -> Get a # Monad Put Instance detailsDefined in Data.ByteString.Builder.Internal Methods(>>=) :: Put a -> (a -> Put b) -> Put b #(>>) :: Put a -> Put b -> Put b #return :: a -> Put a #fail :: String -> Put a # Instance detailsDefined in Data.Tree Methods(>>=) :: Tree a -> (a -> Tree b) -> Tree b #(>>) :: Tree a -> Tree b -> Tree b #return :: a -> Tree a #fail :: String -> Tree a # Instance detailsDefined in Data.Sequence.Internal Methods(>>=) :: Seq a -> (a -> Seq b) -> Seq b #(>>) :: Seq a -> Seq b -> Seq b #return :: a -> Seq a #fail :: String -> Seq a # Instance detailsDefined in Data.DList Methods(>>=) :: DList a -> (a -> DList b) -> DList b #(>>) :: DList a -> DList b -> DList b #return :: a -> DList a #fail :: String -> DList a # Instance detailsDefined in Data.Primitive.SmallArray Methods(>>=) :: SmallArray a -> (a -> SmallArray b) -> SmallArray b #(>>) :: SmallArray a -> SmallArray b -> SmallArray b #return :: a -> SmallArray a # Instance detailsDefined in Data.Primitive.Array Methods(>>=) :: Array a -> (a -> Array b) -> Array b #(>>) :: Array a -> Array b -> Array b #return :: a -> Array a #fail :: String -> Array a # Instance detailsDefined in Data.Vector Methods(>>=) :: Vector a -> (a -> Vector b) -> Vector b #(>>) :: Vector a -> Vector b -> Vector b #return :: a -> Vector a #fail :: String -> Vector a # Instance detailsDefined in Data.Vector.Fusion.Util Methods(>>=) :: Id a -> (a -> Id b) -> Id b #(>>) :: Id a -> Id b -> Id b #return :: a -> Id a #fail :: String -> Id a # Instance detailsDefined in Data.Vector.Fusion.Util Methods(>>=) :: Box a -> (a -> Box b) -> Box b #(>>) :: Box a -> Box b -> Box b #return :: a -> Box a #fail :: String -> Box a # Source # Instance detailsDefined in RON.Epoch Methods(>>=) :: EpochClock a -> (a -> EpochClock b) -> EpochClock b #(>>) :: EpochClock a -> EpochClock b -> EpochClock b #return :: a -> EpochClock a # Monad (Either e) Since: base-4.4.0.0 Instance detailsDefined in Data.Either Methods(>>=) :: Either e a -> (a -> Either e b) -> Either e b #(>>) :: Either e a -> Either e b -> Either e b #return :: a -> Either e a #fail :: String -> Either e a # Monad (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: U1 a -> (a -> U1 b) -> U1 b #(>>) :: U1 a -> U1 b -> U1 b #return :: a -> U1 a #fail :: String -> U1 a # Monoid a => Monad ((,) a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) #(>>) :: (a, a0) -> (a, b) -> (a, b) #return :: a0 -> (a, a0) #fail :: String -> (a, a0) # Monad (Parser i) Instance detailsDefined in Data.Attoparsec.Internal.Types Methods(>>=) :: Parser i a -> (a -> Parser i b) -> Parser i b #(>>) :: Parser i a -> Parser i b -> Parser i b #return :: a -> Parser i a #fail :: String -> Parser i a # Monad m => Monad (WrappedMonad m) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods(>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b #(>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #return :: a -> WrappedMonad m a #fail :: String -> WrappedMonad m a # ArrowApply a => Monad (ArrowMonad a) Since: base-2.1 Instance detailsDefined in Control.Arrow Methods(>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b #(>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b #return :: a0 -> ArrowMonad a a0 #fail :: String -> ArrowMonad a a0 # Monad (Proxy :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #(>>) :: Proxy a -> Proxy b -> Proxy b #return :: a -> Proxy a #fail :: String -> Proxy a # Monad m => Monad (ListT m) Instance detailsDefined in Control.Monad.Trans.List Methods(>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b #(>>) :: ListT m a -> ListT m b -> ListT m b #return :: a -> ListT m a #fail :: String -> ListT m a # Monad m => Monad (MaybeT m) Instance detailsDefined in Control.Monad.Trans.Maybe Methods(>>=) :: MaybeT m a -> (a -> MaybeT m b) -> MaybeT m b #(>>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #return :: a -> MaybeT m a #fail :: String -> MaybeT m a # Monad m => Monad (ReplicaSimT m) Source # Instance detailsDefined in RON.Event.Simulation Methods(>>=) :: ReplicaSimT m a -> (a -> ReplicaSimT m b) -> ReplicaSimT m b #(>>) :: ReplicaSimT m a -> ReplicaSimT m b -> ReplicaSimT m b #return :: a -> ReplicaSimT m a #fail :: String -> ReplicaSimT m a # Monad m => Monad (NetworkSimT m) Source # Instance detailsDefined in RON.Event.Simulation Methods(>>=) :: NetworkSimT m a -> (a -> NetworkSimT m b) -> NetworkSimT m b #(>>) :: NetworkSimT m a -> NetworkSimT m b -> NetworkSimT m b #return :: a -> NetworkSimT m a #fail :: String -> NetworkSimT m a # Monad f => Monad (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b #(>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #return :: a -> Rec1 f a #fail :: String -> Rec1 f a # Monad f => Monad (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Ap f a -> (a -> Ap f b) -> Ap f b #(>>) :: Ap f a -> Ap f b -> Ap f b #return :: a -> Ap f a #fail :: String -> Ap f a # Monad f => Monad (Alt f) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal 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 # (Applicative f, Monad f) => Monad (WhenMissing f x) Equivalent to ReaderT k (ReaderT x (MaybeT f)).Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methods(>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b #(>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b #return :: a -> WhenMissing f x a #fail :: String -> WhenMissing f x a # Monad m => Monad (IdentityT m) Instance detailsDefined in Control.Monad.Trans.Identity Methods(>>=) :: IdentityT m a -> (a -> IdentityT m b) -> IdentityT m b #(>>) :: IdentityT m a -> IdentityT m b -> IdentityT m b #return :: a -> IdentityT m a #fail :: String -> IdentityT m a # (Monad m, Error e) => Monad (ErrorT e m) Instance detailsDefined in Control.Monad.Trans.Error Methods(>>=) :: ErrorT e m a -> (a -> ErrorT e m b) -> ErrorT e m b #(>>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #return :: a -> ErrorT e m a #fail :: String -> ErrorT e m a # Monad m => Monad (ExceptT e m) Instance detailsDefined in Control.Monad.Trans.Except Methods(>>=) :: ExceptT e m a -> (a -> ExceptT e m b) -> ExceptT e m b #(>>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #return :: a -> ExceptT e m a #fail :: String -> ExceptT e m a # Monad m => Monad (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Lazy Methods(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #(>>) :: StateT s m a -> StateT s m b -> StateT s m b #return :: a -> StateT s m a #fail :: String -> StateT s m a # Monad m => Monad (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Strict Methods(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #(>>) :: StateT s m a -> StateT s m b -> StateT s m b #return :: a -> StateT s m a #fail :: String -> StateT s m a # (Monoid w, Monad m) => Monad (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy Methods(>>=) :: WriterT w m a -> (a -> WriterT w m b) -> WriterT w m b #(>>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #return :: a -> WriterT w m a #fail :: String -> WriterT w m a # (Monoid w, Monad m) => Monad (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Strict Methods(>>=) :: WriterT w m a -> (a -> WriterT w m b) -> WriterT w m b #(>>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #return :: a -> WriterT w m a #fail :: String -> WriterT w m a # Monad (Tagged s) Instance detailsDefined in Data.Tagged Methods(>>=) :: Tagged s a -> (a -> Tagged s b) -> Tagged s b #(>>) :: Tagged s a -> Tagged s b -> Tagged s b #return :: a -> Tagged s a #fail :: String -> Tagged s a # Monad ((->) r :: Type -> Type) Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b #(>>) :: (r -> a) -> (r -> b) -> r -> b #return :: a -> r -> a #fail :: String -> r -> a # (Monad f, Monad g) => Monad (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b #(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #return :: a -> (f :*: g) a #fail :: String -> (f :*: g) a # (Monad f, Monad g) => Monad (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methods(>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b #(>>) :: Product f g a -> Product f g b -> Product f g b #return :: a -> Product f g a #fail :: String -> Product f g a # (Monad f, Applicative f) => Monad (WhenMatched f x y) Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methods(>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b #(>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b #return :: a -> WhenMatched f x y a #fail :: String -> WhenMatched f x y a # (Applicative f, Monad f) => Monad (WhenMissing f k x) Equivalent to  ReaderT k (ReaderT x (MaybeT f)) .Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methods(>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b #(>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b #return :: a -> WhenMissing f k x a #fail :: String -> WhenMissing f k x a # Monad (ContT r m) Instance detailsDefined in Control.Monad.Trans.Cont Methods(>>=) :: ContT r m a -> (a -> ContT r m b) -> ContT r m b #(>>) :: ContT r m a -> ContT r m b -> ContT r m b #return :: a -> ContT r m a #fail :: String -> ContT r m a # Monad m => Monad (ReaderT r m) Instance detailsDefined in Control.Monad.Trans.Reader Methods(>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b #(>>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #return :: a -> ReaderT r m a #fail :: String -> ReaderT r m a # Monad f => Monad (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b #(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #return :: a -> M1 i c f a #fail :: String -> M1 i c f a # (Monad f, Applicative f) => Monad (WhenMatched f k x y) Equivalent to  ReaderT k (ReaderT x (ReaderT y (MaybeT f))) Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methods(>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b #(>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b #return :: a -> WhenMatched f k x y a #fail :: String -> WhenMatched f k x y a # (Monoid w, Monad m) => Monad (RWST r w s m) Instance detailsDefined in Control.Monad.Trans.RWS.Lazy Methods(>>=) :: RWST r w s m a -> (a -> RWST r w s m b) -> RWST r w s m b #(>>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #return :: a -> RWST r w s m a #fail :: String -> RWST r w s m a # (Monoid w, Monad m) => Monad (RWST r w s m) Instance detailsDefined in Control.Monad.Trans.RWS.Strict Methods(>>=) :: RWST r w s m a -> (a -> RWST r w s m b) -> RWST r w s m b #(>>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #return :: a -> RWST r w s m a #fail :: String -> RWST r w s m a #

class Typeable a => Data a #

The Data class comprehends a fundamental primitive gfoldl for folding over constructor applications, say terms. This primitive can be instantiated in several ways to map over the immediate subterms of a term; see the gmap combinators later in this class. Indeed, a generic programmer does not necessarily need to use the ingenious gfoldl primitive but rather the intuitive gmap combinators. The gfoldl primitive is completed by means to query top-level constructors, to turn constructor representations into proper terms, and to list all possible datatype constructors. This completion allows us to serve generic programming scenarios like read, show, equality, term generation.

The combinators gmapT, gmapQ, gmapM, etc are all provided with default definitions in terms of gfoldl, leaving open the opportunity to provide datatype-specific definitions. (The inclusion of the gmap combinators as members of class Data allows the programmer or the compiler to derive specialised, and maybe more efficient code per datatype. Note: gfoldl is more higher-order than the gmap combinators. This is subject to ongoing benchmarking experiments. It might turn out that the gmap combinators will be moved out of the class Data.)

Conceptually, the definition of the gmap combinators in terms of the primitive gfoldl requires the identification of the gfoldl function arguments. Technically, we also need to identify the type constructor c for the construction of the result type from the folded term type.

In the definition of gmapQx combinators, we use phantom type constructors for the c in the type of gfoldl because the result type of a query does not involve the (polymorphic) type of the term argument. In the definition of gmapQl we simply use the plain constant type constructor because gfoldl is left-associative anyway and so it is readily suited to fold a left-associative binary operation over the immediate subterms. In the definition of gmapQr, extra effort is needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., (:)). When the query is meant to compute a value of type r, then the result type withing generic folding is r -> r. So the result of folding is a function to which we finally pass the right unit.

With the -XDeriveDataTypeable option, GHC can generate instances of the Data class automatically. For example, given the declaration

data T a b = C1 a b | C2 deriving (Typeable, Data)

GHC will generate an instance that is equivalent to

instance (Data a, Data b) => Data (T a b) where
gfoldl k z (C1 a b) = z C1 k a k b
gfoldl k z C2       = z C2

gunfold k z c = case constrIndex c of
1 -> k (k (z C1))
2 -> z C2

toConstr (C1 _ _) = con_C1
toConstr C2       = con_C2

dataTypeOf _ = ty_T

con_C1 = mkConstr ty_T "C1" [] Prefix
con_C2 = mkConstr ty_T "C2" [] Prefix
ty_T   = mkDataType "Module.T" [con_C1, con_C2]

This is suitable for datatypes that are exported transparently.

Minimal complete definition

Instances