Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Fay.Compiler.Prelude
Description
Re-exports of base functionality. Note that this module is just used inside the compiler. It's not compiled to JavaScript. Based on the base-extended package (c) 2013 Simon Meier, licensed as BSD3.
Synopsis
- (++) :: [a] -> [a] -> [a]
- seq :: a -> b -> b
- filter :: (a -> Bool) -> [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- print :: Show a => a -> IO ()
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- otherwise :: Bool
- map :: (a -> b) -> [a] -> [b]
- ($) :: (a -> b) -> a -> b
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- class Bounded a where
- class Enum a where
- class Eq a where
- class Fractional a => Floating a where
- class Num a => Fractional a where
- class (Real a, Enum a) => Integral a where
- class Applicative m => Monad (m :: * -> *) where
- class Functor (f :: * -> *) where
- class Num a where
- class Eq a => Ord a where
- class Read a where
- class (Num a, Ord a) => Real a where
- class (RealFrac a, Floating a) => RealFloat a where
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- class Functor f => Applicative (f :: * -> *) where
- class Foldable (t :: * -> *) where
- class (Functor t, Foldable t) => Traversable (t :: * -> *) where
- class Semigroup a where
- class Semigroup a => Monoid a where
- data Bool
- data Char
- data Double
- data Float
- data Int
- data Integer
- data Maybe a
- data Ordering
- type Rational = Ratio Integer
- data IO a
- data Word
- data Either a b
- readIO :: Read a => String -> IO a
- readLn :: Read a => IO a
- appendFile :: FilePath -> String -> IO ()
- writeFile :: FilePath -> String -> IO ()
- readFile :: FilePath -> IO String
- interact :: (String -> String) -> IO ()
- getContents :: IO String
- getLine :: IO String
- getChar :: IO Char
- putStrLn :: String -> IO ()
- putStr :: String -> IO ()
- putChar :: Char -> IO ()
- ioError :: IOError -> IO a
- type FilePath = String
- userError :: String -> IOError
- type IOError = IOException
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- or :: Foldable t => t Bool -> Bool
- and :: Foldable t => t Bool -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- concat :: Foldable t => t [a] -> [a]
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- unwords :: [String] -> String
- words :: String -> [String]
- unlines :: [String] -> String
- lines :: String -> [String]
- read :: Read a => String -> a
- reads :: Read a => ReadS a
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- lex :: ReadS String
- readParen :: Bool -> ReadS a -> ReadS a
- type ReadS a = String -> [(a, String)]
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- lcm :: Integral a => a -> a -> a
- gcd :: Integral a => a -> a -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- (^) :: (Num a, Integral b) => a -> b -> a
- odd :: Integral a => a -> Bool
- even :: Integral a => a -> Bool
- showParen :: Bool -> ShowS -> ShowS
- showString :: String -> ShowS
- showChar :: Char -> ShowS
- shows :: Show a => a -> ShowS
- type ShowS = String -> String
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- unzip :: [(a, b)] -> ([a], [b])
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- (!!) :: [a] -> Int -> a
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- reverse :: [a] -> [a]
- break :: (a -> Bool) -> [a] -> ([a], [a])
- span :: (a -> Bool) -> [a] -> ([a], [a])
- splitAt :: Int -> [a] -> ([a], [a])
- drop :: Int -> [a] -> [a]
- take :: Int -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- takeWhile :: (a -> Bool) -> [a] -> [a]
- cycle :: [a] -> [a]
- replicate :: Int -> a -> [a]
- repeat :: a -> [a]
- iterate :: (a -> a) -> a -> [a]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- init :: [a] -> [a]
- last :: [a] -> a
- tail :: [a] -> [a]
- head :: [a] -> a
- maybe :: b -> (a -> b) -> Maybe a -> b
- uncurry :: (a -> b -> c) -> (a, b) -> c
- curry :: ((a, b) -> c) -> a -> b -> c
- subtract :: Num a => a -> a -> a
- asTypeOf :: a -> a -> a
- until :: (a -> Bool) -> (a -> a) -> a -> a
- flip :: (a -> b -> c) -> b -> a -> c
- (.) :: (b -> c) -> (a -> b) -> a -> c
- const :: a -> b -> a
- id :: a -> a
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- type String = [Char]
- undefined :: HasCallStack => a
- errorWithoutStackTrace :: [Char] -> a
- error :: HasCallStack => [Char] -> a
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- ($!) :: (a -> b) -> a -> b
- module Control.Applicative
- first :: Arrow a => a b c -> a (b, d) (c, d)
- second :: Arrow a => a b c -> a (d, b) (d, c)
- (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
- (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d
- (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
- join :: Monad m => m (m a) -> m a
- class Applicative m => Monad (m :: * -> *) where
- class Functor (f :: * -> *) where
- mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- void :: Functor f => f a -> f ()
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
- data Char
- isSeparator :: Char -> Bool
- isNumber :: Char -> Bool
- isMark :: Char -> Bool
- isLetter :: Char -> Bool
- digitToInt :: Char -> Int
- readLitChar :: ReadS Char
- lexLitChar :: ReadS String
- toTitle :: Char -> Char
- toUpper :: Char -> Char
- toLower :: Char -> Char
- isLower :: Char -> Bool
- isUpper :: Char -> Bool
- isPrint :: Char -> Bool
- isControl :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isAlpha :: Char -> Bool
- isSymbol :: Char -> Bool
- isPunctuation :: Char -> Bool
- isHexDigit :: Char -> Bool
- isOctDigit :: Char -> Bool
- isDigit :: Char -> Bool
- isSpace :: Char -> Bool
- isAsciiUpper :: Char -> Bool
- isAsciiLower :: Char -> Bool
- isLatin1 :: Char -> Bool
- isAscii :: Char -> Bool
- generalCategory :: Char -> GeneralCategory
- chr :: Int -> Char
- intToDigit :: Int -> Char
- showLitChar :: Char -> ShowS
- ord :: Char -> Int
- class Typeable a => Data a where
- class Typeable (a :: k)
- module Data.Either
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- module Data.Maybe
- class Semigroup a => Monoid a where
- module Data.Ord
- module Data.Traversable
- anyM :: (Functor m, Applicative m, Monad m) => (a -> m Bool) -> [a] -> m Bool
- io :: MonadIO m => IO a -> m a
- readAllFromProcess :: FilePath -> [String] -> String -> IO (Either (String, String) (String, String))
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.
The value of seq a b
is bottom if a
is bottom, and
otherwise equal to b
. In other words, it evaluates the first
argument a
to weak head normal form (WHNF). seq
is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression seq a b
does
not guarantee that a
will be evaluated before b
.
The only guarantee given by seq
is that the both a
and b
will be evaluated before seq
returns a value.
In particular, this means that b
may be evaluated before
a
. If you need to guarantee a specific order of evaluation,
you must use the function pseq
from the "parallel" package.
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]
print :: Show a => a -> IO () #
The print
function outputs a value of any printable type to the
standard output device.
Printable types are those that are instances of class Show
; print
converts values to strings for output using the show
operation and
adds a newline.
For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
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
. However, $
x)$
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
,
or map
($
0) xs
.zipWith
($
) fs xs
fromIntegral :: (Integral a, Num b) => a -> b #
general coercion from integral types
realToFrac :: (Real a, Fractional b) => a -> b #
general coercion to fractional types
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
.
Instances
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
andsucc
maxBound
should result in a runtime error.pred
minBound
fromEnum
andtoEnum
should give a runtime error if the result value is not representable in the result type. For example,
is an error.toEnum
7 ::Bool
enumFrom
andenumFromThen
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
Methods
the successor of a value. For numeric types, succ
adds 1.
the predecessor of a value. For numeric types, pred
subtracts 1.
Convert from an 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
.
Used in Haskell's translation of [n..]
.
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
.
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m]
.
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m]
.
Instances
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
.
Instances
Eq Bool | |
Eq Char | |
Eq Double | |
Eq Float | |
Eq Int | |
Eq Int8 | Since: 2.1 |
Eq Int16 | Since: 2.1 |
Eq Int32 | Since: 2.1 |
Eq Int64 | Since: 2.1 |
Eq Integer | |
Eq Natural | |
Eq Ordering | |
Eq Word | |
Eq Word8 | Since: 2.1 |
Eq Word16 | Since: 2.1 |
Eq Word32 | Since: 2.1 |
Eq Word64 | Since: 2.1 |
Eq SomeTypeRep | |
Eq Exp | |
Eq Match | |
Eq Clause | |
Eq Pat | |
Eq Type | |
Eq Dec | |
Eq Name | |
Eq FunDep | |
Eq InjectivityAnn | |
Methods (==) :: InjectivityAnn -> InjectivityAnn -> Bool # (/=) :: InjectivityAnn -> InjectivityAnn -> Bool # | |
Eq Overlap | |
Eq DerivStrategy | |
Methods (==) :: DerivStrategy -> DerivStrategy -> Bool # (/=) :: DerivStrategy -> DerivStrategy -> Bool # | |
Eq () | |
Eq TyCon | |
Eq Module | |
Eq TrName | |
Eq Handle | Since: 4.1.0.0 |
Eq BigNat | |
Eq Void | Since: 4.8.0.0 |
Eq SpecConstrAnnotation | |
Methods (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # | |
Eq Constr | Equality of constructors Since: 4.0.0.0 |
Eq DataRep | |
Eq ConstrRep | |
Eq Fixity | |
Eq Version | Since: 2.1 |
Eq HandlePosn | Since: 4.1.0.0 |
Eq ThreadId | Since: 4.2.0.0 |
Eq BlockReason | |
Eq ThreadStatus | |
Eq AsyncException | |
Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool # | |
Eq ArrayException | |
Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool # | |
Eq ExitCode | |
Eq IOErrorType | Since: 4.1.0.0 |
Eq BufferMode | |
Eq Newline | |
Eq NewlineMode | |
Eq IODeviceType | |
Eq SeekMode | |
Eq CodingProgress | |
Methods (==) :: CodingProgress -> CodingProgress -> Bool # (/=) :: CodingProgress -> CodingProgress -> Bool # | |
Eq MaskingState | |
Eq IOException | Since: 4.1.0.0 |
Eq ErrorCall | |
Eq ArithException | |
Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool # | |
Eq All | |
Eq Any | |
Eq Fixity | |
Eq Associativity | |
Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
Eq SourceUnpackedness | |
Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
Eq SourceStrictness | |
Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
Eq DecidedStrictness | |
Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
Eq WordPtr | |
Eq IntPtr | |
Eq IOMode | |
Eq Lexeme | |
Eq Number | |
Eq GeneralCategory | |
Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool # | |
Eq SrcLoc | |
Eq ByteString | |
Eq ByteString | |
Eq IntSet | |
Eq XdgDirectory | |
Eq FileType | |
Eq Permissions | |
Eq Extension | |
Eq ForeignSrcLang | |
Methods (==) :: ForeignSrcLang -> ForeignSrcLang -> Bool # (/=) :: ForeignSrcLang -> ForeignSrcLang -> Bool # | |
Eq Message | |
Eq ParseError | |
Eq SourcePos | |
Eq Doc | |
Eq TextDetails | |
Eq Style | |
Eq Mode | |
Eq CreateProcess | |
Methods (==) :: CreateProcess -> CreateProcess -> Bool # (/=) :: CreateProcess -> CreateProcess -> Bool # | |
Eq CmdSpec | |
Eq StdStream | |
Eq ModName | |
Eq PkgName | |
Eq Module | |
Eq OccName | |
Eq NameFlavour | |
Eq NameSpace | |
Eq Loc | |
Eq Info | |
Eq ModuleInfo | |
Eq Fixity | |
Eq FixityDirection | |
Methods (==) :: FixityDirection -> FixityDirection -> Bool # (/=) :: FixityDirection -> FixityDirection -> Bool # | |
Eq Lit | |
Eq Body | |
Eq Guard | |
Eq Stmt | |
Eq Range | |
Eq DerivClause | |
Eq TypeFamilyHead | |
Methods (==) :: TypeFamilyHead -> TypeFamilyHead -> Bool # (/=) :: TypeFamilyHead -> TypeFamilyHead -> Bool # | |
Eq TySynEqn | |
Eq Foreign | |
Eq Callconv | |
Eq Safety | |
Eq Pragma | |
Eq Inline | |
Eq RuleMatch | |
Eq Phases | |
Eq RuleBndr | |
Eq AnnTarget | |
Eq SourceUnpackedness | |
Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
Eq SourceStrictness | |
Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
Eq DecidedStrictness | |
Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
Eq Con | |
Eq Bang | |
Eq PatSynDir | |
Eq PatSynArgs | |
Eq TyVarBndr | |
Eq FamilyResultSig | |
Methods (==) :: FamilyResultSig -> FamilyResultSig -> Bool # (/=) :: FamilyResultSig -> FamilyResultSig -> Bool # | |
Eq TyLit | |
Eq Role | |
Eq AnnLookup | |
Eq Builder | |
Eq LocalTime | |
Eq UTCTime | |
Eq Comment | |
Eq UnknownPragma | |
Eq Extension | |
Eq KnownExtension | |
Eq Language | |
Eq Fixity | |
Eq Token | |
Eq PPLayout | |
Eq SrcLoc | |
Eq SrcSpan | |
Eq SrcSpanInfo | |
Eq Boxed | |
Eq Tool | |
Eq ExtContext | |
Eq LexContext | |
Eq DotNetTime | |
Eq SumEncoding | |
Eq Value | |
Eq Pos | |
Eq More | |
Eq JSONPathElement | |
Eq Scientific | |
Eq UUID | |
Eq CondensePolicy | |
Eq DelimPolicy | |
Eq EndPolicy | |
Eq VarType | |
Eq Content | |
Eq Pos | |
Eq SerializeContext # | |
Methods (==) :: SerializeContext -> SerializeContext -> Bool # (/=) :: SerializeContext -> SerializeContext -> Bool # | |
Eq ModulePath # | |
Eq JsLit # | |
Eq JsName # | |
Eq JsExp # | |
Eq JsStmt # | |
Eq UnpackedUUID | |
Eq ByteArray | |
Eq Addr | |
Eq AssignOp | |
Eq InfixOp | |
Eq PrefixOp | |
Eq UnaryAssignOp | |
Eq a => Eq [a] | |
Eq a => Eq (Maybe a) | |
Eq a => Eq (Ratio a) | |
Eq (StablePtr a) | Since: 2.1 |
Eq (Ptr a) | |
Eq (FunPtr a) | |
Eq p => Eq (Par1 p) | |
Eq (ForeignPtr a) | Since: 2.1 |
Eq a => Eq (Complex a) | |
Eq a => Eq (Min a) | |
Eq a => Eq (Max a) | |
Eq a => Eq (First a) | |
Eq a => Eq (Last a) | |
Eq m => Eq (WrappedMonoid m) | |
Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # | |
Eq a => Eq (Option a) | |
Eq a => Eq (ZipList a) | |
Eq a => Eq (Identity a) | |
Eq (TVar a) | Since: 4.8.0.0 |
Eq (IORef a) | Pointer equality. Since: 4.1.0.0 |
Eq a => Eq (First a) | |
Eq a => Eq (Last a) | |
Eq a => Eq (Dual a) | |
Eq a => Eq (Sum a) | |
Eq a => Eq (Product a) | |
Eq a => Eq (Down a) | |
Eq (MVar a) | Since: 4.1.0.0 |
Eq a => Eq (NonEmpty a) | |
Eq a => Eq (IntMap a) | |
Eq vertex => Eq (SCC vertex) | Since: 0.5.9 |
Eq a => Eq (Tree a) | |
Eq a => Eq (Seq a) | |
Eq a => Eq (ViewL a) | |
Eq a => Eq (ViewR a) | |
Eq a => Eq (Set a) | |
Eq (Doc a) | |
Eq a => Eq (AnnotDetails a) | |
Methods (==) :: AnnotDetails a -> AnnotDetails a -> Bool # (/=) :: AnnotDetails a -> AnnotDetails a -> Bool # | |
Eq a => Eq (Span a) | |
Eq a => Eq (ListOf a) | |
Eq l => Eq (ModuleHeadAndImports l) | |
Eq a => Eq (NonGreedy a) | |
Eq l => Eq (PragmasAndModuleHead l) | |
Eq l => Eq (PragmasAndModuleName l) | |
Eq a => Eq (Loc a) | |
Eq l => Eq (Activation l) | |
Eq l => Eq (Alt l) | |
Eq l => Eq (Annotation l) | |
Eq l => Eq (Assoc l) | |
Eq l => Eq (Asst l) | |
Eq l => Eq (BangType l) | |
Eq l => Eq (Binds l) | |
Eq l => Eq (BooleanFormula l) | |
Eq l => Eq (Bracket l) | |
Eq l => Eq (CName l) | |
Eq l => Eq (CallConv l) | |
Eq l => Eq (ClassDecl l) | |
Eq l => Eq (ConDecl l) | |
Eq l => Eq (Context l) | |
Eq l => Eq (DataOrNew l) | |
Eq l => Eq (Decl l) | |
Eq l => Eq (DeclHead l) | |
Eq l => Eq (DerivStrategy l) | |
Eq l => Eq (Deriving l) | |
Eq l => Eq (EWildcard l) | |
Eq l => Eq (Exp l) | |
Eq l => Eq (ExportSpec l) | |
Eq l => Eq (ExportSpecList l) | |
Eq l => Eq (FieldDecl l) | |
Eq l => Eq (FieldUpdate l) | |
Eq l => Eq (FunDep l) | |
Eq l => Eq (GadtDecl l) | |
Eq l => Eq (GuardedRhs l) | |
Eq l => Eq (IPBind l) | |
Eq l => Eq (IPName l) | |
Eq l => Eq (ImportDecl l) | |
Eq l => Eq (ImportSpec l) | |
Eq l => Eq (ImportSpecList l) | |
Eq l => Eq (InjectivityInfo l) | |
Eq l => Eq (InstDecl l) | |
Eq l => Eq (InstHead l) | |
Eq l => Eq (InstRule l) | |
Eq l => Eq (Kind l) | |
Eq l => Eq (Literal l) | |
Eq l => Eq (Match l) | |
Eq l => Eq (MaybePromotedName l) | |
Eq l => Eq (Module l) | |
Eq l => Eq (ModuleHead l) | |
Eq l => Eq (ModuleName l) | |
Eq l => Eq (ModulePragma l) | |
Eq l => Eq (Name l) | |
Eq l => Eq (Namespace l) | |
Eq l => Eq (Op l) | |
Eq l => Eq (Overlap l) | |
Eq l => Eq (PXAttr l) | |
Eq l => Eq (Pat l) | |
Eq l => Eq (PatField l) | |
Eq l => Eq (PatternSynDirection l) | |
Eq l => Eq (Promoted l) | |
Eq l => Eq (QName l) | |
Eq l => Eq (QOp l) | |
Eq l => Eq (QualConDecl l) | |
Eq l => Eq (QualStmt l) | |
Eq l => Eq (RPat l) | |
Eq l => Eq (RPatOp l) | |
Eq l => Eq (ResultSig l) | |
Eq l => Eq (Rhs l) | |
Eq l => Eq (Role l) | |
Eq l => Eq (Rule l) | |
Eq l => Eq (RuleVar l) | |
Eq l => Eq (Safety l) | |
Eq l => Eq (Sign l) | |
Eq l => Eq (SpecialCon l) | |
Eq l => Eq (Splice l) | |
Eq l => Eq (Stmt l) | |
Eq l => Eq (TyVarBind l) | |
Eq l => Eq (Type l) | |
Eq l => Eq (TypeEqn l) | |
Eq l => Eq (Unpackedness l) | |
Eq l => Eq (WarningText l) | |
Eq l => Eq (XAttr l) | |
Eq l => Eq (XName l) | |
Eq a => Eq (DList a) | |
Eq (Encoding' a) | |
Eq a => Eq (Result a) | |
Eq a => Eq (IResult a) | |
Eq a => Eq (Vector a) | |
Eq a => Eq (Array a) | |
Eq a => Eq (HashSet a) | |
(Eq a, Prim a) => Eq (PrimArray a) | |
Eq a => Eq (SmallArray a) | |
(Eq a, PrimUnlifted a) => Eq (UnliftedArray a) | |
(Prim a, Eq a) => Eq (Vector a) | |
(Storable a, Eq a) => Eq (Vector a) | |
Eq a => Eq (Hashed a) | |
Eq a => Eq (Chunk a) | |
Eq a => Eq (JavaScript a) | |
Eq a => Eq (Statement a) | |
Eq a => Eq (Expression a) | |
Eq a => Eq (CaseClause a) | |
Eq a => Eq (CatchClause a) | |
Eq a => Eq (ForInInit a) | |
Eq a => Eq (ForInit a) | |
Eq a => Eq (Id a) | |
Eq a => Eq (LValue a) | |
Eq a => Eq (Prop a) | |
Eq a => Eq (VarDecl a) | |
(Eq a, Eq b) => Eq (Either a b) | |
Eq (V1 p) | Since: 4.9.0.0 |
Eq (U1 p) | Since: 4.9.0.0 |
Eq (TypeRep a) | Since: 2.1 |
(Eq a, Eq b) => Eq (a, b) | |
(Ix i, Eq e) => Eq (Array i e) | Since: 2.1 |
Eq a => Eq (Arg a b) | Since: 4.9.0.0 |
Eq (Proxy s) | Since: 4.7.0.0 |
(Eq k, Eq a) => Eq (Map k a) | |
(Eq1 m, Eq a) => Eq (ListT m a) | |
(Eq1 m, Eq a) => Eq (MaybeT m a) | |
(Eq k, Eq v) => Eq (HashMap k v) | |
Eq (MutableArray s a) | |
(Eq k, Eq v) => Eq (Leaf k v) | |
Eq (SmallMutableArray s a) | |
Eq (MutableUnliftedArray s a) | |
Eq (f p) => Eq (Rec1 f p) | |
Eq (URec (Ptr ()) p) | |
Eq (URec Char p) | |
Eq (URec Double p) | |
Eq (URec Float p) | |
Eq (URec Int p) | |
Eq (URec Word p) | |
(Eq a, Eq b, Eq c) => Eq (a, b, c) | |
Eq (STArray s i e) | Since: 2.1 |
Eq a => Eq (Const a b) | |
Eq (f a) => Eq (Alt f a) | |
Eq (Coercion a b) | |
Eq (a :~: b) | |
(Eq1 f, Eq a) => Eq (IdentityT f a) | |
(Eq e, Eq1 m, Eq a) => Eq (ErrorT e m a) | |
(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a) | |
(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) | |
(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) | |
Eq b => Eq (Tagged s b) | |
Eq c => Eq (K1 i c p) | |
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | |
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | |
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) | Since: 4.9.0.0 |
(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) | Since: 4.9.0.0 |
Eq (a :~~: b) | Since: 4.10.0.0 |
Eq (f p) => Eq (M1 i c f p) | |
Eq (f (g p)) => Eq ((f :.: g) p) | |
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) | Since: 4.9.0.0 |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) | |
(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) | |
(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) | |
(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) | |
(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) | |
(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) | |
(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) | |
(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) | |
(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) | |
class Fractional a => Floating a where #
Trigonometric and hyperbolic functions and related functions.
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Instances
Floating Double | Since: 2.1 |
Floating Float | Since: 2.1 |
RealFloat a => Floating (Complex a) | Since: 2.1 |
Methods exp :: Complex a -> Complex a # log :: Complex a -> Complex a # sqrt :: Complex a -> Complex a # (**) :: Complex a -> Complex a -> Complex a # logBase :: Complex a -> Complex a -> Complex a # sin :: Complex a -> Complex a # cos :: Complex a -> Complex a # tan :: Complex a -> Complex a # asin :: Complex a -> Complex a # acos :: Complex a -> Complex a # atan :: Complex a -> Complex a # sinh :: Complex a -> Complex a # cosh :: Complex a -> Complex a # tanh :: Complex a -> Complex a # asinh :: Complex a -> Complex a # acosh :: Complex a -> Complex a # atanh :: Complex a -> Complex a # log1p :: Complex a -> Complex a # expm1 :: Complex a -> Complex a # | |
Floating a => Floating (Identity a) | |
Methods exp :: Identity a -> Identity a # log :: Identity a -> Identity a # sqrt :: Identity a -> Identity a # (**) :: Identity a -> Identity a -> Identity a # logBase :: Identity a -> Identity a -> Identity a # sin :: Identity a -> Identity a # cos :: Identity a -> Identity a # tan :: Identity a -> Identity a # asin :: Identity a -> Identity a # acos :: Identity a -> Identity a # atan :: Identity a -> Identity a # sinh :: Identity a -> Identity a # cosh :: Identity a -> Identity a # tanh :: Identity a -> Identity a # asinh :: Identity a -> Identity a # acosh :: Identity a -> Identity a # atanh :: Identity a -> Identity a # log1p :: Identity a -> Identity a # expm1 :: Identity a -> Identity a # | |
Floating a => Floating (Const a b) | |
Methods exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # | |
Floating a => Floating (Tagged s a) | |
Methods exp :: Tagged s a -> Tagged s a # log :: Tagged s a -> Tagged s a # sqrt :: Tagged s a -> Tagged s a # (**) :: Tagged s a -> Tagged s a -> Tagged s a # logBase :: Tagged s a -> Tagged s a -> Tagged s a # sin :: Tagged s a -> Tagged s a # cos :: Tagged s a -> Tagged s a # tan :: Tagged s a -> Tagged s a # asin :: Tagged s a -> Tagged s a # acos :: Tagged s a -> Tagged s a # atan :: Tagged s a -> Tagged s a # sinh :: Tagged s a -> Tagged s a # cosh :: Tagged s a -> Tagged s a # tanh :: Tagged s a -> Tagged s a # asinh :: Tagged s a -> Tagged s a # acosh :: Tagged s a -> Tagged s a # atanh :: Tagged s a -> Tagged s a # log1p :: Tagged s a -> Tagged s a # expm1 :: Tagged s a -> Tagged s a # |
class Num a => Fractional a where #
Fractional numbers, supporting real division.
Minimal complete definition
fromRational, (recip | (/))
Methods
fractional division
reciprocal fraction
fromRational :: Rational -> a #
Conversion from a Rational
(that is
).
A floating literal stands for an application of Ratio
Integer
fromRational
to a value of type Rational
, so such literals have type
(
.Fractional
a) => a
Instances
Fractional Scientific | |
Integral a => Fractional (Ratio a) | Since: 2.0.1 |
RealFloat a => Fractional (Complex a) | Since: 2.1 |
Fractional a => Fractional (Identity a) | |
Fractional a => Fractional (Const a b) | |
Fractional a => Fractional (Tagged s a) | |
class (Real a, Enum a) => Integral a where #
Integral numbers, supporting integer division.
Methods
quot :: a -> a -> a infixl 7 #
integer division truncated toward zero
integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == x
integer division truncated toward negative infinity
conversion to Integer
Instances
Integral Int | Since: 2.0.1 |
Integral Int8 | Since: 2.1 |
Integral Int16 | Since: 2.1 |
Integral Int32 | Since: 2.1 |
Integral Int64 | Since: 2.1 |
Integral Integer | Since: 2.0.1 |
Integral Natural | Since: 4.8.0.0 |
Integral Word | Since: 2.1 |
Integral Word8 | Since: 2.1 |
Integral Word16 | Since: 2.1 |
Integral Word32 | Since: 2.1 |
Integral Word64 | Since: 2.1 |
Integral WordPtr | |
Integral IntPtr | |
Integral a => Integral (Identity a) | |
Methods quot :: 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) | |
Methods quot :: 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) # | |
Integral a => Integral (Tagged s a) | |
Methods quot :: 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) # |
class Applicative m => Monad (m :: * -> *) where #
The Monad
class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do
expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad
should satisfy the following laws:
Furthermore, the Monad
and Applicative
operations should relate as follows:
The above laws imply:
and that pure
and (<*>
) satisfy the applicative functor laws.
The instances of Monad
for lists, Maybe
and IO
defined in the Prelude satisfy these laws.
Minimal complete definition
Methods
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Inject a value into the monadic type.
Fail with a message. This operation is not part of the
mathematical definition of a monad, but is invoked on pattern-match
failure in a do
expression.
As part of the MonadFail proposal (MFP), this function is moved
to its own class MonadFail
(see Control.Monad.Fail for more
details). The definition here will be removed in a future
release.
Instances
Monad [] | Since: 2.1 |
Monad Maybe | Since: 2.1 |
Monad IO | Since: 2.1 |
Monad Par1 | Since: 4.9.0.0 |
Monad Q | |
Monad Complex | Since: 4.9.0.0 |
Monad Min | Since: 4.9.0.0 |
Monad Max | Since: 4.9.0.0 |
Monad First | Since: 4.9.0.0 |
Monad Last | Since: 4.9.0.0 |
Monad Option | Since: 4.9.0.0 |
Monad Identity | Since: 4.8.0.0 |
Monad STM | Since: 4.3.0.0 |
Monad First | |
Monad Last | |
Monad Dual | Since: 4.8.0.0 |
Monad Sum | Since: 4.8.0.0 |
Monad Product | Since: 4.8.0.0 |
Monad Down | Since: 4.11.0.0 |
Monad ReadPrec | Since: 2.1 |
Monad ReadP | Since: 2.1 |
Monad NonEmpty | Since: 4.9.0.0 |
Monad Put | |
Monad Tree | |
Monad Seq | |
Monad ParseResult | |
Monad P | |
Monad P | Since: 2.1 |
Monad DList | |
Monad Result | |
Monad IResult | |
Monad Parser | |
Monad Vector | |
Monad Id | |
Monad Array | |
Monad Box | |
Monad SmallArray | |
Monad Fay # | |
Monad Compile # | |
Monad EP | |
Monad (Either e) | Since: 4.4.0.0 |
Monad (U1 :: * -> *) | Since: 4.9.0.0 |
Monoid a => Monad ((,) a) | Since: 4.9.0.0 |
Monad (ST s) | Since: 2.1 |
Monad m => Monad (WrappedMonad m) | |
Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a # | |
ArrowApply a => Monad (ArrowMonad a) | Since: 2.1 |
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 :: * -> *) | Since: 4.7.0.0 |
Monad m => Monad (ListT m) | |
Monad m => Monad (MaybeT m) | |
Monad (Lex r) | |
Monad (Parser i) | |
Monad (DocM s) | |
Monad (SetM s) | |
Monad f => Monad (Rec1 f) | Since: 4.9.0.0 |
Monad f => Monad (Alt f) | |
(Applicative f, Monad f) => Monad (WhenMissing f x) | Equivalent to Since: 0.5.9 |
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) | |
(Monad m, Error e) => Monad (ErrorT e m) | |
Monad m => Monad (ExceptT e m) | |
Monad m => Monad (StateT s m) | |
Monad m => Monad (StateT s m) | |
(Monoid w, Monad m) => Monad (WriterT w m) | |
(Monoid w, Monad m) => Monad (WriterT w m) | |
Monad (Tagged s) | |
Monad ((->) r :: * -> *) | Since: 2.1 |
(Monad f, Monad g) => Monad (f :*: g) | Since: 4.9.0.0 |
(Monad f, Monad g) => Monad (Product f g) | Since: 4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f x y) | Equivalent to Since: 0.5.9 |
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 Since: 0.5.9 |
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) | |
Monad m => Monad (ReaderT r m) | |
Monad (ParsecT s u m) | |
Monad f => Monad (M1 i c f) | Since: 4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to Since: 0.5.9 |
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) | |
(Monoid w, Monad m) => Monad (RWST r w s m) | |
class Functor (f :: * -> *) where #
The Functor
class is used for types that can be mapped over.
Instances of Functor
should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor
for lists, Maybe
and IO
satisfy these laws.
Minimal complete definition