Safe Haskell | Unsafe |
---|---|
Language | Haskell2010 |
Protolude.Base
Synopsis
- module GHC.OverloadedLabels
- module GHC.Records
- data Int
- data Float = F# Float#
- data Char
- data IO a
- data Bool
- data Double = D# Double#
- data Word
- data Ordering
- class a ~R# b => Coercible (a :: k) (b :: k)
- data Symbol
- data Integer
- type Type = TYPE LiftedRep
- type Constraint = CONSTRAINT LiftedRep
- (++) :: [a] -> [a] -> [a]
- seq :: a -> b -> b
- print :: Show a => a -> IO ()
- class Num a where
- class Num a => Fractional a where
- (/) :: a -> a -> a
- recip :: a -> a
- fromRational :: Rational -> a
- class Enum a where
- succ :: a -> a
- pred :: a -> a
- toEnum :: Int -> a
- fromEnum :: a -> Int
- enumFrom :: a -> [a]
- enumFromThen :: a -> a -> [a]
- enumFromTo :: a -> a -> [a]
- enumFromThenTo :: a -> a -> a -> [a]
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- class (Real a, Enum a) => Integral a where
- class (Num a, Ord a) => Real a where
- toRational :: a -> Rational
- class Bounded a where
- class Fractional a => Floating a where
- pi :: a
- exp :: a -> a
- log :: a -> a
- sqrt :: a -> a
- (**) :: a -> a -> a
- logBase :: a -> a -> a
- sin :: a -> a
- cos :: a -> a
- tan :: a -> a
- asin :: a -> a
- acos :: a -> a
- atan :: a -> a
- sinh :: a -> a
- cosh :: a -> a
- tanh :: a -> a
- asinh :: a -> a
- acosh :: a -> a
- atanh :: a -> a
- log1p :: a -> a
- expm1 :: a -> a
- log1pexp :: a -> a
- log1mexp :: a -> a
- class (RealFrac a, Floating a) => RealFloat a where
- floatRadix :: a -> Integer
- floatDigits :: a -> Int
- floatRange :: a -> (Int, Int)
- decodeFloat :: a -> (Integer, Int)
- encodeFloat :: Integer -> Int -> a
- exponent :: a -> Int
- significand :: a -> a
- scaleFloat :: Int -> a -> a
- isNaN :: a -> Bool
- isInfinite :: a -> Bool
- isDenormalized :: a -> Bool
- isNegativeZero :: a -> Bool
- isIEEE :: a -> Bool
- atan2 :: a -> a -> a
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- class KnownNat (n :: Nat)
- class KnownSymbol (n :: Symbol)
- data Ratio a
- type Rational = Ratio Integer
- data Ptr a
- data FunPtr a
- data StaticPtr a
- data CallStack
- (^) :: (Num a, Integral b) => a -> b -> a
- type family CmpNat (a :: Natural) (b :: Natural) :: Ordering where ...
- data SrcLoc = SrcLoc String Int Int
- type HasCallStack = ?callStack :: CallStack
- getCallStack :: CallStack -> [([Char], SrcLoc)]
- ord :: Char -> Int
- minInt :: Int
- maxInt :: Int
- until :: (a -> Bool) -> (a -> a) -> a -> a
- asTypeOf :: a -> a -> a
- currentCallStack :: IO [String]
- prettySrcLoc :: SrcLoc -> String
- prettyCallStack :: CallStack -> String
- subtract :: Num a => a -> a -> a
- boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
- boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]
- divZeroError :: a
- ratioZeroDenominatorError :: a
- overflowError :: a
- underflowError :: a
- ratioPrec :: Int
- ratioPrec1 :: Int
- infinity :: Rational
- notANumber :: Rational
- reduce :: Integral a => a -> a -> Ratio a
- (%) :: Integral a => a -> a -> Ratio a
- numerator :: Ratio a -> a
- denominator :: Ratio a -> a
- numericEnumFrom :: Fractional a => a -> [a]
- numericEnumFromThen :: Fractional a => a -> a -> [a]
- numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a]
- numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a]
- showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS
- even :: Integral a => a -> Bool
- odd :: Integral a => a -> Bool
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- (^%^) :: Integral a => Rational -> a -> Rational
- (^^%^^) :: Integral a => Rational -> a -> Rational
- gcd :: Integral a => a -> a -> a
- lcm :: Integral a => a -> a -> a
- integralEnumFrom :: (Integral a, Bounded a) => a -> [a]
- integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a]
- integralEnumFromTo :: Integral a => a -> a -> [a]
- integralEnumFromThenTo :: Integral a => a -> a -> a -> [a]
- showFloat :: RealFloat a => a -> ShowS
- showSignedFloat :: RealFloat a => (a -> ShowS) -> Int -> a -> ShowS
- data SomeNat = KnownNat n => SomeNat (Proxy n)
- type Nat = Natural
- natVal :: forall (n :: Nat) proxy. KnownNat n => proxy n -> Integer
- someNatVal :: Integer -> Maybe SomeNat
- data SomeSymbol = KnownSymbol n => SomeSymbol (Proxy n)
- symbolVal :: forall (n :: Symbol) proxy. KnownSymbol n => proxy n -> String
- someSymbolVal :: String -> SomeSymbol
- putStr :: String -> IO ()
- putStrLn :: String -> IO ()
- callStack :: HasCallStack => CallStack
- withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a
- data Location = Location {
- objectName :: String
- functionName :: String
- srcLoc :: Maybe SrcLoc
- getStackTrace :: IO (Maybe [Location])
- showStackTrace :: IO (Maybe String)
- ($!) :: (a -> b) -> a -> b
Documentation
module GHC.OverloadedLabels
module GHC.Records
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]
.
The exact range for a given implementation can be determined by using
minBound
and maxBound
from the Bounded
class.
Instances
PrintfArg Int | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
NFData Int | |||||
Defined in Control.DeepSeq | |||||
Bits Int | @since base-2.01 | ||||
Defined in GHC.Internal.Bits | |||||
FiniteBits Int | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Int -> Int # countLeadingZeros :: Int -> Int # countTrailingZeros :: Int -> Int # | |||||
Bounded Int | @since base-2.01 | ||||
Enum Int | @since base-2.01 | ||||
Storable Int | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
Num Int | @since base-2.01 | ||||
Read Int | @since base-2.01 | ||||
Integral Int | @since base-2.0.1 | ||||
Real Int | @since base-2.0.1 | ||||
Defined in GHC.Internal.Real Methods toRational :: Int -> Rational # | |||||
Show Int | @since base-2.01 | ||||
Eq Int | |||||
Ord Int | |||||
Hashable Int | |||||
Defined in Data.Hashable.Class | |||||
IArray UArray Int | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i Int -> (i, i) # numElements :: Ix i => UArray i Int -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Int)] -> UArray i Int # unsafeAt :: Ix i => UArray i Int -> Int -> Int # unsafeReplace :: Ix i => UArray i Int -> [(Int, Int)] -> UArray i Int # unsafeAccum :: Ix i => (Int -> e' -> Int) -> UArray i Int -> [(Int, e')] -> UArray i Int # unsafeAccumArray :: Ix i => (Int -> e' -> Int) -> Int -> (i, i) -> [(Int, e')] -> UArray i Int # | |||||
Lift Int | |||||
MArray IOUArray Int IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int -> IO Int # newArray :: Ix i => (i, i) -> Int -> IO (IOUArray i Int) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int) # unsafeRead :: Ix i => IOUArray i Int -> Int -> IO Int # unsafeWrite :: Ix i => IOUArray i Int -> Int -> Int -> IO () # | |||||
GEq1 v (UInt :: Type -> Type) | |||||
GOrd1 v (UInt :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
GShow1Con v (UInt :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic1 (URec Int :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Foldable (UInt :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UInt m -> m # foldMap :: Monoid m => (a -> m) -> UInt a -> m # foldMap' :: Monoid m => (a -> m) -> UInt a -> m # foldr :: (a -> b -> b) -> b -> UInt a -> b # foldr' :: (a -> b -> b) -> b -> UInt a -> b # foldl :: (b -> a -> b) -> b -> UInt a -> b # foldl' :: (b -> a -> b) -> b -> UInt a -> b # foldr1 :: (a -> a -> a) -> UInt a -> a # foldl1 :: (a -> a -> a) -> UInt a -> a # elem :: Eq a => a -> UInt a -> Bool # maximum :: Ord a => UInt a -> a # | |||||
Traversable (UInt :: Type -> Type) | @since base-4.9.0.0 | ||||
IsNullaryCon (UInt :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UInt a -> Bool # | |||||
MArray (STUArray s) Int (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i Int -> ST s (i, i) # getNumElements :: Ix i => STUArray s i Int -> ST s Int # newArray :: Ix i => (i, i) -> Int -> ST s (STUArray s i Int) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int) # unsafeRead :: Ix i => STUArray s i Int -> Int -> ST s Int # unsafeWrite :: Ix i => STUArray s i Int -> Int -> Int -> ST s () # | |||||
Functor (URec Int :: Type -> Type) | @since base-4.9.0.0 | ||||
GEq (UInt p) | |||||
GOrd (UInt p) | |||||
GShowCon (UInt p) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic (URec Int p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Show (URec Int p) | @since base-4.9.0.0 | ||||
Eq (URec Int p) | @since base-4.9.0.0 | ||||
Ord (URec Int p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
data URec Int (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
type Rep1 (URec Int :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec Int p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics |
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Instances
PrintfArg Float | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
NFData Float | |||||
Defined in Control.DeepSeq | |||||
Floating Float | @since base-2.01 | ||||
RealFloat Float | @since base-2.01 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # | |||||
Storable Float | @since base-2.01 | ||||
Read Float | @since base-2.01 | ||||
Eq Float | Note that due to the presence of
Also note that
| ||||
Ord Float | See | ||||
Hashable Float | Note: prior to The Since: hashable-1.3.0.0 | ||||
Defined in Data.Hashable.Class | |||||
IArray UArray Float | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i Float -> (i, i) # numElements :: Ix i => UArray i Float -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Float)] -> UArray i Float # unsafeAt :: Ix i => UArray i Float -> Int -> Float # unsafeReplace :: Ix i => UArray i Float -> [(Int, Float)] -> UArray i Float # unsafeAccum :: Ix i => (Float -> e' -> Float) -> UArray i Float -> [(Int, e')] -> UArray i Float # unsafeAccumArray :: Ix i => (Float -> e' -> Float) -> Float -> (i, i) -> [(Int, e')] -> UArray i Float # | |||||
Lift Float | |||||
MArray IOUArray Float IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Float -> IO (i, i) # getNumElements :: Ix i => IOUArray i Float -> IO Int # newArray :: Ix i => (i, i) -> Float -> IO (IOUArray i Float) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Float) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Float) # unsafeRead :: Ix i => IOUArray i Float -> Int -> IO Float # unsafeWrite :: Ix i => IOUArray i Float -> Int -> Float -> IO () # | |||||
GEq1 v (UFloat :: Type -> Type) | |||||
GOrd1 v (UFloat :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
GShow1Con v (UFloat :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic1 (URec Float :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Foldable (UFloat :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # | |||||
Traversable (UFloat :: Type -> Type) | @since base-4.9.0.0 | ||||
IsNullaryCon (UFloat :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UFloat a -> Bool # | |||||
MArray (STUArray s) Float (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i Float -> ST s (i, i) # getNumElements :: Ix i => STUArray s i Float -> ST s Int # newArray :: Ix i => (i, i) -> Float -> ST s (STUArray s i Float) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Float) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Float) # unsafeRead :: Ix i => STUArray s i Float -> Int -> ST s Float # unsafeWrite :: Ix i => STUArray s i Float -> Int -> Float -> ST s () # | |||||
Functor (URec Float :: Type -> Type) | @since base-4.9.0.0 | ||||
GEq (UFloat p) | |||||
GOrd (UFloat p) | |||||
GShowCon (UFloat p) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic (URec Float p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Show (URec Float p) | |||||
Eq (URec Float p) | |||||
Ord (URec Float p) | |||||
Defined in GHC.Internal.Generics | |||||
data URec Float (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
type Rep1 (URec Float :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec Float p) | |||||
Defined in GHC.Internal.Generics |
The character type Char
represents Unicode codespace
and its elements are code points as in definitions
D9 and D10 of the Unicode Standard.
Character literals in Haskell are single-quoted: 'Q'
, 'Я'
or 'Ω'
.
To represent a single quote itself use '\''
, and to represent a backslash
use '\\'
. The full grammar can be found in the section 2.6 of the
Haskell 2010 Language Report.
To specify a character by its code point one can use decimal, hexadecimal
or octal notation: '\65'
, '\x41'
and '\o101'
are all alternative forms
of 'A'
. The largest code point is '\x10ffff'
.
There is a special escape syntax for ASCII control characters:
Escape | Alternatives | Meaning |
---|---|---|
'\NUL' | '\0' | null character |
'\SOH' | '\1' | start of heading |
'\STX' | '\2' | start of text |
'\ETX' | '\3' | end of text |
'\EOT' | '\4' | end of transmission |
'\ENQ' | '\5' | enquiry |
'\ACK' | '\6' | acknowledge |
'\BEL' | '\7' , '\a' | bell (alert) |
'\BS' | '\8' , '\b' | backspace |
'\HT' | '\9' , '\t' | horizontal tab |
'\LF' | '\10' , '\n' | line feed (new line) |
'\VT' | '\11' , '\v' | vertical tab |
'\FF' | '\12' , '\f' | form feed |
'\CR' | '\13' , '\r' | carriage return |
'\SO' | '\14' | shift out |
'\SI' | '\15' | shift in |
'\DLE' | '\16' | data link escape |
'\DC1' | '\17' | device control 1 |
'\DC2' | '\18' | device control 2 |
'\DC3' | '\19' | device control 3 |
'\DC4' | '\20' | device control 4 |
'\NAK' | '\21' | negative acknowledge |
'\SYN' | '\22' | synchronous idle |
'\ETB' | '\23' | end of transmission block |
'\CAN' | '\24' | cancel |
'\EM' | '\25' | end of medium |
'\SUB' | '\26' | substitute |
'\ESC' | '\27' | escape |
'\FS' | '\28' | file separator |
'\GS' | '\29' | group separator |
'\RS' | '\30' | record separator |
'\US' | '\31' | unit separator |
'\SP' | '\32' , ' ' | space |
'\DEL' | '\127' | delete |
Instances
A value of type
is a computation which, when performed,
does some I/O before returning a value of type IO
aa
.
There is really only one way to "perform" an I/O action: bind it to
Main.main
in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the IO
monad and called
at some point, directly or indirectly, from Main.main
.
IO
is a monad, so IO
actions can be combined using either the do-notation
or the >>
and >>=
operations from the Monad
class.
Instances
MonadIO IO | Since: base-4.9.0.0 |
Defined in Control.Monad.IO.Class | |
Alternative IO | Takes the first non-throwing @since base-4.9.0.0 |
Applicative IO | @since base-2.01 |
Functor IO | @since base-2.01 |
Monad IO | @since base-2.01 |
MonadPlus IO | Takes the first non-throwing @since base-4.9.0.0 |
MonadFail IO | @since base-4.9.0.0 |
Defined in GHC.Internal.Control.Monad.Fail | |
Quasi IO | |
Defined in Language.Haskell.TH.Syntax Methods qNewName :: String -> IO Name # qReport :: Bool -> String -> IO () # qRecover :: IO a -> IO a -> IO a # qLookupName :: Bool -> String -> IO (Maybe Name) # qReifyFixity :: Name -> IO (Maybe Fixity) # qReifyType :: Name -> IO Type # qReifyInstances :: Name -> [Type] -> IO [Dec] # qReifyRoles :: Name -> IO [Role] # qReifyAnnotations :: Data a => AnnLookup -> IO [a] # qReifyModule :: Module -> IO ModuleInfo # qReifyConStrictness :: Name -> IO [DecidedStrictness] # qGetPackageRoot :: IO FilePath # qAddDependentFile :: FilePath -> IO () # qAddTempFile :: String -> IO FilePath # qAddTopDecls :: [Dec] -> IO () # qAddForeignFilePath :: ForeignSrcLang -> String -> IO () # qAddModFinalizer :: Q () -> IO () # qAddCorePlugin :: String -> IO () # qGetQ :: Typeable a => IO (Maybe a) # qPutQ :: Typeable a => a -> IO () # qIsExtEnabled :: Extension -> IO Bool # qExtsEnabled :: IO [Extension] # | |
Quote IO | |
MonadError IOException IO | |
Defined in Control.Monad.Error.Class | |
MArray IOUArray Int16 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int16 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int16 -> IO Int # newArray :: Ix i => (i, i) -> Int16 -> IO (IOUArray i Int16) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int16) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int16) # unsafeRead :: Ix i => IOUArray i Int16 -> Int -> IO Int16 # unsafeWrite :: Ix i => IOUArray i Int16 -> Int -> Int16 -> IO () # | |
MArray IOUArray Int32 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int32 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int32 -> IO Int # newArray :: Ix i => (i, i) -> Int32 -> IO (IOUArray i Int32) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int32) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int32) # unsafeRead :: Ix i => IOUArray i Int32 -> Int -> IO Int32 # unsafeWrite :: Ix i => IOUArray i Int32 -> Int -> Int32 -> IO () # | |
MArray IOUArray Int64 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int64 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int64 -> IO Int # newArray :: Ix i => (i, i) -> Int64 -> IO (IOUArray i Int64) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int64) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int64) # unsafeRead :: Ix i => IOUArray i Int64 -> Int -> IO Int64 # unsafeWrite :: Ix i => IOUArray i Int64 -> Int -> Int64 -> IO () # | |
MArray IOUArray Int8 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int8 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int8 -> IO Int # newArray :: Ix i => (i, i) -> Int8 -> IO (IOUArray i Int8) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int8) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int8) # unsafeRead :: Ix i => IOUArray i Int8 -> Int -> IO Int8 # unsafeWrite :: Ix i => IOUArray i Int8 -> Int -> Int8 -> IO () # | |
MArray IOUArray Word16 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word16 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word16 -> IO Int # newArray :: Ix i => (i, i) -> Word16 -> IO (IOUArray i Word16) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word16) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word16) # unsafeRead :: Ix i => IOUArray i Word16 -> Int -> IO Word16 # unsafeWrite :: Ix i => IOUArray i Word16 -> Int -> Word16 -> IO () # | |
MArray IOUArray Word32 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word32 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word32 -> IO Int # newArray :: Ix i => (i, i) -> Word32 -> IO (IOUArray i Word32) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word32) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word32) # unsafeRead :: Ix i => IOUArray i Word32 -> Int -> IO Word32 # unsafeWrite :: Ix i => IOUArray i Word32 -> Int -> Word32 -> IO () # | |
MArray IOUArray Word64 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word64 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word64 -> IO Int # newArray :: Ix i => (i, i) -> Word64 -> IO (IOUArray i Word64) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word64) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word64) # unsafeRead :: Ix i => IOUArray i Word64 -> Int -> IO Word64 # unsafeWrite :: Ix i => IOUArray i Word64 -> Int -> Word64 -> IO () # | |
MArray IOUArray Word8 IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word8 -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word8 -> IO Int # newArray :: Ix i => (i, i) -> Word8 -> IO (IOUArray i Word8) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word8) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word8) # unsafeRead :: Ix i => IOUArray i Word8 -> Int -> IO Word8 # unsafeWrite :: Ix i => IOUArray i Word8 -> Int -> Word8 -> IO () # | |
MArray IOUArray Bool IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Bool -> IO (i, i) # getNumElements :: Ix i => IOUArray i Bool -> IO Int # newArray :: Ix i => (i, i) -> Bool -> IO (IOUArray i Bool) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Bool) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Bool) # unsafeRead :: Ix i => IOUArray i Bool -> Int -> IO Bool # unsafeWrite :: Ix i => IOUArray i Bool -> Int -> Bool -> IO () # | |
MArray IOUArray Char IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Char -> IO (i, i) # getNumElements :: Ix i => IOUArray i Char -> IO Int # newArray :: Ix i => (i, i) -> Char -> IO (IOUArray i Char) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Char) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Char) # unsafeRead :: Ix i => IOUArray i Char -> Int -> IO Char # unsafeWrite :: Ix i => IOUArray i Char -> Int -> Char -> IO () # | |
MArray IOUArray Double IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Double -> IO (i, i) # getNumElements :: Ix i => IOUArray i Double -> IO Int # newArray :: Ix i => (i, i) -> Double -> IO (IOUArray i Double) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Double) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Double) # unsafeRead :: Ix i => IOUArray i Double -> Int -> IO Double # unsafeWrite :: Ix i => IOUArray i Double -> Int -> Double -> IO () # | |
MArray IOUArray Float IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Float -> IO (i, i) # getNumElements :: Ix i => IOUArray i Float -> IO Int # newArray :: Ix i => (i, i) -> Float -> IO (IOUArray i Float) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Float) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Float) # unsafeRead :: Ix i => IOUArray i Float -> Int -> IO Float # unsafeWrite :: Ix i => IOUArray i Float -> Int -> Float -> IO () # | |
MArray IOUArray Int IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Int -> IO (i, i) # getNumElements :: Ix i => IOUArray i Int -> IO Int # newArray :: Ix i => (i, i) -> Int -> IO (IOUArray i Int) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Int) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Int) # unsafeRead :: Ix i => IOUArray i Int -> Int -> IO Int # unsafeWrite :: Ix i => IOUArray i Int -> Int -> Int -> IO () # | |
MArray IOUArray Word IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word -> IO Int # newArray :: Ix i => (i, i) -> Word -> IO (IOUArray i Word) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word) # unsafeRead :: Ix i => IOUArray i Word -> Int -> IO Word # unsafeWrite :: Ix i => IOUArray i Word -> Int -> Word -> IO () # | |
Storable e => MArray StorableArray e IO | |
Defined in Data.Array.Storable.Internals Methods getBounds :: Ix i => StorableArray i e -> IO (i, i) # getNumElements :: Ix i => StorableArray i e -> IO Int # newArray :: Ix i => (i, i) -> e -> IO (StorableArray i e) # newArray_ :: Ix i => (i, i) -> IO (StorableArray i e) # unsafeNewArray_ :: Ix i => (i, i) -> IO (StorableArray i e) # unsafeRead :: Ix i => StorableArray i e -> Int -> IO e # unsafeWrite :: Ix i => StorableArray i e -> Int -> e -> IO () # | |
MArray IOArray e IO | |
Defined in Data.Array.Base Methods getBounds :: Ix i => IOArray i e -> IO (i, i) # getNumElements :: Ix i => IOArray i e -> IO Int # newArray :: Ix i => (i, i) -> e -> IO (IOArray i e) # newArray_ :: Ix i => (i, i) -> IO (IOArray i e) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOArray i e) # | |
MArray TArray e IO | Writes are slow in |
Defined in Control.Concurrent.STM.TArray Methods getBounds :: Ix i => TArray i e -> IO (i, i) # getNumElements :: Ix i => TArray i e -> IO Int # newArray :: Ix i => (i, i) -> e -> IO (TArray i e) # newArray_ :: Ix i => (i, i) -> IO (TArray i e) # unsafeNewArray_ :: Ix i => (i, i) -> IO (TArray i e) # | |
MArray IOUArray (FunPtr a) IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i (FunPtr a) -> IO (i, i) # getNumElements :: Ix i => IOUArray i (FunPtr a) -> IO Int # newArray :: Ix i => (i, i) -> FunPtr a -> IO (IOUArray i (FunPtr a)) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i (FunPtr a)) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (FunPtr a)) # unsafeRead :: Ix i => IOUArray i (FunPtr a) -> Int -> IO (FunPtr a) # unsafeWrite :: Ix i => IOUArray i (FunPtr a) -> Int -> FunPtr a -> IO () # | |
MArray IOUArray (Ptr a) IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i (Ptr a) -> IO (i, i) # getNumElements :: Ix i => IOUArray i (Ptr a) -> IO Int # newArray :: Ix i => (i, i) -> Ptr a -> IO (IOUArray i (Ptr a)) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) # unsafeRead :: Ix i => IOUArray i (Ptr a) -> Int -> IO (Ptr a) # unsafeWrite :: Ix i => IOUArray i (Ptr a) -> Int -> Ptr a -> IO () # | |
MArray IOUArray (StablePtr a) IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i (StablePtr a) -> IO (i, i) # getNumElements :: Ix i => IOUArray i (StablePtr a) -> IO Int # newArray :: Ix i => (i, i) -> StablePtr a -> IO (IOUArray i (StablePtr a)) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i (StablePtr a)) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (StablePtr a)) # unsafeRead :: Ix i => IOUArray i (StablePtr a) -> Int -> IO (StablePtr a) # unsafeWrite :: Ix i => IOUArray i (StablePtr a) -> Int -> StablePtr a -> IO () # | |
a ~ () => HPrintfType (IO a) | Since: base-4.7.0.0 |
Defined in Text.Printf | |
a ~ () => PrintfType (IO a) | Since: base-4.7.0.0 |
Defined in Text.Printf | |
Monoid a => Monoid (IO a) | @since base-4.9.0.0 |
Semigroup a => Semigroup (IO a) | @since base-4.10.0.0 |
Instances
NFData Bool | |||||
Defined in Control.DeepSeq | |||||
Bits Bool | Interpret @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Bool -> Bool -> Bool # (.|.) :: Bool -> Bool -> Bool # complement :: Bool -> Bool # shift :: Bool -> Int -> Bool # rotate :: Bool -> Int -> Bool # setBit :: Bool -> Int -> Bool # clearBit :: Bool -> Int -> Bool # complementBit :: Bool -> Int -> Bool # testBit :: Bool -> Int -> Bool # bitSizeMaybe :: Bool -> Maybe Int # shiftL :: Bool -> Int -> Bool # unsafeShiftL :: Bool -> Int -> Bool # shiftR :: Bool -> Int -> Bool # unsafeShiftR :: Bool -> Int -> Bool # rotateL :: Bool -> Int -> Bool # | |||||
FiniteBits Bool | @since base-4.7.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Bool -> Int # countLeadingZeros :: Bool -> Int # countTrailingZeros :: Bool -> Int # | |||||
Bounded Bool | @since base-2.01 | ||||
Enum Bool | @since base-2.01 | ||||
Storable Bool | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
Generic Bool | |||||
Defined in GHC.Internal.Generics | |||||
SingKind Bool | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Read Bool | @since base-2.01 | ||||
Show Bool | @since base-2.01 | ||||
Eq Bool | |||||
Ord Bool | |||||
Hashable Bool | |||||
Defined in Data.Hashable.Class | |||||
IArray UArray Bool | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i Bool -> (i, i) # numElements :: Ix i => UArray i Bool -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Bool)] -> UArray i Bool # unsafeAt :: Ix i => UArray i Bool -> Int -> Bool # unsafeReplace :: Ix i => UArray i Bool -> [(Int, Bool)] -> UArray i Bool # unsafeAccum :: Ix i => (Bool -> e' -> Bool) -> UArray i Bool -> [(Int, e')] -> UArray i Bool # unsafeAccumArray :: Ix i => (Bool -> e' -> Bool) -> Bool -> (i, i) -> [(Int, e')] -> UArray i Bool # | |||||
SingI 'False | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
SingI 'True | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
Lift Bool | |||||
MArray IOUArray Bool IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Bool -> IO (i, i) # getNumElements :: Ix i => IOUArray i Bool -> IO Int # newArray :: Ix i => (i, i) -> Bool -> IO (IOUArray i Bool) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Bool) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Bool) # unsafeRead :: Ix i => IOUArray i Bool -> Int -> IO Bool # unsafeWrite :: Ix i => IOUArray i Bool -> Int -> Bool -> IO () # | |||||
MArray (STUArray s) Bool (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i Bool -> ST s (i, i) # getNumElements :: Ix i => STUArray s i Bool -> ST s Int # newArray :: Ix i => (i, i) -> Bool -> ST s (STUArray s i Bool) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Bool) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Bool) # unsafeRead :: Ix i => STUArray s i Bool -> Int -> ST s Bool # unsafeWrite :: Ix i => STUArray s i Bool -> Int -> Bool -> ST s () # | |||||
type DemoteRep Bool | |||||
Defined in GHC.Internal.Generics | |||||
type Rep Bool | @since base-4.6.0.0 | ||||
data Sing (a :: Bool) | |||||
Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
Instances
PrintfArg Double | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
NFData Double | |||||
Defined in Control.DeepSeq | |||||
Floating Double | @since base-2.01 | ||||
RealFloat Double | @since base-2.01 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # | |||||
Storable Double | @since base-2.01 | ||||
Read Double | @since base-2.01 | ||||
Eq Double | Note that due to the presence of
Also note that
| ||||
Ord Double | IEEE 754 IEEE 754-2008, section 5.11 requires that if at least one of arguments of
IEEE 754-2008, section 5.10 defines Thus, users must be extremely cautious when using Moving further, the behaviour of IEEE 754-2008 compliant | ||||
Hashable Double | Note: prior to The Since: hashable-1.3.0.0 | ||||
Defined in Data.Hashable.Class | |||||
IArray UArray Double | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i Double -> (i, i) # numElements :: Ix i => UArray i Double -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Double)] -> UArray i Double # unsafeAt :: Ix i => UArray i Double -> Int -> Double # unsafeReplace :: Ix i => UArray i Double -> [(Int, Double)] -> UArray i Double # unsafeAccum :: Ix i => (Double -> e' -> Double) -> UArray i Double -> [(Int, e')] -> UArray i Double # unsafeAccumArray :: Ix i => (Double -> e' -> Double) -> Double -> (i, i) -> [(Int, e')] -> UArray i Double # | |||||
Lift Double | |||||
MArray IOUArray Double IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Double -> IO (i, i) # getNumElements :: Ix i => IOUArray i Double -> IO Int # newArray :: Ix i => (i, i) -> Double -> IO (IOUArray i Double) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Double) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Double) # unsafeRead :: Ix i => IOUArray i Double -> Int -> IO Double # unsafeWrite :: Ix i => IOUArray i Double -> Int -> Double -> IO () # | |||||
GEq1 v (UDouble :: Type -> Type) | |||||
GOrd1 v (UDouble :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
GShow1Con v (UDouble :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic1 (URec Double :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Foldable (UDouble :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # | |||||
Traversable (UDouble :: Type -> Type) | @since base-4.9.0.0 | ||||
IsNullaryCon (UDouble :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UDouble a -> Bool # | |||||
MArray (STUArray s) Double (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i Double -> ST s (i, i) # getNumElements :: Ix i => STUArray s i Double -> ST s Int # newArray :: Ix i => (i, i) -> Double -> ST s (STUArray s i Double) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Double) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Double) # unsafeRead :: Ix i => STUArray s i Double -> Int -> ST s Double # unsafeWrite :: Ix i => STUArray s i Double -> Int -> Double -> ST s () # | |||||
Functor (URec Double :: Type -> Type) | @since base-4.9.0.0 | ||||
GEq (UDouble p) | |||||
GOrd (UDouble p) | |||||
GShowCon (UDouble p) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic (URec Double p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Show (URec Double p) | @since base-4.9.0.0 | ||||
Eq (URec Double p) | @since base-4.9.0.0 | ||||
Ord (URec Double p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Methods compare :: URec Double p -> URec Double p -> Ordering # (<) :: URec Double p -> URec Double p -> Bool # (<=) :: URec Double p -> URec Double p -> Bool # (>) :: URec Double p -> URec Double p -> Bool # (>=) :: URec Double p -> URec Double p -> Bool # | |||||
data URec Double (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
type Rep1 (URec Double :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec Double p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics |
Instances
PrintfArg Word | Since: base-2.1 | ||||
Defined in Text.Printf | |||||
NFData Word | |||||
Defined in Control.DeepSeq | |||||
Bits Word | @since base-2.01 | ||||
Defined in GHC.Internal.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # complement :: Word -> Word # shift :: Word -> Int -> Word # rotate :: Word -> Int -> Word # setBit :: Word -> Int -> Word # clearBit :: Word -> Int -> Word # complementBit :: Word -> Int -> Word # testBit :: Word -> Int -> Bool # bitSizeMaybe :: Word -> Maybe Int # shiftL :: Word -> Int -> Word # unsafeShiftL :: Word -> Int -> Word # shiftR :: Word -> Int -> Word # unsafeShiftR :: Word -> Int -> Word # rotateL :: Word -> Int -> Word # | |||||
FiniteBits Word | @since base-4.6.0.0 | ||||
Defined in GHC.Internal.Bits Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int # | |||||
Bounded Word | @since base-2.01 | ||||
Enum Word | @since base-2.01 | ||||
Storable Word | @since base-2.01 | ||||
Defined in GHC.Internal.Foreign.Storable | |||||
Num Word | @since base-2.01 | ||||
Read Word | @since base-4.5.0.0 | ||||
Integral Word | @since base-2.01 | ||||
Real Word | @since base-2.01 | ||||
Defined in GHC.Internal.Real Methods toRational :: Word -> Rational # | |||||
Show Word | @since base-2.01 | ||||
Eq Word | |||||
Ord Word | |||||
Hashable Word | |||||
Defined in Data.Hashable.Class | |||||
IArray UArray Word | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i Word -> (i, i) # numElements :: Ix i => UArray i Word -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Word)] -> UArray i Word # unsafeAt :: Ix i => UArray i Word -> Int -> Word # unsafeReplace :: Ix i => UArray i Word -> [(Int, Word)] -> UArray i Word # unsafeAccum :: Ix i => (Word -> e' -> Word) -> UArray i Word -> [(Int, e')] -> UArray i Word # unsafeAccumArray :: Ix i => (Word -> e' -> Word) -> Word -> (i, i) -> [(Int, e')] -> UArray i Word # | |||||
Lift Word | |||||
MArray IOUArray Word IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i Word -> IO (i, i) # getNumElements :: Ix i => IOUArray i Word -> IO Int # newArray :: Ix i => (i, i) -> Word -> IO (IOUArray i Word) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i Word) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i Word) # unsafeRead :: Ix i => IOUArray i Word -> Int -> IO Word # unsafeWrite :: Ix i => IOUArray i Word -> Int -> Word -> IO () # | |||||
GEq1 v (UWord :: Type -> Type) | |||||
GOrd1 v (UWord :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
GShow1Con v (UWord :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic1 (URec Word :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Foldable (UWord :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # | |||||
Traversable (UWord :: Type -> Type) | @since base-4.9.0.0 | ||||
IsNullaryCon (UWord :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal Methods isNullaryCon :: UWord a -> Bool # | |||||
MArray (STUArray s) Word (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i Word -> ST s (i, i) # getNumElements :: Ix i => STUArray s i Word -> ST s Int # newArray :: Ix i => (i, i) -> Word -> ST s (STUArray s i Word) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word) # unsafeRead :: Ix i => STUArray s i Word -> Int -> ST s Word # unsafeWrite :: Ix i => STUArray s i Word -> Int -> Word -> ST s () # | |||||
Functor (URec Word :: Type -> Type) | @since base-4.9.0.0 | ||||
GEq (UWord p) | |||||
GOrd (UWord p) | |||||
GShowCon (UWord p) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
Generic (URec Word p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Show (URec Word p) | @since base-4.9.0.0 | ||||
Eq (URec Word p) | @since base-4.9.0.0 | ||||
Ord (URec Word p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
data URec Word (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
type Rep1 (URec Word :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec Word p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics |
Instances
NFData Ordering | |
Defined in Control.DeepSeq | |
Monoid Ordering | @since base-2.01 |
Semigroup Ordering | @since base-4.9.0.0 |
Bounded Ordering | @since base-2.01 |
Enum Ordering | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Generic Ordering | |
Defined in GHC.Internal.Generics | |
Read Ordering | @since base-2.01 |
Show Ordering | @since base-2.01 |
Eq Ordering | |
Ord Ordering | |
Defined in GHC.Classes | |
Hashable Ordering | |
Defined in Data.Hashable.Class | |
type Rep Ordering | @since base-4.6.0.0 |
class a ~R# b => Coercible (a :: k) (b :: k) #
Coercible
is a two-parameter class that has instances for types a
and b
if
the compiler can infer that they have the same representation. This class
does not have regular instances; instead they are created on-the-fly during
type-checking. Trying to manually declare an instance of Coercible
is an error.
Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:
instance Coercible a a
Furthermore, for every type constructor there is
an instance that allows to coerce under the type constructor. For
example, let D
be a prototypical type constructor (data
or
newtype
) with three type arguments, which have roles nominal
,
representational
resp. phantom
. Then there is an instance of
the form
instance Coercible b b' => Coercible (D a b c) (D a b' c')
Note that the nominal
type arguments are equal, the
representational
type arguments can differ, but need to have a
Coercible
instance themself, and the phantom
type arguments can be
changed arbitrarily.
The third kind of instance exists for every newtype NT = MkNT T
and
comes in two variants, namely
instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b
This instance is only usable if the constructor MkNT
is in scope.
If, as a library author of a type constructor like Set a
, you
want to prevent a user of your module to write
coerce :: Set T -> Set NT
,
you need to set the role of Set
's type parameter to nominal
,
by writing
type role Set nominal
For more details about this feature, please refer to Safe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.
Since: ghc-prim-0.4.0
(Kind) This is the kind of type-level symbols.
Instances
SingKind Symbol | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Associated Types
| |||||
TestCoercion SSymbol | @since base-4.18.0.0 | ||||
Defined in GHC.Internal.TypeLits | |||||
TestEquality SSymbol | @since base-4.18.0.0 | ||||
Defined in GHC.Internal.TypeLits | |||||
KnownSymbol a => SingI (a :: Symbol) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Methods sing :: Sing a | |||||
type DemoteRep Symbol | |||||
Defined in GHC.Internal.Generics | |||||
data Sing (s :: Symbol) | |||||
Defined in GHC.Internal.Generics |
Arbitrary precision integers. In contrast with fixed-size integral types
such as Int
, the Integer
type represents the entire infinite range of
integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (i.e., fits into an Int
), the IS
constructor is
used. Otherwise IP
and IN
constructors are used to store a BigNat
representing the positive or the negative value magnitude, respectively.
Invariant: IP
and IN
are used iff the value does not fit in IS
.
Instances
PrintfArg Integer | Since: base-2.1 |
Defined in Text.Printf | |
NFData Integer | |
Defined in Control.DeepSeq | |
Bits Integer | @since base-2.01 |
Defined in GHC.Internal.Bits Methods (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # | |
Enum Integer | @since base-2.01 |
Num Integer | @since base-2.01 |
Read Integer | @since base-2.01 |
Integral Integer | @since base-2.0.1 |
Defined in GHC.Internal.Real | |
Real Integer | @since base-2.0.1 |
Defined in GHC.Internal.Real Methods toRational :: Integer -> Rational # | |
Show Integer | @since base-2.01 |
Eq Integer | |
Ord Integer | |
Hashable Integer | |
Defined in Data.Hashable.Class | |
Lift Integer | |
type Constraint = CONSTRAINT LiftedRep #
The kind of lifted constraints
(++) :: [a] -> [a] -> [a] infixr 5 #
(++)
appends 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.
Performance considerations
This function takes linear time in the number of elements of the
first list. Thus it is better to associate repeated
applications of (++)
to the right (which is the default behaviour):
xs ++ (ys ++ zs)
or simply xs ++ ys ++ zs
, but not (xs ++ ys) ++ zs
.
For the same reason concat
=
foldr
(++)
[]
has linear performance, while foldl
(++)
[]
is prone
to quadratic slowdown
Examples
>>>
[1, 2, 3] ++ [4, 5, 6]
[1,2,3,4,5,6]
>>>
[] ++ [1, 2, 3]
[1,2,3]
>>>
[3, 2, 1] ++ []
[3,2,1]
The value of
is bottom if seq
a ba
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
does
not guarantee that seq
a ba
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.
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]])
Basic numeric class.
The Haskell Report defines no laws for Num
. However, (
and +
)(
are
customarily expected to define a ring and have the following properties:*
)
- Associativity of
(
+
) (x + y) + z
=x + (y + z)
- Commutativity of
(
+
) x + y
=y + x
is the additive identityfromInteger
0x + fromInteger 0
=x
negate
gives the additive inversex + negate x
=fromInteger 0
- Associativity of
(
*
) (x * y) * z
=x * (y * z)
is the multiplicative identityfromInteger
1x * fromInteger 1
=x
andfromInteger 1 * x
=x
- Distributivity of
(
with respect to*
)(
+
) a * (b + c)
=(a * b) + (a * c)
and(b + c) * a
=(b * a) + (c * a)
- Coherence with
toInteger
- if the type also implements
Integral
, thenfromInteger
is a left inverse fortoInteger
, i.e.fromInteger (toInteger i) == i
Note that it isn't customarily expected that a type instance of both Num
and Ord
implement an ordered ring. Indeed, in base
only Integer
and
Rational
do.
Methods
Unary negation.
Absolute value.
Sign of a number.
The functions abs
and signum
should satisfy the law:
abs x * signum x == x
For real numbers, the signum
is either -1
(negative), 0
(zero)
or 1
(positive).
fromInteger :: Integer -> a #
Conversion from an Integer
.
An integer literal represents the application of the function
fromInteger
to the appropriate value of type Integer
,
so such literals have type (
.Num
a) => a
Instances
Num CBool | |
Num CChar | |
Num CClock | |
Num CDouble | |
Num CFloat | |
Num CInt | |
Num CIntMax | |
Num CIntPtr | |
Num CLLong | |
Num CLong | |
Num CPtrdiff | |
Num CSChar | |
Num CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods (+) :: CSUSeconds -> CSUSeconds -> CSUSeconds # (-) :: CSUSeconds -> CSUSeconds -> CSUSeconds # (*) :: CSUSeconds -> CSUSeconds -> CSUSeconds # negate :: CSUSeconds -> CSUSeconds # abs :: CSUSeconds -> CSUSeconds # signum :: CSUSeconds -> CSUSeconds # fromInteger :: Integer -> CSUSeconds # | |
Num CShort | |
Num CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods (+) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (-) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (*) :: CSigAtomic -> CSigAtomic -> CSigAtomic # negate :: CSigAtomic -> CSigAtomic # abs :: CSigAtomic -> CSigAtomic # signum :: CSigAtomic -> CSigAtomic # fromInteger :: Integer -> CSigAtomic # | |
Num CSize | |
Num CTime | |
Num CUChar | |
Num CUInt | |
Num CUIntMax | |
Num CUIntPtr | |
Num CULLong | |
Num CULong | |
Num CUSeconds | |
Defined in GHC.Internal.Foreign.C.Types | |
Num CUShort | |
Num CWchar | |
Num IntPtr | |
Num WordPtr | |
Num Int16 | @since base-2.01 |
Num Int32 | @since base-2.01 |
Num Int64 | @since base-2.01 |
Num Int8 | @since base-2.01 |
Num CBlkCnt | |
Num CBlkSize | |
Defined in GHC.Internal.System.Posix.Types | |
Num CCc | |
Num CClockId | |
Defined in GHC.Internal.System.Posix.Types | |
Num CDev | |
Num CFsBlkCnt | |
Defined in GHC.Internal.System.Posix.Types | |
Num CFsFilCnt | |
Defined in GHC.Internal.System.Posix.Types | |
Num CGid | |
Num CId | |
Num CIno | |
Num CKey | |
Num CMode | |
Num CNfds | |
Num CNlink | |
Num COff | |
Num CPid | |
Num CRLim | |
Num CSocklen | |
Defined in GHC.Internal.System.Posix.Types | |
Num CSpeed | |
Num CSsize | |
Num CTcflag | |
Num CUid | |
Num Fd | |
Num Word16 | @since base-2.01 |
Num Word32 | @since base-2.01 |
Num Word64 | @since base-2.01 |
Num Word8 | @since base-2.01 |
Num I8 | |
Num Size | |
Num Integer | @since base-2.01 |
Num Natural | Note that @since base-4.8.0.0 |
Num Int | @since base-2.01 |
Num Word | @since base-2.01 |
RealFloat a => Num (Complex a) | Since: base-2.1 |
Num a => Num (Max a) | Since: base-4.9.0.0 |
Num a => Num (Min a) | Since: base-4.9.0.0 |
Num a => Num (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity | |
Num a => Num (Down a) | @since base-4.11.0.0 |
Num a => Num (Product a) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
Num a => Num (Sum a) | @since base-4.7.0.0 |
Integral a => Num (Ratio a) | @since base-2.0.1 |
HasResolution a => Num (Fixed a) | Multiplication is not associative or distributive:
Since: base-2.1 |
Num a => Num (Op a b) | |
Num a => Num (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const | |
(Applicative f, Num a) => Num (Ap f a) | Note that even if the underlying Commutativity:
Additive inverse:
Distributivity:
@since base-4.12.0.0 |
Num (f a) => Num (Alt f a) | @since base-4.8.0.0 |
Num (f (g a)) => Num (Compose f g a) | Since: base-4.19.0.0 |
Defined in Data.Functor.Compose Methods (+) :: Compose f g a -> Compose f g a -> Compose f g a # (-) :: Compose f g a -> Compose f g a -> Compose f g a # (*) :: Compose f g a -> Compose f g a -> Compose f g a # negate :: Compose f g a -> Compose f g a # abs :: Compose f g a -> Compose f g a # signum :: Compose f g a -> Compose f g a # fromInteger :: Integer -> Compose f g a # |
class Num a => Fractional a where #
Fractional numbers, supporting real division.
The Haskell Report defines no laws for Fractional
. However, (
and
+
)(
are customarily expected to define a division ring and have the
following properties:*
)
recip
gives the multiplicative inversex * recip x
=recip x * x
=fromInteger 1
- Totality of
toRational
toRational
is total- Coherence with
toRational
- if the type also implements
Real
, thenfromRational
is a left inverse fortoRational
, i.e.fromRational (toRational i) = i
Note that it isn't customarily expected that a type instance of
Fractional
implement a field. However, all instances in base
do.
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 CDouble | |
Fractional CFloat | |
RealFloat a => Fractional (Complex a) | Since: base-2.1 |
Fractional a => Fractional (Identity a) | @since base-4.9.0.0 |
Fractional a => Fractional (Down a) | @since base-4.14.0.0 |
Integral a => Fractional (Ratio a) | @since base-2.0.1 |
HasResolution a => Fractional (Fixed a) | Since: base-2.1 |
Fractional a => Fractional (Op a b) | |
Fractional a => Fractional (Const a b) | @since base-4.9.0.0 |
Fractional (f (g a)) => Fractional (Compose f g a) | Since: base-4.20.0.0 |
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
Successor of a value. For numeric types, succ
adds 1.
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..]
with [n..] = enumFrom n
,
a possible implementation being enumFrom n = n : enumFrom (succ n)
.
Examples
enumFrom 4 :: [Integer] = [4,5,6,7,...]
enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
with [n,n'..] = enumFromThen n n'
, a possible implementation being
enumFromThen n n' = n : n' : worker (f x) (f x n')
,
worker s v = v : worker s (s v)
, x = fromEnum n' - fromEnum n
and
f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = y
Examples
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m]
with
[n..m] = enumFromTo n m
, a possible implementation being
enumFromTo n m | n <= m = n : enumFromTo (succ n) m | otherwise = []
Examples
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]
enumFromTo 42 1 :: [Integer] = []
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m]
with
[n,n'..m] = enumFromThenTo n n' m
, a possible implementation
being enumFromThenTo n n' m = worker (f x) (c x) n m
,
x = fromEnum n' - fromEnum n
, c x = bool (>=) ((x 0)
f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = y
and
worker s c v m | c v m = v : worker s c (s v) m | otherwise = []
Examples
enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]
enumFromThenTo 6 8 2 :: [Int] = []
Instances
Enum Extension | |
Defined in GHC.LanguageExtensions.Type Methods succ :: Extension -> Extension # pred :: Extension -> Extension # fromEnum :: Extension -> Int # enumFrom :: Extension -> [Extension] # enumFromThen :: Extension -> Extension -> [Extension] # enumFromTo :: Extension -> Extension -> [Extension] # enumFromThenTo :: Extension -> Extension -> Extension -> [Extension] # | |
Enum CBool | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CChar | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CClock | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CDouble | |
Enum CFloat | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CInt | |
Enum CIntMax | |
Enum CIntPtr | |
Enum CLLong | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CLong | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CPtrdiff | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CSChar | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods succ :: CSUSeconds -> CSUSeconds # pred :: CSUSeconds -> CSUSeconds # toEnum :: Int -> CSUSeconds # fromEnum :: CSUSeconds -> Int # enumFrom :: CSUSeconds -> [CSUSeconds] # enumFromThen :: CSUSeconds -> CSUSeconds -> [CSUSeconds] # enumFromTo :: CSUSeconds -> CSUSeconds -> [CSUSeconds] # enumFromThenTo :: CSUSeconds -> CSUSeconds -> CSUSeconds -> [CSUSeconds] # | |
Enum CShort | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods succ :: CSigAtomic -> CSigAtomic # pred :: CSigAtomic -> CSigAtomic # toEnum :: Int -> CSigAtomic # fromEnum :: CSigAtomic -> Int # enumFrom :: CSigAtomic -> [CSigAtomic] # enumFromThen :: CSigAtomic -> CSigAtomic -> [CSigAtomic] # enumFromTo :: CSigAtomic -> CSigAtomic -> [CSigAtomic] # enumFromThenTo :: CSigAtomic -> CSigAtomic -> CSigAtomic -> [CSigAtomic] # | |
Enum CSize | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CTime | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CUChar | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CUInt | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CUIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CUIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CULLong | |
Enum CULong | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum CUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods succ :: CUSeconds -> CUSeconds # pred :: CUSeconds -> CUSeconds # fromEnum :: CUSeconds -> Int # enumFrom :: CUSeconds -> [CUSeconds] # enumFromThen :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromTo :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromThenTo :: CUSeconds -> CUSeconds -> CUSeconds -> [CUSeconds] # | |
Enum CUShort | |
Enum CWchar | |
Defined in GHC.Internal.Foreign.C.Types | |
Enum IntPtr | |
Defined in GHC.Internal.Foreign.Ptr | |
Enum WordPtr | |
Enum Associativity | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods succ :: Associativity -> Associativity # pred :: Associativity -> Associativity # toEnum :: Int -> Associativity # fromEnum :: Associativity -> Int # enumFrom :: Associativity -> [Associativity] # enumFromThen :: Associativity -> Associativity -> [Associativity] # enumFromTo :: Associativity -> Associativity -> [Associativity] # enumFromThenTo :: Associativity -> Associativity -> Associativity -> [Associativity] # | |
Enum DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods succ :: DecidedStrictness -> DecidedStrictness # pred :: DecidedStrictness -> DecidedStrictness # toEnum :: Int -> DecidedStrictness # fromEnum :: DecidedStrictness -> Int # enumFrom :: DecidedStrictness -> [DecidedStrictness] # enumFromThen :: DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] # enumFromTo :: DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] # enumFromThenTo :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] # | |
Enum SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods succ :: SourceStrictness -> SourceStrictness # pred :: SourceStrictness -> SourceStrictness # toEnum :: Int -> SourceStrictness # fromEnum :: SourceStrictness -> Int # enumFrom :: SourceStrictness -> [SourceStrictness] # enumFromThen :: SourceStrictness -> SourceStrictness -> [SourceStrictness] # enumFromTo :: SourceStrictness -> SourceStrictness -> [SourceStrictness] # enumFromThenTo :: SourceStrictness -> SourceStrictness -> SourceStrictness -> [SourceStrictness] # | |
Enum SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods succ :: SourceUnpackedness -> SourceUnpackedness # pred :: SourceUnpackedness -> SourceUnpackedness # toEnum :: Int -> SourceUnpackedness # fromEnum :: SourceUnpackedness -> Int # enumFrom :: SourceUnpackedness -> [SourceUnpackedness] # enumFromThen :: SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] # enumFromTo :: SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] # enumFromThenTo :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] # | |
Enum IOMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.IOMode | |
Enum Int16 | @since base-2.01 |
Defined in GHC.Internal.Int | |
Enum Int32 | @since base-2.01 |
Defined in GHC.Internal.Int | |
Enum Int64 | @since base-2.01 |
Defined in GHC.Internal.Int | |
Enum Int8 | @since base-2.01 |
Enum CBlkCnt | |
Enum CBlkSize | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CCc | |
Enum CClockId | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CDev | |
Enum CFsBlkCnt | |
Defined in GHC.Internal.System.Posix.Types Methods succ :: CFsBlkCnt -> CFsBlkCnt # pred :: CFsBlkCnt -> CFsBlkCnt # fromEnum :: CFsBlkCnt -> Int # enumFrom :: CFsBlkCnt -> [CFsBlkCnt] # enumFromThen :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromTo :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromThenTo :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # | |
Enum CFsFilCnt | |
Defined in GHC.Internal.System.Posix.Types Methods succ :: CFsFilCnt -> CFsFilCnt # pred :: CFsFilCnt -> CFsFilCnt # fromEnum :: CFsFilCnt -> Int # enumFrom :: CFsFilCnt -> [CFsFilCnt] # enumFromThen :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromTo :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromThenTo :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # | |
Enum CGid | |
Enum CId | |
Enum CIno | |
Enum CKey | |
Enum CMode | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CNfds | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CNlink | |
Defined in GHC.Internal.System.Posix.Types | |
Enum COff | |
Enum CPid | |
Enum CRLim | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CSocklen | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CSpeed | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CSsize | |
Defined in GHC.Internal.System.Posix.Types | |
Enum CTcflag | |
Enum CUid | |
Enum Fd | |
Enum GeneralCategory | @since base-2.01 |
Defined in GHC.Internal.Unicode Methods succ :: GeneralCategory -> GeneralCategory # pred :: GeneralCategory -> GeneralCategory # toEnum :: Int -> GeneralCategory # fromEnum :: GeneralCategory -> Int # enumFrom :: GeneralCategory -> [GeneralCategory] # enumFromThen :: GeneralCategory -> GeneralCategory -> [GeneralCategory] # enumFromTo :: GeneralCategory -> GeneralCategory -> [GeneralCategory] # enumFromThenTo :: GeneralCategory -> GeneralCategory -> GeneralCategory -> [GeneralCategory] # | |
Enum Word16 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Enum Word32 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Enum Word64 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Enum Word8 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Enum Ordering | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Enum Leniency # | |
Enum I8 | |
Enum FPFormat | |
Defined in Data.Text.Lazy.Builder.RealFloat | |
Enum Integer | @since base-2.01 |
Enum Natural | @since base-4.8.0.0 |
Enum () | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Enum Bool | @since base-2.01 |
Enum Char | @since base-2.01 |
Enum Int | @since base-2.01 |
Enum Levity | @since base-4.16.0.0 |
Defined in GHC.Internal.Enum | |
Enum VecCount | @since base-4.10.0.0 |
Defined in GHC.Internal.Enum | |
Enum VecElem | @since base-4.10.0.0 |
Enum Word | @since base-2.01 |
Enum a => Enum (First a) | Since: base-4.9.0.0 |
Enum a => Enum (Last a) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
Enum a => Enum (Max a) | Since: base-4.9.0.0 |
Enum a => Enum (Min a) | Since: base-4.9.0.0 |
Enum a => Enum (WrappedMonoid a) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods succ :: WrappedMonoid a -> WrappedMonoid a # pred :: WrappedMonoid a -> WrappedMonoid a # toEnum :: Int -> WrappedMonoid a # fromEnum :: WrappedMonoid a -> Int # enumFrom :: WrappedMonoid a -> [WrappedMonoid a] # enumFromThen :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # enumFromTo :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # enumFromThenTo :: WrappedMonoid a -> WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # | |
Enum a => Enum (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity Methods succ :: Identity a -> Identity a # pred :: Identity a -> Identity a # fromEnum :: Identity a -> Int # enumFrom :: Identity a -> [Identity a] # enumFromThen :: Identity a -> Identity a -> [Identity a] # enumFromTo :: Identity a -> Identity a -> [Identity a] # enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] # | |
(Enum a, Bounded a, Eq a) => Enum (Down a) | Swaps @since base-4.18.0.0 |
Defined in GHC.Internal.Data.Ord | |
Integral a => Enum (Ratio a) | @since base-2.0.1 |
Enum a => Enum (Solo a) | |
Defined in GHC.Internal.Enum | |
Enum (Fixed a) | Recall that, for numeric types,
and likewise
In other words,
and similarly
This is worth bearing in mind when defining [1..10] :: [Pico] evaluates to However, this is not true. On the contrary, similarly to the above
implementations of [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000] and contains Since: base-2.1 |
Enum (Proxy s) | @since base-4.7.0.0 |
Enum a => Enum (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # fromEnum :: Const a b -> Int # enumFrom :: Const a b -> [Const a b] # enumFromThen :: Const a b -> Const a b -> [Const a b] # enumFromTo :: Const a b -> Const a b -> [Const a b] # enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] # | |
Enum (f a) => Enum (Ap f a) | @since base-4.12.0.0 |
Defined in GHC.Internal.Data.Monoid | |
Enum (f a) => Enum (Alt f a) | @since base-4.8.0.0 |
Coercible a b => Enum (Coercion a b) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Type.Coercion Methods succ :: Coercion a b -> Coercion a b # pred :: Coercion a b -> Coercion a b # toEnum :: Int -> Coercion a b # fromEnum :: Coercion a b -> Int # enumFrom :: Coercion a b -> [Coercion a b] # enumFromThen :: Coercion a b -> Coercion a b -> [Coercion a b] # enumFromTo :: Coercion a b -> Coercion a b -> [Coercion a b] # enumFromThenTo :: Coercion a b -> Coercion a b -> Coercion a b -> [Coercion a b] # | |
a ~ b => Enum (a :~: b) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Type.Equality Methods succ :: (a :~: b) -> a :~: b # pred :: (a :~: b) -> a :~: b # fromEnum :: (a :~: b) -> Int # enumFrom :: (a :~: b) -> [a :~: b] # enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] # | |
a ~~ b => Enum (a :~~: b) | @since base-4.10.0.0 |
Defined in GHC.Internal.Data.Type.Equality Methods succ :: (a :~~: b) -> a :~~: b # pred :: (a :~~: b) -> a :~~: b # fromEnum :: (a :~~: b) -> Int # enumFrom :: (a :~~: b) -> [a :~~: b] # enumFromThen :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromTo :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromThenTo :: (a :~~: b) -> (a :~~: b) -> (a :~~: b) -> [a :~~: b] # | |
Enum (f (g a)) => Enum (Compose f g a) | Since: base-4.19.0.0 |
Defined in Data.Functor.Compose Methods succ :: Compose f g a -> Compose f g a # pred :: Compose f g a -> Compose f g a # toEnum :: Int -> Compose f g a # fromEnum :: Compose f g a -> Int # enumFrom :: Compose f g a -> [Compose f g a] # enumFromThen :: Compose f g a -> Compose f g a -> [Compose f g a] # enumFromTo :: Compose f g a -> Compose f g a -> [Compose f g a] # enumFromThenTo :: Compose f g a -> Compose f g a -> Compose f g a -> [Compose f g a] # |
fromIntegral :: (Integral a, Num b) => a -> b #
General coercion from Integral
types.
WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.
realToFrac :: (Real a, Fractional b) => a -> b #
General coercion to Fractional
types.
WARNING: This function goes through the Rational
type, which does not have values for NaN
for example.
This means it does not round-trip.
For Double
it also behaves differently with or without -O0:
Prelude> realToFrac nan -- With -O0 -Infinity Prelude> realToFrac nan NaN
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
withrem x y
=fromInteger 0
org (rem x y)
<g y
x
=y * div x y + mod x y
withmod x y
=fromInteger 0
orf (mod x y)
<f y
An example of a suitable Euclidean function, for Integer
's instance, is
abs
.
In addition, toInteger
should be total, and fromInteger
should be a left
inverse for it, i.e. fromInteger (toInteger i) = i
.
Methods
quot :: a -> a -> a infixl 7 #
Integer division truncated toward zero.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
Integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == x
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
Integer division truncated toward negative infinity.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
Integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == x
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base
.
Conversion to Integer
.
Instances
Integral CBool | |
Integral CChar | |
Integral CInt | |
Integral CIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CLLong | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CLong | |
Integral CPtrdiff | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CSChar | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CShort | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods quot :: CSigAtomic -> CSigAtomic -> CSigAtomic # rem :: CSigAtomic -> CSigAtomic -> CSigAtomic # div :: CSigAtomic -> CSigAtomic -> CSigAtomic # mod :: CSigAtomic -> CSigAtomic -> CSigAtomic # quotRem :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) # divMod :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) # toInteger :: CSigAtomic -> Integer # | |
Integral CSize | |
Integral CUChar | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CUInt | |
Integral CUIntMax | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CUIntPtr | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CULLong | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CULong | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CUShort | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral CWchar | |
Defined in GHC.Internal.Foreign.C.Types | |
Integral IntPtr | |
Defined in GHC.Internal.Foreign.Ptr | |
Integral WordPtr | |
Defined in GHC.Internal.Foreign.Ptr | |
Integral Int16 | @since base-2.01 |
Integral Int32 | @since base-2.01 |
Integral Int64 | @since base-2.01 |
Integral Int8 | @since base-2.01 |
Integral CBlkCnt | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CBlkSize | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CClockId | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CDev | |
Integral CFsBlkCnt | |
Defined in GHC.Internal.System.Posix.Types Methods quot :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # rem :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # div :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # mod :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # quotRem :: CFsBlkCnt -> CFsBlkCnt -> (CFsBlkCnt, CFsBlkCnt) # divMod :: CFsBlkCnt -> CFsBlkCnt -> (CFsBlkCnt, CFsBlkCnt) # | |
Integral CFsFilCnt | |
Defined in GHC.Internal.System.Posix.Types Methods quot :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # rem :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # div :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # mod :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # quotRem :: CFsFilCnt -> CFsFilCnt -> (CFsFilCnt, CFsFilCnt) # divMod :: CFsFilCnt -> CFsFilCnt -> (CFsFilCnt, CFsFilCnt) # | |
Integral CGid | |
Integral CId | |
Integral CIno | |
Integral CKey | |
Integral CMode | |
Integral CNfds | |
Integral CNlink | |
Defined in GHC.Internal.System.Posix.Types | |
Integral COff | |
Integral CPid | |
Integral CRLim | |
Integral CSocklen | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CSsize | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CTcflag | |
Defined in GHC.Internal.System.Posix.Types | |
Integral CUid | |
Integral Fd | |
Integral Word16 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Integral Word32 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Integral Word64 | @since base-2.01 |
Defined in GHC.Internal.Word | |
Integral Word8 | @since base-2.01 |
Integral I8 | |
Integral Integer | @since base-2.0.1 |
Defined in GHC.Internal.Real | |
Integral Natural | @since base-4.8.0.0 |
Defined in GHC.Internal.Real | |
Integral Int | @since base-2.0.1 |
Integral Word | @since base-2.01 |
Integral a => Integral (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity 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) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const 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 (f (g a)) => Integral (Compose f g a) | Since: base-4.19.0.0 |
Defined in Data.Functor.Compose Methods quot :: Compose f g a -> Compose f g a -> Compose f g a # rem :: Compose f g a -> Compose f g a -> Compose f g a # div :: Compose f g a -> Compose f g a -> Compose f g a # mod :: Compose f g a -> Compose f g a -> Compose f g a # quotRem :: Compose f g a -> Compose f g a -> (Compose f g a, Compose f g a) # divMod :: Compose f g a -> Compose f g a -> (Compose f g a, Compose f g a) # |
class (Num a, Ord a) => Real a where #
Real numbers.
The Haskell report defines no laws for Real
, however Real
instances
are customarily expected to adhere to the following law:
- Coherence with
fromRational
- if the type also implements
Fractional
, thenfromRational
is a left inverse fortoRational
, i.e.fromRational (toRational i) = i
The law does not hold for Float
, Double
, CFloat
,
CDouble
, etc., because these types contain non-finite values,
which cannot be roundtripped through Rational
.
Instances
Real CBool | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CBool -> Rational # | |
Real CChar | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CChar -> Rational # | |
Real CClock | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CClock -> Rational # | |
Real CDouble | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CDouble -> Rational # | |
Real CFloat | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CFloat -> Rational # | |
Real CInt | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CInt -> Rational # | |
Real CIntMax | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CIntMax -> Rational # | |
Real CIntPtr | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CIntPtr -> Rational # | |
Real CLLong | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CLLong -> Rational # | |
Real CLong | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CLong -> Rational # | |
Real CPtrdiff | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CPtrdiff -> Rational # | |
Real CSChar | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CSChar -> Rational # | |
Real CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CSUSeconds -> Rational # | |
Real CShort | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CShort -> Rational # | |
Real CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CSigAtomic -> Rational # | |
Real CSize | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CSize -> Rational # | |
Real CTime | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CTime -> Rational # | |
Real CUChar | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUChar -> Rational # | |
Real CUInt | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUInt -> Rational # | |
Real CUIntMax | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUIntMax -> Rational # | |
Real CUIntPtr | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUIntPtr -> Rational # | |
Real CULLong | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CULLong -> Rational # | |
Real CULong | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CULong -> Rational # | |
Real CUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUSeconds -> Rational # | |
Real CUShort | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CUShort -> Rational # | |
Real CWchar | |
Defined in GHC.Internal.Foreign.C.Types Methods toRational :: CWchar -> Rational # | |
Real IntPtr | |
Defined in GHC.Internal.Foreign.Ptr Methods toRational :: IntPtr -> Rational # | |
Real WordPtr | |
Defined in GHC.Internal.Foreign.Ptr Methods toRational :: WordPtr -> Rational # | |
Real Int16 | @since base-2.01 |
Defined in GHC.Internal.Int Methods toRational :: Int16 -> Rational # | |
Real Int32 | @since base-2.01 |
Defined in GHC.Internal.Int Methods toRational :: Int32 -> Rational # | |
Real Int64 | @since base-2.01 |
Defined in GHC.Internal.Int Methods toRational :: Int64 -> Rational # | |
Real Int8 | @since base-2.01 |
Defined in GHC.Internal.Int Methods toRational :: Int8 -> Rational # | |
Real CBlkCnt | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CBlkCnt -> Rational # | |
Real CBlkSize | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CBlkSize -> Rational # | |
Real CCc | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CCc -> Rational # | |
Real CClockId | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CClockId -> Rational # | |
Real CDev | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CDev -> Rational # | |
Real CFsBlkCnt | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CFsBlkCnt -> Rational # | |
Real CFsFilCnt | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CFsFilCnt -> Rational # | |
Real CGid | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CGid -> Rational # | |
Real CId | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CId -> Rational # | |
Real CIno | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CIno -> Rational # | |
Real CKey | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CKey -> Rational # | |
Real CMode | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CMode -> Rational # | |
Real CNfds | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CNfds -> Rational # | |
Real CNlink | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CNlink -> Rational # | |
Real COff | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: COff -> Rational # | |
Real CPid | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CPid -> Rational # | |
Real CRLim | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CRLim -> Rational # | |
Real CSocklen | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CSocklen -> Rational # | |
Real CSpeed | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CSpeed -> Rational # | |
Real CSsize | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CSsize -> Rational # | |
Real CTcflag | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CTcflag -> Rational # | |
Real CUid | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: CUid -> Rational # | |
Real Fd | |
Defined in GHC.Internal.System.Posix.Types Methods toRational :: Fd -> Rational # | |
Real Word16 | @since base-2.01 |
Defined in GHC.Internal.Word Methods toRational :: Word16 -> Rational # | |
Real Word32 | @since base-2.01 |
Defined in GHC.Internal.Word Methods toRational :: Word32 -> Rational # | |
Real Word64 | @since base-2.01 |
Defined in GHC.Internal.Word Methods toRational :: Word64 -> Rational # | |
Real Word8 | @since base-2.01 |
Defined in GHC.Internal.Word Methods toRational :: Word8 -> Rational # | |
Real I8 | |
Defined in Data.Text.Foreign Methods toRational :: I8 -> Rational # | |
Real Integer | @since base-2.0.1 |
Defined in GHC.Internal.Real Methods toRational :: Integer -> Rational # | |
Real Natural | @since base-4.8.0.0 |
Defined in GHC.Internal.Real Methods toRational :: Natural -> Rational # | |
Real Int | @since base-2.0.1 |
Defined in GHC.Internal.Real Methods toRational :: Int -> Rational # | |
Real Word | @since base-2.01 |
Defined in GHC.Internal.Real Methods toRational :: Word -> Rational # | |
Real a => Real (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity Methods toRational :: Identity a -> Rational # | |
Real a => Real (Down a) | @since base-4.14.0.0 |
Defined in GHC.Internal.Data.Ord Methods toRational :: Down a -> Rational # | |
Integral a => Real (Ratio a) | @since base-2.0.1 |
Defined in GHC.Internal.Real Methods toRational :: Ratio a -> Rational # | |
HasResolution a => Real (Fixed a) | Since: base-2.1 |
Defined in Data.Fixed Methods toRational :: Fixed a -> Rational # | |
Real a => Real (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const Methods toRational :: Const a b -> Rational # | |
Real (f (g a)) => Real (Compose f g a) | Since: base-4.19.0.0 |
Defined in Data.Functor.Compose Methods toRational :: Compose f g a -> Rational # |
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
Bounded Extension | |
Bounded All | @since base-2.01 |
Bounded Any | @since base-2.01 |
Bounded CBool | |
Bounded CChar | |
Bounded CInt | |
Bounded CIntMax | |
Bounded CIntPtr | |
Bounded CLLong | |
Bounded CLong | |
Bounded CPtrdiff | |
Bounded CSChar | |
Bounded CShort | |
Bounded CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types | |
Bounded CSize | |
Bounded CUChar | |
Bounded CUInt | |
Bounded CUIntMax | |
Bounded CUIntPtr | |
Bounded CULLong | |
Bounded CULong | |
Bounded CUShort | |
Bounded CWchar | |
Bounded IntPtr | |
Bounded WordPtr | |
Bounded Associativity | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
Bounded DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
Bounded SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
Bounded SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
Bounded Int16 | @since base-2.01 |
Bounded Int32 | @since base-2.01 |
Bounded Int64 | @since base-2.01 |
Bounded Int8 | @since base-2.01 |
Bounded CBlkCnt | |
Bounded CBlkSize | |
Bounded CClockId | |
Bounded CDev | |
Bounded CFsBlkCnt | |
Bounded CFsFilCnt | |
Bounded CGid | |
Bounded CId | |
Bounded CIno | |
Bounded CKey | |
Bounded CMode | |
Bounded CNfds | |
Bounded CNlink | |
Bounded COff | |
Bounded CPid | |
Bounded CRLim | |
Bounded CSocklen | |
Bounded CSsize | |
Bounded CTcflag | |
Bounded CUid | |
Bounded Fd | |
Bounded GeneralCategory | @since base-2.01 |
Defined in GHC.Internal.Unicode | |
Bounded Word16 | @since base-2.01 |
Bounded Word32 | @since base-2.01 |
Bounded Word64 | @since base-2.01 |
Bounded Word8 | @since base-2.01 |
Bounded Ordering | @since base-2.01 |
Bounded Leniency # | |
Bounded I8 | |
Bounded FPFormat | |
Bounded () | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Bounded Bool | @since base-2.01 |
Bounded Char | @since base-2.01 |
Bounded Int | @since base-2.01 |
Bounded Levity | @since base-4.16.0.0 |
Bounded VecCount | @since base-4.10.0.0 |
Bounded VecElem | @since base-4.10.0.0 |
Bounded Word | @since base-2.01 |
Bounded a => Bounded (First a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Last a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Max a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Min a) | Since: base-4.9.0.0 |
Bounded m => Bounded (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
Bounded a => Bounded (Identity a) | @since base-4.9.0.0 |
Bounded a => Bounded (Down a) | Swaps @since base-4.14.0.0 |
Bounded a => Bounded (Dual a) | @since base-2.01 |
Bounded a => Bounded (Product a) | @since base-2.01 |
Bounded a => Bounded (Sum a) | @since base-2.01 |
Bounded a => Bounded (Solo a) | |
Bounded (Proxy t) | @since base-4.7.0.0 |
(Bounded a, Bounded b) => Bounded (a, b) | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Bounded a => Bounded (Const a b) | @since base-4.9.0.0 |
(Applicative f, Bounded a) => Bounded (Ap f a) | @since base-4.12.0.0 |
Coercible a b => Bounded (Coercion a b) | @since base-4.7.0.0 |
a ~ b => Bounded (a :~: b) | @since base-4.7.0.0 |
(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) | @since base-2.01 |
Defined in GHC.Internal.Enum | |
a ~~ b => Bounded (a :~~: b) | @since base-4.10.0.0 |
(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) | @since base-2.01 |
Defined in GHC.Internal.Enum | |
Bounded (f (g a)) => Bounded (Compose f g a) | Since: base-4.19.0.0 |
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) | @since base-2.01 |
Defined in GHC.Internal.Enum | |
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) | @since base-2.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum | |
(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.01 |
Defined in GHC.Internal.Enum |
class Fractional a => Floating a where #
Trigonometric and hyperbolic functions and related functions.
The Haskell Report defines no laws for Floating
. However, (
, +
)(
and *
)exp
are customarily expected to define an exponential field and have
the following properties:
exp (a + b)
=exp a * exp b
exp (fromInteger 0)
=fromInteger 1
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Methods
(**) :: a -> a -> a infixr 8 #
computes log1p
x
, but provides more precise
results for small (absolute) values of log
(1 + x)x
if possible.
@since base-4.9.0.0
computes expm1
x
, but provides more precise
results for small (absolute) values of exp
x - 1x
if possible.
@since base-4.9.0.0
Instances
Floating CDouble | |
Floating CFloat | |
Floating Double | @since base-2.01 |
Floating Float | @since base-2.01 |
RealFloat a => Floating (Complex a) | Since: base-2.1 |
Defined in Data.Complex 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) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity 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 (Down a) | @since base-4.14.0.0 |
Floating a => Floating (Op a b) | |
Floating a => Floating (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const 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 (f (g a)) => Floating (Compose f g a) | Since: base-4.20.0.0 |
Defined in Data.Functor.Compose Methods exp :: Compose f g a -> Compose f g a # log :: Compose f g a -> Compose f g a # sqrt :: Compose f g a -> Compose f g a # (**) :: Compose f g a -> Compose f g a -> Compose f g a # logBase :: Compose f g a -> Compose f g a -> Compose f g a # sin :: Compose f g a -> Compose f g a # cos :: Compose f g a -> Compose f g a # tan :: Compose f g a -> Compose f g a # asin :: Compose f g a -> Compose f g a # acos :: Compose f g a -> Compose f g a # atan :: Compose f g a -> Compose f g a # sinh :: Compose f g a -> Compose f g a # cosh :: Compose f g a -> Compose f g a # tanh :: Compose f g a -> Compose f g a # asinh :: Compose f g a -> Compose f g a # acosh :: Compose f g a -> Compose f g a # atanh :: Compose f g a -> Compose f g a # log1p :: Compose f g a -> Compose f g a # expm1 :: Compose f g a -> Compose f g a # |
class (RealFrac a, Floating a) => RealFloat a where #
Efficient, machine-independent access to the components of a floating-point number.
Minimal complete definition
floatRadix, floatDigits, floatRange, decodeFloat, encodeFloat, isNaN, isInfinite, isDenormalized, isNegativeZero, isIEEE
Methods
floatRadix :: a -> Integer #
a constant function, returning the radix of the representation
(often 2
)
floatDigits :: a -> Int #
a constant function, returning the number of digits of
floatRadix
in the significand
floatRange :: a -> (Int, Int) #
a constant function, returning the lowest and highest values the exponent may assume
decodeFloat :: a -> (Integer, Int) #
The function decodeFloat
applied to a real floating-point
number returns the significand expressed as an Integer
and an
appropriately scaled exponent (an Int
). If
yields decodeFloat
x(m,n)
, then x
is equal in value to m*b^^n
, where b
is the floating-point radix, and furthermore, either m
and n
are both zero or else b^(d-1) <=
, where abs
m < b^dd
is
the value of
.
In particular, floatDigits
x
. If the type
contains a negative zero, also decodeFloat
0 = (0,0)
.
The result of decodeFloat
(-0.0) = (0,0)
is unspecified if either of
decodeFloat
x
or isNaN
x
is isInfinite
xTrue
.
encodeFloat :: Integer -> Int -> a #
encodeFloat
performs the inverse of decodeFloat
in the
sense that for finite x
with the exception of -0.0
,
.
uncurry
encodeFloat
(decodeFloat
x) = x
is one of the two closest representable
floating-point numbers to encodeFloat
m nm*b^^n
(or ±Infinity
if overflow
occurs); usually the closer, but if m
contains too many bits,
the result may be rounded in the wrong direction.
exponent
corresponds to the second component of decodeFloat
.
and for finite nonzero exponent
0 = 0x
,
.
If exponent
x = snd (decodeFloat
x) + floatDigits
xx
is a finite floating-point number, it is equal in value to
, where significand
x * b ^^ exponent
xb
is the
floating-point radix.
The behaviour is unspecified on infinite or NaN
values.
significand :: a -> a #
The first component of decodeFloat
, scaled to lie in the open
interval (-1
,1
), either 0.0
or of absolute value >= 1/b
,
where b
is the floating-point radix.
The behaviour is unspecified on infinite or NaN
values.
scaleFloat :: Int -> a -> a #
multiplies a floating-point number by an integer power of the radix
True
if the argument is an IEEE "not-a-number" (NaN) value
isInfinite :: a -> Bool #
True
if the argument is an IEEE infinity or negative infinity
isDenormalized :: a -> Bool #
True
if the argument is too small to be represented in
normalized format
isNegativeZero :: a -> Bool #
True
if the argument is an IEEE negative zero
True
if the argument is an IEEE floating point number
a version of arctangent taking two real floating-point arguments.
For real floating x
and y
,
computes the angle
(from the positive x-axis) of the vector from the origin to the
point atan2
y x(x,y)
.
returns a value in the range [atan2
y x-pi
,
pi
]. It follows the Common Lisp semantics for the origin when
signed zeroes are supported.
, with atan2
y 1y
in a type
that is RealFloat
, should return the same value as
.
A default definition of atan
yatan2
is provided, but implementors
can provide a more accurate implementation.
Instances
RealFloat CDouble | |
Defined in GHC.Internal.Foreign.C.Types Methods floatRadix :: CDouble -> Integer # floatDigits :: CDouble -> Int # floatRange :: CDouble -> (Int, Int) # decodeFloat :: CDouble -> (Integer, Int) # encodeFloat :: Integer -> Int -> CDouble # significand :: CDouble -> CDouble # scaleFloat :: Int -> CDouble -> CDouble # isInfinite :: CDouble -> Bool # isDenormalized :: CDouble -> Bool # isNegativeZero :: CDouble -> Bool # | |
RealFloat CFloat | |
Defined in GHC.Internal.Foreign.C.Types Methods floatRadix :: CFloat -> Integer # floatDigits :: CFloat -> Int # floatRange :: CFloat -> (Int, Int) # decodeFloat :: CFloat -> (Integer, Int) # encodeFloat :: Integer -> Int -> CFloat # significand :: CFloat -> CFloat # scaleFloat :: Int -> CFloat -> CFloat # isInfinite :: CFloat -> Bool # isDenormalized :: CFloat -> Bool # isNegativeZero :: CFloat -> Bool # | |
RealFloat Double | @since base-2.01 |
Defined in GHC.Internal.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # | |
RealFloat Float | @since base-2.01 |
Defined in GHC.Internal.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # | |
RealFloat a => RealFloat (Identity a) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Identity Methods floatRadix :: Identity a -> Integer # floatDigits :: Identity a -> Int # floatRange :: Identity a -> (Int, Int) # decodeFloat :: Identity a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Identity a # exponent :: Identity a -> Int # significand :: Identity a -> Identity a # scaleFloat :: Int -> Identity a -> Identity a # isInfinite :: Identity a -> Bool # isDenormalized :: Identity a -> Bool # isNegativeZero :: Identity a -> Bool # | |
RealFloat a => RealFloat (Down a) | @since base-4.14.0.0 |
Defined in GHC.Internal.Data.Ord Methods floatRadix :: Down a -> Integer # floatDigits :: Down a -> Int # floatRange :: Down a -> (Int, Int) # decodeFloat :: Down a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Down a # significand :: Down a -> Down a # scaleFloat :: Int -> Down a -> Down a # isInfinite :: Down a -> Bool # isDenormalized :: Down a -> Bool # isNegativeZero :: Down a -> Bool # | |
RealFloat a => RealFloat (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const Methods floatRadix :: Const a b -> Integer # floatDigits :: Const a b -> Int # floatRange :: Const a b -> (Int, Int) # decodeFloat :: Const a b -> (Integer, Int) # encodeFloat :: Integer -> Int -> Const a b # exponent :: Const a b -> Int # significand :: Const a b -> Const a b # scaleFloat :: Int -> Const a b -> Const a b # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # | |
RealFloat (f (g a)) => RealFloat (Compose f g a) | Since: base-4.20.0.0 |
Defined in Data.Functor.Compose Methods floatRadix :: Compose f g a -> Integer # floatDigits :: Compose f g a -> Int # floatRange :: Compose f g a -> (Int, Int) # decodeFloat :: Compose f g a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Compose f g a # exponent :: Compose f g a -> Int # significand :: Compose f g a -> Compose f g a # scaleFloat :: Int -> Compose f g a -> Compose f g a # isNaN :: Compose f g a -> Bool # isInfinite :: Compose f g a -> Bool # isDenormalized :: Compose f g a -> Bool # isNegativeZero :: Compose f g a -> Bool # |
class (Real a, Fractional a) => RealFrac a where #
Extracting components of fractions.
Minimal complete definition
Methods
properFraction :: Integral b => a -> (b, a) #
The function properFraction
takes a real fractional number x
and returns a pair (n,f)
such that x = n+f
, and:
n
is an integral number with the same sign asx
; andf
is a fraction with the same type and sign asx
, and with absolute value less than1
.
The default definitions of the ceiling
, floor
, truncate
and round
functions are in terms of properFraction
.
truncate :: Integral b => a -> b #
returns the integer nearest truncate
xx
between zero and x
round :: Integral b => a -> b #
returns the nearest integer to round
xx
;
the even integer if x
is equidistant between two integers
ceiling :: Integral b => a -> b #
returns the least integer not less than ceiling
xx
floor :: Integral b => a -> b #
returns the greatest integer not greater than floor
xx
Instances
RealFrac CDouble | |
RealFrac CFloat | |
RealFrac a => RealFrac (Identity a) | @since base-4.9.0.0 |
RealFrac a => RealFrac (Down a) | @since base-4.14.0.0 |
Integral a => RealFrac (Ratio a) | @since base-2.0.1 |
HasResolution a => RealFrac (Fixed a) | Since: base-2.1 |
RealFrac a => RealFrac (Const a b) | @since base-4.9.0.0 |
RealFrac (f (g a)) => RealFrac (Compose f g a) | Since: base-4.20.0.0 |
Conversion of values to readable String
s.
Derived instances of Show
have the following properties, which
are compatible with derived instances of Read
:
- The result of
show
is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used. - If the constructor is defined to be an infix operator, then
showsPrec
will produce infix applications of the constructor. - the representation will be enclosed in parentheses if the
precedence of the top-level constructor in
x
is less thand
(associativity is ignored). Thus, ifd
is0
then the result is never surrounded in parentheses; ifd
is11
it is always surrounded in parentheses, unless it is an atomic expression. - If the constructor is defined using record syntax, then
show
will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a
the derived instance of Show
is equivalent to
instance (Show a) => Show (Tree a) where showsPrec d (Leaf m) = showParen (d > app_prec) $ showString "Leaf " . showsPrec (app_prec+1) m where app_prec = 10 showsPrec d (u :^: v) = showParen (d > up_prec) $ showsPrec (up_prec+1) u . showString " :^: " . showsPrec (up_prec+1) v where up_prec = 5
Note that right-associativity of :^:
is ignored. For example,
produces the stringshow
(Leaf 1 :^: Leaf 2 :^: Leaf 3)"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"
.
Methods
Arguments
:: Int | the operator precedence of the enclosing
context (a number from |
-> a | the value to be converted to a |
-> ShowS |
Convert a value to a readable String
.
showsPrec
should satisfy the law
showsPrec d x r ++ s == showsPrec d x (r ++ s)
Derived instances of Read
and Show
satisfy the following:
That is, readsPrec
parses the string produced by
showsPrec
, and delivers the value that showsPrec
started with.
Instances
Show AsyncCancelled | |
Defined in Control.Concurrent.Async.Internal Methods showsPrec :: Int -> AsyncCancelled -> ShowS # show :: AsyncCancelled -> String # showList :: [AsyncCancelled] -> ShowS # | |
Show ExceptionInLinkedThread | |
Defined in Control.Concurrent.Async.Internal Methods showsPrec :: Int -> ExceptionInLinkedThread -> ShowS # show :: ExceptionInLinkedThread -> String # showList :: [ExceptionInLinkedThread] -> ShowS # | |
Show ByteArray | Since: base-4.17.0.0 |
Show Timeout | Since: base-4.0 |
Show FormatMode | |
Show ByteString | |
Defined in Data.ByteString.Internal.Type Methods showsPrec :: Int -> ByteString -> ShowS # show :: ByteString -> String # showList :: [ByteString] -> ShowS # | |
Show SizeOverflowException | |
Defined in Data.ByteString.Internal.Type Methods showsPrec :: Int -> SizeOverflowException -> ShowS # show :: SizeOverflowException -> String # showList :: [SizeOverflowException] -> ShowS # | |
Show ByteString | |
Defined in Data.ByteString.Lazy.Internal Methods showsPrec :: Int -> ByteString -> ShowS # show :: ByteString -> String # showList :: [ByteString] -> ShowS # | |
Show ShortByteString | |
Defined in Data.ByteString.Short.Internal Methods showsPrec :: Int -> ShortByteString -> ShowS # show :: ShortByteString -> String # showList :: [ShortByteString] -> ShowS # | |
Show IntSet | |
Show BitQueue | |
Show BitQueueB | |
Show ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type Methods showsPrec :: Int -> ForeignSrcLang -> ShowS # show :: ForeignSrcLang -> String # showList :: [ForeignSrcLang] -> ShowS # | |
Show Extension | |
Show Void | @since base-4.8.0.0 |
Show BlockReason | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync Methods showsPrec :: Int -> BlockReason -> ShowS # show :: BlockReason -> String # showList :: [BlockReason] -> ShowS # | |
Show ThreadId | @since base-4.2.0.0 |
Show ThreadStatus | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync Methods showsPrec :: Int -> ThreadStatus -> ShowS # show :: ThreadStatus -> String # showList :: [ThreadStatus] -> ShowS # | |
Show NestedAtomically | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> NestedAtomically -> ShowS # show :: NestedAtomically -> String # showList :: [NestedAtomically] -> ShowS # | |
Show NoMatchingContinuationPrompt | @since base-4.18 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> NoMatchingContinuationPrompt -> ShowS # show :: NoMatchingContinuationPrompt -> String # showList :: [NoMatchingContinuationPrompt] -> ShowS # | |
Show NoMethodError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> NoMethodError -> ShowS # show :: NoMethodError -> String # showList :: [NoMethodError] -> ShowS # | |
Show NonTermination | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> NonTermination -> ShowS # show :: NonTermination -> String # showList :: [NonTermination] -> ShowS # | |
Show PatternMatchFail | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> PatternMatchFail -> ShowS # show :: PatternMatchFail -> String # showList :: [PatternMatchFail] -> ShowS # | |
Show RecConError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> RecConError -> ShowS # show :: RecConError -> String # showList :: [RecConError] -> ShowS # | |
Show RecSelError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> RecSelError -> ShowS # show :: RecSelError -> String # showList :: [RecSelError] -> ShowS # | |
Show RecUpdError | @since base-4.0 |
Defined in GHC.Internal.Control.Exception.Base Methods showsPrec :: Int -> RecUpdError -> ShowS # show :: RecUpdError -> String # showList :: [RecUpdError] -> ShowS # | |
Show TypeError | @since base-4.9.0.0 |
Show All | @since base-2.01 |
Show Any | @since base-2.01 |
Show SomeTypeRep | @since base-4.10.0.0 |
Defined in GHC.Internal.Data.Typeable.Internal Methods showsPrec :: Int -> SomeTypeRep -> ShowS # show :: SomeTypeRep -> String # showList :: [SomeTypeRep] -> ShowS # | |
Show ErrorCall | @since base-4.0.0.0 |
Show ArithException | @since base-4.0.0.0 |
Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> ArithException -> ShowS # show :: ArithException -> String # showList :: [ArithException] -> ShowS # | |
Show SomeException | Since: ghc-internal-3.0 |
Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS # | |
Show CBool | |
Show CChar | |
Show CClock | |
Show CDouble | |
Show CFloat | |
Show CInt | |
Show CIntMax | |
Show CIntPtr | |
Show CLLong | |
Show CLong | |
Show CPtrdiff | |
Show CSChar | |
Show CSUSeconds | |
Defined in GHC.Internal.Foreign.C.Types Methods showsPrec :: Int -> CSUSeconds -> ShowS # show :: CSUSeconds -> String # showList :: [CSUSeconds] -> ShowS # | |
Show CShort | |
Show CSigAtomic | |
Defined in GHC.Internal.Foreign.C.Types Methods showsPrec :: Int -> CSigAtomic -> ShowS # show :: CSigAtomic -> String # showList :: [CSigAtomic] -> ShowS # | |
Show CSize | |
Show CTime | |
Show CUChar | |
Show CUInt | |
Show CUIntMax | |
Show CUIntPtr | |
Show CULLong | |
Show CULong | |
Show CUSeconds | |
Show CUShort | |
Show CWchar | |
Show IntPtr | |
Show WordPtr | |
Show Associativity | @since base-4.6.0.0 |
Defined in GHC.Internal.Generics Methods showsPrec :: Int -> Associativity -> ShowS # show :: Associativity -> String # showList :: [Associativity] -> ShowS # | |
Show DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS # | |
Show Fixity | @since base-4.6.0.0 |
Show SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS # | |
Show SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics Methods showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS # | |
Show MaskingState | @since base-4.3.0.0 |
Defined in GHC.Internal.IO Methods showsPrec :: Int -> MaskingState -> ShowS # show :: MaskingState -> String # showList :: [MaskingState] -> ShowS # | |
Show AllocationLimitExceeded | @since base-4.7.1.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> AllocationLimitExceeded -> ShowS # show :: AllocationLimitExceeded -> String # showList :: [AllocationLimitExceeded] -> ShowS # | |
Show ArrayException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> ArrayException -> ShowS # show :: ArrayException -> String # showList :: [ArrayException] -> ShowS # | |
Show AssertionFailed | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> AssertionFailed -> ShowS # show :: AssertionFailed -> String # showList :: [AssertionFailed] -> ShowS # | |
Show AsyncException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> AsyncException -> ShowS # show :: AsyncException -> String # showList :: [AsyncException] -> ShowS # | |
Show BlockedIndefinitelyOnMVar | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS # show :: BlockedIndefinitelyOnMVar -> String # showList :: [BlockedIndefinitelyOnMVar] -> ShowS # | |
Show BlockedIndefinitelyOnSTM | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS # show :: BlockedIndefinitelyOnSTM -> String # showList :: [BlockedIndefinitelyOnSTM] -> ShowS # | |
Show CompactionFailed | @since base-4.10.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> CompactionFailed -> ShowS # show :: CompactionFailed -> String # showList :: [CompactionFailed] -> ShowS # | |
Show Deadlock | @since base-4.1.0.0 |
Show ExitCode | |
Show FixIOException | @since base-4.11.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> FixIOException -> ShowS # show :: FixIOException -> String # showList :: [FixIOException] -> ShowS # | |
Show IOErrorType | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS # show :: IOErrorType -> String # showList :: [IOErrorType] -> ShowS # | |
Show IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS # | |
Show SomeAsyncException | @since base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception Methods showsPrec :: Int -> SomeAsyncException -> ShowS # show :: SomeAsyncException -> String # showList :: [SomeAsyncException] -> ShowS # | |
Show BufferMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types Methods showsPrec :: Int -> BufferMode -> ShowS # show :: BufferMode -> String # showList :: [BufferMode] -> ShowS # | |
Show Handle | @since base-4.1.0.0 |
Show HandleType | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle.Types Methods showsPrec :: Int -> HandleType -> ShowS # show :: HandleType -> String # showList :: [HandleType] -> ShowS # | |
Show Newline | @since base-4.3.0.0 |
Show NewlineMode | @since base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types Methods showsPrec :: Int -> NewlineMode -> ShowS # show :: NewlineMode -> String # showList :: [NewlineMode] -> ShowS # | |
Show IOMode | @since base-4.2.0.0 |
Show Int16 | @since base-2.01 |
Show Int32 | @since base-2.01 |
Show Int64 | @since base-2.01 |
Show Int8 | @since base-2.01 |
Show FractionalExponentBase | |
Defined in GHC.Internal.Real Methods showsPrec :: Int -> FractionalExponentBase -> ShowS # show :: FractionalExponentBase -> String # showList :: [FractionalExponentBase] -> ShowS # | |
Show CallStack | @since base-4.9.0.0 |
Show SrcLoc | @since base-4.9.0.0 |
Show StaticPtrInfo | @since base-4.8.0.0 |
Defined in GHC.Internal.StaticPtr Methods showsPrec :: Int -> StaticPtrInfo -> ShowS # show :: StaticPtrInfo -> String # showList :: [StaticPtrInfo] -> ShowS # | |
Show CBlkCnt | |
Show CBlkSize | |
Show CCc | |
Show CClockId | |
Show CDev | |
Show CFsBlkCnt | |
Show CFsFilCnt | |
Show CGid | |
Show CId | |
Show CIno | |
Show CKey | |
Show CMode | |
Show CNfds | |
Show CNlink | |
Show COff | |
Show CPid | |
Show CRLim | |
Show CSocklen | |
Show CSpeed | |
Show CSsize | |
Show CTcflag | |
Show CTimer | |
Show CUid | |
Show Fd | |
Show SomeChar | |
Show SomeSymbol | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeLits Methods showsPrec :: Int -> SomeSymbol -> ShowS # show :: SomeSymbol -> String # showList :: [SomeSymbol] -> ShowS # | |
Show SomeNat | @since base-4.7.0.0 |
Show GeneralCategory | @since base-2.01 |
Defined in GHC.Internal.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS # show :: GeneralCategory -> String # showList :: [GeneralCategory] -> ShowS # | |
Show Word16 | @since base-2.01 |
Show Word32 | @since base-2.01 |
Show Word64 | @since base-2.01 |
Show Word8 | @since base-2.01 |
Show KindRep | |
Show Module | @since base-4.9.0.0 |
Show Ordering | @since base-2.01 |
Show TrName | @since base-4.9.0.0 |
Show TyCon | @since base-2.01 |
Show TypeLitSort | @since base-4.11.0.0 |
Defined in GHC.Internal.Show Methods showsPrec :: Int -> TypeLitSort -> ShowS # show :: TypeLitSort -> String # showList :: [TypeLitSort] -> ShowS # | |
Show OsChar | |
Show OsString | On windows, decodes as UCS-2. On unix prints the raw bytes without decoding. |
Show PosixChar | |
Show PosixString | Prints the raw bytes without decoding. |
Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> PosixString -> ShowS # show :: PosixString -> String # showList :: [PosixString] -> ShowS # | |
Show WindowsChar | |
Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> WindowsChar -> ShowS # show :: WindowsChar -> String # showList :: [WindowsChar] -> ShowS # | |
Show WindowsString | Decodes as UCS-2. |
Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> WindowsString -> ShowS # show :: WindowsString -> String # showList :: [WindowsString] -> ShowS # | |
Show Mode | |
Show Style | |
Show TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods showsPrec :: Int -> TextDetails -> ShowS # show :: TextDetails -> String # showList :: [TextDetails] -> ShowS # | |
Show Doc | |
Show Leniency # | |
Show FatalError # | |
Defined in Protolude.Panic Methods showsPrec :: Int -> FatalError -> ShowS # show :: FatalError -> String # showList :: [FatalError] -> ShowS # | |
Show AnnLookup | |
Show AnnTarget | |
Show Bang | |
Show BndrVis | |
Show Body | |
Show Bytes | |
Show Callconv | |
Show Clause | |
Show Con | |
Show Dec | |
Show DecidedStrictness | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS # | |
Show DerivClause | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> DerivClause -> ShowS # show :: DerivClause -> String # showList :: [DerivClause] -> ShowS # | |
Show DerivStrategy | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> DerivStrategy -> ShowS # show :: DerivStrategy -> String # showList :: [DerivStrategy] -> ShowS # | |
Show DocLoc | |
Show Exp | |
Show FamilyResultSig | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> FamilyResultSig -> ShowS # show :: FamilyResultSig -> String # showList :: [FamilyResultSig] -> ShowS # | |
Show Fixity | |
Show FixityDirection | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> FixityDirection -> ShowS # show :: FixityDirection -> String # showList :: [FixityDirection] -> ShowS # | |
Show Foreign | |
Show FunDep | |
Show Guard | |
Show Info | |
Show InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> InjectivityAnn -> ShowS # show :: InjectivityAnn -> String # showList :: [InjectivityAnn] -> ShowS # | |
Show Inline | |
Show Lit | |
Show Loc | |
Show Match | |
Show ModName | |
Show Module | |
Show ModuleInfo | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> ModuleInfo -> ShowS # show :: ModuleInfo -> String # showList :: [ModuleInfo] -> ShowS # | |
Show Name | |
Show NameFlavour | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> NameFlavour -> ShowS # show :: NameFlavour -> String # showList :: [NameFlavour] -> ShowS # | |
Show NameSpace | |
Show NamespaceSpecifier | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> NamespaceSpecifier -> ShowS # show :: NamespaceSpecifier -> String # showList :: [NamespaceSpecifier] -> ShowS # | |
Show OccName | |
Show Overlap | |
Show Pat | |
Show PatSynArgs | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> PatSynArgs -> ShowS # show :: PatSynArgs -> String # showList :: [PatSynArgs] -> ShowS # | |
Show PatSynDir | |
Show Phases | |
Show PkgName | |
Show Pragma | |
Show Range | |
Show Role | |
Show RuleBndr | |
Show RuleMatch | |
Show Safety | |
Show SourceStrictness | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS # | |
Show SourceUnpackedness | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS # | |
Show Specificity | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> Specificity -> ShowS # show :: Specificity -> String # showList :: [Specificity] -> ShowS # | |
Show Stmt | |
Show TyLit | |
Show TySynEqn | |
Show Type | |
Show TypeFamilyHead | |
Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> TypeFamilyHead -> ShowS # show :: TypeFamilyHead -> String # showList :: [TypeFamilyHead] -> ShowS # | |
Show Decoding | |
Show UnicodeException | |
Defined in Data.Text.Encoding.Error Methods showsPrec :: Int -> UnicodeException -> ShowS # show :: UnicodeException -> String # showList :: [UnicodeException] -> ShowS # | |
Show I8 | |
Show Builder | |
Show PartialUtf8CodePoint | |
Show Utf8State | |
Show DecoderState | |
Defined in Data.Text.Internal.Encoding.Utf8 Methods showsPrec :: Int -> DecoderState -> ShowS # show :: DecoderState -> String # showList :: [DecoderState] -> ShowS # | |
Show Size | |
Show FPFormat | |
Show Iter | |
Show Integer | @since base-2.01 |
Show Natural | @since base-4.8.0.0 |
Show () | @since base-2.01 |
Show Bool | @since base-2.01 |
Show Char | @since base-2.01 |
Show Int | @since base-2.01 |
Show Levity | @since base-4.15.0.0 |
Show RuntimeRep | @since base-4.11.0.0 |
Defined in GHC.Internal.Show Methods showsPrec :: Int -> RuntimeRep -> ShowS # show :: RuntimeRep -> String # showList :: [RuntimeRep] -> ShowS # | |
Show VecCount | @since base-4.11.0.0 |
Show VecElem | @since base-4.11.0.0 |
Show Word | @since base-2.01 |
Show a => Show (Complex a) | Since: base-2.1 |
Show a => Show (First a) | Since: base-4.9.0.0 |
Show a => Show (Last a) | Since: base-4.9.0.0 |
Show a => Show (Max a) | Since: base-4.9.0.0 |
Show a => Show (Min a) | Since: base-4.9.0.0 |
Show m => Show (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods showsPrec :: Int -> WrappedMonoid m -> ShowS # show :: WrappedMonoid m -> String # showList :: [WrappedMonoid m] -> ShowS # | |
Show vertex => Show (SCC vertex) | Since: containers-0.5.9 |
Show a => Show (IntMap a) | |
Show a => Show (Seq a) | |
Show a => Show (ViewL a) | |
Show a => Show (ViewR a) | |
Show a => Show (Intersection a) | |
Defined in Data.Set.Internal Methods showsPrec :: Int -> Intersection a -> ShowS # show :: Intersection a -> String # showList :: [Intersection a] -> ShowS # | |
Show a => Show (Set a) | |
Show a => Show (Tree a) | |
Show a => Show (NonEmpty a) | @since base-4.11.0.0 |
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the
@since base-4.8.0.0 |
Show a => Show (First a) | @since base-2.01 |
Show a => Show (Last a) | @since base-2.01 |
Show a => Show (Down a) | This instance would be equivalent to the derived instances of the
@since base-4.7.0.0 |
Show a => Show (Dual a) | @since base-2.01 |
Show a => Show (Product a) | @since base-2.01 |
Show a => Show (Sum a) | @since base-2.01 |
Show a => Show (ExceptionWithContext a) | |
Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> ExceptionWithContext a -> ShowS # show :: ExceptionWithContext a -> String # showList :: [ExceptionWithContext a] -> ShowS # | |
Show e => Show (NoBacktrace e) | |
Defined in GHC.Internal.Exception.Type Methods showsPrec :: Int -> NoBacktrace e -> ShowS # show :: NoBacktrace e -> String # showList :: [NoBacktrace e] -> ShowS # | |
Show a => Show (ZipList a) | @since base-4.7.0.0 |
Show p => Show (Par1 p) | @since base-4.7.0.0 |
Show (FunPtr a) | @since base-2.01 |
Show (Ptr a) | @since base-2.01 |
Show a => Show (Ratio a) | @since base-2.0.1 |
Show (SChar c) | @since base-4.18.0.0 |
Show (SSymbol s) | @since base-4.18.0.0 |
Show (SNat n) | @since base-4.18.0.0 |
Show a => Show (Hashed a) | |
Show a => Show (AnnotDetails a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods showsPrec :: Int -> AnnotDetails a -> ShowS # show :: AnnotDetails a -> String # showList :: [AnnotDetails a] -> ShowS # | |
Show (Doc a) | |
Show a => Show (Span a) | |
Show flag => Show (TyVarBndr flag) | |
Show a => Show (Maybe a) | @since base-2.01 |
Show a => Show (Solo a) | @since base-4.15 |
Show a => Show [a] | @since base-2.01 |
(Ix ix, Show ix, Show e, IArray UArray e) => Show (UArray ix e) | |
HasResolution a => Show (Fixed a) | Since: base-2.1 |
(Show a, Show b) => Show (Arg a b) | Since: base-4.9.0.0 |
(Show k, Show a) => Show (Map k a) | |
(Show a, Show b) => Show (Either a b) | @since base-3.0 |
Show (Proxy s) | @since base-4.7.0.0 |
Show (TypeRep a) | |
Show (U1 p) | @since base-4.9.0.0 |
Show (V1 p) | @since base-4.9.0.0 |
Show (ST s a) | @since base-2.01 |
(Show1 f, Show a) => Show (Lift f a) | |
(Show1 m, Show a) => Show (MaybeT m a) | |
(GShow (Rep1 f a), Generic1 f) => Show (FunctorClassesDefault f a) | |
Defined in Data.Functor.Classes.Generic.Internal Methods showsPrec :: Int -> FunctorClassesDefault f a -> ShowS # show :: FunctorClassesDefault f a -> String # showList :: [FunctorClassesDefault f a] -> ShowS # | |
(Show a, Show b) => Show (a, b) | @since base-2.01 |
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the
@since base-4.8.0.0 |
Show (f a) => Show (Ap f a) | @since base-4.12.0.0 |
Show (f a) => Show (Alt f a) | @since base-4.8.0.0 |
Show (Coercion a b) | @since base-4.7.0.0 |
Show (a :~: b) | @since base-4.7.0.0 |
Show (f p) => Show (Rec1 f p) | @since base-4.7.0.0 |
Show (URec Char p) | @since base-4.9.0.0 |
Show (URec Double p) | @since base-4.9.0.0 |
Show (URec Float p) | |
Show (URec Int p) | @since base-4.9.0.0 |
Show (URec Word p) | @since base-4.9.0.0 |
(Show1 f, Show a) => Show (Backwards f a) | |
(Show e, Show1 m, Show a) => Show (ExceptT e m a) | |
(Show1 f, Show a) => Show (IdentityT f a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
Show a => Show (Constant a b) | |
(Show1 f, Show a) => Show (Reverse f a) | |
(Show a, Show b, Show c) => Show (a, b, c) | @since base-2.01 |
(Show (f a), Show (g a)) => Show (Product f g a) | Since: base-4.18.0.0 |
(Show (f a), Show (g a)) => Show (Sum f g a) | Since: base-4.18.0.0 |
Show (a :~~: b) | @since base-4.10.0.0 |
(Show (f p), Show (g p)) => Show ((f :*: g) p) | @since base-4.7.0.0 |
(Show (f p), Show (g p)) => Show ((f :+: g) p) | @since base-4.7.0.0 |
Show c => Show (K1 i c p) | @since base-4.7.0.0 |
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) | @since base-2.01 |
Show (f (g a)) => Show (Compose f g a) | Since: base-4.18.0.0 |
Show (f (g p)) => Show ((f :.: g) p) | @since base-4.7.0.0 |
Show (f p) => Show (M1 i c f p) | @since base-4.7.0.0 |
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | @since base-2.01 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | @since base-2.01 |
This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.
@since base-4.7.0.0
Minimal complete definition
class KnownSymbol (n :: Symbol) #
This class gives the string associated with a type-level symbol. There are instances of the class for every concrete literal: "hello", etc.
@since base-4.7.0.0
Minimal complete definition
Rational numbers, with numerator and denominator of some Integral
type.
Note that Ratio
's instances inherit the deficiencies from the type
parameter's. For example, Ratio Natural
's Num
instance has similar
problems to Natural
's.
Instances
NFData1 Ratio | Available on Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Integral a => Lift (Ratio a :: Type) | |
NFData a => NFData (Ratio a) | |
Defined in Control.DeepSeq | |
Integral a => Enum (Ratio a) | @since base-2.0.1 |
(Storable a, Integral a) => Storable (Ratio a) | @since base-4.8.0.0 |
Integral a => Num (Ratio a) | @since base-2.0.1 |
(Integral a, Read a) => Read (Ratio a) | @since base-2.01 |
Integral a => Fractional (Ratio a) | @since base-2.0.1 |
Integral a => Real (Ratio a) | @since base-2.0.1 |
Defined in GHC.Internal.Real Methods toRational :: Ratio a -> Rational # | |
Integral a => RealFrac (Ratio a) | @since base-2.0.1 |
Show a => Show (Ratio a) | @since base-2.0.1 |
Eq a => Eq (Ratio a) | @since base-2.01 |
Integral a => Ord (Ratio a) | @since base-2.0.1 |
Hashable a => Hashable (Ratio a) | |
Defined in Data.Hashable.Class |
A value of type
represents a pointer to an object, or an
array of objects, which may be marshalled to or from Haskell values
of type Ptr
aa
.
The type a
will often be an instance of class
Storable
which provides the marshalling operations.
However this is not essential, and you can provide your own operations
to access the pointer. For example you might write small foreign
functions to get or set the fields of a C struct
.
Instances
NFData1 Ptr | Since: deepseq-1.4.3.0 | ||||
Defined in Control.DeepSeq | |||||
IArray UArray (Ptr a) | |||||
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i (Ptr a) -> (i, i) # numElements :: Ix i => UArray i (Ptr a) -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, Ptr a)] -> UArray i (Ptr a) # unsafeAt :: Ix i => UArray i (Ptr a) -> Int -> Ptr a # unsafeReplace :: Ix i => UArray i (Ptr a) -> [(Int, Ptr a)] -> UArray i (Ptr a) # unsafeAccum :: Ix i => (Ptr a -> e' -> Ptr a) -> UArray i (Ptr a) -> [(Int, e')] -> UArray i (Ptr a) # unsafeAccumArray :: Ix i => (Ptr a -> e' -> Ptr a) -> Ptr a -> (i, i) -> [(Int, e')] -> UArray i (Ptr a) # | |||||
GEq1 v (UAddr :: Type -> Type) | |||||
GOrd1 v (UAddr :: Type -> Type) | |||||
Defined in Data.Functor.Classes.Generic.Internal | |||||
MArray IOUArray (Ptr a) IO | |||||
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i (Ptr a) -> IO (i, i) # getNumElements :: Ix i => IOUArray i (Ptr a) -> IO Int # newArray :: Ix i => (i, i) -> Ptr a -> IO (IOUArray i (Ptr a)) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) # unsafeRead :: Ix i => IOUArray i (Ptr a) -> Int -> IO (Ptr a) # unsafeWrite :: Ix i => IOUArray i (Ptr a) -> Int -> Ptr a -> IO () # | |||||
Generic1 (URec (Ptr ()) :: k -> Type) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
NFData (Ptr a) | Since: deepseq-1.4.2.0 | ||||
Defined in Control.DeepSeq | |||||
Foldable (UAddr :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UAddr m -> m # foldMap :: Monoid m => (a -> m) -> UAddr a -> m # foldMap' :: Monoid m => (a -> m) -> UAddr a -> m # foldr :: (a -> b -> b) -> b -> UAddr a -> b # foldr' :: (a -> b -> b) -> b -> UAddr a -> b # foldl :: (b -> a -> b) -> b -> UAddr a -> b # foldl' :: (b -> a -> b) -> b -> UAddr a -> b # foldr1 :: (a -> a -> a) -> UAddr a -> a # foldl1 :: (a -> a -> a) -> UAddr a -> a # elem :: Eq a => a -> UAddr a -> Bool # maximum :: Ord a => UAddr a -> a # minimum :: Ord a => UAddr a -> a # | |||||
Traversable (UAddr :: Type -> Type) | @since base-4.9.0.0 | ||||
Storable (Ptr a) | @since base-2.01 | ||||
Show (Ptr a) | @since base-2.01 | ||||
Eq (Ptr a) | @since base-2.01 | ||||
Ord (Ptr a) | @since base-2.01 | ||||
Hashable (Ptr a) | |||||
Defined in Data.Hashable.Class | |||||
MArray (STUArray s) (Ptr a) (ST s) | |||||
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i (Ptr a) -> ST s (i, i) # getNumElements :: Ix i => STUArray s i (Ptr a) -> ST s Int # newArray :: Ix i => (i, i) -> Ptr a -> ST s (STUArray s i (Ptr a)) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a)) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a)) # unsafeRead :: Ix i => STUArray s i (Ptr a) -> Int -> ST s (Ptr a) # unsafeWrite :: Ix i => STUArray s i (Ptr a) -> Int -> Ptr a -> ST s () # | |||||
Functor (URec (Ptr ()) :: Type -> Type) | @since base-4.9.0.0 | ||||
GEq (UAddr p) | |||||
GOrd (UAddr p) | |||||
Generic (URec (Ptr ()) p) | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
Eq (URec (Ptr ()) p) | @since base-4.9.0.0 | ||||
Ord (URec (Ptr ()) p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics Methods compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # | |||||
data URec (Ptr ()) (p :: k) | Used for marking occurrences of @since base-4.9.0.0 | ||||
type Rep1 (URec (Ptr ()) :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec (Ptr ()) p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics |
A value of type
is a pointer to a function callable
from foreign code. The type FunPtr
aa
will normally be a foreign type,
a function type with zero or more arguments where
- the argument types are marshallable foreign types,
i.e.
Char
,Int
,Double
,Float
,Bool
,Int8
,Int16
,Int32
,Int64
,Word8
,Word16
,Word32
,Word64
,
,Ptr
a
,FunPtr
a
or a renaming of any of these usingStablePtr
anewtype
. - the return type is either a marshallable foreign type or has the form
whereIO
tt
is a marshallable foreign type or()
.
A value of type
may be a pointer to a foreign function,
either returned by another foreign function or imported with a
a static address import likeFunPtr
a
foreign import ccall "stdlib.h &free" p_free :: FunPtr (Ptr a -> IO ())
or a pointer to a Haskell function created using a wrapper stub
declared to produce a FunPtr
of the correct type. For example:
type Compare = Int -> Int -> Bool foreign import ccall "wrapper" mkCompare :: Compare -> IO (FunPtr Compare)
Calls to wrapper stubs like mkCompare
allocate storage, which
should be released with freeHaskellFunPtr
when no
longer required.
To convert FunPtr
values to corresponding Haskell functions, one
can define a dynamic stub for the specific foreign type, e.g.
type IntFunction = CInt -> IO () foreign import ccall "dynamic" mkFun :: FunPtr IntFunction -> IntFunction
Instances
NFData1 FunPtr | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
IArray UArray (FunPtr a) | |
Defined in Data.Array.Base Methods bounds :: Ix i => UArray i (FunPtr a) -> (i, i) # numElements :: Ix i => UArray i (FunPtr a) -> Int # unsafeArray :: Ix i => (i, i) -> [(Int, FunPtr a)] -> UArray i (FunPtr a) # unsafeAt :: Ix i => UArray i (FunPtr a) -> Int -> FunPtr a # unsafeReplace :: Ix i => UArray i (FunPtr a) -> [(Int, FunPtr a)] -> UArray i (FunPtr a) # unsafeAccum :: Ix i => (FunPtr a -> e' -> FunPtr a) -> UArray i (FunPtr a) -> [(Int, e')] -> UArray i (FunPtr a) # unsafeAccumArray :: Ix i => (FunPtr a -> e' -> FunPtr a) -> FunPtr a -> (i, i) -> [(Int, e')] -> UArray i (FunPtr a) # | |
MArray IOUArray (FunPtr a) IO | |
Defined in Data.Array.IO.Internals Methods getBounds :: Ix i => IOUArray i (FunPtr a) -> IO (i, i) # getNumElements :: Ix i => IOUArray i (FunPtr a) -> IO Int # newArray :: Ix i => (i, i) -> FunPtr a -> IO (IOUArray i (FunPtr a)) # newArray_ :: Ix i => (i, i) -> IO (IOUArray i (FunPtr a)) # unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (FunPtr a)) # unsafeRead :: Ix i => IOUArray i (FunPtr a) -> Int -> IO (FunPtr a) # unsafeWrite :: Ix i => IOUArray i (FunPtr a) -> Int -> FunPtr a -> IO () # | |
NFData (FunPtr a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
Storable (FunPtr a) | @since base-2.01 |
Defined in GHC.Internal.Foreign.Storable | |
Show (FunPtr a) | @since base-2.01 |
Eq (FunPtr a) | |
Ord (FunPtr a) | |
Defined in GHC.Internal.Ptr | |
Hashable (FunPtr a) | |
Defined in Data.Hashable.Class | |
MArray (STUArray s) (FunPtr a) (ST s) | |
Defined in Data.Array.Base Methods getBounds :: Ix i => STUArray s i (FunPtr a) -> ST s (i, i) # getNumElements :: Ix i => STUArray s i (FunPtr a) -> ST s Int # newArray :: Ix i => (i, i) -> FunPtr a -> ST s (STUArray s i (FunPtr a)) # newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (FunPtr a)) # unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (FunPtr a)) # unsafeRead :: Ix i => STUArray s i (FunPtr a) -> Int -> ST s (FunPtr a) # unsafeWrite :: Ix i => STUArray s i (FunPtr a) -> Int -> FunPtr a -> ST s () # |
A reference to a value of type a
.
Instances
IsStatic StaticPtr | @since base-4.9.0.0 |
Defined in GHC.Internal.StaticPtr Methods fromStaticPtr :: Typeable a => StaticPtr a -> StaticPtr a # |
CallStack
s are a lightweight method of obtaining a
partial call-stack at any point in the program.
A function can request its call-site with the HasCallStack
constraint.
For example, we can define
putStrLnWithCallStack :: HasCallStack => String -> IO ()
as a variant of putStrLn
that will get its call-site and print it,
along with the string given as argument. We can access the
call-stack inside putStrLnWithCallStack
with callStack
.
>>>
:{
putStrLnWithCallStack :: HasCallStack => String -> IO () putStrLnWithCallStack msg = do putStrLn msg putStrLn (prettyCallStack callStack) :}
Thus, if we call putStrLnWithCallStack
we will get a formatted call-stack
alongside our string.
>>>
putStrLnWithCallStack "hello"
hello CallStack (from HasCallStack): putStrLnWithCallStack, called at <interactive>:... in interactive:Ghci...
GHC solves HasCallStack
constraints in three steps:
- If there is a
CallStack
in scope -- i.e. the enclosing function has aHasCallStack
constraint -- GHC will append the new call-site to the existingCallStack
. - If there is no
CallStack
in scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer aHasCallStack
constraint for the enclosing definition (subject to the monomorphism restriction). - If there is no
CallStack
in scope and the enclosing definition has an explicit type signature, GHC will solve theHasCallStack
constraint for the singletonCallStack
containing just the current call-site.
CallStack
s do not interact with the RTS and do not require compilation
with -prof
. On the other hand, as they are built up explicitly via the
HasCallStack
constraints, they will generally not contain as much
information as the simulated call-stacks maintained by the RTS.
A CallStack
is a [(String, SrcLoc)]
. The String
is the name of
function that was called, the SrcLoc
is the call-site. The list is
ordered with the most recently called function at the head.
NOTE: The intrepid user may notice that HasCallStack
is just an
alias for an implicit parameter ?callStack :: CallStack
. This is an
implementation detail and should not be considered part of the
CallStack
API, we may decide to change the implementation in the
future.
@since base-4.8.1.0
Instances
type family CmpNat (a :: Natural) (b :: Natural) :: Ordering where ... #
Comparison of type-level naturals, as a function.
@since base-4.7.0.0
type HasCallStack = ?callStack :: CallStack #
Request a CallStack.
NOTE: The implicit parameter ?callStack :: CallStack
is an
implementation detail and should not be considered part of the
CallStack
API, we may decide to change the implementation in the
future.
@since base-4.9.0.0
getCallStack :: CallStack -> [([Char], SrcLoc)] #
Extract a list of call-sites from the CallStack
.
The list is ordered by most recent call.
@since base-4.8.1.0
until :: (a -> Bool) -> (a -> a) -> a -> a #
yields the result of applying until
p ff
until p
holds.
currentCallStack :: IO [String] #
Returns a [String]
representing the current call stack. This
can be useful for debugging.
The implementation uses the call-stack simulation maintained by the
profiler, so it only works if the program was compiled with -prof
and contains suitable SCC annotations (e.g. by using -fprof-auto
).
Otherwise, the list returned is likely to be empty or
uninformative.
@since base-4.5.0.0
prettySrcLoc :: SrcLoc -> String #
Pretty print a SrcLoc
.
Since: ghc-internal-4.9.0.0
prettyCallStack :: CallStack -> String #
Pretty print a CallStack
.
Since: ghc-internal-4.9.0.0
boundedEnumFrom :: (Enum a, Bounded a) => a -> [a] #
boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a] #
divZeroError :: a #
overflowError :: a #
underflowError :: a #
ratioPrec1 :: Int #
notANumber :: Rational #
reduce :: Integral a => a -> a -> Ratio a #
reduce
is a subsidiary function used only in this module.
It normalises a ratio by dividing both numerator and denominator by
their greatest common divisor.
Extract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.
denominator :: Ratio a -> a #
Extract the denominator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.
numericEnumFrom :: Fractional a => a -> [a] #
numericEnumFromThen :: Fractional a => a -> a -> [a] #
numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a] #
numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] #
Arguments
:: Real a | |
=> (a -> ShowS) | a function that can show unsigned values |
-> Int | the precedence of the enclosing context |
-> a | the value to show |
-> ShowS |
Converts a possibly-negative Real
value to a string.
(^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 #
raise a number to an integral power
gcd :: Integral a => a -> a -> a #
is the non-negative factor of both gcd
x yx
and y
of which
every common factor of x
and y
is also a factor; for example
, gcd
4 2 = 2
, gcd
(-4) 6 = 2
= gcd
0 44
.
= gcd
0 00
.
(That is, the common divisor that is "greatest" in the divisibility
preordering.)
Note: Since for signed fixed-width integer types,
,
the result may be negative if one of the arguments is abs
minBound
< 0
(and
necessarily is if the other is minBound
0
or
) for such types.minBound
lcm :: Integral a => a -> a -> a #
is the smallest positive integer that both lcm
x yx
and y
divide.
integralEnumFrom :: (Integral a, Bounded a) => a -> [a] #
integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a] #
integralEnumFromTo :: Integral a => a -> a -> [a] #
integralEnumFromThenTo :: Integral a => a -> a -> a -> [a] #
showFloat :: RealFloat a => a -> ShowS #
Show a signed RealFloat
value to full precision
using standard decimal notation for arguments whose absolute value lies
between 0.1
and 9,999,999
, and scientific notation otherwise.
This type represents unknown type-level natural numbers.
@since base-4.10.0.0
A type synonym for Natural
.
Previously, this was an opaque data type, but it was changed to a type synonym.
@since base-4.16.0.0
someNatVal :: Integer -> Maybe SomeNat #
Convert an integer into an unknown type-level natural.
@since base-4.7.0.0
data SomeSymbol #
This type represents unknown type-level symbols.
Constructors
KnownSymbol n => SomeSymbol (Proxy n) | @since base-4.7.0.0 |
Instances
Read SomeSymbol | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeLits Methods readsPrec :: Int -> ReadS SomeSymbol # readList :: ReadS [SomeSymbol] # readPrec :: ReadPrec SomeSymbol # readListPrec :: ReadPrec [SomeSymbol] # | |
Show SomeSymbol | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeLits Methods showsPrec :: Int -> SomeSymbol -> ShowS # show :: SomeSymbol -> String # showList :: [SomeSymbol] -> ShowS # | |
Eq SomeSymbol | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeLits | |
Ord SomeSymbol | @since base-4.7.0.0 |
Defined in GHC.Internal.TypeLits Methods compare :: SomeSymbol -> SomeSymbol -> Ordering # (<) :: SomeSymbol -> SomeSymbol -> Bool # (<=) :: SomeSymbol -> SomeSymbol -> Bool # (>) :: SomeSymbol -> SomeSymbol -> Bool # (>=) :: SomeSymbol -> SomeSymbol -> Bool # max :: SomeSymbol -> SomeSymbol -> SomeSymbol # min :: SomeSymbol -> SomeSymbol -> SomeSymbol # |
symbolVal :: forall (n :: Symbol) proxy. KnownSymbol n => proxy n -> String #
@since base-4.7.0.0
someSymbolVal :: String -> SomeSymbol #
Convert a string into an unknown type-level symbol.
@since base-4.7.0.0
callStack :: HasCallStack => CallStack #
withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a #
Perform some computation without adding new entries to the CallStack
.
@since base-4.9.0.0
Location information about an address from a backtrace.
Constructors
Location | |
Fields
|
getStackTrace :: IO (Maybe [Location]) #
Get a trace of the current execution stack state.
Returns Nothing
if stack trace support isn't available on host machine.
showStackTrace :: IO (Maybe String) #
Get a string representation of the current execution stack state.