base-prelude-1.3: The most complete prelude formed solely from the "base" package

Safe Haskell | None
Language | Haskell2010

BasePrelude

Contents

- Reimplementations of functions presented in versions of "base" newer than 4.6
  - Data.Bool
  - Data.Function
  - Data.Functor
  - Data.List
  - Debug.Trace

Description

This module reexports most of the definitions from the "base" package, which are meant to be imported unqualified.

For details check out the source.

Synopsis

- (++) :: [a] -> [a] -> [a]
- seq :: a -> b -> b
- filter :: (a -> Bool) -> [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- newStablePtr :: a -> IO (StablePtr a)
- print :: Show a => a -> IO ()
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- otherwise :: Bool
- assert :: Bool -> a -> a
- lazy :: a -> a
- assertError :: (?callStack :: CallStack) => Bool -> a -> a
- trace :: String -> a -> a
- inline :: a -> a
- map :: (a -> b) -> [a] -> [b]
- groupWith :: Ord b => (a -> b) -> [a] -> [[a]]
- ($) :: (a -> b) -> a -> b
- coerce :: Coercible a b => a -> b
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- guard :: Alternative f => Bool -> f ()
- toDyn :: Typeable a => a -> Dynamic
- join :: Monad m => m (m a) -> m a
- class Bounded a where
- class Enum a where
- class Eq a where
- class Fractional a => Floating a where
- class Num a => Fractional a where
- class (Real a, Enum a) => Integral a where
- class Applicative m => Monad (m :: * -> *) where
- class Typeable a => Data a where
- class Functor (f :: * -> *) where
- class Num a where
- class Eq a => Ord a where
- class Read a where
- class (Num a, Ord a) => Real a where
- class (RealFrac a, Floating a) => RealFloat a where
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- class Ord a => Ix a where
- class Typeable (a :: k)
- class Monad m => MonadFix (m :: * -> *) where
- class Monad m => MonadFail (m :: * -> *)
- class IsString a where
- class Functor f => Applicative (f :: * -> *) where
- class Foldable (t :: * -> *) where
- class (Functor t, Foldable t) => Traversable (t :: * -> *) where
- class Generic a
- class Semigroup a where
- class Semigroup a => Monoid a where
- data Bool
  - = False
  - | True
- data Char
- data Double
- data Float
- data Int
- data Int8
- data Int16
- data Int32
- data Int64
- data Integer
- data Natural
- data Maybe a
  - = Nothing
  - | Just a
- data Ordering
  - = LT
  - | EQ
  - | GT
- data Ratio a
- type Rational = Ratio Integer
- data RealWorld
- data StablePtr a
- data IO a
- data Word
- data Word8
- data Word16
- data Word32
- data Word64
- data Ptr a
- data FunPtr a
- data Either a b
  - = Left a
  - | Right b
- class a ~R# b => Coercible (a :: k0) (b :: k0)
- data TyCon
- untangle :: Addr# -> String -> String
- ioException :: IOException -> IO a
- heapOverflow :: SomeException
- stackOverflow :: SomeException
- cannotCompactMutable :: SomeException
- cannotCompactPinned :: SomeException
- cannotCompactFunction :: SomeException
- allocationLimitExceeded :: SomeException
- blockedIndefinitelyOnSTM :: SomeException
- blockedIndefinitelyOnMVar :: SomeException
- unsupportedOperation :: IOError
- phase :: RealFloat a => Complex a -> a
- magnitude :: RealFloat a => Complex a -> a
- polar :: RealFloat a => Complex a -> (a, a)
- cis :: Floating a => a -> Complex a
- mkPolar :: Floating a => a -> a -> Complex a
- conjugate :: Num a => Complex a -> Complex a
- imagPart :: Complex a -> a
- realPart :: Complex a -> a
- data Complex a = !a :+ !a
- showFixed :: HasResolution a => Bool -> Fixed a -> String
- mod' :: Real a => a -> a -> a
- divMod' :: (Real a, Integral b) => a -> a -> (b, a)
- div' :: (Real a, Integral b) => a -> a -> b
- newtype Fixed a = MkFixed Integer
- class HasResolution a where
- data E0
- type Uni = Fixed E0
- data E1
- type Deci = Fixed E1
- data E2
- type Centi = Fixed E2
- data E3
- type Milli = Fixed E3
- data E6
- type Micro = Fixed E6
- data E9
- type Nano = Fixed E9
- data E12
- type Pico = Fixed E12
- newtype Compose (f :: k -> *) (g :: k1 -> k) (a :: k1) :: forall k k1. (k -> *) -> (k1 -> k) -> k1 -> * = Compose {
  - getCompose :: f (g a)
  }
- vacuous :: Functor f => f Void -> f a
- absurd :: Void -> a
- data Void
- option :: b -> (a -> b) -> Option a -> b
- mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
- diff :: Semigroup m => m -> Endo m
- cycle1 :: Semigroup m => m -> m
- newtype Min a = Min {
  - getMin :: a
  }
- newtype Max a = Max {
  - getMax :: a
  }
- data Arg a b = Arg a b
- type ArgMin a b = Min (Arg a b)
- type ArgMax a b = Max (Arg a b)
- newtype First a = First {
  - getFirst :: a
  }
- newtype Last a = Last {
  - getLast :: a
  }
- newtype WrappedMonoid m = WrapMonoid {
  - unwrapMonoid :: m
  }
- newtype Option a = Option {
  - getOption :: Maybe a
  }
- sortWith :: Ord b => (a -> b) -> [a] -> [a]
- tyconModule :: String -> String
- tyconUQname :: String -> String
- isNorepType :: DataType -> Bool
- mkNoRepType :: String -> DataType
- mkCharConstr :: DataType -> Char -> Constr
- mkRealConstr :: (Real a, Show a) => DataType -> a -> Constr
- mkIntegralConstr :: (Integral a, Show a) => DataType -> a -> Constr
- mkCharType :: String -> DataType
- mkFloatType :: String -> DataType
- mkIntType :: String -> DataType
- maxConstrIndex :: DataType -> ConIndex
- constrIndex :: Constr -> ConIndex
- indexConstr :: DataType -> ConIndex -> Constr
- isAlgType :: DataType -> Bool
- readConstr :: DataType -> String -> Maybe Constr
- showConstr :: Constr -> String
- constrFixity :: Constr -> Fixity
- constrFields :: Constr -> [String]
- dataTypeConstrs :: DataType -> [Constr]
- mkConstr :: DataType -> String -> [String] -> Fixity -> Constr
- mkDataType :: String -> [Constr] -> DataType
- repConstr :: DataType -> ConstrRep -> Constr
- constrRep :: Constr -> ConstrRep
- constrType :: Constr -> DataType
- dataTypeRep :: DataType -> DataRep
- dataTypeName :: DataType -> String
- fromConstrM :: (Monad m, Data a) => (forall d. Data d => m d) -> Constr -> m a
- fromConstrB :: Data a => (forall d. Data d => d) -> Constr -> a
- fromConstr :: Data a => Constr -> a
- data DataType
- data Constr
- data DataRep
  - = AlgRep [Constr]
  - | IntRep
  - | FloatRep
  - | CharRep
  - | NoRep
- data ConstrRep
  - = AlgConstr ConIndex
  - | IntConstr Integer
  - | FloatConstr Rational
  - | CharConstr Char
- type ConIndex = Int
- data Fixity
  - = Prefix
  - | Infix
- timeout :: Int -> IO a -> IO (Maybe a)
- threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
- threadWaitReadSTM :: Fd -> IO (STM (), IO ())
- threadWaitWrite :: Fd -> IO ()
- threadWaitRead :: Fd -> IO ()
- runInUnboundThread :: IO a -> IO a
- runInBoundThread :: IO a -> IO a
- isCurrentThreadBound :: IO Bool
- forkOSWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkOS :: IO () -> IO ThreadId
- forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
- rtsSupportsBoundThreads :: Bool
- writeList2Chan :: Chan a -> [a] -> IO ()
- getChanContents :: Chan a -> IO [a]
- dupChan :: Chan a -> IO (Chan a)
- readChan :: Chan a -> IO a
- writeChan :: Chan a -> a -> IO ()
- newChan :: IO (Chan a)
- data Chan a
- signalQSem :: QSem -> IO ()
- waitQSem :: QSem -> IO ()
- newQSem :: Int -> IO QSem
- data QSem
- signalQSemN :: QSemN -> Int -> IO ()
- waitQSemN :: QSemN -> Int -> IO ()
- newQSemN :: Int -> IO QSemN
- data QSemN
- class Bifunctor (p :: * -> * -> *) where
- showsBinary1 :: (Show1 f, Show1 g, Show a) => String -> Int -> f a -> g a -> ShowS
- showsUnary1 :: (Show1 f, Show a) => String -> Int -> f a -> ShowS
- showsUnary :: Show a => String -> Int -> a -> ShowS
- readsBinary1 :: (Read1 f, Read1 g, Read a) => String -> (f a -> g a -> t) -> String -> ReadS t
- readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS t
- readsUnary :: Read a => String -> (a -> t) -> String -> ReadS t
- showsBinaryWith :: (Int -> a -> ShowS) -> (Int -> b -> ShowS) -> String -> Int -> a -> b -> ShowS
- showsUnaryWith :: (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
- readBinaryWith :: ReadPrec a -> ReadPrec b -> String -> (a -> b -> t) -> ReadPrec t
- readsBinaryWith :: (Int -> ReadS a) -> (Int -> ReadS b) -> String -> (a -> b -> t) -> String -> ReadS t
- readUnaryWith :: ReadPrec a -> String -> (a -> t) -> ReadPrec t
- readsUnaryWith :: (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t
- readData :: ReadPrec a -> ReadPrec a
- readsData :: (String -> ReadS a) -> Int -> ReadS a
- showsPrec2 :: (Show2 f, Show a, Show b) => Int -> f a b -> ShowS
- liftReadListPrec2Default :: Read2 f => ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [f a b]
- liftReadList2Default :: Read2 f => (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [f a b]
- readPrec2 :: (Read2 f, Read a, Read b) => ReadPrec (f a b)
- readsPrec2 :: (Read2 f, Read a, Read b) => Int -> ReadS (f a b)
- compare2 :: (Ord2 f, Ord a, Ord b) => f a b -> f a b -> Ordering
- eq2 :: (Eq2 f, Eq a, Eq b) => f a b -> f a b -> Bool
- showsPrec1 :: (Show1 f, Show a) => Int -> f a -> ShowS
- liftReadListPrecDefault :: Read1 f => ReadPrec a -> ReadPrec [a] -> ReadPrec [f a]
- liftReadListDefault :: Read1 f => (Int -> ReadS a) -> ReadS [a] -> ReadS [f a]
- readPrec1 :: (Read1 f, Read a) => ReadPrec (f a)
- readsPrec1 :: (Read1 f, Read a) => Int -> ReadS (f a)
- compare1 :: (Ord1 f, Ord a) => f a -> f a -> Ordering
- eq1 :: (Eq1 f, Eq a) => f a -> f a -> Bool
- class Eq1 (f :: * -> *) where
- class Eq1 f => Ord1 (f :: * -> *) where
- class Read1 (f :: * -> *) where
- class Show1 (f :: * -> *) where
- class Eq2 (f :: * -> * -> *) where
- class Eq2 f => Ord2 (f :: * -> * -> *) where
- class Read2 (f :: * -> * -> *) where
- class Show2 (f :: * -> * -> *) where
- class Monad m => MonadIO (m :: * -> *) where
- approxRational :: RealFrac a => a -> a -> Rational
- modifySTRef' :: STRef s a -> (a -> a) -> ST s ()
- modifySTRef :: STRef s a -> (a -> a) -> ST s ()
- hashUnique :: Unique -> Int
- newUnique :: IO Unique
- data Unique
- getEnvironment :: IO [(String, String)]
- withProgName :: String -> IO a -> IO a
- withArgs :: [String] -> IO a -> IO a
- unsetEnv :: String -> IO ()
- setEnv :: String -> String -> IO ()
- lookupEnv :: String -> IO (Maybe String)
- getEnv :: String -> IO String
- getProgName :: IO String
- getArgs :: IO [String]
- getExecutablePath :: IO FilePath
- die :: String -> IO a
- exitSuccess :: IO a
- exitFailure :: IO a
- exitWith :: ExitCode -> IO a
- performGC :: IO ()
- performMajorGC :: IO ()
- performMinorGC :: IO ()
- eqStableName :: StableName a -> StableName b -> Bool
- hashStableName :: StableName a -> Int
- makeStableName :: a -> IO (StableName a)
- data StableName a
- hPrintf :: HPrintfType r => Handle -> String -> r
- printf :: PrintfType r => String -> r
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- makeVersion :: [Int] -> Version
- parseVersion :: ReadP Version
- showVersion :: Version -> String
- data Version = Version {
  - versionBranch :: [Int]
  - versionTags :: [String]
  }
- traceMarkerIO :: String -> IO ()
- traceMarker :: String -> a -> a
- traceEventIO :: String -> IO ()
- traceEvent :: String -> a -> a
- traceStack :: String -> a -> a
- traceShowM :: (Show a, Applicative f) => a -> f ()
- traceM :: Applicative f => String -> f ()
- traceShowId :: Show a => a -> a
- traceShow :: Show a => a -> b -> b
- traceId :: String -> String
- putTraceMsg :: String -> IO ()
- traceIO :: String -> IO ()
- isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
- foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m
- fmapDefault :: Traversable t => (a -> b) -> t a -> t b
- mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- optional :: Alternative f => f a -> f (Maybe a)
- newtype WrappedMonad (m :: * -> *) a = WrapMonad {
  - unwrapMonad :: m a
  }
- newtype WrappedArrow (a :: * -> * -> *) b c = WrapArrow {
  - unwrapArrow :: a b c
  }
- newtype ZipList a = ZipList {
  - getZipList :: [a]
  }
- leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- returnA :: Arrow a => a b b
- class Category a => Arrow (a :: * -> * -> *) where
- newtype Kleisli (m :: * -> *) a b = Kleisli {
  - runKleisli :: a -> m b
  }
- class Arrow a => ArrowZero (a :: * -> * -> *) where
- class ArrowZero a => ArrowPlus (a :: * -> * -> *) where
- class Arrow a => ArrowChoice (a :: * -> * -> *) where
- class Arrow a => ArrowApply (a :: * -> * -> *) where
- newtype ArrowMonad (a :: * -> * -> *) b = ArrowMonad (a () b)
- class Arrow a => ArrowLoop (a :: * -> * -> *) where
- newtype Identity a = Identity {
  - runIdentity :: a
  }
- readIO :: Read a => String -> IO a
- readLn :: Read a => IO a
- appendFile :: FilePath -> String -> IO ()
- writeFile :: FilePath -> String -> IO ()
- readFile :: FilePath -> IO String
- interact :: (String -> String) -> IO ()
- getContents :: IO String
- getLine :: IO String
- getChar :: IO Char
- putStrLn :: String -> IO ()
- putStr :: String -> IO ()
- putChar :: Char -> IO ()
- hClose :: Handle -> IO ()
- registerDelay :: Int -> IO (TVar Bool)
- threadDelay :: Int -> IO ()
- closeFdWith :: (Fd -> IO ()) -> Fd -> IO ()
- ioManagerCapabilitiesChanged :: IO ()
- ensureIOManagerIsRunning :: IO ()
- runHandlers :: ForeignPtr Word8 -> Signal -> IO ()
- setHandler :: Signal -> Maybe (HandlerFun, Dynamic) -> IO (Maybe (HandlerFun, Dynamic))
- type Signal = CInt
- type HandlerFun = ForeignPtr Word8 -> IO ()
- mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a))
- addMVarFinalizer :: MVar a -> IO () -> IO ()
- modifyMVarMasked :: MVar a -> (a -> IO (a, b)) -> IO b
- modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO ()
- modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b
- modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()
- withMVarMasked :: MVar a -> (a -> IO b) -> IO b
- withMVar :: MVar a -> (a -> IO b) -> IO b
- swapMVar :: MVar a -> a -> IO a
- unsafeFixIO :: (a -> IO a) -> IO a
- allowInterrupt :: IO ()
- catches :: IO a -> [Handler a] -> IO a
- data Handler a where
  - Handler :: Handler a
- catchIOError :: IO a -> (IOError -> IO a) -> IO a
- annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError
- modifyIOError :: (IOError -> IOError) -> IO a -> IO a
- ioeSetFileName :: IOError -> FilePath -> IOError
- ioeSetHandle :: IOError -> Handle -> IOError
- ioeSetLocation :: IOError -> String -> IOError
- ioeSetErrorString :: IOError -> String -> IOError
- ioeSetErrorType :: IOError -> IOErrorType -> IOError
- ioeGetFileName :: IOError -> Maybe FilePath
- ioeGetHandle :: IOError -> Maybe Handle
- ioeGetLocation :: IOError -> String
- ioeGetErrorString :: IOError -> String
- ioeGetErrorType :: IOError -> IOErrorType
- isUserErrorType :: IOErrorType -> Bool
- isPermissionErrorType :: IOErrorType -> Bool
- isIllegalOperationErrorType :: IOErrorType -> Bool
- isEOFErrorType :: IOErrorType -> Bool
- isFullErrorType :: IOErrorType -> Bool
- isAlreadyInUseErrorType :: IOErrorType -> Bool
- isDoesNotExistErrorType :: IOErrorType -> Bool
- isAlreadyExistsErrorType :: IOErrorType -> Bool
- userErrorType :: IOErrorType
- permissionErrorType :: IOErrorType
- illegalOperationErrorType :: IOErrorType
- eofErrorType :: IOErrorType
- fullErrorType :: IOErrorType
- alreadyInUseErrorType :: IOErrorType
- doesNotExistErrorType :: IOErrorType
- alreadyExistsErrorType :: IOErrorType
- isUserError :: IOError -> Bool
- isPermissionError :: IOError -> Bool
- isIllegalOperation :: IOError -> Bool
- isEOFError :: IOError -> Bool
- isFullError :: IOError -> Bool
- isAlreadyInUseError :: IOError -> Bool
- isDoesNotExistError :: IOError -> Bool
- isAlreadyExistsError :: IOError -> Bool
- mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
- tryIOError :: IO a -> IO (Either IOError a)
- bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
- bracket_ :: IO a -> IO b -> IO c -> IO c
- finally :: IO a -> IO b -> IO a
- bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
- onException :: IO a -> IO b -> IO a
- tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)
- try :: Exception e => IO a -> IO (Either e a)
- mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a
- handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a
- handle :: Exception e => (e -> IO a) -> IO a -> IO a
- catchJust :: Exception e => (e -> Maybe b) -> IO a -> (b -> IO a) -> IO a
- newtype PatternMatchFail = PatternMatchFail String
- newtype RecSelError = RecSelError String
- newtype RecConError = RecConError String
- newtype RecUpdError = RecUpdError String
- newtype NoMethodError = NoMethodError String
- newtype TypeError = TypeError String
- data NonTermination = NonTermination
- data NestedAtomically = NestedAtomically
- getUncaughtExceptionHandler :: IO (SomeException -> IO ())
- setUncaughtExceptionHandler :: (SomeException -> IO ()) -> IO ()
- reportError :: SomeException -> IO ()
- reportStackOverflow :: IO ()
- writeTVar :: TVar a -> a -> STM ()
- readTVar :: TVar a -> STM a
- readTVarIO :: TVar a -> IO a
- newTVarIO :: a -> IO (TVar a)
- newTVar :: a -> STM (TVar a)
- always :: STM Bool -> STM ()
- alwaysSucceeds :: STM a -> STM ()
- catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a
- throwSTM :: Exception e => e -> STM a
- orElse :: STM a -> STM a -> STM a
- retry :: STM a
- atomically :: STM a -> IO a
- unsafeIOToSTM :: IO a -> STM a
- newStablePtrPrimMVar :: MVar () -> IO (StablePtr PrimMVar)
- mkWeakThreadId :: ThreadId -> IO (Weak ThreadId)
- threadCapability :: ThreadId -> IO (Int, Bool)
- threadStatus :: ThreadId -> IO ThreadStatus
- runSparks :: IO ()
- par :: a -> b -> b
- pseq :: a -> b -> b
- labelThread :: ThreadId -> String -> IO ()
- yield :: IO ()
- myThreadId :: IO ThreadId
- throwTo :: Exception e => ThreadId -> e -> IO ()
- killThread :: ThreadId -> IO ()
- childHandler :: SomeException -> IO ()
- numSparks :: IO Int
- getNumProcessors :: IO Int
- setNumCapabilities :: Int -> IO ()
- getNumCapabilities :: IO Int
- numCapabilities :: Int
- forkOnWithUnmask :: Int -> ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkOn :: Int -> IO () -> IO ThreadId
- forkIOWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkIO :: IO () -> IO ThreadId
- disableAllocationLimit :: IO ()
- enableAllocationLimit :: IO ()
- getAllocationCounter :: IO Int64
- setAllocationCounter :: Int64 -> IO ()
- reportHeapOverflow :: IO ()
- data ThreadId = ThreadId ThreadId#
- data BlockReason
  - = BlockedOnMVar
  - | BlockedOnBlackHole
  - | BlockedOnException
  - | BlockedOnSTM
  - | BlockedOnForeignCall
  - | BlockedOnOther
- data ThreadStatus
  - = ThreadRunning
  - | ThreadFinished
  - | ThreadBlocked BlockReason
  - | ThreadDied
- data PrimMVar
- newtype STM a = STM (State# RealWorld -> (#State# RealWorld, a#))
- data TVar a = TVar (TVar# RealWorld a)
- dynTypeRep :: Dynamic -> SomeTypeRep
- dynApp :: Dynamic -> Dynamic -> Dynamic
- dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
- fromDynamic :: Typeable a => Dynamic -> Maybe a
- fromDyn :: Typeable a => Dynamic -> a -> a
- data Dynamic where
  - Dynamic :: Dynamic
- ioError :: IOError -> IO a
- asyncExceptionFromException :: Exception e => SomeException -> Maybe e
- asyncExceptionToException :: Exception e => e -> SomeException
- data BlockedIndefinitelyOnMVar = BlockedIndefinitelyOnMVar
- data BlockedIndefinitelyOnSTM = BlockedIndefinitelyOnSTM
- data Deadlock = Deadlock
- data AllocationLimitExceeded = AllocationLimitExceeded
- newtype CompactionFailed = CompactionFailed String
- newtype AssertionFailed = AssertionFailed String
- data SomeAsyncException where
  - SomeAsyncException :: SomeAsyncException
- data AsyncException
  - = StackOverflow
  - | HeapOverflow
  - | ThreadKilled
  - | UserInterrupt
- data ArrayException
  - = IndexOutOfBounds String
  - | UndefinedElement String
- data FixIOException = FixIOException
- data ExitCode
  - = ExitSuccess
  - | ExitFailure Int
- data IOErrorType
  - = AlreadyExists
  - | NoSuchThing
  - | ResourceBusy
  - | ResourceExhausted
  - | EOF
  - | IllegalOperation
  - | PermissionDenied
  - | UserError
  - | UnsatisfiedConstraints
  - | SystemError
  - | ProtocolError
  - | OtherError
  - | InvalidArgument
  - | InappropriateType
  - | HardwareFault
  - | UnsupportedOperation
  - | TimeExpired
  - | ResourceVanished
  - | Interrupted
- data Handle
- atomicWriteIORef :: IORef a -> a -> IO ()
- atomicModifyIORef' :: IORef a -> (a -> (a, b)) -> IO b
- atomicModifyIORef :: IORef a -> (a -> (a, b)) -> IO b
- modifyIORef' :: IORef a -> (a -> a) -> IO ()
- modifyIORef :: IORef a -> (a -> a) -> IO ()
- mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))
- mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)
- mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)
- newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a)
- withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
- newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
- finalizeForeignPtr :: ForeignPtr a -> IO ()
- plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b
- castForeignPtr :: ForeignPtr a -> ForeignPtr b
- touchForeignPtr :: ForeignPtr a -> IO ()
- newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)
- addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
- addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()
- mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)
- mallocForeignPtr :: Storable a => IO (ForeignPtr a)
- data ForeignPtr a
- type FinalizerPtr a = FunPtr (Ptr a -> IO ())
- type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ())
- writeIORef :: IORef a -> a -> IO ()
- readIORef :: IORef a -> IO a
- newIORef :: a -> IO (IORef a)
- data IORef a
- evaluate :: a -> IO a
- uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
- uninterruptibleMask_ :: IO a -> IO a
- mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
- mask_ :: IO a -> IO a
- getMaskingState :: IO MaskingState
- interruptible :: IO a -> IO a
- throwIO :: Exception e => e -> IO a
- catch :: Exception e => IO a -> (e -> IO a) -> IO a
- stToIO :: ST RealWorld a -> IO a
- type FilePath = String
- data MaskingState
  - = Unmasked
  - | MaskedInterruptible
  - | MaskedUninterruptible
- userError :: String -> IOError
- data IOException = IOError {
  - ioe_handle :: Maybe Handle
  - ioe_type :: IOErrorType
  - ioe_location :: String
  - ioe_description :: String
  - ioe_errno :: Maybe CInt
  - ioe_filename :: Maybe FilePath
  }
- type IOError = IOException
- throw :: Exception e => e -> a
- class (Typeable e, Show e) => Exception e where
- data ErrorCall where
  - ErrorCallWithLocation String String
  - pattern ErrorCall :: String -> ErrorCall
- data ArithException
  - = Overflow
  - | Underflow
  - | LossOfPrecision
  - | DivideByZero
  - | Denormal
  - | RatioZeroDenominator
- typeOf7 :: Typeable t => t a b c d e f g -> TypeRep
- typeOf6 :: Typeable t => t a b c d e f -> TypeRep
- typeOf5 :: Typeable t => t a b c d e -> TypeRep
- typeOf4 :: Typeable t => t a b c d -> TypeRep
- typeOf3 :: Typeable t => t a b c -> TypeRep
- typeOf2 :: Typeable t => t a b -> TypeRep
- typeOf1 :: Typeable t => t a -> TypeRep
- rnfTypeRep :: TypeRep -> ()
- typeRepFingerprint :: TypeRep -> Fingerprint
- typeRepTyCon :: TypeRep -> TyCon
- typeRepArgs :: TypeRep -> [TypeRep]
- splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
- mkFunTy :: TypeRep -> TypeRep -> TypeRep
- funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
- gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b))
- gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a))
- gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)
- eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)
- cast :: (Typeable a, Typeable b) => a -> Maybe b
- showsTypeRep :: TypeRep -> ShowS
- typeRep :: Typeable a => proxy a -> TypeRep
- typeOf :: Typeable a => a -> TypeRep
- type TypeRep = SomeTypeRep
- rnfTyCon :: TyCon -> ()
- tyConFingerprint :: TyCon -> Fingerprint
- tyConName :: TyCon -> String
- tyConModule :: TyCon -> String
- tyConPackage :: TyCon -> String
- newtype Const a (b :: k) :: forall k. * -> k -> * = Const {
  - getConst :: a
  }
- find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- or :: Foldable t => t Bool -> Bool
- and :: Foldable t => t Bool -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- concat :: Foldable t => t [a] -> [a]
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
- stimesMonoid :: (Integral b, Monoid a) => b -> a -> a
- stimesIdempotent :: Integral b => b -> a -> a
- newtype Dual a = Dual {
  - getDual :: a
  }
- newtype Endo a = Endo {
  - appEndo :: a -> a
  }
- newtype All = All {
  - getAll :: Bool
  }
- newtype Any = Any {
  - getAny :: Bool
  }
- newtype Sum a = Sum {
  - getSum :: a
  }
- newtype Product a = Product {
  - getProduct :: a
  }
- newtype Alt (f :: k -> *) (a :: k) :: forall k. (k -> *) -> k -> * = Alt {
  - getAlt :: f a
  }
- unsafeCoerce :: a -> b
- unwords :: [String] -> String
- words :: String -> [String]
- unlines :: [String] -> String
- lines :: String -> [String]
- unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- sortOn :: Ord b => (a -> b) -> [a] -> [a]
- sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- sort :: Ord a => [a] -> [a]
- permutations :: [a] -> [[a]]
- subsequences :: [a] -> [[a]]
- tails :: [a] -> [[a]]
- inits :: [a] -> [[a]]
- groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
- group :: Eq a => [a] -> [[a]]
- deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
- unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
- unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
- unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
- zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
- zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
- zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
- zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
- zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
- zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
- zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
- zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
- genericReplicate :: Integral i => i -> a -> [a]
- genericIndex :: Integral i => [a] -> i -> a
- genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- genericDrop :: Integral i => i -> [a] -> [a]
- genericTake :: Integral i => i -> [a] -> [a]
- genericLength :: Num i => [a] -> i
- insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
- insert :: Ord a => a -> [a] -> [a]
- partition :: (a -> Bool) -> [a] -> ([a], [a])
- transpose :: [[a]] -> [[a]]
- intercalate :: [a] -> [[a]] -> [a]
- intersperse :: a -> [a] -> [a]
- intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- intersect :: Eq a => [a] -> [a] -> [a]
- unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- union :: Eq a => [a] -> [a] -> [a]
- (\\) :: Eq a => [a] -> [a] -> [a]
- deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
- delete :: Eq a => a -> [a] -> [a]
- nubBy :: (a -> a -> Bool) -> [a] -> [a]
- nub :: Eq a => [a] -> [a]
- isInfixOf :: Eq a => [a] -> [a] -> Bool
- isSuffixOf :: Eq a => [a] -> [a] -> Bool
- isPrefixOf :: Eq a => [a] -> [a] -> Bool
- findIndices :: (a -> Bool) -> [a] -> [Int]
- findIndex :: (a -> Bool) -> [a] -> Maybe Int
- elemIndices :: Eq a => a -> [a] -> [Int]
- elemIndex :: Eq a => a -> [a] -> Maybe Int
- stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]
- dropWhileEnd :: (a -> Bool) -> [a] -> [a]
- isSeparator :: Char -> Bool
- isNumber :: Char -> Bool
- isMark :: Char -> Bool
- isLetter :: Char -> Bool
- digitToInt :: Char -> Int
- read :: Read a => String -> a
- readMaybe :: Read a => String -> Maybe a
- readEither :: Read a => String -> Either String a
- reads :: Read a => ReadS a
- fromRight :: b -> Either a b -> b
- fromLeft :: a -> Either a b -> a
- isRight :: Either a b -> Bool
- isLeft :: Either a b -> Bool
- partitionEithers :: [Either a b] -> ([a], [b])
- rights :: [Either a b] -> [b]
- lefts :: [Either a b] -> [a]
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- newtype Down a = Down a
- asProxyTypeOf :: a -> proxy a -> a
- data Proxy (t :: k) :: forall k. k -> * = Proxy
- data KProxy t = KProxy
- (>>>) :: Category cat => cat a b -> cat b c -> cat a c
- (<<<) :: Category cat => cat b c -> cat a b -> cat a c
- class Category (cat :: k -> k -> *) where
- data (a :: k) :~: (b :: k) :: forall k. k -> k -> * where
  - Refl :: a :~: a
- data (a :: k1) :~~: (b :: k2) :: forall k1 k2. k1 -> k2 -> * where
  - HRefl :: a :~~: a
- intPtrToPtr :: IntPtr -> Ptr a
- ptrToIntPtr :: Ptr a -> IntPtr
- wordPtrToPtr :: WordPtr -> Ptr a
- ptrToWordPtr :: Ptr a -> WordPtr
- freeHaskellFunPtr :: FunPtr a -> IO ()
- newtype WordPtr = WordPtr Word
- newtype IntPtr = IntPtr Int
- class Storable a where
- castPtrToStablePtr :: Ptr () -> StablePtr a
- castStablePtrToPtr :: StablePtr a -> Ptr ()
- deRefStablePtr :: StablePtr a -> IO a
- freeStablePtr :: StablePtr a -> IO ()
- castPtrToFunPtr :: Ptr a -> FunPtr b
- castFunPtrToPtr :: FunPtr a -> Ptr b
- castFunPtr :: FunPtr a -> FunPtr b
- nullFunPtr :: FunPtr a
- minusPtr :: Ptr a -> Ptr b -> Int
- alignPtr :: Ptr a -> Int -> Ptr a
- plusPtr :: Ptr a -> Int -> Ptr b
- castPtr :: Ptr a -> Ptr b
- nullPtr :: Ptr a
- showOct :: (Integral a, Show a) => a -> ShowS
- showHex :: (Integral a, Show a) => a -> ShowS
- showIntAtBase :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS
- showHFloat :: RealFloat a => a -> ShowS
- showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS
- showGFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showFFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showEFloat :: RealFloat a => Maybe Int -> a -> ShowS
- showInt :: Integral a => a -> ShowS
- readSigned :: Real a => ReadS a -> ReadS a
- readFloat :: RealFrac a => ReadS a
- readHex :: (Eq a, Num a) => ReadS a
- readDec :: (Eq a, Num a) => ReadS a
- readOct :: (Eq a, Num a) => ReadS a
- readInt :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
- lexDigits :: ReadS String
- readLitChar :: ReadS Char
- lexLitChar :: ReadS String
- lex :: ReadS String
- readParen :: Bool -> ReadS a -> ReadS a
- readS_to_Prec :: (Int -> ReadS a) -> ReadPrec a
- readPrec_to_S :: ReadPrec a -> Int -> ReadS a
- readP_to_Prec :: (Int -> ReadP a) -> ReadPrec a
- readPrec_to_P :: ReadPrec a -> Int -> ReadP a
- data ReadPrec a
- readS_to_P :: ReadS a -> ReadP a
- readP_to_S :: ReadP a -> ReadS a
- type ReadS a = String -> [(a, String)]
- data ReadP a
- fromRat :: RealFloat a => Rational -> a
- floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)
- showFloat :: RealFloat a => a -> ShowS
- byteSwap64 :: Word64 -> Word64
- byteSwap32 :: Word32 -> Word32
- byteSwap16 :: Word16 -> Word16
- toTitle :: Char -> Char
- toUpper :: Char -> Char
- toLower :: Char -> Char
- isLower :: Char -> Bool
- isUpper :: Char -> Bool
- isPrint :: Char -> Bool
- isControl :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isAlpha :: Char -> Bool
- isSymbol :: Char -> Bool
- isPunctuation :: Char -> Bool
- isHexDigit :: Char -> Bool
- isOctDigit :: Char -> Bool
- isDigit :: Char -> Bool
- isSpace :: Char -> Bool
- isAsciiUpper :: Char -> Bool
- isAsciiLower :: Char -> Bool
- isLatin1 :: Char -> Bool
- isAscii :: Char -> Bool
- generalCategory :: Char -> GeneralCategory
- data GeneralCategory
  - = UppercaseLetter
  - | LowercaseLetter
  - | TitlecaseLetter
  - | ModifierLetter
  - | OtherLetter
  - | NonSpacingMark
  - | SpacingCombiningMark
  - | EnclosingMark
  - | DecimalNumber
  - | LetterNumber
  - | OtherNumber
  - | ConnectorPunctuation
  - | DashPunctuation
  - | OpenPunctuation
  - | ClosePunctuation
  - | InitialQuote
  - | FinalQuote
  - | OtherPunctuation
  - | MathSymbol
  - | CurrencySymbol
  - | ModifierSymbol
  - | OtherSymbol
  - | Space
  - | LineSeparator
  - | ParagraphSeparator
  - | Control
  - | Format
  - | Surrogate
  - | PrivateUse
  - | NotAssigned
- writeSTRef :: STRef s a -> a -> ST s ()
- readSTRef :: STRef s a -> ST s a
- newSTRef :: a -> ST s (STRef s a)
- data STRef s a
- runST :: (forall s. ST s a) -> a
- fixST :: (a -> ST s a) -> ST s a
- data ST s a
- toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b
- popCountDefault :: (Bits a, Num a) => a -> Int
- testBitDefault :: (Bits a, Num a) => a -> Int -> Bool
- bitDefault :: (Bits a, Num a) => Int -> a
- class Eq a => Bits a where
- class Bits b => FiniteBits b where
- bool :: a -> a -> Bool -> a
- (&) :: a -> (a -> b) -> b
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- fix :: (a -> a) -> a
- void :: Functor f => f a -> f ()
- ($>) :: Functor f => f a -> b -> f b
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- lcm :: Integral a => a -> a -> a
- gcd :: Integral a => a -> a -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- (^) :: (Num a, Integral b) => a -> b -> a
- odd :: Integral a => a -> Bool
- even :: Integral a => a -> Bool
- showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS
- denominator :: Ratio a -> a
- numerator :: Ratio a -> a
- (%) :: Integral a => a -> a -> Ratio a
- chr :: Int -> Char
- intToDigit :: Int -> Char
- showLitChar :: Char -> ShowS
- showParen :: Bool -> ShowS -> ShowS
- showString :: String -> ShowS
- showChar :: Char -> ShowS
- shows :: Show a => a -> ShowS
- type ShowS = String -> String
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- unzip :: [(a, b)] -> ([a], [b])
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- (!!) :: [a] -> Int -> a
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- reverse :: [a] -> [a]
- break :: (a -> Bool) -> [a] -> ([a], [a])
- span :: (a -> Bool) -> [a] -> ([a], [a])
- splitAt :: Int -> [a] -> ([a], [a])
- drop :: Int -> [a] -> [a]
- take :: Int -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- takeWhile :: (a -> Bool) -> [a] -> [a]
- cycle :: [a] -> [a]
- replicate :: Int -> a -> [a]
- repeat :: a -> [a]
- iterate' :: (a -> a) -> a -> [a]
- iterate :: (a -> a) -> a -> [a]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- foldl1' :: (a -> a -> a) -> [a] -> a
- init :: [a] -> [a]
- last :: [a] -> a
- tail :: [a] -> [a]
- uncons :: [a] -> Maybe (a, [a])
- head :: [a] -> a
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- catMaybes :: [Maybe a] -> [a]
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- fromMaybe :: a -> Maybe a -> a
- fromJust :: Maybe a -> a
- isNothing :: Maybe a -> Bool
- isJust :: Maybe a -> Bool
- maybe :: b -> (a -> b) -> Maybe a -> b
- swap :: (a, b) -> (b, a)
- uncurry :: (a -> b -> c) -> (a, b) -> c
- curry :: ((a, b) -> c) -> a -> b -> c
- unsafeInterleaveIO :: IO a -> IO a
- unsafeDupablePerformIO :: IO a -> a
- unsafePerformIO :: IO a -> a
- isEmptyMVar :: MVar a -> IO Bool
- tryReadMVar :: MVar a -> IO (Maybe a)
- tryPutMVar :: MVar a -> a -> IO Bool
- tryTakeMVar :: MVar a -> IO (Maybe a)
- putMVar :: MVar a -> a -> IO ()
- readMVar :: MVar a -> IO a
- takeMVar :: MVar a -> IO a
- newMVar :: a -> IO (MVar a)
- newEmptyMVar :: IO (MVar a)
- data MVar a
- subtract :: Num a => a -> a -> a
- asTypeOf :: a -> a -> a
- until :: (a -> Bool) -> (a -> a) -> a -> a
- ($!) :: (a -> b) -> a -> b
- flip :: (a -> b -> c) -> b -> a -> c
- const :: a -> b -> a
- ord :: Char -> Int
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- liftA :: Applicative f => (a -> b) -> f a -> f b
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- class Applicative f => Alternative (f :: * -> *) where
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
- data NonEmpty a = a :| [a]
- type String = [Char]
- undefined :: HasCallStack => a
- errorWithoutStackTrace :: [Char] -> a
- error :: HasCallStack => [Char] -> a
- data SomeException where
  - SomeException :: SomeException
- stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- bool :: a -> a -> Bool -> a
- (&) :: a -> (a -> b) -> b
- ($>) :: Functor f => f a -> b -> f b
- isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
- sortOn :: Ord b => (a -> b) -> [a] -> [a]
- uncons :: [a] -> Maybe (a, [a])
- traceShowId :: Show a => a -> a
- traceM :: Applicative f => String -> f ()
- traceShowM :: (Show a, Applicative f) => a -> f ()

# Documentation

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

Append two lists, i.e.,

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

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

seq :: a -> b -> b #

The value of `seq a b` is bottom if `a` is bottom, and otherwise equal to `b`. In other words, it evaluates the first argument `a` to weak head normal form (WHNF). `seq` is usually introduced to improve performance by avoiding unneeded laziness.

A note on evaluation order: the expression `seq a b` does not guarantee that `a` will be evaluated before `b`. The only guarantee given by `seq` is that the both `a` and `b` will be evaluated before `seq` returns a value. In particular, this means that `b` may be evaluated before `a`. If you need to guarantee a specific order of evaluation, you must use the function `pseq` from the "parallel" package.

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

`filter`, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

    filter p xs = [ x | x <- xs, p x]

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

`zip` takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.

`zip` is right-lazy:

    zip [] _|_ = []

newStablePtr :: a -> IO (StablePtr a) #

Create a stable pointer referring to the given Haskell value.

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]])

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

Extract the first component of a pair.

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

Extract the second component of a pair.

otherwise :: Bool #

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

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

assert :: Bool -> a -> a #

If the first argument evaluates to `True`, then the result is the second argument. Otherwise an `AssertionFailed` exception is raised, containing a `String` with the source file and line number of the call to `assert`.

Assertions can normally be turned on or off with a compiler flag (for GHC, assertions are normally on unless optimisation is turned on with `-O` or the `-fignore-asserts` option is given). When assertions are turned off, the first argument to `assert` is ignored, and the second argument is returned as the result.

lazy :: a -> a #

The `lazy` function restrains strictness analysis a little. The call `lazy e` means the same as `e`, but `lazy` has a magical property so far as strictness analysis is concerned: it is lazy in its first argument, even though its semantics is strict. After strictness analysis has run, calls to `lazy` are inlined to be the identity function.

This behaviour is occasionally useful when controlling evaluation order. Notably, `lazy` is used in the library definition of `par`:

    par :: a -> b -> b
    par x y = case (par# x) of _ -> lazy y

If `lazy` were not lazy, `par` would look strict in `y` which would defeat the whole purpose of `par`.

Like `seq`, the argument of `lazy` can have an unboxed type.

assertError :: (?callStack :: CallStack) => Bool -> a -> a #

trace :: String -> a -> a #

The `trace` function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of `f x` but first outputs the message.

    >>> let x = 123; f = show
    >>> trace ("calling f with x = " ++ show x) (f x)
    "calling f with x = 123
    123"

The `trace` function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

inline :: a -> a #

The call `inline f` arranges that `f` is inlined, regardless of its size. More precisely, the call `inline f` rewrites to the right-hand side of `f`'s definition. This allows the programmer to control inlining from a particular call site rather than the definition site of the function (c.f. `INLINE` pragmas).

This inlining occurs regardless of the argument to the call or the size of `f`'s definition; it is unconditional. The main caveat is that `f`'s definition must be visible to the compiler; it is therefore recommended to mark the function with an `INLINABLE` pragma at its definition so that GHC guarantees to record its unfolding regardless of size.

If no inlining takes place, the `inline` function expands to the identity function in Phase zero, so its use imposes no overhead.

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

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

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

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

The `groupWith` function uses the user supplied function which projects an element out of every list element in order to first sort the input list and then to form groups by equality on these projected elements

($) :: (a -> b) -> a -> b infixr 0 #

Application operator. This operator is redundant, since ordinary application `(f x)` means the same as `(f `$` x)`. However, `$` has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:

    f $ g $ h x  =  f (g (h x))

It is also useful in higher-order situations, such as ``map` (`$` 0) xs`, or ``zipWith` (`$`) fs xs`.

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

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

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

general coercion from integral types

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

general coercion to fractional types

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

Conditional failure of `Alternative` computations. Defined by

    guard True  = pure ()
    guard False = empty

#### Examples

Expand

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

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

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

A definition of `safeDiv` using guards, but not `guard`:

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

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

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

toDyn :: Typeable a => a -> Dynamic #

Converts an arbitrary value into an object of type `Dynamic`.

The type of the object must be an instance of `Typeable`, which ensures that only monomorphically-typed objects may be converted to `Dynamic`. To convert a polymorphic object into `Dynamic`, give it a monomorphic type signature. For example:

       toDyn (id :: Int -> Int)

join :: Monad m => m (m a) -> m a #

The `join` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.

class Bounded a where #

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

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

Minimal complete definition

minBound, maxBound

Methods

minBound :: a #

maxBound :: a #

Instances

Bounded Bool | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Bool # maxBound :: Bool #
Bounded Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Char # maxBound :: Char #
Bounded Int | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Int # maxBound :: Int #
Bounded Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int8 # maxBound :: Int8 #
Bounded Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int16 # maxBound :: Int16 #
Bounded Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int32 # maxBound :: Int32 #
Bounded Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int64 # maxBound :: Int64 #
Bounded Ordering | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Ordering # maxBound :: Ordering #
Bounded Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Word # maxBound :: Word #
Bounded Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word8 # maxBound :: Word8 #
Bounded Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word16 # maxBound :: Word16 #
Bounded Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word32 # maxBound :: Word32 #
Bounded Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word64 # maxBound :: Word64 #
Bounded VecCount | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods minBound :: VecCount # maxBound :: VecCount #
Bounded VecElem | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods minBound :: VecElem # maxBound :: VecElem #
Bounded () | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: () # maxBound :: () #
Bounded CDev |
Instance details Defined in System.Posix.Types Methods minBound :: CDev # maxBound :: CDev #
Bounded CIno |
Instance details Defined in System.Posix.Types Methods minBound :: CIno # maxBound :: CIno #
Bounded CMode |
Instance details Defined in System.Posix.Types Methods minBound :: CMode # maxBound :: CMode #
Bounded COff |
Instance details Defined in System.Posix.Types Methods minBound :: COff # maxBound :: COff #
Bounded CPid |
Instance details Defined in System.Posix.Types Methods minBound :: CPid # maxBound :: CPid #
Bounded CSsize |
Instance details Defined in System.Posix.Types Methods minBound :: CSsize # maxBound :: CSsize #
Bounded CGid |
Instance details Defined in System.Posix.Types Methods minBound :: CGid # maxBound :: CGid #
Bounded CNlink |
Instance details Defined in System.Posix.Types Methods minBound :: CNlink # maxBound :: CNlink #
Bounded CUid |
Instance details Defined in System.Posix.Types Methods minBound :: CUid # maxBound :: CUid #
Bounded CTcflag |
Instance details Defined in System.Posix.Types Methods minBound :: CTcflag # maxBound :: CTcflag #
Bounded CRLim |
Instance details Defined in System.Posix.Types Methods minBound :: CRLim # maxBound :: CRLim #
Bounded CBlkSize |
Instance details Defined in System.Posix.Types Methods minBound :: CBlkSize # maxBound :: CBlkSize #
Bounded CBlkCnt |
Instance details Defined in System.Posix.Types Methods minBound :: CBlkCnt # maxBound :: CBlkCnt #
Bounded CClockId |
Instance details Defined in System.Posix.Types Methods minBound :: CClockId # maxBound :: CClockId #
Bounded CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods minBound :: CFsBlkCnt # maxBound :: CFsBlkCnt #
Bounded CFsFilCnt |
Instance details Defined in System.Posix.Types Methods minBound :: CFsFilCnt # maxBound :: CFsFilCnt #
Bounded CId |
Instance details Defined in System.Posix.Types Methods minBound :: CId # maxBound :: CId #
Bounded CKey |
Instance details Defined in System.Posix.Types Methods minBound :: CKey # maxBound :: CKey #
Bounded Fd |
Instance details Defined in System.Posix.Types Methods minBound :: Fd # maxBound :: Fd #
Bounded All |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: All # maxBound :: All #
Bounded Any |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Any # maxBound :: Any #
Bounded Associativity |
Instance details Defined in GHC.Generics Methods minBound :: Associativity # maxBound :: Associativity #
Bounded SourceUnpackedness |
Instance details Defined in GHC.Generics Methods minBound :: SourceUnpackedness # maxBound :: SourceUnpackedness #
Bounded SourceStrictness |
Instance details Defined in GHC.Generics Methods minBound :: SourceStrictness # maxBound :: SourceStrictness #
Bounded DecidedStrictness |
Instance details Defined in GHC.Generics Methods minBound :: DecidedStrictness # maxBound :: DecidedStrictness #
Bounded CChar |
Instance details Defined in Foreign.C.Types Methods minBound :: CChar # maxBound :: CChar #
Bounded CSChar |
Instance details Defined in Foreign.C.Types Methods minBound :: CSChar # maxBound :: CSChar #
Bounded CUChar |
Instance details Defined in Foreign.C.Types Methods minBound :: CUChar # maxBound :: CUChar #
Bounded CShort |
Instance details Defined in Foreign.C.Types Methods minBound :: CShort # maxBound :: CShort #
Bounded CUShort |
Instance details Defined in Foreign.C.Types Methods minBound :: CUShort # maxBound :: CUShort #
Bounded CInt |
Instance details Defined in Foreign.C.Types Methods minBound :: CInt # maxBound :: CInt #
Bounded CUInt |
Instance details Defined in Foreign.C.Types Methods minBound :: CUInt # maxBound :: CUInt #
Bounded CLong |
Instance details Defined in Foreign.C.Types Methods minBound :: CLong # maxBound :: CLong #
Bounded CULong |
Instance details Defined in Foreign.C.Types Methods minBound :: CULong # maxBound :: CULong #
Bounded CLLong |
Instance details Defined in Foreign.C.Types Methods minBound :: CLLong # maxBound :: CLLong #
Bounded CULLong |
Instance details Defined in Foreign.C.Types Methods minBound :: CULLong # maxBound :: CULLong #
Bounded CBool |
Instance details Defined in Foreign.C.Types Methods minBound :: CBool # maxBound :: CBool #
Bounded CPtrdiff |
Instance details Defined in Foreign.C.Types Methods minBound :: CPtrdiff # maxBound :: CPtrdiff #
Bounded CSize |
Instance details Defined in Foreign.C.Types Methods minBound :: CSize # maxBound :: CSize #
Bounded CWchar |
Instance details Defined in Foreign.C.Types Methods minBound :: CWchar # maxBound :: CWchar #
Bounded CSigAtomic |
Instance details Defined in Foreign.C.Types Methods minBound :: CSigAtomic # maxBound :: CSigAtomic #
Bounded CIntPtr |
Instance details Defined in Foreign.C.Types Methods minBound :: CIntPtr # maxBound :: CIntPtr #
Bounded CUIntPtr |
Instance details Defined in Foreign.C.Types Methods minBound :: CUIntPtr # maxBound :: CUIntPtr #
Bounded CIntMax |
Instance details Defined in Foreign.C.Types Methods minBound :: CIntMax # maxBound :: CIntMax #
Bounded CUIntMax |
Instance details Defined in Foreign.C.Types Methods minBound :: CUIntMax # maxBound :: CUIntMax #
Bounded WordPtr |
Instance details Defined in Foreign.Ptr Methods minBound :: WordPtr # maxBound :: WordPtr #
Bounded IntPtr |
Instance details Defined in Foreign.Ptr Methods minBound :: IntPtr # maxBound :: IntPtr #
Bounded GeneralCategory |
Instance details Defined in GHC.Unicode Methods minBound :: GeneralCategory # maxBound :: GeneralCategory #
Bounded a => Bounded (Min a) |
Instance details Defined in Data.Semigroup Methods minBound :: Min a # maxBound :: Min a #
Bounded a => Bounded (Max a) |
Instance details Defined in Data.Semigroup Methods minBound :: Max a # maxBound :: Max a #
Bounded a => Bounded (First a) |
Instance details Defined in Data.Semigroup Methods minBound :: First a # maxBound :: First a #
Bounded a => Bounded (Last a) |
Instance details Defined in Data.Semigroup Methods minBound :: Last a # maxBound :: Last a #
Bounded m => Bounded (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods minBound :: WrappedMonoid m # maxBound :: WrappedMonoid m #
Bounded a => Bounded (Identity a) |
Instance details Defined in Data.Functor.Identity Methods minBound :: Identity a # maxBound :: Identity a #
Bounded a => Bounded (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Dual a # maxBound :: Dual a #
Bounded a => Bounded (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Sum a # maxBound :: Sum a #
Bounded a => Bounded (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Product a # maxBound :: Product a #
(Bounded a, Bounded b) => Bounded (a, b) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b) # maxBound :: (a, b) #
Bounded (Proxy t) |
Instance details Defined in Data.Proxy Methods minBound :: Proxy t # maxBound :: Proxy t #
(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c) # maxBound :: (a, b, c) #
Bounded a => Bounded (Const a b) |
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b # maxBound :: Const a b #
a ~ b => Bounded (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~: b # maxBound :: a :~: b #
(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d) # maxBound :: (a, b, c, d) #
a ~~ b => Bounded (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~~: b # maxBound :: a :~~: b #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e) # maxBound :: (a, b, c, d, e) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f) # maxBound :: (a, b, c, d, e, f) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g) # maxBound :: (a, b, c, d, e, f, g) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h) # maxBound :: (a, b, c, d, e, f, g, h) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i) # maxBound :: (a, b, c, d, e, f, g, h, i) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j) # maxBound :: (a, b, c, d, e, f, g, h, i, j) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Enum a where #

Class `Enum` defines operations on sequentially ordered types.

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

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

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

- The calls ``succ` `maxBound`` and ``pred` `minBound`` should result in a runtime error.
- `fromEnum` and `toEnum` should give a runtime error if the result value is not representable in the result type. For example, ``toEnum` 7 :: `Bool`` is an error.
- `enumFrom` and `enumFromThen` should be defined with an implicit bound, thus:

       enumFrom     x   = enumFromTo     x maxBound
       enumFromThen x y = enumFromThenTo x y bound
         where
           bound | fromEnum y >= fromEnum x = maxBound
                 | otherwise                = minBound

Minimal complete definition

toEnum, fromEnum

Methods

succ :: a -> a #

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

pred :: a -> a #

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

toEnum :: Int -> a #

Convert from an `Int`.

fromEnum :: a -> Int #

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

enumFrom :: a -> [a] #

Used in Haskell's translation of `[n..]`.

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

Used in Haskell's translation of `[n,n'..]`.

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

Used in Haskell's translation of `[n..m]`.

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

Used in Haskell's translation of `[n,n'..m]`.

Instances

Enum Bool | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Bool -> Bool # pred :: Bool -> Bool # toEnum :: Int -> Bool # fromEnum :: Bool -> Int # enumFrom :: Bool -> [Bool] # enumFromThen :: Bool -> Bool -> [Bool] # enumFromTo :: Bool -> Bool -> [Bool] # enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #
Enum Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Char -> Char # pred :: Char -> Char # toEnum :: Int -> Char # fromEnum :: Char -> Int # enumFrom :: Char -> [Char] # enumFromThen :: Char -> Char -> [Char] # enumFromTo :: Char -> Char -> [Char] # enumFromThenTo :: Char -> Char -> Char -> [Char] #
Enum Int | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Int -> Int # pred :: Int -> Int # toEnum :: Int -> Int # fromEnum :: Int -> Int # enumFrom :: Int -> [Int] # enumFromThen :: Int -> Int -> [Int] # enumFromTo :: Int -> Int -> [Int] # enumFromThenTo :: Int -> Int -> Int -> [Int] #
Enum Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int8 -> Int8 # pred :: Int8 -> Int8 # toEnum :: Int -> Int8 # fromEnum :: Int8 -> Int # enumFrom :: Int8 -> [Int8] # enumFromThen :: Int8 -> Int8 -> [Int8] # enumFromTo :: Int8 -> Int8 -> [Int8] # enumFromThenTo :: Int8 -> Int8 -> Int8 -> [Int8] #
Enum Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int16 -> Int16 # pred :: Int16 -> Int16 # toEnum :: Int -> Int16 # fromEnum :: Int16 -> Int # enumFrom :: Int16 -> [Int16] # enumFromThen :: Int16 -> Int16 -> [Int16] # enumFromTo :: Int16 -> Int16 -> [Int16] # enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] #
Enum Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int32 -> Int32 # pred :: Int32 -> Int32 # toEnum :: Int -> Int32 # fromEnum :: Int32 -> Int # enumFrom :: Int32 -> [Int32] # enumFromThen :: Int32 -> Int32 -> [Int32] # enumFromTo :: Int32 -> Int32 -> [Int32] # enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] #
Enum Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int64 -> Int64 # pred :: Int64 -> Int64 # toEnum :: Int -> Int64 # fromEnum :: Int64 -> Int # enumFrom :: Int64 -> [Int64] # enumFromThen :: Int64 -> Int64 -> [Int64] # enumFromTo :: Int64 -> Int64 -> [Int64] # enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] #
Enum Integer | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Integer -> Integer # pred :: Integer -> Integer # toEnum :: Int -> Integer # fromEnum :: Integer -> Int # enumFrom :: Integer -> [Integer] # enumFromThen :: Integer -> Integer -> [Integer] # enumFromTo :: Integer -> Integer -> [Integer] # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] #
Enum Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods succ :: Natural -> Natural # pred :: Natural -> Natural # toEnum :: Int -> Natural # fromEnum :: Natural -> Int # enumFrom :: Natural -> [Natural] # enumFromThen :: Natural -> Natural -> [Natural] # enumFromTo :: Natural -> Natural -> [Natural] # enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] #
Enum Ordering | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Ordering -> Ordering # pred :: Ordering -> Ordering # toEnum :: Int -> Ordering # fromEnum :: Ordering -> Int # enumFrom :: Ordering -> [Ordering] # enumFromThen :: Ordering -> Ordering -> [Ordering] # enumFromTo :: Ordering -> Ordering -> [Ordering] # enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] #
Enum Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Word -> Word # pred :: Word -> Word # toEnum :: Int -> Word # fromEnum :: Word -> Int # enumFrom :: Word -> [Word] # enumFromThen :: Word -> Word -> [Word] # enumFromTo :: Word -> Word -> [Word] # enumFromThenTo :: Word -> Word -> Word -> [Word] #
Enum Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word8 -> Word8 # pred :: Word8 -> Word8 # toEnum :: Int -> Word8 # fromEnum :: Word8 -> Int # enumFrom :: Word8 -> [Word8] # enumFromThen :: Word8 -> Word8 -> [Word8] # enumFromTo :: Word8 -> Word8 -> [Word8] # enumFromThenTo :: Word8 -> Word8 -> Word8 -> [Word8] #
Enum Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word16 -> Word16 # pred :: Word16 -> Word16 # toEnum :: Int -> Word16 # fromEnum :: Word16 -> Int # enumFrom :: Word16 -> [Word16] # enumFromThen :: Word16 -> Word16 -> [Word16] # enumFromTo :: Word16 -> Word16 -> [Word16] # enumFromThenTo :: Word16 -> Word16 -> Word16 -> [Word16] #
Enum Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word32 -> Word32 # pred :: Word32 -> Word32 # toEnum :: Int -> Word32 # fromEnum :: Word32 -> Int # enumFrom :: Word32 -> [Word32] # enumFromThen :: Word32 -> Word32 -> [Word32] # enumFromTo :: Word32 -> Word32 -> [Word32] # enumFromThenTo :: Word32 -> Word32 -> Word32 -> [Word32] #
Enum Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word64 -> Word64 # pred :: Word64 -> Word64 # toEnum :: Int -> Word64 # fromEnum :: Word64 -> Int # enumFrom :: Word64 -> [Word64] # enumFromThen :: Word64 -> Word64 -> [Word64] # enumFromTo :: Word64 -> Word64 -> [Word64] # enumFromThenTo :: Word64 -> Word64 -> Word64 -> [Word64] #
Enum VecCount | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods succ :: VecCount -> VecCount # pred :: VecCount -> VecCount # toEnum :: Int -> VecCount # fromEnum :: VecCount -> Int # enumFrom :: VecCount -> [VecCount] # enumFromThen :: VecCount -> VecCount -> [VecCount] # enumFromTo :: VecCount -> VecCount -> [VecCount] # enumFromThenTo :: VecCount -> VecCount -> VecCount -> [VecCount] #
Enum VecElem | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods succ :: VecElem -> VecElem # pred :: VecElem -> VecElem # toEnum :: Int -> VecElem # fromEnum :: VecElem -> Int # enumFrom :: VecElem -> [VecElem] # enumFromThen :: VecElem -> VecElem -> [VecElem] # enumFromTo :: VecElem -> VecElem -> [VecElem] # enumFromThenTo :: VecElem -> VecElem -> VecElem -> [VecElem] #
Enum () | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: () -> () # pred :: () -> () # toEnum :: Int -> () # fromEnum :: () -> Int # enumFrom :: () -> [()] # enumFromThen :: () -> () -> [()] # enumFromTo :: () -> () -> [()] # enumFromThenTo :: () -> () -> () -> [()] #
Enum CDev |
Instance details Defined in System.Posix.Types Methods succ :: CDev -> CDev # pred :: CDev -> CDev # toEnum :: Int -> CDev # fromEnum :: CDev -> Int # enumFrom :: CDev -> [CDev] # enumFromThen :: CDev -> CDev -> [CDev] # enumFromTo :: CDev -> CDev -> [CDev] # enumFromThenTo :: CDev -> CDev -> CDev -> [CDev] #
Enum CIno |
Instance details Defined in System.Posix.Types Methods succ :: CIno -> CIno # pred :: CIno -> CIno # toEnum :: Int -> CIno # fromEnum :: CIno -> Int # enumFrom :: CIno -> [CIno] # enumFromThen :: CIno -> CIno -> [CIno] # enumFromTo :: CIno -> CIno -> [CIno] # enumFromThenTo :: CIno -> CIno -> CIno -> [CIno] #
Enum CMode |
Instance details Defined in System.Posix.Types Methods succ :: CMode -> CMode # pred :: CMode -> CMode # toEnum :: Int -> CMode # fromEnum :: CMode -> Int # enumFrom :: CMode -> [CMode] # enumFromThen :: CMode -> CMode -> [CMode] # enumFromTo :: CMode -> CMode -> [CMode] # enumFromThenTo :: CMode -> CMode -> CMode -> [CMode] #
Enum COff |
Instance details Defined in System.Posix.Types Methods succ :: COff -> COff # pred :: COff -> COff # toEnum :: Int -> COff # fromEnum :: COff -> Int # enumFrom :: COff -> [COff] # enumFromThen :: COff -> COff -> [COff] # enumFromTo :: COff -> COff -> [COff] # enumFromThenTo :: COff -> COff -> COff -> [COff] #
Enum CPid |
Instance details Defined in System.Posix.Types Methods succ :: CPid -> CPid # pred :: CPid -> CPid # toEnum :: Int -> CPid # fromEnum :: CPid -> Int # enumFrom :: CPid -> [CPid] # enumFromThen :: CPid -> CPid -> [CPid] # enumFromTo :: CPid -> CPid -> [CPid] # enumFromThenTo :: CPid -> CPid -> CPid -> [CPid] #
Enum CSsize |
Instance details Defined in System.Posix.Types Methods succ :: CSsize -> CSsize # pred :: CSsize -> CSsize # toEnum :: Int -> CSsize # fromEnum :: CSsize -> Int # enumFrom :: CSsize -> [CSsize] # enumFromThen :: CSsize -> CSsize -> [CSsize] # enumFromTo :: CSsize -> CSsize -> [CSsize] # enumFromThenTo :: CSsize -> CSsize -> CSsize -> [CSsize] #
Enum CGid |
Instance details Defined in System.Posix.Types Methods succ :: CGid -> CGid # pred :: CGid -> CGid # toEnum :: Int -> CGid # fromEnum :: CGid -> Int # enumFrom :: CGid -> [CGid] # enumFromThen :: CGid -> CGid -> [CGid] # enumFromTo :: CGid -> CGid -> [CGid] # enumFromThenTo :: CGid -> CGid -> CGid -> [CGid] #
Enum CNlink |
Instance details Defined in System.Posix.Types Methods succ :: CNlink -> CNlink # pred :: CNlink -> CNlink # toEnum :: Int -> CNlink # fromEnum :: CNlink -> Int # enumFrom :: CNlink -> [CNlink] # enumFromThen :: CNlink -> CNlink -> [CNlink] # enumFromTo :: CNlink -> CNlink -> [CNlink] # enumFromThenTo :: CNlink -> CNlink -> CNlink -> [CNlink] #
Enum CUid |
Instance details Defined in System.Posix.Types Methods succ :: CUid -> CUid # pred :: CUid -> CUid # toEnum :: Int -> CUid # fromEnum :: CUid -> Int # enumFrom :: CUid -> [CUid] # enumFromThen :: CUid -> CUid -> [CUid] # enumFromTo :: CUid -> CUid -> [CUid] # enumFromThenTo :: CUid -> CUid -> CUid -> [CUid] #
Enum CCc |
Instance details Defined in System.Posix.Types Methods succ :: CCc -> CCc # pred :: CCc -> CCc # toEnum :: Int -> CCc # fromEnum :: CCc -> Int # enumFrom :: CCc -> [CCc] # enumFromThen :: CCc -> CCc -> [CCc] # enumFromTo :: CCc -> CCc -> [CCc] # enumFromThenTo :: CCc -> CCc -> CCc -> [CCc] #
Enum CSpeed |
Instance details Defined in System.Posix.Types Methods succ :: CSpeed -> CSpeed # pred :: CSpeed -> CSpeed # toEnum :: Int -> CSpeed # fromEnum :: CSpeed -> Int # enumFrom :: CSpeed -> [CSpeed] # enumFromThen :: CSpeed -> CSpeed -> [CSpeed] # enumFromTo :: CSpeed -> CSpeed -> [CSpeed] # enumFromThenTo :: CSpeed -> CSpeed -> CSpeed -> [CSpeed] #
Enum CTcflag |
Instance details Defined in System.Posix.Types Methods succ :: CTcflag -> CTcflag # pred :: CTcflag -> CTcflag # toEnum :: Int -> CTcflag # fromEnum :: CTcflag -> Int # enumFrom :: CTcflag -> [CTcflag] # enumFromThen :: CTcflag -> CTcflag -> [CTcflag] # enumFromTo :: CTcflag -> CTcflag -> [CTcflag] # enumFromThenTo :: CTcflag -> CTcflag -> CTcflag -> [CTcflag] #
Enum CRLim |
Instance details Defined in System.Posix.Types Methods succ :: CRLim -> CRLim # pred :: CRLim -> CRLim # toEnum :: Int -> CRLim # fromEnum :: CRLim -> Int # enumFrom :: CRLim -> [CRLim] # enumFromThen :: CRLim -> CRLim -> [CRLim] # enumFromTo :: CRLim -> CRLim -> [CRLim] # enumFromThenTo :: CRLim -> CRLim -> CRLim -> [CRLim] #
Enum CBlkSize |
Instance details Defined in System.Posix.Types Methods succ :: CBlkSize -> CBlkSize # pred :: CBlkSize -> CBlkSize # toEnum :: Int -> CBlkSize # fromEnum :: CBlkSize -> Int # enumFrom :: CBlkSize -> [CBlkSize] # enumFromThen :: CBlkSize -> CBlkSize -> [CBlkSize] # enumFromTo :: CBlkSize -> CBlkSize -> [CBlkSize] # enumFromThenTo :: CBlkSize -> CBlkSize -> CBlkSize -> [CBlkSize] #
Enum CBlkCnt |
Instance details Defined in System.Posix.Types Methods succ :: CBlkCnt -> CBlkCnt # pred :: CBlkCnt -> CBlkCnt # toEnum :: Int -> CBlkCnt # fromEnum :: CBlkCnt -> Int # enumFrom :: CBlkCnt -> [CBlkCnt] # enumFromThen :: CBlkCnt -> CBlkCnt -> [CBlkCnt] # enumFromTo :: CBlkCnt -> CBlkCnt -> [CBlkCnt] # enumFromThenTo :: CBlkCnt -> CBlkCnt -> CBlkCnt -> [CBlkCnt] #
Enum CClockId |
Instance details Defined in System.Posix.Types Methods succ :: CClockId -> CClockId # pred :: CClockId -> CClockId # toEnum :: Int -> CClockId # fromEnum :: CClockId -> Int # enumFrom :: CClockId -> [CClockId] # enumFromThen :: CClockId -> CClockId -> [CClockId] # enumFromTo :: CClockId -> CClockId -> [CClockId] # enumFromThenTo :: CClockId -> CClockId -> CClockId -> [CClockId] #
Enum CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods succ :: CFsBlkCnt -> CFsBlkCnt # pred :: CFsBlkCnt -> CFsBlkCnt # toEnum :: Int -> CFsBlkCnt # fromEnum :: CFsBlkCnt -> Int # enumFrom :: CFsBlkCnt -> [CFsBlkCnt] # enumFromThen :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromTo :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromThenTo :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] #
Enum CFsFilCnt |
Instance details Defined in System.Posix.Types Methods succ :: CFsFilCnt -> CFsFilCnt # pred :: CFsFilCnt -> CFsFilCnt # toEnum :: Int -> CFsFilCnt # fromEnum :: CFsFilCnt -> Int # enumFrom :: CFsFilCnt -> [CFsFilCnt] # enumFromThen :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromTo :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromThenTo :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] #
Enum CId |
Instance details Defined in System.Posix.Types Methods succ :: CId -> CId # pred :: CId -> CId # toEnum :: Int -> CId # fromEnum :: CId -> Int # enumFrom :: CId -> [CId] # enumFromThen :: CId -> CId -> [CId] # enumFromTo :: CId -> CId -> [CId] # enumFromThenTo :: CId -> CId -> CId -> [CId] #
Enum CKey |
Instance details Defined in System.Posix.Types Methods succ :: CKey -> CKey # pred :: CKey -> CKey # toEnum :: Int -> CKey # fromEnum :: CKey -> Int # enumFrom :: CKey -> [CKey] # enumFromThen :: CKey -> CKey -> [CKey] # enumFromTo :: CKey -> CKey -> [CKey] # enumFromThenTo :: CKey -> CKey -> CKey -> [CKey] #
Enum Fd |
Instance details Defined in System.Posix.Types Methods succ :: Fd -> Fd # pred :: Fd -> Fd # toEnum :: Int -> Fd # fromEnum :: Fd -> Int # enumFrom :: Fd -> [Fd] # enumFromThen :: Fd -> Fd -> [Fd] # enumFromTo :: Fd -> Fd -> [Fd] # enumFromThenTo :: Fd -> Fd -> Fd -> [Fd] #
Enum Associativity |
Instance details Defined in GHC.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 SourceUnpackedness |
Instance details Defined in GHC.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 SourceStrictness |
Instance details Defined in GHC.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 DecidedStrictness |
Instance details Defined in GHC.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 CChar |
Instance details Defined in Foreign.C.Types Methods succ :: CChar -> CChar # pred :: CChar -> CChar # toEnum :: Int -> CChar # fromEnum :: CChar -> Int # enumFrom :: CChar -> [CChar] # enumFromThen :: CChar -> CChar -> [CChar] # enumFromTo :: CChar -> CChar -> [CChar] # enumFromThenTo :: CChar -> CChar -> CChar -> [CChar] #
Enum CSChar |
Instance details Defined in Foreign.C.Types Methods succ :: CSChar -> CSChar # pred :: CSChar -> CSChar # toEnum :: Int -> CSChar # fromEnum :: CSChar -> Int # enumFrom :: CSChar -> [CSChar] # enumFromThen :: CSChar -> CSChar -> [CSChar] # enumFromTo :: CSChar -> CSChar -> [CSChar] # enumFromThenTo :: CSChar -> CSChar -> CSChar -> [CSChar] #
Enum CUChar |
Instance details Defined in Foreign.C.Types Methods succ :: CUChar -> CUChar # pred :: CUChar -> CUChar # toEnum :: Int -> CUChar # fromEnum :: CUChar -> Int # enumFrom :: CUChar -> [CUChar] # enumFromThen :: CUChar -> CUChar -> [CUChar] # enumFromTo :: CUChar -> CUChar -> [CUChar] # enumFromThenTo :: CUChar -> CUChar -> CUChar -> [CUChar] #
Enum CShort |
Instance details Defined in Foreign.C.Types Methods succ :: CShort -> CShort # pred :: CShort -> CShort # toEnum :: Int -> CShort # fromEnum :: CShort -> Int # enumFrom :: CShort -> [CShort] # enumFromThen :: CShort -> CShort -> [CShort] # enumFromTo :: CShort -> CShort -> [CShort] # enumFromThenTo :: CShort -> CShort -> CShort -> [CShort] #
Enum CUShort |
Instance details Defined in Foreign.C.Types Methods succ :: CUShort -> CUShort # pred :: CUShort -> CUShort # toEnum :: Int -> CUShort # fromEnum :: CUShort -> Int # enumFrom :: CUShort -> [CUShort] # enumFromThen :: CUShort -> CUShort -> [CUShort] # enumFromTo :: CUShort -> CUShort -> [CUShort] # enumFromThenTo :: CUShort -> CUShort -> CUShort -> [CUShort] #
Enum CInt |
Instance details Defined in Foreign.C.Types Methods succ :: CInt -> CInt # pred :: CInt -> CInt # toEnum :: Int -> CInt # fromEnum :: CInt -> Int # enumFrom :: CInt -> [CInt] # enumFromThen :: CInt -> CInt -> [CInt] # enumFromTo :: CInt -> CInt -> [CInt] # enumFromThenTo :: CInt -> CInt -> CInt -> [CInt] #
Enum CUInt |
Instance details Defined in Foreign.C.Types Methods succ :: CUInt -> CUInt # pred :: CUInt -> CUInt # toEnum :: Int -> CUInt # fromEnum :: CUInt -> Int # enumFrom :: CUInt -> [CUInt] # enumFromThen :: CUInt -> CUInt -> [CUInt] # enumFromTo :: CUInt -> CUInt -> [CUInt] # enumFromThenTo :: CUInt -> CUInt -> CUInt -> [CUInt] #
Enum CLong |
Instance details Defined in Foreign.C.Types Methods succ :: CLong -> CLong # pred :: CLong -> CLong # toEnum :: Int -> CLong # fromEnum :: CLong -> Int # enumFrom :: CLong -> [CLong] # enumFromThen :: CLong -> CLong -> [CLong] # enumFromTo :: CLong -> CLong -> [CLong] # enumFromThenTo :: CLong -> CLong -> CLong -> [CLong] #
Enum CULong |
Instance details Defined in Foreign.C.Types Methods succ :: CULong -> CULong # pred :: CULong -> CULong # toEnum :: Int -> CULong # fromEnum :: CULong -> Int # enumFrom :: CULong -> [CULong] # enumFromThen :: CULong -> CULong -> [CULong] # enumFromTo :: CULong -> CULong -> [CULong] # enumFromThenTo :: CULong -> CULong -> CULong -> [CULong] #
Enum CLLong |
Instance details Defined in Foreign.C.Types Methods succ :: CLLong -> CLLong # pred :: CLLong -> CLLong # toEnum :: Int -> CLLong # fromEnum :: CLLong -> Int # enumFrom :: CLLong -> [CLLong] # enumFromThen :: CLLong -> CLLong -> [CLLong] # enumFromTo :: CLLong -> CLLong -> [CLLong] # enumFromThenTo :: CLLong -> CLLong -> CLLong -> [CLLong] #
Enum CULLong |
Instance details Defined in Foreign.C.Types Methods succ :: CULLong -> CULLong # pred :: CULLong -> CULLong # toEnum :: Int -> CULLong # fromEnum :: CULLong -> Int # enumFrom :: CULLong -> [CULLong] # enumFromThen :: CULLong -> CULLong -> [CULLong] # enumFromTo :: CULLong -> CULLong -> [CULLong] # enumFromThenTo :: CULLong -> CULLong -> CULLong -> [CULLong] #
Enum CBool |
Instance details Defined in Foreign.C.Types Methods succ :: CBool -> CBool # pred :: CBool -> CBool # toEnum :: Int -> CBool # fromEnum :: CBool -> Int # enumFrom :: CBool -> [CBool] # enumFromThen :: CBool -> CBool -> [CBool] # enumFromTo :: CBool -> CBool -> [CBool] # enumFromThenTo :: CBool -> CBool -> CBool -> [CBool] #
Enum CFloat |
Instance details Defined in Foreign.C.Types Methods succ :: CFloat -> CFloat # pred :: CFloat -> CFloat # toEnum :: Int -> CFloat # fromEnum :: CFloat -> Int # enumFrom :: CFloat -> [CFloat] # enumFromThen :: CFloat -> CFloat -> [CFloat] # enumFromTo :: CFloat -> CFloat -> [CFloat] # enumFromThenTo :: CFloat -> CFloat -> CFloat -> [CFloat] #
Enum CDouble |
Instance details Defined in Foreign.C.Types Methods succ :: CDouble -> CDouble # pred :: CDouble -> CDouble # toEnum :: Int -> CDouble # fromEnum :: CDouble -> Int # enumFrom :: CDouble -> [CDouble] # enumFromThen :: CDouble -> CDouble -> [CDouble] # enumFromTo :: CDouble -> CDouble -> [CDouble] # enumFromThenTo :: CDouble -> CDouble -> CDouble -> [CDouble] #
Enum CPtrdiff |
Instance details Defined in Foreign.C.Types Methods succ :: CPtrdiff -> CPtrdiff # pred :: CPtrdiff -> CPtrdiff # toEnum :: Int -> CPtrdiff # fromEnum :: CPtrdiff -> Int # enumFrom :: CPtrdiff -> [CPtrdiff] # enumFromThen :: CPtrdiff -> CPtrdiff -> [CPtrdiff] # enumFromTo :: CPtrdiff -> CPtrdiff -> [CPtrdiff] # enumFromThenTo :: CPtrdiff -> CPtrdiff -> CPtrdiff -> [CPtrdiff] #
Enum CSize |
Instance details Defined in Foreign.C.Types Methods succ :: CSize -> CSize # pred :: CSize -> CSize # toEnum :: Int -> CSize # fromEnum :: CSize -> Int # enumFrom :: CSize -> [CSize] # enumFromThen :: CSize -> CSize -> [CSize] # enumFromTo :: CSize -> CSize -> [CSize] # enumFromThenTo :: CSize -> CSize -> CSize -> [CSize] #
Enum CWchar |
Instance details Defined in Foreign.C.Types Methods succ :: CWchar -> CWchar # pred :: CWchar -> CWchar # toEnum :: Int -> CWchar # fromEnum :: CWchar -> Int # enumFrom :: CWchar -> [CWchar] # enumFromThen :: CWchar -> CWchar -> [CWchar] # enumFromTo :: CWchar -> CWchar -> [CWchar] # enumFromThenTo :: CWchar -> CWchar -> CWchar -> [CWchar] #
Enum CSigAtomic |
Instance details Defined in 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 CClock |
Instance details Defined in Foreign.C.Types Methods succ :: CClock -> CClock # pred :: CClock -> CClock # toEnum :: Int -> CClock # fromEnum :: CClock -> Int # enumFrom :: CClock -> [CClock] # enumFromThen :: CClock -> CClock -> [CClock] # enumFromTo :: CClock -> CClock -> [CClock] # enumFromThenTo :: CClock -> CClock -> CClock -> [CClock] #
Enum CTime |
Instance details Defined in Foreign.C.Types Methods succ :: CTime -> CTime # pred :: CTime -> CTime # toEnum :: Int -> CTime # fromEnum :: CTime -> Int # enumFrom :: CTime -> [CTime] # enumFromThen :: CTime -> CTime -> [CTime] # enumFromTo :: CTime -> CTime -> [CTime] # enumFromThenTo :: CTime -> CTime -> CTime -> [CTime] #
Enum CUSeconds |
Instance details Defined in Foreign.C.Types Methods succ :: CUSeconds -> CUSeconds # pred :: CUSeconds -> CUSeconds # toEnum :: Int -> CUSeconds # fromEnum :: CUSeconds -> Int # enumFrom :: CUSeconds -> [CUSeconds] # enumFromThen :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromTo :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromThenTo :: CUSeconds -> CUSeconds -> CUSeconds -> [CUSeconds] #
Enum CSUSeconds |
Instance details Defined in 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 CIntPtr |
Instance details Defined in Foreign.C.Types Methods succ :: CIntPtr -> CIntPtr # pred :: CIntPtr -> CIntPtr # toEnum :: Int -> CIntPtr # fromEnum :: CIntPtr -> Int # enumFrom :: CIntPtr -> [CIntPtr] # enumFromThen :: CIntPtr -> CIntPtr -> [CIntPtr] # enumFromTo :: CIntPtr -> CIntPtr -> [CIntPtr] # enumFromThenTo :: CIntPtr -> CIntPtr -> CIntPtr -> [CIntPtr] #
Enum CUIntPtr |
Instance details Defined in Foreign.C.Types Methods succ :: CUIntPtr -> CUIntPtr # pred :: CUIntPtr -> CUIntPtr # toEnum :: Int -> CUIntPtr # fromEnum :: CUIntPtr -> Int # enumFrom :: CUIntPtr -> [CUIntPtr] # enumFromThen :: CUIntPtr -> CUIntPtr -> [CUIntPtr] # enumFromTo :: CUIntPtr -> CUIntPtr -> [CUIntPtr] # enumFromThenTo :: CUIntPtr -> CUIntPtr -> CUIntPtr -> [CUIntPtr] #
Enum CIntMax |
Instance details Defined in Foreign.C.Types Methods succ :: CIntMax -> CIntMax # pred :: CIntMax -> CIntMax # toEnum :: Int -> CIntMax # fromEnum :: CIntMax -> Int # enumFrom :: CIntMax -> [CIntMax] # enumFromThen :: CIntMax -> CIntMax -> [CIntMax] # enumFromTo :: CIntMax -> CIntMax -> [CIntMax] # enumFromThenTo :: CIntMax -> CIntMax -> CIntMax -> [CIntMax] #
Enum CUIntMax |
Instance details Defined in Foreign.C.Types Methods succ :: CUIntMax -> CUIntMax # pred :: CUIntMax -> CUIntMax # toEnum :: Int -> CUIntMax # fromEnum :: CUIntMax -> Int # enumFrom :: CUIntMax -> [CUIntMax] # enumFromThen :: CUIntMax -> CUIntMax -> [CUIntMax] # enumFromTo :: CUIntMax -> CUIntMax -> [CUIntMax] # enumFromThenTo :: CUIntMax -> CUIntMax -> CUIntMax -> [CUIntMax] #
Enum WordPtr |
Instance details Defined in Foreign.Ptr Methods succ :: WordPtr -> WordPtr # pred :: WordPtr -> WordPtr # toEnum :: Int -> WordPtr # fromEnum :: WordPtr -> Int # enumFrom :: WordPtr -> [WordPtr] # enumFromThen :: WordPtr -> WordPtr -> [WordPtr] # enumFromTo :: WordPtr -> WordPtr -> [WordPtr] # enumFromThenTo :: WordPtr -> WordPtr -> WordPtr -> [WordPtr] #
Enum IntPtr |
Instance details Defined in Foreign.Ptr Methods succ :: IntPtr -> IntPtr # pred :: IntPtr -> IntPtr # toEnum :: Int -> IntPtr # fromEnum :: IntPtr -> Int # enumFrom :: IntPtr -> [IntPtr] # enumFromThen :: IntPtr -> IntPtr -> [IntPtr] # enumFromTo :: IntPtr -> IntPtr -> [IntPtr] # enumFromThenTo :: IntPtr -> IntPtr -> IntPtr -> [IntPtr] #
Enum GeneralCategory |
Instance details Defined in GHC.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] #
Integral a => Enum (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods succ :: Ratio a -> Ratio a # pred :: Ratio a -> Ratio a # toEnum :: Int -> Ratio a # fromEnum :: Ratio a -> Int # enumFrom :: Ratio a -> [Ratio a] # enumFromThen :: Ratio a -> Ratio a -> [Ratio a] # enumFromTo :: Ratio a -> Ratio a -> [Ratio a] # enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] #
Enum (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods succ :: Fixed a -> Fixed a # pred :: Fixed a -> Fixed a # toEnum :: Int -> Fixed a # fromEnum :: Fixed a -> Int # enumFrom :: Fixed a -> [Fixed a] # enumFromThen :: Fixed a -> Fixed a -> [Fixed a] # enumFromTo :: Fixed a -> Fixed a -> [Fixed a] # enumFromThenTo :: Fixed a -> Fixed a -> Fixed a -> [Fixed a] #
Enum a => Enum (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Min a -> Min a # pred :: Min a -> Min a # toEnum :: Int -> Min a # fromEnum :: Min a -> Int # enumFrom :: Min a -> [Min a] # enumFromThen :: Min a -> Min a -> [Min a] # enumFromTo :: Min a -> Min a -> [Min a] # enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] #
Enum a => Enum (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Max a -> Max a # pred :: Max a -> Max a # toEnum :: Int -> Max a # fromEnum :: Max a -> Int # enumFrom :: Max a -> [Max a] # enumFromThen :: Max a -> Max a -> [Max a] # enumFromTo :: Max a -> Max a -> [Max a] # enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] #
Enum a => Enum (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: First a -> First a # pred :: First a -> First a # toEnum :: Int -> First a # fromEnum :: First a -> Int # enumFrom :: First a -> [First a] # enumFromThen :: First a -> First a -> [First a] # enumFromTo :: First a -> First a -> [First a] # enumFromThenTo :: First a -> First a -> First a -> [First a] #
Enum a => Enum (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Last a -> Last a # pred :: Last a -> Last a # toEnum :: Int -> Last a # fromEnum :: Last a -> Int # enumFrom :: Last a -> [Last a] # enumFromThen :: Last a -> Last a -> [Last a] # enumFromTo :: Last a -> Last a -> [Last a] # enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] #
Enum a => Enum (WrappedMonoid a) | Since: base-4.9.0.0
Instance details 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) |
Instance details Defined in Data.Functor.Identity Methods succ :: Identity a -> Identity a # pred :: Identity a -> Identity a # toEnum :: Int -> 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 (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods succ :: Proxy s -> Proxy s # pred :: Proxy s -> Proxy s # toEnum :: Int -> Proxy s # fromEnum :: Proxy s -> Int # enumFrom :: Proxy s -> [Proxy s] # enumFromThen :: Proxy s -> Proxy s -> [Proxy s] # enumFromTo :: Proxy s -> Proxy s -> [Proxy s] # enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #
Enum a => Enum (Const a b) |
Instance details Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # toEnum :: Int -> 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 (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods succ :: Alt f a -> Alt f a # pred :: Alt f a -> Alt f a # toEnum :: Int -> Alt f a # fromEnum :: Alt f a -> Int # enumFrom :: Alt f a -> [Alt f a] # enumFromThen :: Alt f a -> Alt f a -> [Alt f a] # enumFromTo :: Alt f a -> Alt f a -> [Alt f a] # enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] #
a ~ b => Enum (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods succ :: (a :~: b) -> a :~: b # pred :: (a :~: b) -> a :~: b # toEnum :: Int -> 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
Instance details Defined in Data.Type.Equality Methods succ :: (a :~~: b) -> a :~~: b # pred :: (a :~~: b) -> a :~~: b # toEnum :: Int -> 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] #

class Eq a where #

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

Minimal complete definition: either `==` or `/=`.

Minimal complete definition

(==) | (/=)

Methods

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

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

Instances

Eq Bool |
Instance details Defined in GHC.Classes Methods (==) :: Bool -> Bool -> Bool # (/=) :: Bool -> Bool -> Bool #
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool # (/=) :: Char -> Char -> Bool #
Eq Double |
Instance details Defined in GHC.Classes Methods (==) :: Double -> Double -> Bool # (/=) :: Double -> Double -> Bool #
Eq Float |
Instance details Defined in GHC.Classes Methods (==) :: Float -> Float -> Bool # (/=) :: Float -> Float -> Bool #
Eq Int |
Instance details Defined in GHC.Classes Methods (==) :: Int -> Int -> Bool # (/=) :: Int -> Int -> Bool #
Eq Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int8 -> Int8 -> Bool # (/=) :: Int8 -> Int8 -> Bool #
Eq Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int16 -> Int16 -> Bool # (/=) :: Int16 -> Int16 -> Bool #
Eq Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int32 -> Int32 -> Bool # (/=) :: Int32 -> Int32 -> Bool #
Eq Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int64 -> Int64 -> Bool # (/=) :: Int64 -> Int64 -> Bool #
Eq Integer |
Instance details Defined in GHC.Integer.Type Methods (==) :: Integer -> Integer -> Bool # (/=) :: Integer -> Integer -> Bool #
Eq Natural |
Instance details Defined in GHC.Natural Methods (==) :: Natural -> Natural -> Bool # (/=) :: Natural -> Natural -> Bool #
Eq Ordering |
Instance details Defined in GHC.Classes Methods (==) :: Ordering -> Ordering -> Bool # (/=) :: Ordering -> Ordering -> Bool #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool # (/=) :: Word -> Word -> Bool #
Eq Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word8 -> Word8 -> Bool # (/=) :: Word8 -> Word8 -> Bool #
Eq Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word16 -> Word16 -> Bool # (/=) :: Word16 -> Word16 -> Bool #
Eq Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word32 -> Word32 -> Bool # (/=) :: Word32 -> Word32 -> Bool #
Eq Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word64 -> Word64 -> Bool # (/=) :: Word64 -> Word64 -> Bool #
Eq SomeTypeRep |
Instance details Defined in Data.Typeable.Internal Methods (==) :: SomeTypeRep -> SomeTypeRep -> Bool # (/=) :: SomeTypeRep -> SomeTypeRep -> Bool #
Eq () |
Instance details Defined in GHC.Classes Methods (==) :: () -> () -> Bool # (/=) :: () -> () -> Bool #
Eq TyCon |
Instance details Defined in GHC.Classes Methods (==) :: TyCon -> TyCon -> Bool # (/=) :: TyCon -> TyCon -> Bool #
Eq Module |
Instance details Defined in GHC.Classes Methods (==) :: Module -> Module -> Bool # (/=) :: Module -> Module -> Bool #
Eq TrName |
Instance details Defined in GHC.Classes Methods (==) :: TrName -> TrName -> Bool # (/=) :: TrName -> TrName -> Bool #
Eq BigNat |
Instance details Defined in GHC.Integer.Type Methods (==) :: BigNat -> BigNat -> Bool # (/=) :: BigNat -> BigNat -> Bool #
Eq Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods (==) :: Void -> Void -> Bool # (/=) :: Void -> Void -> Bool #
Eq SpecConstrAnnotation |
Instance details Defined in GHC.Exts Methods (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool #
Eq Constr | Equality of constructors Since: base-4.0.0.0
Instance details Defined in Data.Data Methods (==) :: Constr -> Constr -> Bool # (/=) :: Constr -> Constr -> Bool #
Eq DataRep |
Instance details Defined in Data.Data Methods (==) :: DataRep -> DataRep -> Bool # (/=) :: DataRep -> DataRep -> Bool #
Eq ConstrRep |
Instance details Defined in Data.Data Methods (==) :: ConstrRep -> ConstrRep -> Bool # (/=) :: ConstrRep -> ConstrRep -> Bool #
Eq Fixity |
Instance details Defined in Data.Data Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #
Eq Unique |
Instance details Defined in Data.Unique Methods (==) :: Unique -> Unique -> Bool # (/=) :: Unique -> Unique -> Bool #
Eq Version | Since: base-2.1
Instance details Defined in Data.Version Methods (==) :: Version -> Version -> Bool # (/=) :: Version -> Version -> Bool #
Eq HandlePosn | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods (==) :: HandlePosn -> HandlePosn -> Bool # (/=) :: HandlePosn -> HandlePosn -> Bool #
Eq ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadId -> ThreadId -> Bool # (/=) :: ThreadId -> ThreadId -> Bool #
Eq BlockReason |
Instance details Defined in GHC.Conc.Sync Methods (==) :: BlockReason -> BlockReason -> Bool # (/=) :: BlockReason -> BlockReason -> Bool #
Eq ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadStatus -> ThreadStatus -> Bool # (/=) :: ThreadStatus -> ThreadStatus -> Bool #
Eq CDev |
Instance details Defined in System.Posix.Types Methods (==) :: CDev -> CDev -> Bool # (/=) :: CDev -> CDev -> Bool #
Eq CIno |
Instance details Defined in System.Posix.Types Methods (==) :: CIno -> CIno -> Bool # (/=) :: CIno -> CIno -> Bool #
Eq CMode |
Instance details Defined in System.Posix.Types Methods (==) :: CMode -> CMode -> Bool # (/=) :: CMode -> CMode -> Bool #
Eq COff |
Instance details Defined in System.Posix.Types Methods (==) :: COff -> COff -> Bool # (/=) :: COff -> COff -> Bool #
Eq CPid |
Instance details Defined in System.Posix.Types Methods (==) :: CPid -> CPid -> Bool # (/=) :: CPid -> CPid -> Bool #
Eq CSsize |
Instance details Defined in System.Posix.Types Methods (==) :: CSsize -> CSsize -> Bool # (/=) :: CSsize -> CSsize -> Bool #
Eq CGid |
Instance details Defined in System.Posix.Types Methods (==) :: CGid -> CGid -> Bool # (/=) :: CGid -> CGid -> Bool #
Eq CNlink |
Instance details Defined in System.Posix.Types Methods (==) :: CNlink -> CNlink -> Bool # (/=) :: CNlink -> CNlink -> Bool #
Eq CUid |
Instance details Defined in System.Posix.Types Methods (==) :: CUid -> CUid -> Bool # (/=) :: CUid -> CUid -> Bool #
Eq CCc |
Instance details Defined in System.Posix.Types Methods (==) :: CCc -> CCc -> Bool # (/=) :: CCc -> CCc -> Bool #
Eq CSpeed |
Instance details Defined in System.Posix.Types Methods (==) :: CSpeed -> CSpeed -> Bool # (/=) :: CSpeed -> CSpeed -> Bool #
Eq CTcflag |
Instance details Defined in System.Posix.Types Methods (==) :: CTcflag -> CTcflag -> Bool # (/=) :: CTcflag -> CTcflag -> Bool #
Eq CRLim |
Instance details Defined in System.Posix.Types Methods (==) :: CRLim -> CRLim -> Bool # (/=) :: CRLim -> CRLim -> Bool #
Eq CBlkSize |
Instance details Defined in System.Posix.Types Methods (==) :: CBlkSize -> CBlkSize -> Bool # (/=) :: CBlkSize -> CBlkSize -> Bool #
Eq CBlkCnt |
Instance details Defined in System.Posix.Types Methods (==) :: CBlkCnt -> CBlkCnt -> Bool # (/=) :: CBlkCnt -> CBlkCnt -> Bool #
Eq CClockId |
Instance details Defined in System.Posix.Types Methods (==) :: CClockId -> CClockId -> Bool # (/=) :: CClockId -> CClockId -> Bool #
Eq CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods (==) :: CFsBlkCnt -> CFsBlkCnt -> Bool # (/=) :: CFsBlkCnt -> CFsBlkCnt -> Bool #
Eq CFsFilCnt |
Instance details Defined in System.Posix.Types Methods (==) :: CFsFilCnt -> CFsFilCnt -> Bool # (/=) :: CFsFilCnt -> CFsFilCnt -> Bool #
Eq CId |
Instance details Defined in System.Posix.Types Methods (==) :: CId -> CId -> Bool # (/=) :: CId -> CId -> Bool #
Eq CKey |
Instance details Defined in System.Posix.Types Methods (==) :: CKey -> CKey -> Bool # (/=) :: CKey -> CKey -> Bool #
Eq CTimer |
Instance details Defined in System.Posix.Types Methods (==) :: CTimer -> CTimer -> Bool # (/=) :: CTimer -> CTimer -> Bool #
Eq Fd |
Instance details Defined in System.Posix.Types Methods (==) :: Fd -> Fd -> Bool # (/=) :: Fd -> Fd -> Bool #
Eq AsyncException |
Instance details Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool #
Eq ArrayException |
Instance details Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool #
Eq ExitCode |
Instance details Defined in GHC.IO.Exception Methods (==) :: ExitCode -> ExitCode -> Bool # (/=) :: ExitCode -> ExitCode -> Bool #
Eq IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOErrorType -> IOErrorType -> Bool # (/=) :: IOErrorType -> IOErrorType -> Bool #
Eq Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Handle -> Handle -> Bool # (/=) :: Handle -> Handle -> Bool #
Eq BufferMode |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: BufferMode -> BufferMode -> Bool # (/=) :: BufferMode -> BufferMode -> Bool #
Eq Newline |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Newline -> Newline -> Bool # (/=) :: Newline -> Newline -> Bool #
Eq NewlineMode |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: NewlineMode -> NewlineMode -> Bool # (/=) :: NewlineMode -> NewlineMode -> Bool #
Eq MaskingState |
Instance details Defined in GHC.IO Methods (==) :: MaskingState -> MaskingState -> Bool # (/=) :: MaskingState -> MaskingState -> Bool #
Eq IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOException -> IOException -> Bool # (/=) :: IOException -> IOException -> Bool #
Eq ErrorCall |
Instance details Defined in GHC.Exception Methods (==) :: ErrorCall -> ErrorCall -> Bool # (/=) :: ErrorCall -> ErrorCall -> Bool #
Eq ArithException |
Instance details Defined in GHC.Exception Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool #
Eq All |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: All -> All -> Bool # (/=) :: All -> All -> Bool #
Eq Any |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Any -> Any -> Bool # (/=) :: Any -> Any -> Bool #
Eq Fixity |
Instance details Defined in GHC.Generics Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #
Eq Associativity |
Instance details Defined in GHC.Generics Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool #
Eq SourceUnpackedness |
Instance details Defined in GHC.Generics Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool #
Eq SourceStrictness |
Instance details Defined in GHC.Generics Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool #
Eq DecidedStrictness |
Instance details Defined in GHC.Generics Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool #
Eq CChar |
Instance details Defined in Foreign.C.Types Methods (==) :: CChar -> CChar -> Bool # (/=) :: CChar -> CChar -> Bool #
Eq CSChar |
Instance details Defined in Foreign.C.Types Methods (==) :: CSChar -> CSChar -> Bool # (/=) :: CSChar -> CSChar -> Bool #
Eq CUChar |
Instance details Defined in Foreign.C.Types Methods (==) :: CUChar -> CUChar -> Bool # (/=) :: CUChar -> CUChar -> Bool #
Eq CShort |
Instance details Defined in Foreign.C.Types Methods (==) :: CShort -> CShort -> Bool # (/=) :: CShort -> CShort -> Bool #
Eq CUShort |
Instance details Defined in Foreign.C.Types Methods (==) :: CUShort -> CUShort -> Bool # (/=) :: CUShort -> CUShort -> Bool #
Eq CInt |
Instance details Defined in Foreign.C.Types Methods (==) :: CInt -> CInt -> Bool # (/=) :: CInt -> CInt -> Bool #
Eq CUInt |
Instance details Defined in Foreign.C.Types Methods (==) :: CUInt -> CUInt -> Bool # (/=) :: CUInt -> CUInt -> Bool #
Eq CLong |
Instance details Defined in Foreign.C.Types Methods (==) :: CLong -> CLong -> Bool # (/=) :: CLong -> CLong -> Bool #
Eq CULong |
Instance details Defined in Foreign.C.Types Methods (==) :: CULong -> CULong -> Bool # (/=) :: CULong -> CULong -> Bool #
Eq CLLong |
Instance details Defined in Foreign.C.Types Methods (==) :: CLLong -> CLLong -> Bool # (/=) :: CLLong -> CLLong -> Bool #
Eq CULLong |
Instance details Defined in Foreign.C.Types Methods (==) :: CULLong -> CULLong -> Bool # (/=) :: CULLong -> CULLong -> Bool #
Eq CBool |
Instance details Defined in Foreign.C.Types Methods (==) :: CBool -> CBool -> Bool # (/=) :: CBool -> CBool -> Bool #
Eq CFloat |
Instance details Defined in Foreign.C.Types Methods (==) :: CFloat -> CFloat -> Bool # (/=) :: CFloat -> CFloat -> Bool #
Eq CDouble |
Instance details Defined in Foreign.C.Types Methods (==) :: CDouble -> CDouble -> Bool # (/=) :: CDouble -> CDouble -> Bool #
Eq CPtrdiff |
Instance details Defined in Foreign.C.Types Methods (==) :: CPtrdiff -> CPtrdiff -> Bool # (/=) :: CPtrdiff -> CPtrdiff -> Bool #
Eq CSize |
Instance details Defined in Foreign.C.Types Methods (==) :: CSize -> CSize -> Bool # (/=) :: CSize -> CSize -> Bool #
Eq CWchar |
Instance details Defined in Foreign.C.Types Methods (==) :: CWchar -> CWchar -> Bool # (/=) :: CWchar -> CWchar -> Bool #
Eq CSigAtomic |
Instance details Defined in Foreign.C.Types Methods (==) :: CSigAtomic -> CSigAtomic -> Bool # (/=) :: CSigAtomic -> CSigAtomic -> Bool #
Eq CClock |
Instance details Defined in Foreign.C.Types Methods (==) :: CClock -> CClock -> Bool # (/=) :: CClock -> CClock -> Bool #
Eq CTime |
Instance details Defined in Foreign.C.Types Methods (==) :: CTime -> CTime -> Bool # (/=) :: CTime -> CTime -> Bool #
Eq CUSeconds |
Instance details Defined in Foreign.C.Types Methods (==) :: CUSeconds -> CUSeconds -> Bool # (/=) :: CUSeconds -> CUSeconds -> Bool #
Eq CSUSeconds |
Instance details Defined in Foreign.C.Types Methods (==) :: CSUSeconds -> CSUSeconds -> Bool # (/=) :: CSUSeconds -> CSUSeconds -> Bool #
Eq CIntPtr |
Instance details Defined in Foreign.C.Types Methods (==) :: CIntPtr -> CIntPtr -> Bool # (/=) :: CIntPtr -> CIntPtr -> Bool #
Eq CUIntPtr |
Instance details Defined in Foreign.C.Types Methods (==) :: CUIntPtr -> CUIntPtr -> Bool # (/=) :: CUIntPtr -> CUIntPtr -> Bool #
Eq CIntMax |
Instance details Defined in Foreign.C.Types Methods (==) :: CIntMax -> CIntMax -> Bool # (/=) :: CIntMax -> CIntMax -> Bool #
Eq CUIntMax |
Instance details Defined in Foreign.C.Types Methods (==) :: CUIntMax -> CUIntMax -> Bool # (/=) :: CUIntMax -> CUIntMax -> Bool #
Eq WordPtr |
Instance details Defined in Foreign.Ptr Methods (==) :: WordPtr -> WordPtr -> Bool # (/=) :: WordPtr -> WordPtr -> Bool #
Eq IntPtr |
Instance details Defined in Foreign.Ptr Methods (==) :: IntPtr -> IntPtr -> Bool # (/=) :: IntPtr -> IntPtr -> Bool #
Eq Fingerprint |
Instance details Defined in GHC.Fingerprint.Type Methods (==) :: Fingerprint -> Fingerprint -> Bool # (/=) :: Fingerprint -> Fingerprint -> Bool #
Eq GeneralCategory |
Instance details Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool #
Eq SrcLoc |
Instance details Defined in GHC.Stack.Types Methods (==) :: SrcLoc -> SrcLoc -> Bool # (/=) :: SrcLoc -> SrcLoc -> Bool #
Eq Timeout |
Instance details Defined in System.Timeout Methods (==) :: Timeout -> Timeout -> Bool # (/=) :: Timeout -> Timeout -> Bool #
Eq a => Eq [a] |
Instance details Defined in GHC.Classes Methods (==) :: [a] -> [a] -> Bool # (/=) :: [a] -> [a] -> Bool #
Eq a => Eq (Maybe a) |
Instance details Defined in GHC.Base Methods (==) :: Maybe a -> Maybe a -> Bool # (/=) :: Maybe a -> Maybe a -> Bool #
Eq a => Eq (Ratio a) |
Instance details Defined in GHC.Real Methods (==) :: Ratio a -> Ratio a -> Bool # (/=) :: Ratio a -> Ratio a -> Bool #
Eq (StablePtr a) | Since: base-2.1
Instance details Defined in GHC.Stable Methods (==) :: StablePtr a -> StablePtr a -> Bool # (/=) :: StablePtr a -> StablePtr a -> Bool #
Eq (Ptr a) |
Instance details Defined in GHC.Ptr Methods (==) :: Ptr a -> Ptr a -> Bool # (/=) :: Ptr a -> Ptr a -> Bool #
Eq (FunPtr a) |
Instance details Defined in GHC.Ptr Methods (==) :: FunPtr a -> FunPtr a -> Bool # (/=) :: FunPtr a -> FunPtr a -> Bool #
Eq p => Eq (Par1 p) |
Instance details Defined in GHC.Generics Methods (==) :: Par1 p -> Par1 p -> Bool # (/=) :: Par1 p -> Par1 p -> Bool #
Eq a => Eq (Complex a) |
Instance details Defined in Data.Complex Methods (==) :: Complex a -> Complex a -> Bool # (/=) :: Complex a -> Complex a -> Bool #
Eq (Fixed a) |
Instance details Defined in Data.Fixed Methods (==) :: Fixed a -> Fixed a -> Bool # (/=) :: Fixed a -> Fixed a -> Bool #
Eq a => Eq (Min a) |
Instance details Defined in Data.Semigroup Methods (==) :: Min a -> Min a -> Bool # (/=) :: Min a -> Min a -> Bool #
Eq a => Eq (Max a) |
Instance details Defined in Data.Semigroup Methods (==) :: Max a -> Max a -> Bool # (/=) :: Max a -> Max a -> Bool #
Eq a => Eq (First a) |
Instance details Defined in Data.Semigroup Methods (==) :: First a -> First a -> Bool # (/=) :: First a -> First a -> Bool #
Eq a => Eq (Last a) |
Instance details Defined in Data.Semigroup Methods (==) :: Last a -> Last a -> Bool # (/=) :: Last a -> Last a -> Bool #
Eq m => Eq (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #
Eq a => Eq (Option a) |
Instance details Defined in Data.Semigroup Methods (==) :: Option a -> Option a -> Bool # (/=) :: Option a -> Option a -> Bool #
Eq (Chan a) |
Instance details Defined in Control.Concurrent.Chan Methods (==) :: Chan a -> Chan a -> Bool # (/=) :: Chan a -> Chan a -> Bool #
Eq (StableName a) | Since: base-2.1
Instance details Defined in System.Mem.StableName Methods (==) :: StableName a -> StableName a -> Bool # (/=) :: StableName a -> StableName a -> Bool #
Eq a => Eq (ZipList a) |
Instance details Defined in Control.Applicative Methods (==) :: ZipList a -> ZipList a -> Bool # (/=) :: ZipList a -> ZipList a -> Bool #
Eq a => Eq (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (==) :: Identity a -> Identity a -> Bool # (/=) :: Identity a -> Identity a -> Bool #
Eq (TVar a) | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: TVar a -> TVar a -> Bool # (/=) :: TVar a -> TVar a -> Bool #
Eq (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods (==) :: ForeignPtr a -> ForeignPtr a -> Bool # (/=) :: ForeignPtr a -> ForeignPtr a -> Bool #
Eq (IORef a) | Pointer equality. Since: base-4.1.0.0
Instance details Defined in GHC.IORef Methods (==) :: IORef a -> IORef a -> Bool # (/=) :: IORef a -> IORef a -> Bool #
Eq a => Eq (First a) |
Instance details Defined in Data.Monoid Methods (==) :: First a -> First a -> Bool # (/=) :: First a -> First a -> Bool #
Eq a => Eq (Last a) |
Instance details Defined in Data.Monoid Methods (==) :: Last a -> Last a -> Bool # (/=) :: Last a -> Last a -> Bool #
Eq a => Eq (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Dual a -> Dual a -> Bool # (/=) :: Dual a -> Dual a -> Bool #
Eq a => Eq (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Sum a -> Sum a -> Bool # (/=) :: Sum a -> Sum a -> Bool #
Eq a => Eq (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Product a -> Product a -> Bool # (/=) :: Product a -> Product a -> Bool #
Eq a => Eq (Down a) |
Instance details Defined in Data.Ord Methods (==) :: Down a -> Down a -> Bool # (/=) :: Down a -> Down a -> Bool #
Eq (MVar a) | Since: base-4.1.0.0
Instance details Defined in GHC.MVar Methods (==) :: MVar a -> MVar a -> Bool # (/=) :: MVar a -> MVar a -> Bool #
Eq a => Eq (NonEmpty a) |
Instance details Defined in GHC.Base Methods (==) :: NonEmpty a -> NonEmpty a -> Bool # (/=) :: NonEmpty a -> NonEmpty a -> Bool #
(Eq a, Eq b) => Eq (Either a b) |
Instance details Defined in Data.Either Methods (==) :: Either a b -> Either a b -> Bool # (/=) :: Either a b -> Either a b -> Bool #
Eq (V1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: V1 p -> V1 p -> Bool # (/=) :: V1 p -> V1 p -> Bool #
Eq (U1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: U1 p -> U1 p -> Bool # (/=) :: U1 p -> U1 p -> Bool #
Eq (TypeRep a) | Since: base-2.1
Instance details Defined in Data.Typeable.Internal Methods (==) :: TypeRep a -> TypeRep a -> Bool # (/=) :: TypeRep a -> TypeRep a -> Bool #
(Eq a, Eq b) => Eq (a, b) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b) -> (a, b) -> Bool # (/=) :: (a, b) -> (a, b) -> Bool #
(Ix i, Eq e) => Eq (Array i e) | Since: base-2.1
Instance details Defined in GHC.Arr Methods (==) :: Array i e -> Array i e -> Bool # (/=) :: Array i e -> Array i e -> Bool #
Eq a => Eq (Arg a b) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (==) :: Arg a b -> Arg a b -> Bool # (/=) :: Arg a b -> Arg a b -> Bool #
Eq (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (==) :: Proxy s -> Proxy s -> Bool # (/=) :: Proxy s -> Proxy s -> Bool #
Eq (STRef s a) | Pointer equality. Since: base-2.1
Instance details Defined in GHC.STRef Methods (==) :: STRef s a -> STRef s a -> Bool # (/=) :: STRef s a -> STRef s a -> Bool #
Eq (f p) => Eq (Rec1 f p) |
Instance details Defined in GHC.Generics Methods (==) :: Rec1 f p -> Rec1 f p -> Bool # (/=) :: Rec1 f p -> Rec1 f p -> Bool #
Eq (URec (Ptr ()) p) |
Instance details Defined in GHC.Generics Methods (==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #
Eq (URec Char p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool # (/=) :: URec Char p -> URec Char p -> Bool #
Eq (URec Double p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Double p -> URec Double p -> Bool # (/=) :: URec Double p -> URec Double p -> Bool #
Eq (URec Float p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Float p -> URec Float p -> Bool # (/=) :: URec Float p -> URec Float p -> Bool #
Eq (URec Int p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Int p -> URec Int p -> Bool # (/=) :: URec Int p -> URec Int p -> Bool #
Eq (URec Word p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool # (/=) :: URec Word p -> URec Word p -> Bool #
(Eq a, Eq b, Eq c) => Eq (a, b, c) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c) -> (a, b, c) -> Bool # (/=) :: (a, b, c) -> (a, b, c) -> Bool #
Eq (STArray s i e) | Since: base-2.1
Instance details Defined in GHC.Arr Methods (==) :: STArray s i e -> STArray s i e -> Bool # (/=) :: STArray s i e -> STArray s i e -> Bool #
Eq a => Eq (Const a b) |
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool # (/=) :: Const a b -> Const a b -> Bool #
Eq (f a) => Eq (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Alt f a -> Alt f a -> Bool # (/=) :: Alt f a -> Alt f a -> Bool #
Eq (a :~: b) |
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~: b) -> (a :~: b) -> Bool # (/=) :: (a :~: b) -> (a :~: b) -> Bool #
Eq c => Eq (K1 i c p) |
Instance details Defined in GHC.Generics Methods (==) :: K1 i c p -> K1 i c p -> Bool # (/=) :: K1 i c p -> K1 i c p -> Bool #
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) |
Instance details Defined in GHC.Generics Methods (==) :: (f :+: g) p -> (f :+: g) p -> Bool # (/=) :: (f :+: g) p -> (f :+: g) p -> Bool #
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) |
Instance details Defined in GHC.Generics Methods (==) :: (f :*: g) p -> (f :*: g) p -> Bool # (/=) :: (f :*: g) p -> (f :*: g) p -> Bool #
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool #
Eq (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~~: b) -> (a :~~: b) -> Bool # (/=) :: (a :~~: b) -> (a :~~: b) -> Bool #
Eq (f p) => Eq (M1 i c f p) |
Instance details Defined in GHC.Generics Methods (==) :: M1 i c f p -> M1 i c f p -> Bool # (/=) :: M1 i c f p -> M1 i c f p -> Bool #
Eq (f (g p)) => Eq ((f :.: g) p) |
Instance details Defined in GHC.Generics Methods (==) :: (f :.: g) p -> (f :.: g) p -> Bool # (/=) :: (f :.: g) p -> (f :.: g) p -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods (==) :: Compose f g a -> Compose f g a -> Bool # (/=) :: Compose f g a -> Compose f g a -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (/=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (/=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (/=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

class Fractional a => Floating a where #

Trigonometric and hyperbolic functions and related functions.

Minimal complete definition

pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh

Methods

pi :: a #

exp :: a -> a #

log :: a -> a #

sqrt :: a -> a #

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

logBase :: a -> a -> a #

sin :: a -> a #

cos :: a -> a #

tan :: a -> a #

asin :: a -> a #

acos :: a -> a #

atan :: a -> a #

sinh :: a -> a #

cosh :: a -> a #

tanh :: a -> a #

asinh :: a -> a #

acosh :: a -> a #

atanh :: a -> a #

log1p :: a -> a #

``log1p` x` computes ``log` (1 + x)`, but provides more precise results for small (absolute) values of `x` if possible.

Since: base-4.9.0.0

expm1 :: a -> a #

``expm1` x` computes ``exp` x - 1`, but provides more precise results for small (absolute) values of `x` if possible.

Since: base-4.9.0.0

log1pexp :: a -> a #

``log1pexp` x` computes ``log` (1 + `exp` x)`, but provides more precise results if possible.

Examples:

- if `x` is a large negative number, ``log` (1 + `exp` x)` will be imprecise for the reasons given in `log1p`.
- if ``exp` x` is close to `-1`, ``log` (1 + `exp` x)` will be imprecise for the reasons given in `expm1`.

Since: base-4.9.0.0

log1mexp :: a -> a #

``log1mexp` x` computes ``log` (1 - `exp` x)`, but provides more precise results if possible.

Examples:

- if `x` is a large negative number, ``log` (1 - `exp` x)` will be imprecise for the reasons given in `log1p`.
- if ``exp` x` is close to `1`, ``log` (1 - `exp` x)` will be imprecise for the reasons given in `expm1`.

Since: base-4.9.0.0

Instances

Floating Double | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double # exp :: Double -> Double # log :: Double -> Double # sqrt :: Double -> Double # (**) :: Double -> Double -> Double # logBase :: Double -> Double -> Double # sin :: Double -> Double # cos :: Double -> Double # tan :: Double -> Double # asin :: Double -> Double # acos :: Double -> Double # atan :: Double -> Double # sinh :: Double -> Double # cosh :: Double -> Double # tanh :: Double -> Double # asinh :: Double -> Double # acosh :: Double -> Double # atanh :: Double -> Double # log1p :: Double -> Double # expm1 :: Double -> Double # log1pexp :: Double -> Double # log1mexp :: Double -> Double #
Floating Float | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float # exp :: Float -> Float # log :: Float -> Float # sqrt :: Float -> Float # (**) :: Float -> Float -> Float # logBase :: Float -> Float -> Float # sin :: Float -> Float # cos :: Float -> Float # tan :: Float -> Float # asin :: Float -> Float # acos :: Float -> Float # atan :: Float -> Float # sinh :: Float -> Float # cosh :: Float -> Float # tanh :: Float -> Float # asinh :: Float -> Float # acosh :: Float -> Float # atanh :: Float -> Float # log1p :: Float -> Float # expm1 :: Float -> Float # log1pexp :: Float -> Float # log1mexp :: Float -> Float #
Floating CFloat |
Instance details Defined in Foreign.C.Types Methods pi :: CFloat # exp :: CFloat -> CFloat # log :: CFloat -> CFloat # sqrt :: CFloat -> CFloat # (**) :: CFloat -> CFloat -> CFloat # logBase :: CFloat -> CFloat -> CFloat # sin :: CFloat -> CFloat # cos :: CFloat -> CFloat # tan :: CFloat -> CFloat # asin :: CFloat -> CFloat # acos :: CFloat -> CFloat # atan :: CFloat -> CFloat # sinh :: CFloat -> CFloat # cosh :: CFloat -> CFloat # tanh :: CFloat -> CFloat # asinh :: CFloat -> CFloat # acosh :: CFloat -> CFloat # atanh :: CFloat -> CFloat # log1p :: CFloat -> CFloat # expm1 :: CFloat -> CFloat # log1pexp :: CFloat -> CFloat # log1mexp :: CFloat -> CFloat #
Floating CDouble |
Instance details Defined in Foreign.C.Types Methods pi :: CDouble # exp :: CDouble -> CDouble # log :: CDouble -> CDouble # sqrt :: CDouble -> CDouble # (**) :: CDouble -> CDouble -> CDouble # logBase :: CDouble -> CDouble -> CDouble # sin :: CDouble -> CDouble # cos :: CDouble -> CDouble # tan :: CDouble -> CDouble # asin :: CDouble -> CDouble # acos :: CDouble -> CDouble # atan :: CDouble -> CDouble # sinh :: CDouble -> CDouble # cosh :: CDouble -> CDouble # tanh :: CDouble -> CDouble # asinh :: CDouble -> CDouble # acosh :: CDouble -> CDouble # atanh :: CDouble -> CDouble # log1p :: CDouble -> CDouble # expm1 :: CDouble -> CDouble # log1pexp :: CDouble -> CDouble # log1mexp :: CDouble -> CDouble #
RealFloat a => Floating (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods pi :: Complex a # 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 # log1pexp :: Complex a -> Complex a # log1mexp :: Complex a -> Complex a #
Floating a => Floating (Identity a) |
Instance details Defined in Data.Functor.Identity Methods pi :: Identity a # 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 # log1pexp :: Identity a -> Identity a # log1mexp :: Identity a -> Identity a #
Floating a => Floating (Const a b) |
Instance details Defined in Data.Functor.Const Methods pi :: Const a b # 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 # log1pexp :: Const a b -> Const a b # log1mexp :: Const a b -> Const a b #

class Num a => Fractional a where #

Fractional numbers, supporting real division.

Minimal complete definition

fromRational, (recip | (/))

Methods

(/) :: a -> a -> a infixl 7 #

fractional division

recip :: a -> a #

reciprocal fraction

fromRational :: Rational -> a #

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

Instances

Fractional CFloat |
Instance details Defined in Foreign.C.Types Methods (/) :: CFloat -> CFloat -> CFloat # recip :: CFloat -> CFloat # fromRational :: Rational -> CFloat #
Fractional CDouble |
Instance details Defined in Foreign.C.Types Methods (/) :: CDouble -> CDouble -> CDouble # recip :: CDouble -> CDouble # fromRational :: Rational -> CDouble #
Integral a => Fractional (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (/) :: Ratio a -> Ratio a -> Ratio a # recip :: Ratio a -> Ratio a # fromRational :: Rational -> Ratio a #
RealFloat a => Fractional (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods (/) :: Complex a -> Complex a -> Complex a # recip :: Complex a -> Complex a # fromRational :: Rational -> Complex a #
HasResolution a => Fractional (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods (/) :: Fixed a -> Fixed a -> Fixed a # recip :: Fixed a -> Fixed a # fromRational :: Rational -> Fixed a #
Fractional a => Fractional (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (/) :: Identity a -> Identity a -> Identity a # recip :: Identity a -> Identity a # fromRational :: Rational -> Identity a #
Fractional a => Fractional (Const a b) |
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b # recip :: Const a b -> Const a b # fromRational :: Rational -> Const a b #

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

Integral numbers, supporting integer division.

Minimal complete definition

quotRem, toInteger

Methods

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

integer division truncated toward zero

rem :: a -> a -> a infixl 7 #

integer remainder, satisfying

    (x `quot` y)*y + (x `rem` y) == x

div :: a -> a -> a infixl 7 #

integer division truncated toward negative infinity

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

integer modulus, satisfying

    (x `div` y)*y + (x `mod` y) == x

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

simultaneous `quot` and `rem`

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

simultaneous `div` and `mod`

toInteger :: a -> Integer #

conversion to `Integer`

Instances

Integral Int | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Int -> Int -> Int # rem :: Int -> Int -> Int # div :: Int -> Int -> Int # mod :: Int -> Int -> Int # quotRem :: Int -> Int -> (Int, Int) # divMod :: Int -> Int -> (Int, Int) # toInteger :: Int -> Integer #
Integral Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int8 -> Int8 -> Int8 # rem :: Int8 -> Int8 -> Int8 # div :: Int8 -> Int8 -> Int8 # mod :: Int8 -> Int8 -> Int8 # quotRem :: Int8 -> Int8 -> (Int8, Int8) # divMod :: Int8 -> Int8 -> (Int8, Int8) # toInteger :: Int8 -> Integer #
Integral Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int16 -> Int16 -> Int16 # rem :: Int16 -> Int16 -> Int16 # div :: Int16 -> Int16 -> Int16 # mod :: Int16 -> Int16 -> Int16 # quotRem :: Int16 -> Int16 -> (Int16, Int16) # divMod :: Int16 -> Int16 -> (Int16, Int16) # toInteger :: Int16 -> Integer #
Integral Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int32 -> Int32 -> Int32 # rem :: Int32 -> Int32 -> Int32 # div :: Int32 -> Int32 -> Int32 # mod :: Int32 -> Int32 -> Int32 # quotRem :: Int32 -> Int32 -> (Int32, Int32) # divMod :: Int32 -> Int32 -> (Int32, Int32) # toInteger :: Int32 -> Integer #
Integral Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int64 -> Int64 -> Int64 # rem :: Int64 -> Int64 -> Int64 # div :: Int64 -> Int64 -> Int64 # mod :: Int64 -> Int64 -> Int64 # quotRem :: Int64 -> Int64 -> (Int64, Int64) # divMod :: Int64 -> Int64 -> (Int64, Int64) # toInteger :: Int64 -> Integer #
Integral Integer | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Integer -> Integer -> Integer # rem :: Integer -> Integer -> Integer # div :: Integer -> Integer -> Integer # mod :: Integer -> Integer -> Integer # quotRem :: Integer -> Integer -> (Integer, Integer) # divMod :: Integer -> Integer -> (Integer, Integer) # toInteger :: Integer -> Integer #
Integral Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods quot :: Natural -> Natural -> Natural # rem :: Natural -> Natural -> Natural # div :: Natural -> Natural -> Natural # mod :: Natural -> Natural -> Natural # quotRem :: Natural -> Natural -> (Natural, Natural) # divMod :: Natural -> Natural -> (Natural, Natural) # toInteger :: Natural -> Integer #
Integral Word | Since: base-2.1
Instance details Defined in GHC.Real Methods quot :: Word -> Word -> Word # rem :: Word -> Word -> Word # div :: Word -> Word -> Word # mod :: Word -> Word -> Word # quotRem :: Word -> Word -> (Word, Word) # divMod :: Word -> Word -> (Word, Word) # toInteger :: Word -> Integer #
Integral Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word8 -> Word8 -> Word8 # rem :: Word8 -> Word8 -> Word8 # div :: Word8 -> Word8 -> Word8 # mod :: Word8 -> Word8 -> Word8 # quotRem :: Word8 -> Word8 -> (Word8, Word8) # divMod :: Word8 -> Word8 -> (Word8, Word8) # toInteger :: Word8 -> Integer #
Integral Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word16 -> Word16 -> Word16 # rem :: Word16 -> Word16 -> Word16 # div :: Word16 -> Word16 -> Word16 # mod :: Word16 -> Word16 -> Word16 # quotRem :: Word16 -> Word16 -> (Word16, Word16) # divMod :: Word16 -> Word16 -> (Word16, Word16) # toInteger :: Word16 -> Integer #
Integral Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word32 -> Word32 -> Word32 # rem :: Word32 -> Word32 -> Word32 # div :: Word32 -> Word32 -> Word32 # mod :: Word32 -> Word32 -> Word32 # quotRem :: Word32 -> Word32 -> (Word32, Word32) # divMod :: Word32 -> Word32 -> (Word32, Word32) # toInteger :: Word32 -> Integer #
Integral Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word64 -> Word64 -> Word64 # rem :: Word64 -> Word64 -> Word64 # div :: Word64 -> Word64 -> Word64 # mod :: Word64 -> Word64 -> Word64 # quotRem :: Word64 -> Word64 -> (Word64, Word64) # divMod :: Word64 -> Word64 -> (Word64, Word64) # toInteger :: Word64 -> Integer #
Integral CDev |
Instance details Defined in System.Posix.Types Methods quot :: CDev -> CDev -> CDev # rem :: CDev -> CDev -> CDev # div :: CDev -> CDev -> CDev # mod :: CDev -> CDev -> CDev # quotRem :: CDev -> CDev -> (CDev, CDev) # divMod :: CDev -> CDev -> (CDev, CDev) # toInteger :: CDev -> Integer #
Integral CIno |
Instance details Defined in System.Posix.Types Methods quot :: CIno -> CIno -> CIno # rem :: CIno -> CIno -> CIno # div :: CIno -> CIno -> CIno # mod :: CIno -> CIno -> CIno # quotRem :: CIno -> CIno -> (CIno, CIno) # divMod :: CIno -> CIno -> (CIno, CIno) # toInteger :: CIno -> Integer #
Integral CMode |
Instance details Defined in System.Posix.Types Methods quot :: CMode -> CMode -> CMode # rem :: CMode -> CMode -> CMode # div :: CMode -> CMode -> CMode # mod :: CMode -> CMode -> CMode # quotRem :: CMode -> CMode -> (CMode, CMode) # divMod :: CMode -> CMode -> (CMode, CMode) # toInteger :: CMode -> Integer #
Integral COff |
Instance details Defined in System.Posix.Types Methods quot :: COff -> COff -> COff # rem :: COff -> COff -> COff # div :: COff -> COff -> COff # mod :: COff -> COff -> COff # quotRem :: COff -> COff -> (COff, COff) # divMod :: COff -> COff -> (COff, COff) # toInteger :: COff -> Integer #
Integral CPid |
Instance details Defined in System.Posix.Types Methods quot :: CPid -> CPid -> CPid # rem :: CPid -> CPid -> CPid # div :: CPid -> CPid -> CPid # mod :: CPid -> CPid -> CPid # quotRem :: CPid -> CPid -> (CPid, CPid) # divMod :: CPid -> CPid -> (CPid, CPid) # toInteger :: CPid -> Integer #
Integral CSsize |
Instance details Defined in System.Posix.Types Methods quot :: CSsize -> CSsize -> CSsize # rem :: CSsize -> CSsize -> CSsize # div :: CSsize -> CSsize -> CSsize # mod :: CSsize -> CSsize -> CSsize # quotRem :: CSsize -> CSsize -> (CSsize, CSsize) # divMod :: CSsize -> CSsize -> (CSsize, CSsize) # toInteger :: CSsize -> Integer #
Integral CGid |
Instance details Defined in System.Posix.Types Methods quot :: CGid -> CGid -> CGid # rem :: CGid -> CGid -> CGid # div :: CGid -> CGid -> CGid # mod :: CGid -> CGid -> CGid # quotRem :: CGid -> CGid -> (CGid, CGid) # divMod :: CGid -> CGid -> (CGid, CGid) # toInteger :: CGid -> Integer #
Integral CNlink |
Instance details Defined in System.Posix.Types Methods quot :: CNlink -> CNlink -> CNlink # rem :: CNlink -> CNlink -> CNlink # div :: CNlink -> CNlink -> CNlink # mod :: CNlink -> CNlink -> CNlink # quotRem :: CNlink -> CNlink -> (CNlink, CNlink) # divMod :: CNlink -> CNlink -> (CNlink, CNlink) # toInteger :: CNlink -> Integer #
Integral CUid |
Instance details Defined in System.Posix.Types Methods quot :: CUid -> CUid -> CUid # rem :: CUid -> CUid -> CUid # div :: CUid -> CUid -> CUid # mod :: CUid -> CUid -> CUid # quotRem :: CUid -> CUid -> (CUid, CUid) # divMod :: CUid -> CUid -> (CUid, CUid) # toInteger :: CUid -> Integer #
Integral CTcflag |
Instance details Defined in System.Posix.Types Methods quot :: CTcflag -> CTcflag -> CTcflag # rem :: CTcflag -> CTcflag -> CTcflag # div :: CTcflag -> CTcflag -> CTcflag # mod :: CTcflag -> CTcflag -> CTcflag # quotRem :: CTcflag -> CTcflag -> (CTcflag, CTcflag) # divMod :: CTcflag -> CTcflag -> (CTcflag, CTcflag) # toInteger :: CTcflag -> Integer #
Integral CRLim |
Instance details Defined in System.Posix.Types Methods quot :: CRLim -> CRLim -> CRLim # rem :: CRLim -> CRLim -> CRLim # div :: CRLim -> CRLim -> CRLim # mod :: CRLim -> CRLim -> CRLim # quotRem :: CRLim -> CRLim -> (CRLim, CRLim) # divMod :: CRLim -> CRLim -> (CRLim, CRLim) # toInteger :: CRLim -> Integer #
Integral CBlkSize |
Instance details Defined in System.Posix.Types Methods quot :: CBlkSize -> CBlkSize -> CBlkSize # rem :: CBlkSize -> CBlkSize -> CBlkSize # div :: CBlkSize -> CBlkSize -> CBlkSize # mod :: CBlkSize -> CBlkSize -> CBlkSize # quotRem :: CBlkSize -> CBlkSize -> (CBlkSize, CBlkSize) # divMod :: CBlkSize -> CBlkSize -> (CBlkSize, CBlkSize) # toInteger :: CBlkSize -> Integer #
Integral CBlkCnt |
Instance details Defined in System.Posix.Types Methods quot :: CBlkCnt -> CBlkCnt -> CBlkCnt # rem :: CBlkCnt -> CBlkCnt -> CBlkCnt # div :: CBlkCnt -> CBlkCnt -> CBlkCnt # mod :: CBlkCnt -> CBlkCnt -> CBlkCnt # quotRem :: CBlkCnt -> CBlkCnt -> (CBlkCnt, CBlkCnt) # divMod :: CBlkCnt -> CBlkCnt -> (CBlkCnt, CBlkCnt) # toInteger :: CBlkCnt -> Integer #
Integral CClockId |
Instance details Defined in System.Posix.Types Methods quot :: CClockId -> CClockId -> CClockId # rem :: CClockId -> CClockId -> CClockId # div :: CClockId -> CClockId -> CClockId # mod :: CClockId -> CClockId -> CClockId # quotRem :: CClockId -> CClockId -> (CClockId, CClockId) # divMod :: CClockId -> CClockId -> (CClockId, CClockId) # toInteger :: CClockId -> Integer #
Integral CFsBlkCnt |
Instance details Defined in 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) # toInteger :: CFsBlkCnt -> Integer #
Integral CFsFilCnt |
Instance details Defined in 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) # toInteger :: CFsFilCnt -> Integer #
Integral CId |
Instance details Defined in System.Posix.Types Methods quot :: CId -> CId -> CId # rem :: CId -> CId -> CId # div :: CId -> CId -> CId # mod :: CId -> CId -> CId # quotRem :: CId -> CId -> (CId, CId) # divMod :: CId -> CId -> (CId, CId) # toInteger :: CId -> Integer #
Integral CKey |
Instance details Defined in System.Posix.Types Methods quot :: CKey -> CKey -> CKey # rem :: CKey -> CKey -> CKey # div :: CKey -> CKey -> CKey # mod :: CKey -> CKey -> CKey # quotRem :: CKey -> CKey -> (CKey, CKey) # divMod :: CKey -> CKey -> (CKey, CKey) # toInteger :: CKey -> Integer #
Integral Fd |
Instance details Defined in System.Posix.Types Methods quot :: Fd -> Fd -> Fd # rem :: Fd -> Fd -> Fd # div :: Fd -> Fd -> Fd # mod :: Fd -> Fd -> Fd # quotRem :: Fd -> Fd -> (Fd, Fd) # divMod :: Fd -> Fd -> (Fd, Fd) # toInteger :: Fd -> Integer #
Integral CChar |
Instance details Defined in Foreign.C.Types Methods quot :: CChar -> CChar -> CChar # rem :: CChar -> CChar -> CChar # div :: CChar -> CChar -> CChar # mod :: CChar -> CChar -> CChar # quotRem :: CChar -> CChar -> (CChar, CChar) # divMod :: CChar -> CChar -> (CChar, CChar) # toInteger :: CChar -> Integer #
Integral CSChar |
Instance details Defined in Foreign.C.Types Methods quot :: CSChar -> CSChar -> CSChar # rem :: CSChar -> CSChar -> CSChar # div :: CSChar -> CSChar -> CSChar # mod :: CSChar -> CSChar -> CSChar # quotRem :: CSChar -> CSChar -> (CSChar, CSChar) # divMod :: CSChar -> CSChar -> (CSChar, CSChar) # toInteger :: CSChar -> Integer #
Integral CUChar |
Instance details Defined in Foreign.C.Types Methods quot :: CUChar -> CUChar -> CUChar # rem :: CUChar -> CUChar -> CUChar # div :: CUChar -> CUChar -> CUChar # mod :: CUChar -> CUChar -> CUChar # quotRem :: CUChar -> CUChar -> (CUChar, CUChar) # divMod :: CUChar -> CUChar -> (CUChar, CUChar) # toInteger :: CUChar -> Integer #
Integral CShort |
Instance details Defined in Foreign.C.Types Methods quot :: CShort -> CShort -> CShort # rem :: CShort -> CShort -> CShort # div :: CShort -> CShort -> CShort # mod :: CShort -> CShort -> CShort # quotRem :: CShort -> CShort -> (CShort, CShort) # divMod :: CShort -> CShort -> (CShort, CShort) # toInteger :: CShort -> Integer #
Integral CUShort |
Instance details Defined in Foreign.C.Types Methods quot :: CUShort -> CUShort -> CUShort # rem :: CUShort -> CUShort -> CUShort # div :: CUShort -> CUShort -> CUShort # mod :: CUShort -> CUShort -> CUShort # quotRem :: CUShort -> CUShort -> (CUShort, CUShort) # divMod :: CUShort -> CUShort -> (CUShort, CUShort) # toInteger :: CUShort -> Integer #
Integral CInt |
Instance details Defined in Foreign.C.Types Methods quot :: CInt -> CInt -> CInt # rem :: CInt -> CInt -> CInt # div :: CInt -> CInt -> CInt # mod :: CInt -> CInt -> CInt # quotRem :: CInt -> CInt -> (CInt, CInt) # divMod :: CInt -> CInt -> (CInt, CInt) # toInteger :: CInt -> Integer #
Integral CUInt |
Instance details Defined in Foreign.C.Types Methods quot :: CUInt -> CUInt -> CUInt # rem :: CUInt -> CUInt -> CUInt # div :: CUInt -> CUInt -> CUInt # mod :: CUInt -> CUInt -> CUInt # quotRem :: CUInt -> CUInt -> (CUInt, CUInt) # divMod :: CUInt -> CUInt -> (CUInt, CUInt) # toInteger :: CUInt -> Integer #
Integral CLong |
Instance details Defined in Foreign.C.Types Methods quot :: CLong -> CLong -> CLong # rem :: CLong -> CLong -> CLong # div :: CLong -> CLong -> CLong # mod :: CLong -> CLong -> CLong # quotRem :: CLong -> CLong -> (CLong, CLong) # divMod :: CLong -> CLong -> (CLong, CLong) # toInteger :: CLong -> Integer #
Integral CULong |
Instance details Defined in Foreign.C.Types Methods quot :: CULong -> CULong -> CULong # rem :: CULong -> CULong -> CULong # div :: CULong -> CULong -> CULong # mod :: CULong -> CULong -> CULong # quotRem :: CULong -> CULong -> (CULong, CULong) # divMod :: CULong -> CULong -> (CULong, CULong) # toInteger :: CULong -> Integer #
Integral CLLong |
Instance details Defined in Foreign.C.Types Methods quot :: CLLong -> CLLong -> CLLong # rem :: CLLong -> CLLong -> CLLong # div :: CLLong -> CLLong -> CLLong # mod :: CLLong -> CLLong -> CLLong # quotRem :: CLLong -> CLLong -> (CLLong, CLLong) # divMod :: CLLong -> CLLong -> (CLLong, CLLong) # toInteger :: CLLong -> Integer #
Integral CULLong |
Instance details Defined in Foreign.C.Types Methods quot :: CULLong -> CULLong -> CULLong # rem :: CULLong -> CULLong -> CULLong # div :: CULLong -> CULLong -> CULLong # mod :: CULLong -> CULLong -> CULLong # quotRem :: CULLong -> CULLong -> (CULLong, CULLong) # divMod :: CULLong -> CULLong -> (CULLong, CULLong) # toInteger :: CULLong -> Integer #
Integral CBool |
Instance details Defined in Foreign.C.Types Methods quot :: CBool -> CBool -> CBool # rem :: CBool -> CBool -> CBool # div :: CBool -> CBool -> CBool # mod :: CBool -> CBool -> CBool # quotRem :: CBool -> CBool -> (CBool, CBool) # divMod :: CBool -> CBool -> (CBool, CBool) # toInteger :: CBool -> Integer #
Integral CPtrdiff |
Instance details Defined in Foreign.C.Types Methods quot :: CPtrdiff -> CPtrdiff -> CPtrdiff # rem :: CPtrdiff -> CPtrdiff -> CPtrdiff # div :: CPtrdiff -> CPtrdiff -> CPtrdiff # mod :: CPtrdiff -> CPtrdiff -> CPtrdiff # quotRem :: CPtrdiff -> CPtrdiff -> (CPtrdiff, CPtrdiff) # divMod :: CPtrdiff -> CPtrdiff -> (CPtrdiff, CPtrdiff) # toInteger :: CPtrdiff -> Integer #
Integral CSize |
Instance details Defined in Foreign.C.Types Methods quot :: CSize -> CSize -> CSize # rem :: CSize -> CSize -> CSize # div :: CSize -> CSize -> CSize # mod :: CSize -> CSize -> CSize # quotRem :: CSize -> CSize -> (CSize, CSize) # divMod :: CSize -> CSize -> (CSize, CSize) # toInteger :: CSize -> Integer #
Integral CWchar |
Instance details Defined in Foreign.C.Types Methods quot :: CWchar -> CWchar -> CWchar # rem :: CWchar -> CWchar -> CWchar # div :: CWchar -> CWchar -> CWchar # mod :: CWchar -> CWchar -> CWchar # quotRem :: CWchar -> CWchar -> (CWchar, CWchar) # divMod :: CWchar -> CWchar -> (CWchar, CWchar) # toInteger :: CWchar -> Integer #
Integral CSigAtomic |
Instance details Defined in 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 CIntPtr |
Instance details Defined in Foreign.C.Types Methods quot :: CIntPtr -> CIntPtr -> CIntPtr # rem :: CIntPtr -> CIntPtr -> CIntPtr # div :: CIntPtr -> CIntPtr -> CIntPtr # mod :: CIntPtr -> CIntPtr -> CIntPtr # quotRem :: CIntPtr -> CIntPtr -> (CIntPtr, CIntPtr) # divMod :: CIntPtr -> CIntPtr -> (CIntPtr, CIntPtr) # toInteger :: CIntPtr -> Integer #
Integral CUIntPtr |
Instance details Defined in Foreign.C.Types Methods quot :: CUIntPtr -> CUIntPtr -> CUIntPtr # rem :: CUIntPtr -> CUIntPtr -> CUIntPtr # div :: CUIntPtr -> CUIntPtr -> CUIntPtr # mod :: CUIntPtr -> CUIntPtr -> CUIntPtr # quotRem :: CUIntPtr -> CUIntPtr -> (CUIntPtr, CUIntPtr) # divMod :: CUIntPtr -> CUIntPtr -> (CUIntPtr, CUIntPtr) # toInteger :: CUIntPtr -> Integer #
Integral CIntMax |
Instance details Defined in Foreign.C.Types Methods quot :: CIntMax -> CIntMax -> CIntMax # rem :: CIntMax -> CIntMax -> CIntMax # div :: CIntMax -> CIntMax -> CIntMax # mod :: CIntMax -> CIntMax -> CIntMax # quotRem :: CIntMax -> CIntMax -> (CIntMax, CIntMax) # divMod :: CIntMax -> CIntMax -> (CIntMax, CIntMax) # toInteger :: CIntMax -> Integer #
Integral CUIntMax |
Instance details Defined in Foreign.C.Types Methods quot :: CUIntMax -> CUIntMax -> CUIntMax # rem :: CUIntMax -> CUIntMax -> CUIntMax # div :: CUIntMax -> CUIntMax -> CUIntMax # mod :: CUIntMax -> CUIntMax -> CUIntMax # quotRem :: CUIntMax -> CUIntMax -> (CUIntMax, CUIntMax) # divMod :: CUIntMax -> CUIntMax -> (CUIntMax, CUIntMax) # toInteger :: CUIntMax -> Integer #
Integral WordPtr |
Instance details Defined in Foreign.Ptr Methods quot :: WordPtr -> WordPtr -> WordPtr # rem :: WordPtr -> WordPtr -> WordPtr # div :: WordPtr -> WordPtr -> WordPtr # mod :: WordPtr -> WordPtr -> WordPtr # quotRem :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # divMod :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # toInteger :: WordPtr -> Integer #
Integral IntPtr |
Instance details Defined in Foreign.Ptr Methods quot :: IntPtr -> IntPtr -> IntPtr # rem :: IntPtr -> IntPtr -> IntPtr # div :: IntPtr -> IntPtr -> IntPtr # mod :: IntPtr -> IntPtr -> IntPtr # quotRem :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # divMod :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # toInteger :: IntPtr -> Integer #
Integral a => Integral (Identity a) |
Instance details Defined in 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) # toInteger :: Identity a -> Integer #
Integral a => Integral (Const a b) |
Instance details Defined in 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) # toInteger :: Const a b -> Integer #

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

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

Instances of `Monad` should satisfy the following laws:

-     return a >>= k  =  k a

-     m >>= return  =  m

-     m >>= (\x -> k x >>= h)  =  (m >>= k) >>= h

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

-     pure = return

-     (<*>) = ap

The above laws imply:

-     fmap f xs  =  xs >>= return . f

-     (>>) = (*>)

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

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

Minimal complete definition

(>>=)

Methods

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

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

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

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

return :: a -> m a #

Inject a value into the monadic type.

fail :: String -> m a #

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

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

Instances

Monad [] | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: [a] -> (a -> [b]) -> [b] # (>>) :: [a] -> [b] -> [b] # return :: a -> [a] # fail :: String -> [a] #
Monad Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b # (>>) :: Maybe a -> Maybe b -> Maybe b # return :: a -> Maybe a # fail :: String -> Maybe a #
Monad IO | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b # (>>) :: IO a -> IO b -> IO b # return :: a -> IO a # fail :: String -> IO a #
Monad Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b # (>>) :: Par1 a -> Par1 b -> Par1 b # return :: a -> Par1 a # fail :: String -> Par1 a #
Monad Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods (>>=) :: Complex a -> (a -> Complex b) -> Complex b # (>>) :: Complex a -> Complex b -> Complex b # return :: a -> Complex a # fail :: String -> Complex a #
Monad Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Min a -> (a -> Min b) -> Min b # (>>) :: Min a -> Min b -> Min b # return :: a -> Min a # fail :: String -> Min a #
Monad Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Max a -> (a -> Max b) -> Max b # (>>) :: Max a -> Max b -> Max b # return :: a -> Max a # fail :: String -> Max a #
Monad First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a # fail :: String -> First a #
Monad Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a # fail :: String -> Last a #
Monad Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Option a -> (a -> Option b) -> Option b # (>>) :: Option a -> Option b -> Option b # return :: a -> Option a # fail :: String -> Option a #
Monad Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b # (>>) :: Identity a -> Identity b -> Identity b # return :: a -> Identity a # fail :: String -> Identity a #
Monad STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods (>>=) :: STM a -> (a -> STM b) -> STM b # (>>) :: STM a -> STM b -> STM b # return :: a -> STM a # fail :: String -> STM a #
Monad First |
Instance details Defined in Data.Monoid Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a # fail :: String -> First a #
Monad Last |
Instance details Defined in Data.Monoid Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a # fail :: String -> Last a #
Monad Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Dual a -> (a -> Dual b) -> Dual b # (>>) :: Dual a -> Dual b -> Dual b # return :: a -> Dual a # fail :: String -> Dual a #
Monad Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Sum a -> (a -> Sum b) -> Sum b # (>>) :: Sum a -> Sum b -> Sum b # return :: a -> Sum a # fail :: String -> Sum a #
Monad Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Product a -> (a -> Product b) -> Product b # (>>) :: Product a -> Product b -> Product b # return :: a -> Product a # fail :: String -> Product a #
Monad Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (>>=) :: Down a -> (a -> Down b) -> Down b # (>>) :: Down a -> Down b -> Down b # return :: a -> Down a # fail :: String -> Down a #
Monad ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods (>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b # (>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # return :: a -> ReadPrec a # fail :: String -> ReadPrec a #
Monad ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b # (>>) :: ReadP a -> ReadP b -> ReadP b # return :: a -> ReadP a # fail :: String -> ReadP a #
Monad NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b # (>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # return :: a -> NonEmpty a # fail :: String -> NonEmpty a #
Monad P | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: P a -> (a -> P b) -> P b # (>>) :: P a -> P b -> P b # return :: a -> P a # fail :: String -> P a #
Monad (Either e) | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b # (>>) :: Either e a -> Either e b -> Either e b # return :: a -> Either e a # fail :: String -> Either e a #
Monad (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: U1 a -> (a -> U1 b) -> U1 b # (>>) :: U1 a -> U1 b -> U1 b # return :: a -> U1 a # fail :: String -> U1 a #
Monoid a => Monad ((,) a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) # (>>) :: (a, a0) -> (a, b) -> (a, b) # return :: a0 -> (a, a0) # fail :: String -> (a, a0) #
Monad m => Monad (WrappedMonad m) |
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a #
ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1
Instance details Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # fail :: String -> ArrowMonad a a0 #
Monad (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b # (>>) :: Proxy a -> Proxy b -> Proxy b # return :: a -> Proxy a # fail :: String -> Proxy a #
Monad (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods (>>=) :: ST s a -> (a -> ST s b) -> ST s b # (>>) :: ST s a -> ST s b -> ST s b # return :: a -> ST s a # fail :: String -> ST s a #
Monad f => Monad (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b # (>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b # return :: a -> Rec1 f a # fail :: String -> Rec1 f a #
Monad f => Monad (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b # (>>) :: Alt f a -> Alt f b -> Alt f b # return :: a -> Alt f a # fail :: String -> Alt f a #
Monad ((->) r :: * -> *) | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: (r -> a) -> (a -> r -> b) -> r -> b # (>>) :: (r -> a) -> (r -> b) -> r -> b # return :: a -> r -> a # fail :: String -> r -> a #
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b # (>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b # return :: a -> (f :*: g) a # fail :: String -> (f :*: g) a #
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b # (>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b # return :: a -> M1 i c f a # fail :: String -> M1 i c f a #

class Typeable a => Data a where #

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

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

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

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

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

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

GHC will generate an instance that is equivalent to

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

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

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

        dataTypeOf _ = ty_T

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

This is suitable for datatypes that are exported transparently.

Minimal complete definition

gunfold, toConstr, dataTypeOf

Methods

gfoldl #

Arguments

:: (forall d b. Data d => c (d -> b) -> d -> c b) | defines how nonempty constructor applications are folded. It takes the folded tail of the constructor application and its head, i.e., an immediate subterm, and combines them in some way.
-> (forall g. g -> c g) | defines how the empty constructor application is folded, like the neutral / start element for list folding.
-> a | structure to be folded.
-> c a | result, with a type defined in terms of `a`, but variability is achieved by means of type constructor `c` for the construction of the actual result type.

Left-associative fold operation for constructor applications.

The type of `gfoldl` is a headache, but operationally it is a simple generalisation of a list fold.

The default definition for `gfoldl` is ``const` `id``, which is suitable for abstract datatypes with no substructures.

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

Unfolding constructor applications

toConstr :: a -> Constr #

Obtaining the constructor from a given datum. For proper terms, this is meant to be the top-level constructor. Primitive datatypes are here viewed as potentially infinite sets of values (i.e., constructors).

dataTypeOf :: a -> DataType #

The outer type constructor of the type

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

Mediate types and unary type constructors.

In `Data` instances of the form

        instance (Data a, ...) => Data (T a)

`dataCast1` should be defined as `gcast1`.

The default definition is ``const` `Nothing``, which is appropriate for instances of other forms.

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

Mediate types and binary type constructors.

In `Data` instances of the form

        instance (Data a, Data b, ...) => Data (T a b)

`dataCast2` should be defined as `gcast2`.

The default definition is ``const` `Nothing``, which is appropriate for instances of other forms.

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

A generic transformation that maps over the immediate subterms

The default definition instantiates the type constructor `c` in the type of `gfoldl` to an identity datatype constructor, using the isomorphism pair as injection and projection.

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

A generic query with a left-associative binary operator

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

A generic query with a right-associative binary operator

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

A generic query that processes the immediate subterms and returns a list of results. The list is given in the same order as originally specified in the declaration of the data constructors.

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

A generic query that processes one child by index (zero-based)

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

A generic monadic transformation that maps over the immediate subterms

The default definition instantiates the type constructor `c` in the type of `gfoldl` to the monad datatype constructor, defining injection and projection using `return` and `>>=`.

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

Transformation of at least one immediate subterm does not fail

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

Transformation of one immediate subterm with success

Instances

Data Bool | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bool -> c Bool # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool # toConstr :: Bool -> Constr # dataTypeOf :: Bool -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) # gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool #
Data Char | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char # toConstr :: Char -> Constr # dataTypeOf :: Char -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) # gmapT :: (forall b. Data b => b -> b) -> Char -> Char # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #
Data Double | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double # toConstr :: Double -> Constr # dataTypeOf :: Double -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) # gmapT :: (forall b. Data b => b -> b) -> Double -> Double # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double #
Data Float | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float # toConstr :: Float -> Constr # dataTypeOf :: Float -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) # gmapT :: (forall b. Data b => b -> b) -> Float -> Float # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float #
Data Int | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int -> c Int # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int # toConstr :: Int -> Constr # dataTypeOf :: Int -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) # gmapT :: (forall b. Data b => b -> b) -> Int -> Int # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int #
Data Int8 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int8 -> c Int8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int8 # toConstr :: Int8 -> Constr # dataTypeOf :: Int8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int8) # gmapT :: (forall b. Data b => b -> b) -> Int8 -> Int8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 #
Data Int16 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int16 -> c Int16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int16 # toConstr :: Int16 -> Constr # dataTypeOf :: Int16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int16) # gmapT :: (forall b. Data b => b -> b) -> Int16 -> Int16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 #
Data Int32 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int32 -> c Int32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int32 # toConstr :: Int32 -> Constr # dataTypeOf :: Int32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int32) # gmapT :: (forall b. Data b => b -> b) -> Int32 -> Int32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 #
Data Int64 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int64 -> c Int64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int64 # toConstr :: Int64 -> Constr # dataTypeOf :: Int64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int64) # gmapT :: (forall b. Data b => b -> b) -> Int64 -> Int64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 #
Data Integer | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer # toConstr :: Integer -> Constr # dataTypeOf :: Integer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer #
Data Natural | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural # toConstr :: Natural -> Constr # dataTypeOf :: Natural -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) # gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural #
Data Ordering | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering # toConstr :: Ordering -> Constr # dataTypeOf :: Ordering -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) # gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering #
Data Word | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word # toConstr :: Word -> Constr # dataTypeOf :: Word -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) # gmapT :: (forall b. Data b => b -> b) -> Word -> Word # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word #
Data Word8 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word8 -> c Word8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word8 # toConstr :: Word8 -> Constr # dataTypeOf :: Word8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word8) # gmapT :: (forall b. Data b => b -> b) -> Word8 -> Word8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 #
Data Word16 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word16 -> c Word16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word16 # toConstr :: Word16 -> Constr # dataTypeOf :: Word16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word16) # gmapT :: (forall b. Data b => b -> b) -> Word16 -> Word16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 #
Data Word32 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word32 -> c Word32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word32 # toConstr :: Word32 -> Constr # dataTypeOf :: Word32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word32) # gmapT :: (forall b. Data b => b -> b) -> Word32 -> Word32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 #
Data Word64 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word64 -> c Word64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word64 # toConstr :: Word64 -> Constr # dataTypeOf :: Word64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word64) # gmapT :: (forall b. Data b => b -> b) -> Word64 -> Word64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 #
Data () | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> () -> c () # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c () # toConstr :: () -> Constr # dataTypeOf :: () -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ()) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ()) # gmapT :: (forall b. Data b => b -> b) -> () -> () # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> () -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> () -> r # gmapQ :: (forall d. Data d => d -> u) -> () -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> () -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> () -> m () # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> () -> m () # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> () -> m () #
Data Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Void -> c Void # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Void # toConstr :: Void -> Constr # dataTypeOf :: Void -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Void) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Void) # gmapT :: (forall b. Data b => b -> b) -> Void -> Void # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQ :: (forall d. Data d => d -> u) -> Void -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Void -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void #
Data SpecConstrAnnotation |
Instance details Defined in GHC.Exts Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpecConstrAnnotation -> c SpecConstrAnnotation # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SpecConstrAnnotation # toConstr :: SpecConstrAnnotation -> Constr # dataTypeOf :: SpecConstrAnnotation -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SpecConstrAnnotation) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpecConstrAnnotation) # gmapT :: (forall b. Data b => b -> b) -> SpecConstrAnnotation -> SpecConstrAnnotation # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpecConstrAnnotation -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpecConstrAnnotation -> r # gmapQ :: (forall d. Data d => d -> u) -> SpecConstrAnnotation -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SpecConstrAnnotation -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpecConstrAnnotation -> m SpecConstrAnnotation # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpecConstrAnnotation -> m SpecConstrAnnotation # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpecConstrAnnotation -> m SpecConstrAnnotation #
Data Version | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version # toConstr :: Version -> Constr # dataTypeOf :: Version -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) # gmapT :: (forall b. Data b => b -> b) -> Version -> Version # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version #
Data All | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All # toConstr :: All -> Constr # dataTypeOf :: All -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c All) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) # gmapT :: (forall b. Data b => b -> b) -> All -> All # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQ :: (forall d. Data d => d -> u) -> All -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All #
Data Any | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any # toConstr :: Any -> Constr # dataTypeOf :: Any -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Any) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) # gmapT :: (forall b. Data b => b -> b) -> Any -> Any # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any #
Data Fixity | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixity -> c Fixity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity # toConstr :: Fixity -> Constr # dataTypeOf :: Fixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity #
Data Associativity | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Associativity -> c Associativity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Associativity # toConstr :: Associativity -> Constr # dataTypeOf :: Associativity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Associativity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Associativity) # gmapT :: (forall b. Data b => b -> b) -> Associativity -> Associativity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Associativity -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Associativity -> r # gmapQ :: (forall d. Data d => d -> u) -> Associativity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Associativity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity #
Data SourceUnpackedness | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceUnpackedness -> c SourceUnpackedness # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceUnpackedness # toConstr :: SourceUnpackedness -> Constr # dataTypeOf :: SourceUnpackedness -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceUnpackedness) # gmapT :: (forall b. Data b => b -> b) -> SourceUnpackedness -> SourceUnpackedness # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r # gmapQ :: (forall d. Data d => d -> u) -> SourceUnpackedness -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness #
Data SourceStrictness | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceStrictness # toConstr :: SourceStrictness -> Constr # dataTypeOf :: SourceStrictness -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceStrictness) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceStrictness) # gmapT :: (forall b. Data b => b -> b) -> SourceStrictness -> SourceStrictness # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r # gmapQ :: (forall d. Data d => d -> u) -> SourceStrictness -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness #
Data DecidedStrictness | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DecidedStrictness -> c DecidedStrictness # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DecidedStrictness # toConstr :: DecidedStrictness -> Constr # dataTypeOf :: DecidedStrictness -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DecidedStrictness) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DecidedStrictness) # gmapT :: (forall b. Data b => b -> b) -> DecidedStrictness -> DecidedStrictness # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r # gmapQ :: (forall d. Data d => d -> u) -> DecidedStrictness -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DecidedStrictness -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DecidedStrictness -> m DecidedStrictness # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DecidedStrictness -> m DecidedStrictness # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DecidedStrictness -> m DecidedStrictness #
Data WordPtr | Since: base-4.11.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WordPtr -> c WordPtr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WordPtr # toConstr :: WordPtr -> Constr # dataTypeOf :: WordPtr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WordPtr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WordPtr) # gmapT :: (forall b. Data b => b -> b) -> WordPtr -> WordPtr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WordPtr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WordPtr -> r # gmapQ :: (forall d. Data d => d -> u) -> WordPtr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WordPtr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr #
Data IntPtr | Since: base-4.11.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntPtr -> c IntPtr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IntPtr # toConstr :: IntPtr -> Constr # dataTypeOf :: IntPtr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IntPtr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IntPtr) # gmapT :: (forall b. Data b => b -> b) -> IntPtr -> IntPtr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntPtr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntPtr -> r # gmapQ :: (forall d. Data d => d -> u) -> IntPtr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IntPtr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr #
Data a => Data [a] | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> [a] -> c [a] # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c [a] # toConstr :: [a] -> Constr # dataTypeOf :: [a] -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c [a]) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c [a]) # gmapT :: (forall b. Data b => b -> b) -> [a] -> [a] # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> [a] -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> [a] -> r # gmapQ :: (forall d. Data d => d -> u) -> [a] -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> [a] -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> [a] -> m [a] # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> [a] -> m [a] # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> [a] -> m [a] #
Data a => Data (Maybe a) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) # toConstr :: Maybe a -> Constr # dataTypeOf :: Maybe a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) # gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #
(Data a, Integral a) => Data (Ratio a) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ratio a -> c (Ratio a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ratio a) # toConstr :: Ratio a -> Constr # dataTypeOf :: Ratio a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ratio a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ratio a)) # gmapT :: (forall b. Data b => b -> b) -> Ratio a -> Ratio a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ratio a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ratio a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ratio a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ratio a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) #
Data a => Data (Ptr a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ptr a -> c (Ptr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ptr a) # toConstr :: Ptr a -> Constr # dataTypeOf :: Ptr a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ptr a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ptr a)) # gmapT :: (forall b. Data b => b -> b) -> Ptr a -> Ptr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ptr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ptr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) #
Data p => Data (Par1 p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Par1 p -> c (Par1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Par1 p) # toConstr :: Par1 p -> Constr # dataTypeOf :: Par1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Par1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Par1 p)) # gmapT :: (forall b. Data b => b -> b) -> Par1 p -> Par1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Par1 p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Par1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> Par1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Par1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Par1 p -> m (Par1 p) #
Data a => Data (Complex a) |
Instance details Defined in Data.Complex Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a) # toConstr :: Complex a -> Constr # dataTypeOf :: Complex a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a)) # gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r # gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #
Typeable a => Data (Fixed a) | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixed a -> c (Fixed a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Fixed a) # toConstr :: Fixed a -> Constr # dataTypeOf :: Fixed a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Fixed a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Fixed a)) # gmapT :: (forall b. Data b => b -> b) -> Fixed a -> Fixed a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixed a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixed a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) #
Data a => Data (Min a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Min a -> c (Min a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Min a) # toConstr :: Min a -> Constr # dataTypeOf :: Min a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Min a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Min a)) # gmapT :: (forall b. Data b => b -> b) -> Min a -> Min a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r # gmapQ :: (forall d. Data d => d -> u) -> Min a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Min a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #
Data a => Data (Max a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Max a -> c (Max a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Max a) # toConstr :: Max a -> Constr # dataTypeOf :: Max a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Max a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Max a)) # gmapT :: (forall b. Data b => b -> b) -> Max a -> Max a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r # gmapQ :: (forall d. Data d => d -> u) -> Max a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Max a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #
Data a => Data (First a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) # toConstr :: First a -> Constr # dataTypeOf :: First a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) # gmapT :: (forall b. Data b => b -> b) -> First a -> First a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #
Data a => Data (Last a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) # toConstr :: Last a -> Constr # dataTypeOf :: Last a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) # gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #
Data m => Data (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonoid m -> c (WrappedMonoid m) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonoid m) # toConstr :: WrappedMonoid m -> Constr # dataTypeOf :: WrappedMonoid m -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonoid m)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonoid m)) # gmapT :: (forall b. Data b => b -> b) -> WrappedMonoid m -> WrappedMonoid m # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r # gmapQ :: (forall d. Data d => d -> u) -> WrappedMonoid m -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonoid m -> u # gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) # gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) # gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #
Data a => Data (Option a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Option a -> c (Option a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Option a) # toConstr :: Option a -> Constr # dataTypeOf :: Option a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Option a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Option a)) # gmapT :: (forall b. Data b => b -> b) -> Option a -> Option a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r # gmapQ :: (forall d. Data d => d -> u) -> Option a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Option a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) #
Data a => Data (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) # toConstr :: Identity a -> Constr # dataTypeOf :: Identity a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) # gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #
Data a => Data (ForeignPtr a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ForeignPtr a -> c (ForeignPtr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ForeignPtr a) # toConstr :: ForeignPtr a -> Constr # dataTypeOf :: ForeignPtr a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ForeignPtr a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ForeignPtr a)) # gmapT :: (forall b. Data b => b -> b) -> ForeignPtr a -> ForeignPtr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ForeignPtr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ForeignPtr a -> r # gmapQ :: (forall d. Data d => d -> u) -> ForeignPtr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ForeignPtr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) #
Data a => Data (First a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) # toConstr :: First a -> Constr # dataTypeOf :: First a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) # gmapT :: (forall b. Data b => b -> b) -> First a -> First a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #
Data a => Data (Last a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) # toConstr :: Last a -> Constr # dataTypeOf :: Last a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) # gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #
Data a => Data (Dual a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dual a -> c (Dual a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dual a) # toConstr :: Dual a -> Constr # dataTypeOf :: Dual a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dual a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dual a)) # gmapT :: (forall b. Data b => b -> b) -> Dual a -> Dual a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQ :: (forall d. Data d => d -> u) -> Dual a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dual a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) #
Data a => Data (Sum a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum a -> c (Sum a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum a) # toConstr :: Sum a -> Constr # dataTypeOf :: Sum a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sum a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum a)) # gmapT :: (forall b. Data b => b -> b) -> Sum a -> Sum a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQ :: (forall d. Data d => d -> u) -> Sum a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) #
Data a => Data (Product a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Product a -> c (Product a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product a) # toConstr :: Product a -> Constr # dataTypeOf :: Product a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product a)) # gmapT :: (forall b. Data b => b -> b) -> Product a -> Product a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQ :: (forall d. Data d => d -> u) -> Product a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Product a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) #
Data a => Data (NonEmpty a) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) # toConstr :: NonEmpty a -> Constr # dataTypeOf :: NonEmpty a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) # gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #
(Data a, Data b) => Data (Either a b) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Either a b -> c (Either a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) # toConstr :: Either a b -> Constr # dataTypeOf :: Either a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) #
Data p => Data (V1 p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V1 p -> c (V1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V1 p) # toConstr :: V1 p -> Constr # dataTypeOf :: V1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V1 p)) # gmapT :: (forall b. Data b => b -> b) -> V1 p -> V1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> V1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> V1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) #
Data p => Data (U1 p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> U1 p -> c (U1 p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (U1 p) # toConstr :: U1 p -> Constr # dataTypeOf :: U1 p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (U1 p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (U1 p)) # gmapT :: (forall b. Data b => b -> b) -> U1 p -> U1 p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> U1 p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> U1 p -> r # gmapQ :: (forall d. Data d => d -> u) -> U1 p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> U1 p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> U1 p -> m (U1 p) #
(Data a, Data b) => Data (a, b) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a, b) -> c (a, b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a, b) # toConstr :: (a, b) -> Constr # dataTypeOf :: (a, b) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a, b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a, b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b) -> (a, b) # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a, b) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a, b) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a, b) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a, b) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a, b) -> m (a, b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a, b) -> m (a, b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a, b) -> m (a, b) #
(Data a, Data b, Ix a) => Data (Array a b) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Array a b -> c (Array a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Array a b) # toConstr :: Array a b -> Constr # dataTypeOf :: Array a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Array a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Array a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Array a b -> Array a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Array a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Array a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Array a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Array a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Array a b -> m (Array a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Array a b -> m (Array a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Array a b -> m (Array a b) #
(Data a, Data b) => Data (Arg a b) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Arg a b -> c (Arg a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Arg a b) # toConstr :: Arg a b -> Constr # dataTypeOf :: Arg a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Arg a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Arg a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Arg a b -> Arg a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Arg a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Arg a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) #
Data t => Data (Proxy t) | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) #
(Data (f p), Typeable f, Data p) => Data (Rec1 f p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Rec1 f p -> c (Rec1 f p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Rec1 f p) # toConstr :: Rec1 f p -> Constr # dataTypeOf :: Rec1 f p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Rec1 f p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Rec1 f p)) # gmapT :: (forall b. Data b => b -> b) -> Rec1 f p -> Rec1 f p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Rec1 f p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Rec1 f p -> r # gmapQ :: (forall d. Data d => d -> u) -> Rec1 f p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Rec1 f p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Rec1 f p -> m (Rec1 f p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Rec1 f p -> m (Rec1 f p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Rec1 f p -> m (Rec1 f p) #
(Data a, Data b, Data c) => Data (a, b, c) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c0 (d -> b0) -> d -> c0 b0) -> (forall g. g -> c0 g) -> (a, b, c) -> c0 (a, b, c) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (a, b, c) # toConstr :: (a, b, c) -> Constr # dataTypeOf :: (a, b, c) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (a, b, c)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (a, b, c)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b, c) -> (a, b, c) # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a, b, c) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a, b, c) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a, b, c) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a, b, c) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a, b, c) -> m (a, b, c) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a, b, c) -> m (a, b, c) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a, b, c) -> m (a, b, c) #
(Typeable k, Data a, Typeable b) => Data (Const a b) | Since: base-4.10.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Const a b -> c (Const a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Const a b) # toConstr :: Const a b -> Constr # dataTypeOf :: Const a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Const a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Const a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Const a b -> Const a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Const a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Const a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) #
(Data (f a), Data a, Typeable f) => Data (Alt f a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alt f a -> c (Alt f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alt f a) # toConstr :: Alt f a -> Constr # dataTypeOf :: Alt f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Alt f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alt f a)) # gmapT :: (forall b. Data b => b -> b) -> Alt f a -> Alt f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQ :: (forall d. Data d => d -> u) -> Alt f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Alt f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) #
(Coercible a b, Data a, Data b) => Data (Coercion a b) | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Coercion a b -> c (Coercion a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Coercion a b) # toConstr :: Coercion a b -> Constr # dataTypeOf :: Coercion a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Coercion a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Coercion a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Coercion a b -> Coercion a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coercion a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coercion a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Coercion a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Coercion a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Coercion a b -> m (Coercion a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion a b -> m (Coercion a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion a b -> m (Coercion a b) #
(a ~ b, Data a) => Data (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~: b) -> c (a :~: b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~: b) # toConstr :: (a :~: b) -> Constr # dataTypeOf :: (a :~: b) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~: b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~: b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~: b) -> a :~: b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a :~: b) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~: b) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) #
(Typeable i, Data p, Data c) => Data (K1 i c p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> K1 i c p -> c0 (K1 i c p) # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (K1 i c p) # toConstr :: K1 i c p -> Constr # dataTypeOf :: K1 i c p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (K1 i c p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (K1 i c p)) # gmapT :: (forall b. Data b => b -> b) -> K1 i c p -> K1 i c p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> K1 i c p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> K1 i c p -> r # gmapQ :: (forall d. Data d => d -> u) -> K1 i c p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> K1 i c p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> K1 i c p -> m (K1 i c p) #
(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :+: g) p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :+: g) p -> c ((f :+: g) p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :+: g) p) # toConstr :: (f :+: g) p -> Constr # dataTypeOf :: (f :+: g) p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :+: g) p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :+: g) p)) # gmapT :: (forall b. Data b => b -> b) -> (f :+: g) p -> (f :+: g) p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :+: g) p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :+: g) p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) #
(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :*: g) p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :*: g) p -> c ((f :*: g) p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :*: g) p) # toConstr :: (f :*: g) p -> Constr # dataTypeOf :: (f :*: g) p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :*: g) p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :*: g) p)) # gmapT :: (forall b. Data b => b -> b) -> (f :*: g) p -> (f :*: g) p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :*: g) p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :*: g) p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) #
(Data a, Data b, Data c, Data d) => Data (a, b, c, d) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d0 b0. Data d0 => c0 (d0 -> b0) -> d0 -> c0 b0) -> (forall g. g -> c0 g) -> (a, b, c, d) -> c0 (a, b, c, d) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (a, b, c, d) # toConstr :: (a, b, c, d) -> Constr # dataTypeOf :: (a, b, c, d) -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (a, b, c, d)) # dataCast2 :: Typeable t => (forall d0 e. (Data d0, Data e) => c0 (t d0 e)) -> Maybe (c0 (a, b, c, d)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b, c, d) -> (a, b, c, d) # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d) -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> (a, b, c, d) -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> (a, b, c, d) -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d) -> m (a, b, c, d) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d) -> m (a, b, c, d) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d) -> m (a, b, c, d) #
(Typeable i, Typeable j, Typeable a, Typeable b, a ~~ b) => Data (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~~: b) -> c (a :~~: b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~~: b) # toConstr :: (a :~~: b) -> Constr # dataTypeOf :: (a :~~: b) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~~: b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~~: b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~~: b) -> a :~~: b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~~: b) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~~: b) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a :~~: b) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~~: b) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) #
(Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> M1 i c f p -> c0 (M1 i c f p) # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (M1 i c f p) # toConstr :: M1 i c f p -> Constr # dataTypeOf :: M1 i c f p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (M1 i c f p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (M1 i c f p)) # gmapT :: (forall b. Data b => b -> b) -> M1 i c f p -> M1 i c f p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> M1 i c f p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> M1 i c f p -> r # gmapQ :: (forall d. Data d => d -> u) -> M1 i c f p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> M1 i c f p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> M1 i c f p -> m (M1 i c f p) #
(Typeable f, Typeable g, Data p, Data (f (g p))) => Data ((f :.: g) p) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :.: g) p -> c ((f :.: g) p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :.: g) p) # toConstr :: (f :.: g) p -> Constr # dataTypeOf :: (f :.: g) p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :.: g) p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :.: g) p)) # gmapT :: (forall b. Data b => b -> b) -> (f :.: g) p -> (f :.: g) p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :.: g) p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :.: g) p -> r # gmapQ :: (forall d. Data d => d -> u) -> (f :.: g) p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :.: g) p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :.: g) p -> m ((f :.: g) p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :.: g) p -> m ((f :.: g) p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :.: g) p -> m ((f :.: g) p) #
(Data a, Data b, Data c, Data d, Data e) => Data (a, b, c, d, e) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d0 b0. Data d0 => c0 (d0 -> b0) -> d0 -> c0 b0) -> (forall g. g -> c0 g) -> (a, b, c, d, e) -> c0 (a, b, c, d, e) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (a, b, c, d, e) # toConstr :: (a, b, c, d, e) -> Constr # dataTypeOf :: (a, b, c, d, e) -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (a, b, c, d, e)) # dataCast2 :: Typeable t => (forall d0 e0. (Data d0, Data e0) => c0 (t d0 e0)) -> Maybe (c0 (a, b, c, d, e)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b, c, d, e) -> (a, b, c, d, e) # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e) -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e) -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e) -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e) -> m (a, b, c, d, e) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e) -> m (a, b, c, d, e) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e) -> m (a, b, c, d, e) #
(Typeable a, Typeable f, Typeable g, Typeable k1, Typeable k2, Data (f (g a))) => Data (Compose f g a) |
Instance details Defined in Data.Functor.Compose Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Compose f g a -> c (Compose f g a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Compose f g a) # toConstr :: Compose f g a -> Constr # dataTypeOf :: Compose f g a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Compose f g a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Compose f g a)) # gmapT :: (forall b. Data b => b -> b) -> Compose f g a -> Compose f g a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r # gmapQ :: (forall d. Data d => d -> u) -> Compose f g a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Compose f g a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) #
(Data a, Data b, Data c, Data d, Data e, Data f) => Data (a, b, c, d, e, f) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d0 b0. Data d0 => c0 (d0 -> b0) -> d0 -> c0 b0) -> (forall g. g -> c0 g) -> (a, b, c, d, e, f) -> c0 (a, b, c, d, e, f) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (a, b, c, d, e, f) # toConstr :: (a, b, c, d, e, f) -> Constr # dataTypeOf :: (a, b, c, d, e, f) -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (a, b, c, d, e, f)) # dataCast2 :: Typeable t => (forall d0 e0. (Data d0, Data e0) => c0 (t d0 e0)) -> Maybe (c0 (a, b, c, d, e, f)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e, f) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e, f) -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e, f) -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e, f) -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f) -> m (a, b, c, d, e, f) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f) -> m (a, b, c, d, e, f) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f) -> m (a, b, c, d, e, f) #
(Data a, Data b, Data c, Data d, Data e, Data f, Data g) => Data (a, b, c, d, e, f, g) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d0 b0. Data d0 => c0 (d0 -> b0) -> d0 -> c0 b0) -> (forall g0. g0 -> c0 g0) -> (a, b, c, d, e, f, g) -> c0 (a, b, c, d, e, f, g) # gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (a, b, c, d, e, f, g) # toConstr :: (a, b, c, d, e, f, g) -> Constr # dataTypeOf :: (a, b, c, d, e, f, g) -> DataType # dataCast1 :: Typeable t => (forall d0. Data d0 => c0 (t d0)) -> Maybe (c0 (a, b, c, d, e, f, g)) # dataCast2 :: Typeable t => (forall d0 e0. (Data d0, Data e0) => c0 (t d0 e0)) -> Maybe (c0 (a, b, c, d, e, f, g)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # gmapQl :: (r -> r' -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e, f, g) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d0. Data d0 => d0 -> r') -> (a, b, c, d, e, f, g) -> r # gmapQ :: (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e, f, g) -> [u] # gmapQi :: Int -> (forall d0. Data d0 => d0 -> u) -> (a, b, c, d, e, f, g) -> u # gmapM :: Monad m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f, g) -> m (a, b, c, d, e, f, g) # gmapMp :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f, g) -> m (a, b, c, d, e, f, g) # gmapMo :: MonadPlus m => (forall d0. Data d0 => d0 -> m d0) -> (a, b, c, d, e, f, g) -> m (a, b, c, d, e, f, g) #

class Functor (f :: * -> *) where #

The `Functor` class is used for types that can be mapped over. Instances of `Functor` should satisfy the following laws:

    fmap id  ==  id
    fmap (f . g)  ==  fmap f . fmap g

The instances of `Functor` for lists, `Maybe` and `IO` satisfy these laws.

Minimal complete definition

fmap

Methods

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

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

Replace all locations in the input with the same value. The default definition is ``fmap` . `const``, but this may be overridden with a more efficient version.

Instances

Functor [] | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> [a] -> [b] # (<$) :: a -> [b] -> [a] #
Functor Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
Functor IO | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
Functor Par1 |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Par1 a -> Par1 b # (<$) :: a -> Par1 b -> Par1 a #
Functor Complex |
Instance details Defined in Data.Complex Methods fmap :: (a -> b) -> Complex a -> Complex b # (<$) :: a -> Complex b -> Complex a #
Functor Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b # (<$) :: a -> Min b -> Min a #
Functor Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b # (<$) :: a -> Max b -> Max a #
Functor First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Option a -> Option b # (<$) :: a -> Option b -> Option a #
Functor ZipList |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b # (<$) :: a -> ZipList b -> ZipList a #
Functor Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b # (<$) :: a -> Identity b -> Identity a #
Functor Handler | Since: base-4.6.0.0
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #
Functor STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b # (<$) :: a -> STM b -> STM a #
Functor First |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b # (<$) :: a -> Dual b -> Dual a #
Functor Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b # (<$) :: a -> Sum b -> Sum a #
Functor Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b # (<$) :: a -> Product b -> Product a #
Functor Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods fmap :: (a -> b) -> Down a -> Down b # (<$) :: a -> Down b -> Down a #
Functor ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b # (<$) :: a -> ReadPrec b -> ReadPrec a #
Functor ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b # (<$) :: a -> ReadP b -> ReadP a #
Functor NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b # (<$) :: a -> NonEmpty b -> NonEmpty a #
Functor P |
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> P a -> P b # (<$) :: a -> P b -> P a #
Functor (Either a) | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
Functor (V1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> V1 a -> V1 b # (<$) :: a -> V1 b -> V1 a #
Functor (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> U1 a -> U1 b # (<$) :: a -> U1 b -> U1 a #
Functor ((,) a) | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b) -> (a, a0) -> (a, b) # (<$) :: a0 -> (a, b) -> (a, a0) #
Functor (Array i) | Since: base-2.1
Instance details Defined in GHC.Arr Methods fmap :: (a -> b) -> Array i a -> Array i b # (<$) :: a -> Array i b -> Array i a #
Functor (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b # (<$) :: a0 -> Arg a b -> Arg a a0 #
Monad m => Functor (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a #
Arrow a => Functor (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Functor (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods fmap :: (a -> b) -> Proxy a -> Proxy b # (<$) :: a -> Proxy b -> Proxy a #
Functor (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
Functor f => Functor (Rec1 f) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Rec1 f a -> Rec1 f b # (<$) :: a -> Rec1 f b -> Rec1 f a #
Functor (URec Char :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b # (<$) :: a -> URec Char b -> URec Char a #
Functor (URec Double :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Double a -> URec Double b # (<$) :: a -> URec Double b -> URec Double a #
Functor (URec Float :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Float a -> URec Float b # (<$) :: a -> URec Float b -> URec Float a #
Functor (URec Int :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Int a -> URec Int b # (<$) :: a -> URec Int b -> URec Int a #
Functor (URec Word :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Functor (URec (Ptr ()) :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b # (<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #
Arrow a => Functor (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Functor (Const m :: * -> *) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Functor f => Functor (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b # (<$) :: a -> Alt f b -> Alt f a #
Functor ((->) r :: * -> *) | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> (r -> a) -> r -> b # (<$) :: a -> (r -> b) -> r -> a #
Functor (K1 i c :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> K1 i c a -> K1 i c b # (<$) :: a -> K1 i c b -> K1 i c a #
(Functor f, Functor g) => Functor (f :+: g) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b # (<$) :: a -> (f :+: g) b -> (f :+: g) a #
(Functor f, Functor g) => Functor (f :*: g) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b # (<$) :: a -> (f :*: g) b -> (f :*: g) a #
Functor f => Functor (M1 i c f) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> M1 i c f a -> M1 i c f b # (<$) :: a -> M1 i c f b -> M1 i c f a #
(Functor f, Functor g) => Functor (f :.: g) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b # (<$) :: a -> (f :.: g) b -> (f :.: g) a #
(Functor f, Functor g) => Functor (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b # (<$) :: a -> Compose f g b -> Compose f g a #

class Num a where #

Basic numeric class.

Minimal complete definition

(+), (*), abs, signum, fromInteger, (negate | (-))

Methods

(+) :: a -> a -> a infixl 6 #

(-) :: a -> a -> a infixl 6 #

(*) :: a -> a -> a infixl 7 #

negate :: a -> a #

Unary negation.

abs :: a -> a #

Absolute value.

signum :: a -> a #

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

    abs x * signum x == x

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

fromInteger :: Integer -> a #

Conversion from an `Integer`. An integer literal represents the application of the function `fromInteger` to the appropriate value of type `Integer`, so such literals have type `(`Num` a) => a`.

Instances

Num Int | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Int -> Int -> Int # (-) :: Int -> Int -> Int # (*) :: Int -> Int -> Int # negate :: Int -> Int # abs :: Int -> Int # signum :: Int -> Int # fromInteger :: Integer -> Int #
Num Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int8 -> Int8 -> Int8 # (-) :: Int8 -> Int8 -> Int8 # (*) :: Int8 -> Int8 -> Int8 # negate :: Int8 -> Int8 # abs :: Int8 -> Int8 # signum :: Int8 -> Int8 # fromInteger :: Integer -> Int8 #
Num Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int16 -> Int16 -> Int16 # (-) :: Int16 -> Int16 -> Int16 # (*) :: Int16 -> Int16 -> Int16 # negate :: Int16 -> Int16 # abs :: Int16 -> Int16 # signum :: Int16 -> Int16 # fromInteger :: Integer -> Int16 #
Num Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int32 -> Int32 -> Int32 # (-) :: Int32 -> Int32 -> Int32 # (*) :: Int32 -> Int32 -> Int32 # negate :: Int32 -> Int32 # abs :: Int32 -> Int32 # signum :: Int32 -> Int32 # fromInteger :: Integer -> Int32 #
Num Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int64 -> Int64 -> Int64 # (-) :: Int64 -> Int64 -> Int64 # (*) :: Int64 -> Int64 -> Int64 # negate :: Int64 -> Int64 # abs :: Int64 -> Int64 # signum :: Int64 -> Int64 # fromInteger :: Integer -> Int64 #
Num Integer | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Integer -> Integer -> Integer # (-) :: Integer -> Integer -> Integer # (*) :: Integer -> Integer -> Integer # negate :: Integer -> Integer # abs :: Integer -> Integer # signum :: Integer -> Integer # fromInteger :: Integer -> Integer #
Num Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods (+) :: Natural -> Natural -> Natural # (-) :: Natural -> Natural -> Natural # (*) :: Natural -> Natural -> Natural # negate :: Natural -> Natural # abs :: Natural -> Natural # signum :: Natural -> Natural # fromInteger :: Integer -> Natural #
Num Word | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word # (-) :: Word -> Word -> Word # (*) :: Word -> Word -> Word # negate :: Word -> Word # abs :: Word -> Word # signum :: Word -> Word # fromInteger :: Integer -> Word #
Num Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word8 -> Word8 -> Word8 # (-) :: Word8 -> Word8 -> Word8 # (*) :: Word8 -> Word8 -> Word8 # negate :: Word8 -> Word8 # abs :: Word8 -> Word8 # signum :: Word8 -> Word8 # fromInteger :: Integer -> Word8 #
Num Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word16 -> Word16 -> Word16 # (-) :: Word16 -> Word16 -> Word16 # (*) :: Word16 -> Word16 -> Word16 # negate :: Word16 -> Word16 # abs :: Word16 -> Word16 # signum :: Word16 -> Word16 # fromInteger :: Integer -> Word16 #
Num Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word32 -> Word32 -> Word32 # (-) :: Word32 -> Word32 -> Word32 # (*) :: Word32 -> Word32 -> Word32 # negate :: Word32 -> Word32 # abs :: Word32 -> Word32 # signum :: Word32 -> Word32 # fromInteger :: Integer -> Word32 #
Num Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word64 -> Word64 -> Word64 # (-) :: Word64 -> Word64 -> Word64 # (*) :: Word64 -> Word64 -> Word64 # negate :: Word64 -> Word64 # abs :: Word64 -> Word64 # signum :: Word64 -> Word64 # fromInteger :: Integer -> Word64 #
Num CDev |
Instance details Defined in System.Posix.Types Methods (+) :: CDev -> CDev -> CDev # (-) :: CDev -> CDev -> CDev # (*) :: CDev -> CDev -> CDev # negate :: CDev -> CDev # abs :: CDev -> CDev # signum :: CDev -> CDev # fromInteger :: Integer -> CDev #
Num CIno |
Instance details Defined in System.Posix.Types Methods (+) :: CIno -> CIno -> CIno # (-) :: CIno -> CIno -> CIno # (*) :: CIno -> CIno -> CIno # negate :: CIno -> CIno # abs :: CIno -> CIno # signum :: CIno -> CIno # fromInteger :: Integer -> CIno #
Num CMode |
Instance details Defined in System.Posix.Types Methods (+) :: CMode -> CMode -> CMode # (-) :: CMode -> CMode -> CMode # (*) :: CMode -> CMode -> CMode # negate :: CMode -> CMode # abs :: CMode -> CMode # signum :: CMode -> CMode # fromInteger :: Integer -> CMode #
Num COff |
Instance details Defined in System.Posix.Types Methods (+) :: COff -> COff -> COff # (-) :: COff -> COff -> COff # (*) :: COff -> COff -> COff # negate :: COff -> COff # abs :: COff -> COff # signum :: COff -> COff # fromInteger :: Integer -> COff #
Num CPid |
Instance details Defined in System.Posix.Types Methods (+) :: CPid -> CPid -> CPid # (-) :: CPid -> CPid -> CPid # (*) :: CPid -> CPid -> CPid # negate :: CPid -> CPid # abs :: CPid -> CPid # signum :: CPid -> CPid # fromInteger :: Integer -> CPid #
Num CSsize |
Instance details Defined in System.Posix.Types Methods (+) :: CSsize -> CSsize -> CSsize # (-) :: CSsize -> CSsize -> CSsize # (*) :: CSsize -> CSsize -> CSsize # negate :: CSsize -> CSsize # abs :: CSsize -> CSsize # signum :: CSsize -> CSsize # fromInteger :: Integer -> CSsize #
Num CGid |
Instance details Defined in System.Posix.Types Methods (+) :: CGid -> CGid -> CGid # (-) :: CGid -> CGid -> CGid # (*) :: CGid -> CGid -> CGid # negate :: CGid -> CGid # abs :: CGid -> CGid # signum :: CGid -> CGid # fromInteger :: Integer -> CGid #
Num CNlink |
Instance details Defined in System.Posix.Types Methods (+) :: CNlink -> CNlink -> CNlink # (-) :: CNlink -> CNlink -> CNlink # (*) :: CNlink -> CNlink -> CNlink # negate :: CNlink -> CNlink # abs :: CNlink -> CNlink # signum :: CNlink -> CNlink # fromInteger :: Integer -> CNlink #
Num CUid |
Instance details Defined in System.Posix.Types Methods (+) :: CUid -> CUid -> CUid # (-) :: CUid -> CUid -> CUid # (*) :: CUid -> CUid -> CUid # negate :: CUid -> CUid # abs :: CUid -> CUid # signum :: CUid -> CUid # fromInteger :: Integer -> CUid #
Num CCc |
Instance details Defined in System.Posix.Types Methods (+) :: CCc -> CCc -> CCc # (-) :: CCc -> CCc -> CCc # (*) :: CCc -> CCc -> CCc # negate :: CCc -> CCc # abs :: CCc -> CCc # signum :: CCc -> CCc # fromInteger :: Integer -> CCc #
Num CSpeed |
Instance details Defined in System.Posix.Types Methods (+) :: CSpeed -> CSpeed -> CSpeed # (-) :: CSpeed -> CSpeed -> CSpeed # (*) :: CSpeed -> CSpeed -> CSpeed # negate :: CSpeed -> CSpeed # abs :: CSpeed -> CSpeed # signum :: CSpeed -> CSpeed # fromInteger :: Integer -> CSpeed #
Num CTcflag |
Instance details Defined in System.Posix.Types Methods (+) :: CTcflag -> CTcflag -> CTcflag # (-) :: CTcflag -> CTcflag -> CTcflag # (*) :: CTcflag -> CTcflag -> CTcflag # negate :: CTcflag -> CTcflag # abs :: CTcflag -> CTcflag # signum :: CTcflag -> CTcflag # fromInteger :: Integer -> CTcflag #
Num CRLim |
Instance details Defined in System.Posix.Types Methods (+) :: CRLim -> CRLim -> CRLim # (-) :: CRLim -> CRLim -> CRLim # (*) :: CRLim -> CRLim -> CRLim # negate :: CRLim -> CRLim # abs :: CRLim -> CRLim # signum :: CRLim -> CRLim # fromInteger :: Integer -> CRLim #
Num CBlkSize |
Instance details Defined in System.Posix.Types Methods (+) :: CBlkSize -> CBlkSize -> CBlkSize # (-) :: CBlkSize -> CBlkSize -> CBlkSize # (*) :: CBlkSize -> CBlkSize -> CBlkSize # negate :: CBlkSize -> CBlkSize # abs :: CBlkSize -> CBlkSize # signum :: CBlkSize -> CBlkSize # fromInteger :: Integer -> CBlkSize #
Num CBlkCnt |
Instance details Defined in System.Posix.Types Methods (+) :: CBlkCnt -> CBlkCnt -> CBlkCnt # (-) :: CBlkCnt -> CBlkCnt -> CBlkCnt # (*) :: CBlkCnt -> CBlkCnt -> CBlkCnt # negate :: CBlkCnt -> CBlkCnt # abs :: CBlkCnt -> CBlkCnt # signum :: CBlkCnt -> CBlkCnt # fromInteger :: Integer -> CBlkCnt #
Num CClockId |
Instance details Defined in System.Posix.Types Methods (+) :: CClockId -> CClockId -> CClockId # (-) :: CClockId -> CClockId -> CClockId # (*) :: CClockId -> CClockId -> CClockId # negate :: CClockId -> CClockId # abs :: CClockId -> CClockId # signum :: CClockId -> CClockId # fromInteger :: Integer -> CClockId #
Num CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods (+) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # (-) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # (*) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # negate :: CFsBlkCnt -> CFsBlkCnt # abs :: CFsBlkCnt -> CFsBlkCnt # signum :: CFsBlkCnt -> CFsBlkCnt # fromInteger :: Integer -> CFsBlkCnt #
Num CFsFilCnt |
Instance details Defined in System.Posix.Types Methods (+) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # (-) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # (*) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # negate :: CFsFilCnt -> CFsFilCnt # abs :: CFsFilCnt -> CFsFilCnt # signum :: CFsFilCnt -> CFsFilCnt # fromInteger :: Integer -> CFsFilCnt #
Num CId |
Instance details Defined in System.Posix.Types Methods (+) :: CId -> CId -> CId # (-) :: CId -> CId -> CId # (*) :: CId -> CId -> CId # negate :: CId -> CId # abs :: CId -> CId # signum :: CId -> CId # fromInteger :: Integer -> CId #
Num CKey |
Instance details Defined in System.Posix.Types Methods (+) :: CKey -> CKey -> CKey # (-) :: CKey -> CKey -> CKey # (*) :: CKey -> CKey -> CKey # negate :: CKey -> CKey # abs :: CKey -> CKey # signum :: CKey -> CKey # fromInteger :: Integer -> CKey #
Num Fd |
Instance details Defined in System.Posix.Types Methods (+) :: Fd -> Fd -> Fd # (-) :: Fd -> Fd -> Fd # (*) :: Fd -> Fd -> Fd # negate :: Fd -> Fd # abs :: Fd -> Fd # signum :: Fd -> Fd # fromInteger :: Integer -> Fd #
Num CChar |
Instance details Defined in Foreign.C.Types Methods (+) :: CChar -> CChar -> CChar # (-) :: CChar -> CChar -> CChar # (*) :: CChar -> CChar -> CChar # negate :: CChar -> CChar # abs :: CChar -> CChar # signum :: CChar -> CChar # fromInteger :: Integer -> CChar #
Num CSChar |
Instance details Defined in Foreign.C.Types Methods (+) :: CSChar -> CSChar -> CSChar # (-) :: CSChar -> CSChar -> CSChar # (*) :: CSChar -> CSChar -> CSChar # negate :: CSChar -> CSChar # abs :: CSChar -> CSChar # signum :: CSChar -> CSChar # fromInteger :: Integer -> CSChar #
Num CUChar |
Instance details Defined in Foreign.C.Types Methods (+) :: CUChar -> CUChar -> CUChar # (-) :: CUChar -> CUChar -> CUChar # (*) :: CUChar -> CUChar -> CUChar # negate :: CUChar -> CUChar # abs :: CUChar -> CUChar # signum :: CUChar -> CUChar # fromInteger :: Integer -> CUChar #
Num CShort |
Instance details Defined in Foreign.C.Types Methods (+) :: CShort -> CShort -> CShort # (-) :: CShort -> CShort -> CShort # (*) :: CShort -> CShort -> CShort # negate :: CShort -> CShort # abs :: CShort -> CShort # signum :: CShort -> CShort # fromInteger :: Integer -> CShort #
Num CUShort |
Instance details Defined in Foreign.C.Types Methods (+) :: CUShort -> CUShort -> CUShort # (-) :: CUShort -> CUShort -> CUShort # (*) :: CUShort -> CUShort -> CUShort # negate :: CUShort -> CUShort # abs :: CUShort -> CUShort # signum :: CUShort -> CUShort # fromInteger :: Integer -> CUShort #
Num CInt |
Instance details Defined in Foreign.C.Types Methods (+) :: CInt -> CInt -> CInt # (-) :: CInt -> CInt -> CInt # (*) :: CInt -> CInt -> CInt # negate :: CInt -> CInt # abs :: CInt -> CInt # signum :: CInt -> CInt # fromInteger :: Integer -> CInt #
Num CUInt |
Instance details Defined in Foreign.C.Types Methods (+) :: CUInt -> CUInt -> CUInt # (-) :: CUInt -> CUInt -> CUInt # (*) :: CUInt -> CUInt -> CUInt # negate :: CUInt -> CUInt # abs :: CUInt -> CUInt # signum :: CUInt -> CUInt # fromInteger :: Integer -> CUInt #
Num CLong |
Instance details Defined in Foreign.C.Types Methods (+) :: CLong -> CLong -> CLong # (-) :: CLong -> CLong -> CLong # (*) :: CLong -> CLong -> CLong # negate :: CLong -> CLong # abs :: CLong -> CLong # signum :: CLong -> CLong # fromInteger :: Integer -> CLong #
Num CULong |
Instance details Defined in Foreign.C.Types Methods (+) :: CULong -> CULong -> CULong # (-) :: CULong -> CULong -> CULong # (*) :: CULong -> CULong -> CULong # negate :: CULong -> CULong # abs :: CULong -> CULong # signum :: CULong -> CULong # fromInteger :: Integer -> CULong #
Num CLLong |
Instance details Defined in Foreign.C.Types Methods (+) :: CLLong -> CLLong -> CLLong # (-) :: CLLong -> CLLong -> CLLong # (*) :: CLLong -> CLLong -> CLLong # negate :: CLLong -> CLLong # abs :: CLLong -> CLLong # signum :: CLLong -> CLLong # fromInteger :: Integer -> CLLong #
Num CULLong |
Instance details Defined in Foreign.C.Types Methods (+) :: CULLong -> CULLong -> CULLong # (-) :: CULLong -> CULLong -> CULLong # (*) :: CULLong -> CULLong -> CULLong # negate :: CULLong -> CULLong # abs :: CULLong -> CULLong # signum :: CULLong -> CULLong # fromInteger :: Integer -> CULLong #
Num CBool |
Instance details Defined in Foreign.C.Types Methods (+) :: CBool -> CBool -> CBool # (-) :: CBool -> CBool -> CBool # (*) :: CBool -> CBool -> CBool # negate :: CBool -> CBool # abs :: CBool -> CBool # signum :: CBool -> CBool # fromInteger :: Integer -> CBool #
Num CFloat |
Instance details Defined in Foreign.C.Types Methods (+) :: CFloat -> CFloat -> CFloat # (-) :: CFloat -> CFloat -> CFloat # (*) :: CFloat -> CFloat -> CFloat # negate :: CFloat -> CFloat # abs :: CFloat -> CFloat # signum :: CFloat -> CFloat # fromInteger :: Integer -> CFloat #
Num CDouble |
Instance details Defined in Foreign.C.Types Methods (+) :: CDouble -> CDouble -> CDouble # (-) :: CDouble -> CDouble -> CDouble # (*) :: CDouble -> CDouble -> CDouble # negate :: CDouble -> CDouble # abs :: CDouble -> CDouble # signum :: CDouble -> CDouble # fromInteger :: Integer -> CDouble #
Num CPtrdiff |
Instance details Defined in Foreign.C.Types Methods (+) :: CPtrdiff -> CPtrdiff -> CPtrdiff # (-) :: CPtrdiff -> CPtrdiff -> CPtrdiff # (*) :: CPtrdiff -> CPtrdiff -> CPtrdiff # negate :: CPtrdiff -> CPtrdiff # abs :: CPtrdiff -> CPtrdiff # signum :: CPtrdiff -> CPtrdiff # fromInteger :: Integer -> CPtrdiff #
Num CSize |
Instance details Defined in Foreign.C.Types Methods (+) :: CSize -> CSize -> CSize # (-) :: CSize -> CSize -> CSize # (*) :: CSize -> CSize -> CSize # negate :: CSize -> CSize # abs :: CSize -> CSize # signum :: CSize -> CSize # fromInteger :: Integer -> CSize #
Num CWchar |
Instance details Defined in Foreign.C.Types Methods (+) :: CWchar -> CWchar -> CWchar # (-) :: CWchar -> CWchar -> CWchar # (*) :: CWchar -> CWchar -> CWchar # negate :: CWchar -> CWchar # abs :: CWchar -> CWchar # signum :: CWchar -> CWchar # fromInteger :: Integer -> CWchar #
Num CSigAtomic |
Instance details Defined in 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 CClock |
Instance details Defined in Foreign.C.Types Methods (+) :: CClock -> CClock -> CClock # (-) :: CClock -> CClock -> CClock # (*) :: CClock -> CClock -> CClock # negate :: CClock -> CClock # abs :: CClock -> CClock # signum :: CClock -> CClock # fromInteger :: Integer -> CClock #
Num CTime |
Instance details Defined in Foreign.C.Types Methods (+) :: CTime -> CTime -> CTime # (-) :: CTime -> CTime -> CTime # (*) :: CTime -> CTime -> CTime # negate :: CTime -> CTime # abs :: CTime -> CTime # signum :: CTime -> CTime # fromInteger :: Integer -> CTime #
Num CUSeconds |
Instance details Defined in Foreign.C.Types Methods (+) :: CUSeconds -> CUSeconds -> CUSeconds # (-) :: CUSeconds -> CUSeconds -> CUSeconds # (*) :: CUSeconds -> CUSeconds -> CUSeconds # negate :: CUSeconds -> CUSeconds # abs :: CUSeconds -> CUSeconds # signum :: CUSeconds -> CUSeconds # fromInteger :: Integer -> CUSeconds #
Num CSUSeconds |
Instance details Defined in 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 CIntPtr |
Instance details Defined in Foreign.C.Types Methods (+) :: CIntPtr -> CIntPtr -> CIntPtr # (-) :: CIntPtr -> CIntPtr -> CIntPtr # (*) :: CIntPtr -> CIntPtr -> CIntPtr # negate :: CIntPtr -> CIntPtr # abs :: CIntPtr -> CIntPtr # signum :: CIntPtr -> CIntPtr # fromInteger :: Integer -> CIntPtr #
Num CUIntPtr |
Instance details Defined in Foreign.C.Types Methods (+) :: CUIntPtr -> CUIntPtr -> CUIntPtr # (-) :: CUIntPtr -> CUIntPtr -> CUIntPtr # (*) :: CUIntPtr -> CUIntPtr -> CUIntPtr # negate :: CUIntPtr -> CUIntPtr # abs :: CUIntPtr -> CUIntPtr # signum :: CUIntPtr -> CUIntPtr # fromInteger :: Integer -> CUIntPtr #
Num CIntMax |
Instance details Defined in Foreign.C.Types Methods (+) :: CIntMax -> CIntMax -> CIntMax # (-) :: CIntMax -> CIntMax -> CIntMax # (*) :: CIntMax -> CIntMax -> CIntMax # negate :: CIntMax -> CIntMax # abs :: CIntMax -> CIntMax # signum :: CIntMax -> CIntMax # fromInteger :: Integer -> CIntMax #
Num CUIntMax |
Instance details Defined in Foreign.C.Types Methods (+) :: CUIntMax -> CUIntMax -> CUIntMax # (-) :: CUIntMax -> CUIntMax -> CUIntMax # (*) :: CUIntMax -> CUIntMax -> CUIntMax # negate :: CUIntMax -> CUIntMax # abs :: CUIntMax -> CUIntMax # signum :: CUIntMax -> CUIntMax # fromInteger :: Integer -> CUIntMax #
Num WordPtr |
Instance details Defined in Foreign.Ptr Methods (+) :: WordPtr -> WordPtr -> WordPtr # (-) :: WordPtr -> WordPtr -> WordPtr # (*) :: WordPtr -> WordPtr -> WordPtr # negate :: WordPtr -> WordPtr # abs :: WordPtr -> WordPtr # signum :: WordPtr -> WordPtr # fromInteger :: Integer -> WordPtr #
Num IntPtr |
Instance details Defined in Foreign.Ptr Methods (+) :: IntPtr -> IntPtr -> IntPtr # (-) :: IntPtr -> IntPtr -> IntPtr # (*) :: IntPtr -> IntPtr -> IntPtr # negate :: IntPtr -> IntPtr # abs :: IntPtr -> IntPtr # signum :: IntPtr -> IntPtr # fromInteger :: Integer -> IntPtr #
Integral a => Num (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (+) :: Ratio a -> Ratio a -> Ratio a # (-) :: Ratio a -> Ratio a -> Ratio a # (*) :: Ratio a -> Ratio a -> Ratio a # negate :: Ratio a -> Ratio a # abs :: Ratio a -> Ratio a # signum :: Ratio a -> Ratio a # fromInteger :: Integer -> Ratio a #
RealFloat a => Num (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods (+) :: Complex a -> Complex a -> Complex a # (-) :: Complex a -> Complex a -> Complex a # (*) :: Complex a -> Complex a -> Complex a # negate :: Complex a -> Complex a # abs :: Complex a -> Complex a # signum :: Complex a -> Complex a # fromInteger :: Integer -> Complex a #
HasResolution a => Num (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods (+) :: Fixed a -> Fixed a -> Fixed a # (-) :: Fixed a -> Fixed a -> Fixed a # (*) :: Fixed a -> Fixed a -> Fixed a # negate :: Fixed a -> Fixed a # abs :: Fixed a -> Fixed a # signum :: Fixed a -> Fixed a # fromInteger :: Integer -> Fixed a #
Num a => Num (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Min a -> Min a -> Min a # (-) :: Min a -> Min a -> Min a # (*) :: Min a -> Min a -> Min a # negate :: Min a -> Min a # abs :: Min a -> Min a # signum :: Min a -> Min a # fromInteger :: Integer -> Min a #
Num a => Num (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Max a -> Max a -> Max a # (-) :: Max a -> Max a -> Max a # (*) :: Max a -> Max a -> Max a # negate :: Max a -> Max a # abs :: Max a -> Max a # signum :: Max a -> Max a # fromInteger :: Integer -> Max a #
Num a => Num (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (+) :: Identity a -> Identity a -> Identity a # (-) :: Identity a -> Identity a -> Identity a # (*) :: Identity a -> Identity a -> Identity a # negate :: Identity a -> Identity a # abs :: Identity a -> Identity a # signum :: Identity a -> Identity a # fromInteger :: Integer -> Identity a #
Num a => Num (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Sum a -> Sum a -> Sum a # (-) :: Sum a -> Sum a -> Sum a # (*) :: Sum a -> Sum a -> Sum a # negate :: Sum a -> Sum a # abs :: Sum a -> Sum a # signum :: Sum a -> Sum a # fromInteger :: Integer -> Sum a #
Num a => Num (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Product a -> Product a -> Product a # (-) :: Product a -> Product a -> Product a # (*) :: Product a -> Product a -> Product a # negate :: Product a -> Product a # abs :: Product a -> Product a # signum :: Product a -> Product a # fromInteger :: Integer -> Product a #
Num a => Num (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (+) :: Down a -> Down a -> Down a # (-) :: Down a -> Down a -> Down a # (*) :: Down a -> Down a -> Down a # negate :: Down a -> Down a # abs :: Down a -> Down a # signum :: Down a -> Down a # fromInteger :: Integer -> Down a #
Num a => Num (Const a b) |
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b # (-) :: Const a b -> Const a b -> Const a b # (*) :: Const a b -> Const a b -> Const a b # negate :: Const a b -> Const a b # abs :: Const a b -> Const a b # signum :: Const a b -> Const a b # fromInteger :: Integer -> Const a b #
Num (f a) => Num (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Alt f a -> Alt f a -> Alt f a # (-) :: Alt f a -> Alt f a -> Alt f a # (*) :: Alt f a -> Alt f a -> Alt f a # negate :: Alt f a -> Alt f a # abs :: Alt f a -> Alt f a # signum :: Alt f a -> Alt f a # fromInteger :: Integer -> Alt f a #

class Eq a => Ord a where #

The `Ord` class is used for totally ordered datatypes.

Instances of `Ord` can be derived for any user-defined datatype whose constituent types are in `Ord`. The declared order of the constructors in the data declaration determines the ordering in derived `Ord` instances. The `Ordering` datatype allows a single comparison to determine the precise ordering of two objects.

Minimal complete definition: either `compare` or `<=`. Using `compare` can be more efficient for complex types.

Minimal complete definition

compare | (<=)

Methods

compare :: a -> a -> Ordering #

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

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

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

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

max :: a -> a -> a #

min :: a -> a -> a #

Instances

Ord Bool |
Instance details Defined in GHC.Classes Methods compare :: Bool -> Bool -> Ordering # (<) :: Bool -> Bool -> Bool # (<=) :: Bool -> Bool -> Bool # (>) :: Bool -> Bool -> Bool # (>=) :: Bool -> Bool -> Bool # max :: Bool -> Bool -> Bool # min :: Bool -> Bool -> Bool #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering # (<) :: Char -> Char -> Bool # (<=) :: Char -> Char -> Bool # (>) :: Char -> Char -> Bool # (>=) :: Char -> Char -> Bool # max :: Char -> Char -> Char # min :: Char -> Char -> Char #
Ord Double |
Instance details Defined in GHC.Classes Methods compare :: Double -> Double -> Ordering # (<) :: Double -> Double -> Bool # (<=) :: Double -> Double -> Bool # (>) :: Double -> Double -> Bool # (>=) :: Double -> Double -> Bool # max :: Double -> Double -> Double # min :: Double -> Double -> Double #
Ord Float |
Instance details Defined in GHC.Classes Methods compare :: Float -> Float -> Ordering # (<) :: Float -> Float -> Bool # (<=) :: Float -> Float -> Bool # (>) :: Float -> Float -> Bool # (>=) :: Float -> Float -> Bool # max :: Float -> Float -> Float # min :: Float -> Float -> Float #
Ord Int |
Instance details Defined in GHC.Classes Methods compare :: Int -> Int -> Ordering # (<) :: Int -> Int -> Bool # (<=) :: Int -> Int -> Bool # (>) :: Int -> Int -> Bool # (>=) :: Int -> Int -> Bool # max :: Int -> Int -> Int # min :: Int -> Int -> Int #
Ord Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int8 -> Int8 -> Ordering # (<) :: Int8 -> Int8 -> Bool # (<=) :: Int8 -> Int8 -> Bool # (>) :: Int8 -> Int8 -> Bool # (>=) :: Int8 -> Int8 -> Bool # max :: Int8 -> Int8 -> Int8 # min :: Int8 -> Int8 -> Int8 #
Ord Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int16 -> Int16 -> Ordering # (<) :: Int16 -> Int16 -> Bool # (<=) :: Int16 -> Int16 -> Bool # (>) :: Int16 -> Int16 -> Bool # (>=) :: Int16 -> Int16 -> Bool # max :: Int16 -> Int16 -> Int16 # min :: Int16 -> Int16 -> Int16 #
Ord Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int32 -> Int32 -> Ordering # (<) :: Int32 -> Int32 -> Bool # (<=) :: Int32 -> Int32 -> Bool # (>) :: Int32 -> Int32 -> Bool # (>=) :: Int32 -> Int32 -> Bool # max :: Int32 -> Int32 -> Int32 # min :: Int32 -> Int32 -> Int32 #
Ord Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int64 -> Int64 -> Ordering # (<) :: Int64 -> Int64 -> Bool # (<=) :: Int64 -> Int64 -> Bool # (>) :: Int64 -> Int64 -> Bool # (>=) :: Int64 -> Int64 -> Bool # max :: Int64 -> Int64 -> Int64 # min :: Int64 -> Int64 -> Int64 #
Ord Integer |
Instance details Defined in GHC.Integer.Type Methods compare :: Integer -> Integer -> Ordering # (<) :: Integer -> Integer -> Bool # (<=) :: Integer -> Integer -> Bool # (>) :: Integer -> Integer -> Bool # (>=) :: Integer -> Integer -> Bool # max :: Integer -> Integer -> Integer # min :: Integer -> Integer -> Integer #
Ord Natural |
Instance details Defined in GHC.Natural Methods compare :: Natural -> Natural -> Ordering # (<) :: Natural -> Natural -> Bool # (<=) :: Natural -> Natural -> Bool # (>) :: Natural -> Natural -> Bool # (>=) :: Natural -> Natural -> Bool # max :: Natural -> Natural -> Natural # min :: Natural -> Natural -> Natural #
Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering # (<) :: Ordering -> Ordering -> Bool # (<=) :: Ordering -> Ordering -> Bool # (>) :: Ordering -> Ordering -> Bool # (>=) :: Ordering -> Ordering -> Bool # max :: Ordering -> Ordering -> Ordering # min :: Ordering -> Ordering -> Ordering #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering # (<) :: Word -> Word -> Bool # (<=) :: Word -> Word -> Bool # (>) :: Word -> Word -> Bool # (>=) :: Word -> Word -> Bool # max :: Word -> Word -> Word # min :: Word -> Word -> Word #
Ord Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word8 -> Word8 -> Ordering # (<) :: Word8 -> Word8 -> Bool # (<=) :: Word8 -> Word8 -> Bool # (>) :: Word8 -> Word8 -> Bool # (>=) :: Word8 -> Word8 -> Bool # max :: Word8 -> Word8 -> Word8 # min :: Word8 -> Word8 -> Word8 #
Ord Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word16 -> Word16 -> Ordering # (<) :: Word16 -> Word16 -> Bool # (<=) :: Word16 -> Word16 -> Bool # (>) :: Word16 -> Word16 -> Bool # (>=) :: Word16 -> Word16 -> Bool # max :: Word16 -> Word16 -> Word16 # min :: Word16 -> Word16 -> Word16 #
Ord Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word32 -> Word32 -> Ordering # (<) :: Word32 -> Word32 -> Bool # (<=) :: Word32 -> Word32 -> Bool # (>) :: Word32 -> Word32 -> Bool # (>=) :: Word32 -> Word32 -> Bool # max :: Word32 -> Word32 -> Word32 # min :: Word32 -> Word32 -> Word32 #
Ord Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word64 -> Word64 -> Ordering # (<) :: Word64 -> Word64 -> Bool # (<=) :: Word64 -> Word64 -> Bool # (>) :: Word64 -> Word64 -> Bool # (>=) :: Word64 -> Word64 -> Bool # max :: Word64 -> Word64 -> Word64 # min :: Word64 -> Word64 -> Word64 #
Ord SomeTypeRep |
Instance details Defined in Data.Typeable.Internal Methods compare :: SomeTypeRep -> SomeTypeRep -> Ordering # (<) :: SomeTypeRep -> SomeTypeRep -> Bool # (<=) :: SomeTypeRep -> SomeTypeRep -> Bool # (>) :: SomeTypeRep -> SomeTypeRep -> Bool # (>=) :: SomeTypeRep -> SomeTypeRep -> Bool # max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep # min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep #
Ord () |
Instance details Defined in GHC.Classes Methods compare :: () -> () -> Ordering # (<) :: () -> () -> Bool # (<=) :: () -> () -> Bool # (>) :: () -> () -> Bool # (>=) :: () -> () -> Bool # max :: () -> () -> () # min :: () -> () -> () #
Ord TyCon |
Instance details Defined in GHC.Classes Methods compare :: TyCon -> TyCon -> Ordering # (<) :: TyCon -> TyCon -> Bool # (<=) :: TyCon -> TyCon -> Bool # (>) :: TyCon -> TyCon -> Bool # (>=) :: TyCon -> TyCon -> Bool # max :: TyCon -> TyCon -> TyCon # min :: TyCon -> TyCon -> TyCon #
Ord BigNat |
Instance details Defined in GHC.Integer.Type Methods compare :: BigNat -> BigNat -> Ordering # (<) :: BigNat -> BigNat -> Bool # (<=) :: BigNat -> BigNat -> Bool # (>) :: BigNat -> BigNat -> Bool # (>=) :: BigNat -> BigNat -> Bool # max :: BigNat -> BigNat -> BigNat # min :: BigNat -> BigNat -> BigNat #
Ord Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods compare :: Void -> Void -> Ordering # (<) :: Void -> Void -> Bool # (<=) :: Void -> Void -> Bool # (>) :: Void -> Void -> Bool # (>=) :: Void -> Void -> Bool # max :: Void -> Void -> Void # min :: Void -> Void -> Void #
Ord Unique |
Instance details Defined in Data.Unique Methods compare :: Unique -> Unique -> Ordering # (<) :: Unique -> Unique -> Bool # (<=) :: Unique -> Unique -> Bool # (>) :: Unique -> Unique -> Bool # (>=) :: Unique -> Unique -> Bool # max :: Unique -> Unique -> Unique # min :: Unique -> Unique -> Unique #
Ord Version | Since: base-2.1
Instance details Defined in Data.Version Methods compare :: Version -> Version -> Ordering # (<) :: Version -> Version -> Bool # (<=) :: Version -> Version -> Bool # (>) :: Version -> Version -> Bool # (>=) :: Version -> Version -> Bool # max :: Version -> Version -> Version # min :: Version -> Version -> Version #
Ord ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadId -> ThreadId -> Ordering # (<) :: ThreadId -> ThreadId -> Bool # (<=) :: ThreadId -> ThreadId -> Bool # (>) :: ThreadId -> ThreadId -> Bool # (>=) :: ThreadId -> ThreadId -> Bool # max :: ThreadId -> ThreadId -> ThreadId # min :: ThreadId -> ThreadId -> ThreadId #
Ord BlockReason |
Instance details Defined in GHC.Conc.Sync Methods compare :: BlockReason -> BlockReason -> Ordering # (<) :: BlockReason -> BlockReason -> Bool # (<=) :: BlockReason -> BlockReason -> Bool # (>) :: BlockReason -> BlockReason -> Bool # (>=) :: BlockReason -> BlockReason -> Bool # max :: BlockReason -> BlockReason -> BlockReason # min :: BlockReason -> BlockReason -> BlockReason #
Ord ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadStatus -> ThreadStatus -> Ordering # (<) :: ThreadStatus -> ThreadStatus -> Bool # (<=) :: ThreadStatus -> ThreadStatus -> Bool # (>) :: ThreadStatus -> ThreadStatus -> Bool # (>=) :: ThreadStatus -> ThreadStatus -> Bool # max :: ThreadStatus -> ThreadStatus -> ThreadStatus # min :: ThreadStatus -> ThreadStatus -> ThreadStatus #
Ord CDev |
Instance details Defined in System.Posix.Types Methods compare :: CDev -> CDev -> Ordering # (<) :: CDev -> CDev -> Bool # (<=) :: CDev -> CDev -> Bool # (>) :: CDev -> CDev -> Bool # (>=) :: CDev -> CDev -> Bool # max :: CDev -> CDev -> CDev # min :: CDev -> CDev -> CDev #
Ord CIno |
Instance details Defined in System.Posix.Types Methods compare :: CIno -> CIno -> Ordering # (<) :: CIno -> CIno -> Bool # (<=) :: CIno -> CIno -> Bool # (>) :: CIno -> CIno -> Bool # (>=) :: CIno -> CIno -> Bool # max :: CIno -> CIno -> CIno # min :: CIno -> CIno -> CIno #
Ord CMode |
Instance details Defined in System.Posix.Types Methods compare :: CMode -> CMode -> Ordering # (<) :: CMode -> CMode -> Bool # (<=) :: CMode -> CMode -> Bool # (>) :: CMode -> CMode -> Bool # (>=) :: CMode -> CMode -> Bool # max :: CMode -> CMode -> CMode # min :: CMode -> CMode -> CMode #
Ord COff |
Instance details Defined in System.Posix.Types Methods compare :: COff -> COff -> Ordering # (<) :: COff -> COff -> Bool # (<=) :: COff -> COff -> Bool # (>) :: COff -> COff -> Bool # (>=) :: COff -> COff -> Bool # max :: COff -> COff -> COff # min :: COff -> COff -> COff #
Ord CPid |
Instance details Defined in System.Posix.Types Methods compare :: CPid -> CPid -> Ordering # (<) :: CPid -> CPid -> Bool # (<=) :: CPid -> CPid -> Bool # (>) :: CPid -> CPid -> Bool # (>=) :: CPid -> CPid -> Bool # max :: CPid -> CPid -> CPid # min :: CPid -> CPid -> CPid #
Ord CSsize |
Instance details Defined in System.Posix.Types Methods compare :: CSsize -> CSsize -> Ordering # (<) :: CSsize -> CSsize -> Bool # (<=) :: CSsize -> CSsize -> Bool # (>) :: CSsize -> CSsize -> Bool # (>=) :: CSsize -> CSsize -> Bool # max :: CSsize -> CSsize -> CSsize # min :: CSsize -> CSsize -> CSsize #
Ord CGid |
Instance details Defined in System.Posix.Types Methods compare :: CGid -> CGid -> Ordering # (<) :: CGid -> CGid -> Bool # (<=) :: CGid -> CGid -> Bool # (>) :: CGid -> CGid -> Bool # (>=) :: CGid -> CGid -> Bool # max :: CGid -> CGid -> CGid # min :: CGid -> CGid -> CGid #
Ord CNlink |
Instance details Defined in System.Posix.Types Methods compare :: CNlink -> CNlink -> Ordering # (<) :: CNlink -> CNlink -> Bool # (<=) :: CNlink -> CNlink -> Bool # (>) :: CNlink -> CNlink -> Bool # (>=) :: CNlink -> CNlink -> Bool # max :: CNlink -> CNlink -> CNlink # min :: CNlink -> CNlink -> CNlink #
Ord CUid |
Instance details Defined in System.Posix.Types Methods compare :: CUid -> CUid -> Ordering # (<) :: CUid -> CUid -> Bool # (<=) :: CUid -> CUid -> Bool # (>) :: CUid -> CUid -> Bool # (>=) :: CUid -> CUid -> Bool # max :: CUid -> CUid -> CUid # min :: CUid -> CUid -> CUid #
Ord CCc |
Instance details Defined in System.Posix.Types Methods compare :: CCc -> CCc -> Ordering # (<) :: CCc -> CCc -> Bool # (<=) :: CCc -> CCc -> Bool # (>) :: CCc -> CCc -> Bool # (>=) :: CCc -> CCc -> Bool # max :: CCc -> CCc -> CCc # min :: CCc -> CCc -> CCc #
Ord CSpeed |
Instance details Defined in System.Posix.Types Methods compare :: CSpeed -> CSpeed -> Ordering # (<) :: CSpeed -> CSpeed -> Bool # (<=) :: CSpeed -> CSpeed -> Bool # (>) :: CSpeed -> CSpeed -> Bool # (>=) :: CSpeed -> CSpeed -> Bool # max :: CSpeed -> CSpeed -> CSpeed # min :: CSpeed -> CSpeed -> CSpeed #
Ord CTcflag |
Instance details Defined in System.Posix.Types Methods compare :: CTcflag -> CTcflag -> Ordering # (<) :: CTcflag -> CTcflag -> Bool # (<=) :: CTcflag -> CTcflag -> Bool # (>) :: CTcflag -> CTcflag -> Bool # (>=) :: CTcflag -> CTcflag -> Bool # max :: CTcflag -> CTcflag -> CTcflag # min :: CTcflag -> CTcflag -> CTcflag #
Ord CRLim |
Instance details Defined in System.Posix.Types Methods compare :: CRLim -> CRLim -> Ordering # (<) :: CRLim -> CRLim -> Bool # (<=) :: CRLim -> CRLim -> Bool # (>) :: CRLim -> CRLim -> Bool # (>=) :: CRLim -> CRLim -> Bool # max :: CRLim -> CRLim -> CRLim # min :: CRLim -> CRLim -> CRLim #
Ord CBlkSize |
Instance details Defined in System.Posix.Types Methods compare :: CBlkSize -> CBlkSize -> Ordering # (<) :: CBlkSize -> CBlkSize -> Bool # (<=) :: CBlkSize -> CBlkSize -> Bool # (>) :: CBlkSize -> CBlkSize -> Bool # (>=) :: CBlkSize -> CBlkSize -> Bool # max :: CBlkSize -> CBlkSize -> CBlkSize # min :: CBlkSize -> CBlkSize -> CBlkSize #
Ord CBlkCnt |
Instance details Defined in System.Posix.Types Methods compare :: CBlkCnt -> CBlkCnt -> Ordering # (<) :: CBlkCnt -> CBlkCnt -> Bool # (<=) :: CBlkCnt -> CBlkCnt -> Bool # (>) :: CBlkCnt -> CBlkCnt -> Bool # (>=) :: CBlkCnt -> CBlkCnt -> Bool # max :: CBlkCnt -> CBlkCnt -> CBlkCnt # min :: CBlkCnt -> CBlkCnt -> CBlkCnt #
Ord CClockId |
Instance details Defined in System.Posix.Types Methods compare :: CClockId -> CClockId -> Ordering # (<) :: CClockId -> CClockId -> Bool # (<=) :: CClockId -> CClockId -> Bool # (>) :: CClockId -> CClockId -> Bool # (>=) :: CClockId -> CClockId -> Bool # max :: CClockId -> CClockId -> CClockId # min :: CClockId -> CClockId -> CClockId #
Ord CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods compare :: CFsBlkCnt -> CFsBlkCnt -> Ordering # (<) :: CFsBlkCnt -> CFsBlkCnt -> Bool # (<=) :: CFsBlkCnt -> CFsBlkCnt -> Bool # (>) :: CFsBlkCnt -> CFsBlkCnt -> Bool # (>=) :: CFsBlkCnt -> CFsBlkCnt -> Bool # max :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # min :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt #
Ord CFsFilCnt |
Instance details Defined in System.Posix.Types Methods compare :: CFsFilCnt -> CFsFilCnt -> Ordering # (<) :: CFsFilCnt -> CFsFilCnt -> Bool # (<=) :: CFsFilCnt -> CFsFilCnt -> Bool # (>) :: CFsFilCnt -> CFsFilCnt -> Bool # (>=) :: CFsFilCnt -> CFsFilCnt -> Bool # max :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # min :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt #
Ord CId |
Instance details Defined in System.Posix.Types Methods compare :: CId -> CId -> Ordering # (<) :: CId -> CId -> Bool # (<=) :: CId -> CId -> Bool # (>) :: CId -> CId -> Bool # (>=) :: CId -> CId -> Bool # max :: CId -> CId -> CId # min :: CId -> CId -> CId #
Ord CKey |
Instance details Defined in System.Posix.Types Methods compare :: CKey -> CKey -> Ordering # (<) :: CKey -> CKey -> Bool # (<=) :: CKey -> CKey -> Bool # (>) :: CKey -> CKey -> Bool # (>=) :: CKey -> CKey -> Bool # max :: CKey -> CKey -> CKey # min :: CKey -> CKey -> CKey #
Ord CTimer |
Instance details Defined in System.Posix.Types Methods compare :: CTimer -> CTimer -> Ordering # (<) :: CTimer -> CTimer -> Bool # (<=) :: CTimer -> CTimer -> Bool # (>) :: CTimer -> CTimer -> Bool # (>=) :: CTimer -> CTimer -> Bool # max :: CTimer -> CTimer -> CTimer # min :: CTimer -> CTimer -> CTimer #
Ord Fd |
Instance details Defined in System.Posix.Types Methods compare :: Fd -> Fd -> Ordering # (<) :: Fd -> Fd -> Bool # (<=) :: Fd -> Fd -> Bool # (>) :: Fd -> Fd -> Bool # (>=) :: Fd -> Fd -> Bool # max :: Fd -> Fd -> Fd # min :: Fd -> Fd -> Fd #
Ord AsyncException |
Instance details Defined in GHC.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering # (<) :: AsyncException -> AsyncException -> Bool # (<=) :: AsyncException -> AsyncException -> Bool # (>) :: AsyncException -> AsyncException -> Bool # (>=) :: AsyncException -> AsyncException -> Bool # max :: AsyncException -> AsyncException -> AsyncException # min :: AsyncException -> AsyncException -> AsyncException #
Ord ArrayException |
Instance details Defined in GHC.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering # (<) :: ArrayException -> ArrayException -> Bool # (<=) :: ArrayException -> ArrayException -> Bool # (>) :: ArrayException -> ArrayException -> Bool # (>=) :: ArrayException -> ArrayException -> Bool # max :: ArrayException -> ArrayException -> ArrayException # min :: ArrayException -> ArrayException -> ArrayException #
Ord ExitCode |
Instance details Defined in GHC.IO.Exception Methods compare :: ExitCode -> ExitCode -> Ordering # (<) :: ExitCode -> ExitCode -> Bool # (<=) :: ExitCode -> ExitCode -> Bool # (>) :: ExitCode -> ExitCode -> Bool # (>=) :: ExitCode -> ExitCode -> Bool # max :: ExitCode -> ExitCode -> ExitCode # min :: ExitCode -> ExitCode -> ExitCode #
Ord BufferMode |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: BufferMode -> BufferMode -> Ordering # (<) :: BufferMode -> BufferMode -> Bool # (<=) :: BufferMode -> BufferMode -> Bool # (>) :: BufferMode -> BufferMode -> Bool # (>=) :: BufferMode -> BufferMode -> Bool # max :: BufferMode -> BufferMode -> BufferMode # min :: BufferMode -> BufferMode -> BufferMode #
Ord Newline |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: Newline -> Newline -> Ordering # (<) :: Newline -> Newline -> Bool # (<=) :: Newline -> Newline -> Bool # (>) :: Newline -> Newline -> Bool # (>=) :: Newline -> Newline -> Bool # max :: Newline -> Newline -> Newline # min :: Newline -> Newline -> Newline #
Ord NewlineMode |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: NewlineMode -> NewlineMode -> Ordering # (<) :: NewlineMode -> NewlineMode -> Bool # (<=) :: NewlineMode -> NewlineMode -> Bool # (>) :: NewlineMode -> NewlineMode -> Bool # (>=) :: NewlineMode -> NewlineMode -> Bool # max :: NewlineMode -> NewlineMode -> NewlineMode # min :: NewlineMode -> NewlineMode -> NewlineMode #
Ord ErrorCall |
Instance details Defined in GHC.Exception Methods compare :: ErrorCall -> ErrorCall -> Ordering # (<) :: ErrorCall -> ErrorCall -> Bool # (<=) :: ErrorCall -> ErrorCall -> Bool # (>) :: ErrorCall -> ErrorCall -> Bool # (>=) :: ErrorCall -> ErrorCall -> Bool # max :: ErrorCall -> ErrorCall -> ErrorCall # min :: ErrorCall -> ErrorCall -> ErrorCall #
Ord ArithException |
Instance details Defined in GHC.Exception Methods compare :: ArithException -> ArithException -> Ordering # (<) :: ArithException -> ArithException -> Bool # (<=) :: ArithException -> ArithException -> Bool # (>) :: ArithException -> ArithException -> Bool # (>=) :: ArithException -> ArithException -> Bool # max :: ArithException -> ArithException -> ArithException # min :: ArithException -> ArithException -> ArithException #
Ord All |
Instance details Defined in Data.Semigroup.Internal Methods compare :: All -> All -> Ordering # (<) :: All -> All -> Bool # (<=) :: All -> All -> Bool # (>) :: All -> All -> Bool # (>=) :: All -> All -> Bool # max :: All -> All -> All # min :: All -> All -> All #
Ord Any |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Any -> Any -> Ordering # (<) :: Any -> Any -> Bool # (<=) :: Any -> Any -> Bool # (>) :: Any -> Any -> Bool # (>=) :: Any -> Any -> Bool # max :: Any -> Any -> Any # min :: Any -> Any -> Any #
Ord Fixity |
Instance details Defined in GHC.Generics Methods compare :: Fixity -> Fixity -> Ordering # (<) :: Fixity -> Fixity -> Bool # (<=) :: Fixity -> Fixity -> Bool # (>) :: Fixity -> Fixity -> Bool # (>=) :: Fixity -> Fixity -> Bool # max :: Fixity -> Fixity -> Fixity # min :: Fixity -> Fixity -> Fixity #
Ord Associativity |
Instance details Defined in GHC.Generics Methods compare :: Associativity -> Associativity -> Ordering # (<) :: Associativity -> Associativity -> Bool # (<=) :: Associativity -> Associativity -> Bool # (>) :: Associativity -> Associativity -> Bool # (>=) :: Associativity -> Associativity -> Bool # max :: Associativity -> Associativity -> Associativity # min :: Associativity -> Associativity -> Associativity #
Ord SourceUnpackedness |
Instance details Defined in GHC.Generics Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness #
Ord SourceStrictness |
Instance details Defined in GHC.Generics Methods compare :: SourceStrictness -> SourceStrictness -> Ordering # (<) :: SourceStrictness -> SourceStrictness -> Bool # (<=) :: SourceStrictness -> SourceStrictness -> Bool # (>) :: SourceStrictness -> SourceStrictness -> Bool # (>=) :: SourceStrictness -> SourceStrictness -> Bool # max :: SourceStrictness -> SourceStrictness -> SourceStrictness # min :: SourceStrictness -> SourceStrictness -> SourceStrictness #
Ord DecidedStrictness |
Instance details Defined in GHC.Generics Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering # (<) :: DecidedStrictness -> DecidedStrictness -> Bool # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool # (>) :: DecidedStrictness -> DecidedStrictness -> Bool # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness #
Ord CChar |
Instance details Defined in Foreign.C.Types Methods compare :: CChar -> CChar -> Ordering # (<) :: CChar -> CChar -> Bool # (<=) :: CChar -> CChar -> Bool # (>) :: CChar -> CChar -> Bool # (>=) :: CChar -> CChar -> Bool # max :: CChar -> CChar -> CChar # min :: CChar -> CChar -> CChar #
Ord CSChar |
Instance details Defined in Foreign.C.Types Methods compare :: CSChar -> CSChar -> Ordering # (<) :: CSChar -> CSChar -> Bool # (<=) :: CSChar -> CSChar -> Bool # (>) :: CSChar -> CSChar -> Bool # (>=) :: CSChar -> CSChar -> Bool # max :: CSChar -> CSChar -> CSChar # min :: CSChar -> CSChar -> CSChar #
Ord CUChar |
Instance details Defined in Foreign.C.Types Methods compare :: CUChar -> CUChar -> Ordering # (<) :: CUChar -> CUChar -> Bool # (<=) :: CUChar -> CUChar -> Bool # (>) :: CUChar -> CUChar -> Bool # (>=) :: CUChar -> CUChar -> Bool # max :: CUChar -> CUChar -> CUChar # min :: CUChar -> CUChar -> CUChar #
Ord CShort |
Instance details Defined in Foreign.C.Types Methods compare :: CShort -> CShort -> Ordering # (<) :: CShort -> CShort -> Bool # (<=) :: CShort -> CShort -> Bool # (>) :: CShort -> CShort -> Bool # (>=) :: CShort -> CShort -> Bool # max :: CShort -> CShort -> CShort # min :: CShort -> CShort -> CShort #
Ord CUShort |
Instance details Defined in Foreign.C.Types Methods compare :: CUShort -> CUShort -> Ordering # (<) :: CUShort -> CUShort -> Bool # (<=) :: CUShort -> CUShort -> Bool # (>) :: CUShort -> CUShort -> Bool # (>=) :: CUShort -> CUShort -> Bool # max :: CUShort -> CUShort -> CUShort # min :: CUShort -> CUShort -> CUShort #
Ord CInt |
Instance details Defined in Foreign.C.Types Methods compare :: CInt -> CInt -> Ordering # (<) :: CInt -> CInt -> Bool # (<=) :: CInt -> CInt -> Bool # (>) :: CInt -> CInt -> Bool # (>=) :: CInt -> CInt -> Bool # max :: CInt -> CInt -> CInt # min :: CInt -> CInt -> CInt #
Ord CUInt |
Instance details Defined in Foreign.C.Types Methods compare :: CUInt -> CUInt -> Ordering # (<) :: CUInt -> CUInt -> Bool # (<=) :: CUInt -> CUInt -> Bool # (>) :: CUInt -> CUInt -> Bool # (>=) :: CUInt -> CUInt -> Bool # max :: CUInt -> CUInt -> CUInt # min :: CUInt -> CUInt -> CUInt #
Ord CLong |
Instance details Defined in Foreign.C.Types Methods compare :: CLong -> CLong -> Ordering # (<) :: CLong -> CLong -> Bool # (<=) :: CLong -> CLong -> Bool # (>) :: CLong -> CLong -> Bool # (>=) :: CLong -> CLong -> Bool # max :: CLong -> CLong -> CLong # min :: CLong -> CLong -> CLong #
Ord CULong |
Instance details Defined in Foreign.C.Types Methods compare :: CULong -> CULong -> Ordering # (<) :: CULong -> CULong -> Bool # (<=) :: CULong -> CULong -> Bool # (>) :: CULong -> CULong -> Bool # (>=) :: CULong -> CULong -> Bool # max :: CULong -> CULong -> CULong # min :: CULong -> CULong -> CULong #
Ord CLLong |
Instance details Defined in Foreign.C.Types Methods compare :: CLLong -> CLLong -> Ordering # (<) :: CLLong -> CLLong -> Bool # (<=) :: CLLong -> CLLong -> Bool # (>) :: CLLong -> CLLong -> Bool # (>=) :: CLLong -> CLLong -> Bool # max :: CLLong -> CLLong -> CLLong # min :: CLLong -> CLLong -> CLLong #
Ord CULLong |
Instance details Defined in Foreign.C.Types Methods compare :: CULLong -> CULLong -> Ordering # (<) :: CULLong -> CULLong -> Bool # (<=) :: CULLong -> CULLong -> Bool # (>) :: CULLong -> CULLong -> Bool # (>=) :: CULLong -> CULLong -> Bool # max :: CULLong -> CULLong -> CULLong # min :: CULLong -> CULLong -> CULLong #
Ord CBool |
Instance details Defined in Foreign.C.Types Methods compare :: CBool -> CBool -> Ordering # (<) :: CBool -> CBool -> Bool # (<=) :: CBool -> CBool -> Bool # (>) :: CBool -> CBool -> Bool # (>=) :: CBool -> CBool -> Bool # max :: CBool -> CBool -> CBool # min :: CBool -> CBool -> CBool #
Ord CFloat |
Instance details Defined in Foreign.C.Types Methods compare :: CFloat -> CFloat -> Ordering # (<) :: CFloat -> CFloat -> Bool # (<=) :: CFloat -> CFloat -> Bool # (>) :: CFloat -> CFloat -> Bool # (>=) :: CFloat -> CFloat -> Bool # max :: CFloat -> CFloat -> CFloat # min :: CFloat -> CFloat -> CFloat #
Ord CDouble |
Instance details Defined in Foreign.C.Types Methods compare :: CDouble -> CDouble -> Ordering # (<) :: CDouble -> CDouble -> Bool # (<=) :: CDouble -> CDouble -> Bool # (>) :: CDouble -> CDouble -> Bool # (>=) :: CDouble -> CDouble -> Bool # max :: CDouble -> CDouble -> CDouble # min :: CDouble -> CDouble -> CDouble #
Ord CPtrdiff |
Instance details Defined in Foreign.C.Types Methods compare :: CPtrdiff -> CPtrdiff -> Ordering # (<) :: CPtrdiff -> CPtrdiff -> Bool # (<=) :: CPtrdiff -> CPtrdiff -> Bool # (>) :: CPtrdiff -> CPtrdiff -> Bool # (>=) :: CPtrdiff -> CPtrdiff -> Bool # max :: CPtrdiff -> CPtrdiff -> CPtrdiff # min :: CPtrdiff -> CPtrdiff -> CPtrdiff #
Ord CSize |
Instance details Defined in Foreign.C.Types Methods compare :: CSize -> CSize -> Ordering # (<) :: CSize -> CSize -> Bool # (<=) :: CSize -> CSize -> Bool # (>) :: CSize -> CSize -> Bool # (>=) :: CSize -> CSize -> Bool # max :: CSize -> CSize -> CSize # min :: CSize -> CSize -> CSize #
Ord CWchar |
Instance details Defined in Foreign.C.Types Methods compare :: CWchar -> CWchar -> Ordering # (<) :: CWchar -> CWchar -> Bool # (<=) :: CWchar -> CWchar -> Bool # (>) :: CWchar -> CWchar -> Bool # (>=) :: CWchar -> CWchar -> Bool # max :: CWchar -> CWchar -> CWchar # min :: CWchar -> CWchar -> CWchar #
Ord CSigAtomic |
Instance details Defined in Foreign.C.Types Methods compare :: CSigAtomic -> CSigAtomic -> Ordering # (<) :: CSigAtomic -> CSigAtomic -> Bool # (<=) :: CSigAtomic -> CSigAtomic -> Bool # (>) :: CSigAtomic -> CSigAtomic -> Bool # (>=) :: CSigAtomic -> CSigAtomic -> Bool # max :: CSigAtomic -> CSigAtomic -> CSigAtomic # min :: CSigAtomic -> CSigAtomic -> CSigAtomic #
Ord CClock |
Instance details Defined in Foreign.C.Types Methods compare :: CClock -> CClock -> Ordering # (<) :: CClock -> CClock -> Bool # (<=) :: CClock -> CClock -> Bool # (>) :: CClock -> CClock -> Bool # (>=) :: CClock -> CClock -> Bool # max :: CClock -> CClock -> CClock # min :: CClock -> CClock -> CClock #
Ord CTime |
Instance details Defined in Foreign.C.Types Methods compare :: CTime -> CTime -> Ordering # (<) :: CTime -> CTime -> Bool # (<=) :: CTime -> CTime -> Bool # (>) :: CTime -> CTime -> Bool # (>=) :: CTime -> CTime -> Bool # max :: CTime -> CTime -> CTime # min :: CTime -> CTime -> CTime #
Ord CUSeconds |
Instance details Defined in Foreign.C.Types Methods compare :: CUSeconds -> CUSeconds -> Ordering # (<) :: CUSeconds -> CUSeconds -> Bool # (<=) :: CUSeconds -> CUSeconds -> Bool # (>) :: CUSeconds -> CUSeconds -> Bool # (>=) :: CUSeconds -> CUSeconds -> Bool # max :: CUSeconds -> CUSeconds -> CUSeconds # min :: CUSeconds -> CUSeconds -> CUSeconds #
Ord CSUSeconds |
Instance details Defined in Foreign.C.Types Methods compare :: CSUSeconds -> CSUSeconds -> Ordering # (<) :: CSUSeconds -> CSUSeconds -> Bool # (<=) :: CSUSeconds -> CSUSeconds -> Bool # (>) :: CSUSeconds -> CSUSeconds -> Bool # (>=) :: CSUSeconds -> CSUSeconds -> Bool # max :: CSUSeconds -> CSUSeconds -> CSUSeconds # min :: CSUSeconds -> CSUSeconds -> CSUSeconds #
Ord CIntPtr |
Instance details Defined in Foreign.C.Types Methods compare :: CIntPtr -> CIntPtr -> Ordering # (<) :: CIntPtr -> CIntPtr -> Bool # (<=) :: CIntPtr -> CIntPtr -> Bool # (>) :: CIntPtr -> CIntPtr -> Bool # (>=) :: CIntPtr -> CIntPtr -> Bool # max :: CIntPtr -> CIntPtr -> CIntPtr # min :: CIntPtr -> CIntPtr -> CIntPtr #
Ord CUIntPtr |
Instance details Defined in Foreign.C.Types Methods compare :: CUIntPtr -> CUIntPtr -> Ordering # (<) :: CUIntPtr -> CUIntPtr -> Bool # (<=) :: CUIntPtr -> CUIntPtr -> Bool # (>) :: CUIntPtr -> CUIntPtr -> Bool # (>=) :: CUIntPtr -> CUIntPtr -> Bool # max :: CUIntPtr -> CUIntPtr -> CUIntPtr # min :: CUIntPtr -> CUIntPtr -> CUIntPtr #
Ord CIntMax |
Instance details Defined in Foreign.C.Types Methods compare :: CIntMax -> CIntMax -> Ordering # (<) :: CIntMax -> CIntMax -> Bool # (<=) :: CIntMax -> CIntMax -> Bool # (>) :: CIntMax -> CIntMax -> Bool # (>=) :: CIntMax -> CIntMax -> Bool # max :: CIntMax -> CIntMax -> CIntMax # min :: CIntMax -> CIntMax -> CIntMax #
Ord CUIntMax |
Instance details Defined in Foreign.C.Types Methods compare :: CUIntMax -> CUIntMax -> Ordering # (<) :: CUIntMax -> CUIntMax -> Bool # (<=) :: CUIntMax -> CUIntMax -> Bool # (>) :: CUIntMax -> CUIntMax -> Bool # (>=) :: CUIntMax -> CUIntMax -> Bool # max :: CUIntMax -> CUIntMax -> CUIntMax # min :: CUIntMax -> CUIntMax -> CUIntMax #
Ord WordPtr |
Instance details Defined in Foreign.Ptr Methods compare :: WordPtr -> WordPtr -> Ordering # (<) :: WordPtr -> WordPtr -> Bool # (<=) :: WordPtr -> WordPtr -> Bool # (>) :: WordPtr -> WordPtr -> Bool # (>=) :: WordPtr -> WordPtr -> Bool # max :: WordPtr -> WordPtr -> WordPtr # min :: WordPtr -> WordPtr -> WordPtr #
Ord IntPtr |
Instance details Defined in Foreign.Ptr Methods compare :: IntPtr -> IntPtr -> Ordering # (<) :: IntPtr -> IntPtr -> Bool # (<=) :: IntPtr -> IntPtr -> Bool # (>) :: IntPtr -> IntPtr -> Bool # (>=) :: IntPtr -> IntPtr -> Bool # max :: IntPtr -> IntPtr -> IntPtr # min :: IntPtr -> IntPtr -> IntPtr #
Ord Fingerprint |
Instance details Defined in GHC.Fingerprint.Type Methods compare :: Fingerprint -> Fingerprint -> Ordering # (<) :: Fingerprint -> Fingerprint -> Bool # (<=) :: Fingerprint -> Fingerprint -> Bool # (>) :: Fingerprint -> Fingerprint -> Bool # (>=) :: Fingerprint -> Fingerprint -> Bool # max :: Fingerprint -> Fingerprint -> Fingerprint # min :: Fingerprint -> Fingerprint -> Fingerprint #
Ord GeneralCategory |
Instance details Defined in GHC.Unicode Methods compare :: GeneralCategory -> GeneralCategory -> Ordering # (<) :: GeneralCategory -> GeneralCategory -> Bool # (<=) :: GeneralCategory -> GeneralCategory -> Bool # (>) :: GeneralCategory -> GeneralCategory -> Bool # (>=) :: GeneralCategory -> GeneralCategory -> Bool # max :: GeneralCategory -> GeneralCategory -> GeneralCategory # min :: GeneralCategory -> GeneralCategory -> GeneralCategory #
Ord a => Ord [a] |
Instance details Defined in GHC.Classes Methods compare :: [a] -> [a] -> Ordering # (<) :: [a] -> [a] -> Bool # (<=) :: [a] -> [a] -> Bool # (>) :: [a] -> [a] -> Bool # (>=) :: [a] -> [a] -> Bool # max :: [a] -> [a] -> [a] # min :: [a] -> [a] -> [a] #
Ord a => Ord (Maybe a) |
Instance details Defined in GHC.Base Methods compare :: Maybe a -> Maybe a -> Ordering # (<) :: Maybe a -> Maybe a -> Bool # (<=) :: Maybe a -> Maybe a -> Bool # (>) :: Maybe a -> Maybe a -> Bool # (>=) :: Maybe a -> Maybe a -> Bool # max :: Maybe a -> Maybe a -> Maybe a # min :: Maybe a -> Maybe a -> Maybe a #
Integral a => Ord (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods compare :: Ratio a -> Ratio a -> Ordering # (<) :: Ratio a -> Ratio a -> Bool # (<=) :: Ratio a -> Ratio a -> Bool # (>) :: Ratio a -> Ratio a -> Bool # (>=) :: Ratio a -> Ratio a -> Bool # max :: Ratio a -> Ratio a -> Ratio a # min :: Ratio a -> Ratio a -> Ratio a #
Ord (Ptr a) |
Instance details Defined in GHC.Ptr Methods compare :: Ptr a -> Ptr a -> Ordering # (<) :: Ptr a -> Ptr a -> Bool # (<=) :: Ptr a -> Ptr a -> Bool # (>) :: Ptr a -> Ptr a -> Bool # (>=) :: Ptr a -> Ptr a -> Bool # max :: Ptr a -> Ptr a -> Ptr a # min :: Ptr a -> Ptr a -> Ptr a #
Ord (FunPtr a) |
Instance details Defined in GHC.Ptr Methods compare :: FunPtr a -> FunPtr a -> Ordering # (<) :: FunPtr a -> FunPtr a -> Bool # (<=) :: FunPtr a -> FunPtr a -> Bool # (>) :: FunPtr a -> FunPtr a -> Bool # (>=) :: FunPtr a -> FunPtr a -> Bool # max :: FunPtr a -> FunPtr a -> FunPtr a # min :: FunPtr a -> FunPtr a -> FunPtr a #
Ord p => Ord (Par1 p) |
Instance details Defined in GHC.Generics Methods compare :: Par1 p -> Par1 p -> Ordering # (<) :: Par1 p -> Par1 p -> Bool # (<=) :: Par1 p -> Par1 p -> Bool # (>) :: Par1 p -> Par1 p -> Bool # (>=) :: Par1 p -> Par1 p -> Bool # max :: Par1 p -> Par1 p -> Par1 p # min :: Par1 p -> Par1 p -> Par1 p #
Ord (Fixed a) |
Instance details Defined in Data.Fixed Methods compare :: Fixed a -> Fixed a -> Ordering # (<) :: Fixed a -> Fixed a -> Bool # (<=) :: Fixed a -> Fixed a -> Bool # (>) :: Fixed a -> Fixed a -> Bool # (>=) :: Fixed a -> Fixed a -> Bool # max :: Fixed a -> Fixed a -> Fixed a # min :: Fixed a -> Fixed a -> Fixed a #
Ord a => Ord (Min a) |
Instance details Defined in Data.Semigroup Methods compare :: Min a -> Min a -> Ordering # (<) :: Min a -> Min a -> Bool # (<=) :: Min a -> Min a -> Bool # (>) :: Min a -> Min a -> Bool # (>=) :: Min a -> Min a -> Bool # max :: Min a -> Min a -> Min a # min :: Min a -> Min a -> Min a #
Ord a => Ord (Max a) |
Instance details Defined in Data.Semigroup Methods compare :: Max a -> Max a -> Ordering # (<) :: Max a -> Max a -> Bool # (<=) :: Max a -> Max a -> Bool # (>) :: Max a -> Max a -> Bool # (>=) :: Max a -> Max a -> Bool # max :: Max a -> Max a -> Max a # min :: Max a -> Max a -> Max a #
Ord a => Ord (First a) |
Instance details Defined in Data.Semigroup Methods compare :: First a -> First a -> Ordering # (<) :: First a -> First a -> Bool # (<=) :: First a -> First a -> Bool # (>) :: First a -> First a -> Bool # (>=) :: First a -> First a -> Bool # max :: First a -> First a -> First a # min :: First a -> First a -> First a #
Ord a => Ord (Last a) |
Instance details Defined in Data.Semigroup Methods compare :: Last a -> Last a -> Ordering # (<) :: Last a -> Last a -> Bool # (<=) :: Last a -> Last a -> Bool # (>) :: Last a -> Last a -> Bool # (>=) :: Last a -> Last a -> Bool # max :: Last a -> Last a -> Last a # min :: Last a -> Last a -> Last a #
Ord m => Ord (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #
Ord a => Ord (Option a) |
Instance details Defined in Data.Semigroup Methods compare :: Option a -> Option a -> Ordering # (<) :: Option a -> Option a -> Bool # (<=) :: Option a -> Option a -> Bool # (>) :: Option a -> Option a -> Bool # (>=) :: Option a -> Option a -> Bool # max :: Option a -> Option a -> Option a # min :: Option a -> Option a -> Option a #
Ord a => Ord (ZipList a) |
Instance details Defined in Control.Applicative Methods compare :: ZipList a -> ZipList a -> Ordering # (<) :: ZipList a -> ZipList a -> Bool # (<=) :: ZipList a -> ZipList a -> Bool # (>) :: ZipList a -> ZipList a -> Bool # (>=) :: ZipList a -> ZipList a -> Bool # max :: ZipList a -> ZipList a -> ZipList a # min :: ZipList a -> ZipList a -> ZipList a #
Ord a => Ord (Identity a) |
Instance details Defined in Data.Functor.Identity Methods compare :: Identity a -> Identity a -> Ordering # (<) :: Identity a -> Identity a -> Bool # (<=) :: Identity a -> Identity a -> Bool # (>) :: Identity a -> Identity a -> Bool # (>=) :: Identity a -> Identity a -> Bool # max :: Identity a -> Identity a -> Identity a # min :: Identity a -> Identity a -> Identity a #
Ord (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods compare :: ForeignPtr a -> ForeignPtr a -> Ordering # (<) :: ForeignPtr a -> ForeignPtr a -> Bool # (<=) :: ForeignPtr a -> ForeignPtr a -> Bool # (>) :: ForeignPtr a -> ForeignPtr a -> Bool # (>=) :: ForeignPtr a -> ForeignPtr a -> Bool # max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a # min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a #
Ord a => Ord (First a) |
Instance details Defined in Data.Monoid Methods compare :: First a -> First a -> Ordering # (<) :: First a -> First a -> Bool # (<=) :: First a -> First a -> Bool # (>) :: First a -> First a -> Bool # (>=) :: First a -> First a -> Bool # max :: First a -> First a -> First a # min :: First a -> First a -> First a #
Ord a => Ord (Last a) |
Instance details Defined in Data.Monoid Methods compare :: Last a -> Last a -> Ordering # (<) :: Last a -> Last a -> Bool # (<=) :: Last a -> Last a -> Bool # (>) :: Last a -> Last a -> Bool # (>=) :: Last a -> Last a -> Bool # max :: Last a -> Last a -> Last a # min :: Last a -> Last a -> Last a #
Ord a => Ord (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Dual a -> Dual a -> Ordering # (<) :: Dual a -> Dual a -> Bool # (<=) :: Dual a -> Dual a -> Bool # (>) :: Dual a -> Dual a -> Bool # (>=) :: Dual a -> Dual a -> Bool # max :: Dual a -> Dual a -> Dual a # min :: Dual a -> Dual a -> Dual a #
Ord a => Ord (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Sum a -> Sum a -> Ordering # (<) :: Sum a -> Sum a -> Bool # (<=) :: Sum a -> Sum a -> Bool # (>) :: Sum a -> Sum a -> Bool # (>=) :: Sum a -> Sum a -> Bool # max :: Sum a -> Sum a -> Sum a # min :: Sum a -> Sum a -> Sum a #
Ord a => Ord (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Product a -> Product a -> Ordering # (<) :: Product a -> Product a -> Bool # (<=) :: Product a -> Product a -> Bool # (>) :: Product a -> Product a -> Bool # (>=) :: Product a -> Product a -> Bool # max :: Product a -> Product a -> Product a # min :: Product a -> Product a -> Product a #
Ord a => Ord (Down a) | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods compare :: Down a -> Down a -> Ordering # (<) :: Down a -> Down a -> Bool # (<=) :: Down a -> Down a -> Bool # (>) :: Down a -> Down a -> Bool # (>=) :: Down a -> Down a -> Bool # max :: Down a -> Down a -> Down a # min :: Down a -> Down a -> Down a #
Ord a => Ord (NonEmpty a) |
Instance details Defined in GHC.Base Methods compare :: NonEmpty a -> NonEmpty a -> Ordering # (<) :: NonEmpty a -> NonEmpty a -> Bool # (<=) :: NonEmpty a -> NonEmpty a -> Bool # (>) :: NonEmpty a -> NonEmpty a -> Bool # (>=) :: NonEmpty a -> NonEmpty a -> Bool # max :: NonEmpty a -> NonEmpty a -> NonEmpty a # min :: NonEmpty a -> NonEmpty a -> NonEmpty a #
(Ord a, Ord b) => Ord (Either a b) |
Instance details Defined in Data.Either Methods compare :: Either a b -> Either a b -> Ordering # (<) :: Either a b -> Either a b -> Bool # (<=) :: Either a b -> Either a b -> Bool # (>) :: Either a b -> Either a b -> Bool # (>=) :: Either a b -> Either a b -> Bool # max :: Either a b -> Either a b -> Either a b # min :: Either a b -> Either a b -> Either a b #
Ord (V1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods compare :: V1 p -> V1 p -> Ordering # (<) :: V1 p -> V1 p -> Bool # (<=) :: V1 p -> V1 p -> Bool # (>) :: V1 p -> V1 p -> Bool # (>=) :: V1 p -> V1 p -> Bool # max :: V1 p -> V1 p -> V1 p # min :: V1 p -> V1 p -> V1 p #
Ord (U1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods compare :: U1 p -> U1 p -> Ordering # (<) :: U1 p -> U1 p -> Bool # (<=) :: U1 p -> U1 p -> Bool # (>) :: U1 p -> U1 p -> Bool # (>=) :: U1 p -> U1 p -> Bool # max :: U1 p -> U1 p -> U1 p # min :: U1 p -> U1 p -> U1 p #
Ord (TypeRep a) | Since: base-4.4.0.0
Instance details Defined in Data.Typeable.Internal Methods compare :: TypeRep a -> TypeRep a -> Ordering # (<) :: TypeRep a -> TypeRep a -> Bool # (<=) :: TypeRep a -> TypeRep a -> Bool # (>) :: TypeRep a -> TypeRep a -> Bool # (>=) :: TypeRep a -> TypeRep a -> Bool # max :: TypeRep a -> TypeRep a -> TypeRep a # min :: TypeRep a -> TypeRep a -> TypeRep a #
(Ord a, Ord b) => Ord (a, b) |
Instance details Defined in GHC.Classes Methods compare :: (a, b) -> (a, b) -> Ordering # (<) :: (a, b) -> (a, b) -> Bool # (<=) :: (a, b) -> (a, b) -> Bool # (>) :: (a, b) -> (a, b) -> Bool # (>=) :: (a, b) -> (a, b) -> Bool # max :: (a, b) -> (a, b) -> (a, b) # min :: (a, b) -> (a, b) -> (a, b) #
(Ix i, Ord e) => Ord (Array i e) | Since: base-2.1
Instance details Defined in GHC.Arr Methods compare :: Array i e -> Array i e -> Ordering # (<) :: Array i e -> Array i e -> Bool # (<=) :: Array i e -> Array i e -> Bool # (>) :: Array i e -> Array i e -> Bool # (>=) :: Array i e -> Array i e -> Bool # max :: Array i e -> Array i e -> Array i e # min :: Array i e -> Array i e -> Array i e #
Ord a => Ord (Arg a b) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Arg a b -> Arg a b -> Ordering # (<) :: Arg a b -> Arg a b -> Bool # (<=) :: Arg a b -> Arg a b -> Bool # (>) :: Arg a b -> Arg a b -> Bool # (>=) :: Arg a b -> Arg a b -> Bool # max :: Arg a b -> Arg a b -> Arg a b # min :: Arg a b -> Arg a b -> Arg a b #
Ord (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods compare :: Proxy s -> Proxy s -> Ordering # (<) :: Proxy s -> Proxy s -> Bool # (<=) :: Proxy s -> Proxy s -> Bool # (>) :: Proxy s -> Proxy s -> Bool # (>=) :: Proxy s -> Proxy s -> Bool # max :: Proxy s -> Proxy s -> Proxy s # min :: Proxy s -> Proxy s -> Proxy s #
Ord (f p) => Ord (Rec1 f p) |
Instance details Defined in GHC.Generics Methods compare :: Rec1 f p -> Rec1 f p -> Ordering # (<) :: Rec1 f p -> Rec1 f p -> Bool # (<=) :: Rec1 f p -> Rec1 f p -> Bool # (>) :: Rec1 f p -> Rec1 f p -> Bool # (>=) :: Rec1 f p -> Rec1 f p -> Bool # max :: Rec1 f p -> Rec1 f p -> Rec1 f p # min :: Rec1 f p -> Rec1 f p -> Rec1 f p #
Ord (URec (Ptr ()) p) |
Instance details Defined in GHC.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 #
Ord (URec Char p) |
Instance details Defined in GHC.Generics Methods compare :: URec Char p -> URec Char p -> Ordering # (<) :: URec Char p -> URec Char p -> Bool # (<=) :: URec Char p -> URec Char p -> Bool # (>) :: URec Char p -> URec Char p -> Bool # (>=) :: URec Char p -> URec Char p -> Bool # max :: URec Char p -> URec Char p -> URec Char p # min :: URec Char p -> URec Char p -> URec Char p #
Ord (URec Double p) |
Instance details Defined in GHC.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 # max :: URec Double p -> URec Double p -> URec Double p # min :: URec Double p -> URec Double p -> URec Double p #
Ord (URec Float p) |
Instance details Defined in GHC.Generics Methods compare :: URec Float p -> URec Float p -> Ordering # (<) :: URec Float p -> URec Float p -> Bool # (<=) :: URec Float p -> URec Float p -> Bool # (>) :: URec Float p -> URec Float p -> Bool # (>=) :: URec Float p -> URec Float p -> Bool # max :: URec Float p -> URec Float p -> URec Float p # min :: URec Float p -> URec Float p -> URec Float p #
Ord (URec Int p) |
Instance details Defined in GHC.Generics Methods compare :: URec Int p -> URec Int p -> Ordering # (<) :: URec Int p -> URec Int p -> Bool # (<=) :: URec Int p -> URec Int p -> Bool # (>) :: URec Int p -> URec Int p -> Bool # (>=) :: URec Int p -> URec Int p -> Bool # max :: URec Int p -> URec Int p -> URec Int p # min :: URec Int p -> URec Int p -> URec Int p #
Ord (URec Word p) |
Instance details Defined in GHC.Generics Methods compare :: URec Word p -> URec Word p -> Ordering # (<) :: URec Word p -> URec Word p -> Bool # (<=) :: URec Word p -> URec Word p -> Bool # (>) :: URec Word p -> URec Word p -> Bool # (>=) :: URec Word p -> URec Word p -> Bool # max :: URec Word p -> URec Word p -> URec Word p # min :: URec Word p -> URec Word p -> URec Word p #
(Ord a, Ord b, Ord c) => Ord (a, b, c) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c) -> (a, b, c) -> Ordering # (<) :: (a, b, c) -> (a, b, c) -> Bool # (<=) :: (a, b, c) -> (a, b, c) -> Bool # (>) :: (a, b, c) -> (a, b, c) -> Bool # (>=) :: (a, b, c) -> (a, b, c) -> Bool # max :: (a, b, c) -> (a, b, c) -> (a, b, c) # min :: (a, b, c) -> (a, b, c) -> (a, b, c) #
Ord a => Ord (Const a b) |
Instance details Defined in Data.Functor.Const Methods compare :: Const a b -> Const a b -> Ordering # (<) :: Const a b -> Const a b -> Bool # (<=) :: Const a b -> Const a b -> Bool # (>) :: Const a b -> Const a b -> Bool # (>=) :: Const a b -> Const a b -> Bool # max :: Const a b -> Const a b -> Const a b # min :: Const a b -> Const a b -> Const a b #
Ord (f a) => Ord (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Alt f a -> Alt f a -> Ordering # (<) :: Alt f a -> Alt f a -> Bool # (<=) :: Alt f a -> Alt f a -> Bool # (>) :: Alt f a -> Alt f a -> Bool # (>=) :: Alt f a -> Alt f a -> Bool # max :: Alt f a -> Alt f a -> Alt f a # min :: Alt f a -> Alt f a -> Alt f a #
Ord (a :~: b) |
Instance details Defined in Data.Type.Equality Methods compare :: (a :~: b) -> (a :~: b) -> Ordering # (<) :: (a :~: b) -> (a :~: b) -> Bool # (<=) :: (a :~: b) -> (a :~: b) -> Bool # (>) :: (a :~: b) -> (a :~: b) -> Bool # (>=) :: (a :~: b) -> (a :~: b) -> Bool # max :: (a :~: b) -> (a :~: b) -> a :~: b # min :: (a :~: b) -> (a :~: b) -> a :~: b #
Ord c => Ord (K1 i c p) |
Instance details Defined in GHC.Generics Methods compare :: K1 i c p -> K1 i c p -> Ordering # (<) :: K1 i c p -> K1 i c p -> Bool # (<=) :: K1 i c p -> K1 i c p -> Bool # (>) :: K1 i c p -> K1 i c p -> Bool # (>=) :: K1 i c p -> K1 i c p -> Bool # max :: K1 i c p -> K1 i c p -> K1 i c p # min :: K1 i c p -> K1 i c p -> K1 i c p #
(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) |
Instance details Defined in GHC.Generics Methods compare :: (f :+: g) p -> (f :+: g) p -> Ordering # (<) :: (f :+: g) p -> (f :+: g) p -> Bool # (<=) :: (f :+: g) p -> (f :+: g) p -> Bool # (>) :: (f :+: g) p -> (f :+: g) p -> Bool # (>=) :: (f :+: g) p -> (f :+: g) p -> Bool # max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p # min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #
(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) |
Instance details Defined in GHC.Generics Methods compare :: (f :*: g) p -> (f :*: g) p -> Ordering # (<) :: (f :*: g) p -> (f :*: g) p -> Bool # (<=) :: (f :*: g) p -> (f :*: g) p -> Bool # (>) :: (f :*: g) p -> (f :*: g) p -> Bool # (>=) :: (f :*: g) p -> (f :*: g) p -> Bool # max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p # min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #
(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering # (<) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (>) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #
Ord (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods compare :: (a :~~: b) -> (a :~~: b) -> Ordering # (<) :: (a :~~: b) -> (a :~~: b) -> Bool # (<=) :: (a :~~: b) -> (a :~~: b) -> Bool # (>) :: (a :~~: b) -> (a :~~: b) -> Bool # (>=) :: (a :~~: b) -> (a :~~: b) -> Bool # max :: (a :~~: b) -> (a :~~: b) -> a :~~: b # min :: (a :~~: b) -> (a :~~: b) -> a :~~: b #
Ord (f p) => Ord (M1 i c f p) |
Instance details Defined in GHC.Generics Methods compare :: M1 i c f p -> M1 i c f p -> Ordering # (<) :: M1 i c f p -> M1 i c f p -> Bool # (<=) :: M1 i c f p -> M1 i c f p -> Bool # (>) :: M1 i c f p -> M1 i c f p -> Bool # (>=) :: M1 i c f p -> M1 i c f p -> Bool # max :: M1 i c f p -> M1 i c f p -> M1 i c f p # min :: M1 i c f p -> M1 i c f p -> M1 i c f p #
Ord (f (g p)) => Ord ((f :.: g) p) |
Instance details Defined in GHC.Generics Methods compare :: (f :.: g) p -> (f :.: g) p -> Ordering # (<) :: (f :.: g) p -> (f :.: g) p -> Bool # (<=) :: (f :.: g) p -> (f :.: g) p -> Bool # (>) :: (f :.: g) p -> (f :.: g) p -> Bool # (>=) :: (f :.: g) p -> (f :.: g) p -> Bool # max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p # min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #
(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering # (<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #
(Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods compare :: Compose f g a -> Compose f g a -> Ordering # (<) :: Compose f g a -> Compose f g a -> Bool # (<=) :: Compose f g a -> Compose f g a -> Bool # (>) :: Compose f g a -> Compose f g a -> Bool # (>=) :: Compose f g a -> Compose f g a -> Bool # max :: Compose f g a -> Compose f g a -> Compose f g a # min :: Compose f g a -> Compose f g a -> Compose f g a #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering # (<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering # (<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering # (<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Read a where #

Parsing of `String`s, producing values.

Derived instances of `Read` make the following assumptions, which derived instances of `Show` obey:

- If the constructor is defined to be an infix operator, then the derived `Read` instance will parse only infix applications of the constructor (not the prefix form).
- Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
- If the constructor is defined using record syntax, the derived `Read` will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
- The derived `Read` instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.

For example, given the declarations

    infixr 5 :^:
    data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of `Read` in Haskell 2010 is equivalent to

    instance (Read a) => Read (Tree a) where

            readsPrec d r =  readParen (d > app_prec)
                             (\r -> [(Leaf m,t) |
                                     ("Leaf",s) <- lex r,
                                     (m,t) <- readsPrec (app_prec+1) s]) r

                          ++ readParen (d > up_prec)
                             (\r -> [(u:^:v,w) |
                                     (u,s) <- readsPrec (up_prec+1) r,
                                     (":^:",t) <- lex s,
                                     (v,w) <- readsPrec (up_prec+1) t]) r

              where app_prec = 10
                    up_prec = 5

Note that right-associativity of `:^:` is unused.

The derived instance in GHC is equivalent to

    instance (Read a) => Read (Tree a) where

            readPrec = parens $ (prec app_prec $ do
                                     Ident "Leaf" <- lexP
                                     m <- step readPrec
                                     return (Leaf m))

                         +++ (prec up_prec $ do
                                     u <- step readPrec
                                     Symbol ":^:" <- lexP
                                     v <- step readPrec
                                     return (u :^: v))

              where app_prec = 10
                    up_prec = 5

            readListPrec = readListPrecDefault

Why do both `readsPrec` and `readPrec` exist, and why does GHC opt to implement `readPrec` in derived `Read` instances instead of `readsPrec`? The reason is that `readsPrec` is based on the `ReadS` type, and although `ReadS` is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.

`readPrec`, on the other hand, is based on a much more efficient `ReadPrec` datatype (a.k.a "new-style parsers"), but its definition relies on the use of the `RankNTypes` language extension. Therefore, `readPrec` (and its cousin, `readListPrec`) are marked as GHC-only. Nevertheless, it is recommended to use `readPrec` instead of `readsPrec` whenever possible for the efficiency improvements it brings.

As mentioned above, derived `Read` instances in GHC will implement `readPrec` instead of `readsPrec`. The default implementations of `readsPrec` (and its cousin, `readList`) will simply use `readPrec` under the hood. If you are writing a `Read` instance by hand, it is recommended to write it like so:

    instance Read T where
      readPrec     = ...
      readListPrec = readListPrecDefault

Minimal complete definition

readsPrec | readPrec

Methods

readsPrec #

Arguments

:: Int | the operator precedence of the enclosing context (a number from `0` to `11`). Function application has precedence `10`.
-> ReadS a |

attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.

Derived instances of `Read` and `Show` satisfy the following:

- `(x,"")` is an element of `(`readsPrec` d (`showsPrec` d x ""))`.

That is, `readsPrec` parses the string produced by `showsPrec`, and delivers the value that `showsPrec` started with.

readList :: ReadS [a] #

The method `readList` is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined `Read` instance of the `Char` type, where values of type `String` should be are expected to use double quotes, rather than square brackets.

readPrec :: ReadPrec a #

Proposed replacement for `readsPrec` using new-style parsers (GHC only).

readListPrec :: ReadPrec [a] #

Proposed replacement for `readList` using new-style parsers (GHC only). The default definition uses `readList`. Instances that define `readPrec` should also define `readListPrec` as `readListPrecDefault`.

Instances

Read Bool | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Bool # readList :: ReadS [Bool] # readPrec :: ReadPrec Bool # readListPrec :: ReadPrec [Bool] #
Read Char | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char # readList :: ReadS [Char] # readPrec :: ReadPrec Char # readListPrec :: ReadPrec [Char] #
Read Double | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Double # readList :: ReadS [Double] # readPrec :: ReadPrec Double # readListPrec :: ReadPrec [Double] #
Read Float | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Float # readList :: ReadS [Float] # readPrec :: ReadPrec Float # readListPrec :: ReadPrec [Float] #
Read Int | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Int # readList :: ReadS [Int] # readPrec :: ReadPrec Int # readListPrec :: ReadPrec [Int] #
Read Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int8 # readList :: ReadS [Int8] # readPrec :: ReadPrec Int8 # readListPrec :: ReadPrec [Int8] #
Read Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int16 # readList :: ReadS [Int16] # readPrec :: ReadPrec Int16 # readListPrec :: ReadPrec [Int16] #
Read Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int32 # readList :: ReadS [Int32] # readPrec :: ReadPrec Int32 # readListPrec :: ReadPrec [Int32] #
Read Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int64 # readList :: ReadS [Int64] # readPrec :: ReadPrec Int64 # readListPrec :: ReadPrec [Int64] #
Read Integer | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Integer # readList :: ReadS [Integer] # readPrec :: ReadPrec Integer # readListPrec :: ReadPrec [Integer] #
Read Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods readsPrec :: Int -> ReadS Natural # readList :: ReadS [Natural] # readPrec :: ReadPrec Natural # readListPrec :: ReadPrec [Natural] #
Read Ordering | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Ordering # readList :: ReadS [Ordering] # readPrec :: ReadPrec Ordering # readListPrec :: ReadPrec [Ordering] #
Read Word | Since: base-4.5.0.0
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word # readList :: ReadS [Word] # readPrec :: ReadPrec Word # readListPrec :: ReadPrec [Word] #
Read Word8 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word8 # readList :: ReadS [Word8] # readPrec :: ReadPrec Word8 # readListPrec :: ReadPrec [Word8] #
Read Word16 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word16 # readList :: ReadS [Word16] # readPrec :: ReadPrec Word16 # readListPrec :: ReadPrec [Word16] #
Read Word32 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word32 # readList :: ReadS [Word32] # readPrec :: ReadPrec Word32 # readListPrec :: ReadPrec [Word32] #
Read Word64 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word64 # readList :: ReadS [Word64] # readPrec :: ReadPrec Word64 # readListPrec :: ReadPrec [Word64] #
Read () | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS () # readList :: ReadS [()] # readPrec :: ReadPrec () # readListPrec :: ReadPrec [()] #
Read Void | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors. Since: base-4.8.0.0
Instance details Defined in Data.Void Methods readsPrec :: Int -> ReadS Void # readList :: ReadS [Void] # readPrec :: ReadPrec Void # readListPrec :: ReadPrec [Void] #
Read Version |
Instance details Defined in Data.Version Methods readsPrec :: Int -> ReadS Version # readList :: ReadS [Version] # readPrec :: ReadPrec Version # readListPrec :: ReadPrec [Version] #
Read CDev |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CDev # readList :: ReadS [CDev] # readPrec :: ReadPrec CDev # readListPrec :: ReadPrec [CDev] #
Read CIno |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CIno # readList :: ReadS [CIno] # readPrec :: ReadPrec CIno # readListPrec :: ReadPrec [CIno] #
Read CMode |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CMode # readList :: ReadS [CMode] # readPrec :: ReadPrec CMode # readListPrec :: ReadPrec [CMode] #
Read COff |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS COff # readList :: ReadS [COff] # readPrec :: ReadPrec COff # readListPrec :: ReadPrec [COff] #
Read CPid |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CPid # readList :: ReadS [CPid] # readPrec :: ReadPrec CPid # readListPrec :: ReadPrec [CPid] #
Read CSsize |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CSsize # readList :: ReadS [CSsize] # readPrec :: ReadPrec CSsize # readListPrec :: ReadPrec [CSsize] #
Read CGid |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CGid # readList :: ReadS [CGid] # readPrec :: ReadPrec CGid # readListPrec :: ReadPrec [CGid] #
Read CNlink |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CNlink # readList :: ReadS [CNlink] # readPrec :: ReadPrec CNlink # readListPrec :: ReadPrec [CNlink] #
Read CUid |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CUid # readList :: ReadS [CUid] # readPrec :: ReadPrec CUid # readListPrec :: ReadPrec [CUid] #
Read CCc |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CCc # readList :: ReadS [CCc] # readPrec :: ReadPrec CCc # readListPrec :: ReadPrec [CCc] #
Read CSpeed |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CSpeed # readList :: ReadS [CSpeed] # readPrec :: ReadPrec CSpeed # readListPrec :: ReadPrec [CSpeed] #
Read CTcflag |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CTcflag # readList :: ReadS [CTcflag] # readPrec :: ReadPrec CTcflag # readListPrec :: ReadPrec [CTcflag] #
Read CRLim |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CRLim # readList :: ReadS [CRLim] # readPrec :: ReadPrec CRLim # readListPrec :: ReadPrec [CRLim] #
Read CBlkSize |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CBlkSize # readList :: ReadS [CBlkSize] # readPrec :: ReadPrec CBlkSize # readListPrec :: ReadPrec [CBlkSize] #
Read CBlkCnt |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CBlkCnt # readList :: ReadS [CBlkCnt] # readPrec :: ReadPrec CBlkCnt # readListPrec :: ReadPrec [CBlkCnt] #
Read CClockId |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CClockId # readList :: ReadS [CClockId] # readPrec :: ReadPrec CClockId # readListPrec :: ReadPrec [CClockId] #
Read CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CFsBlkCnt # readList :: ReadS [CFsBlkCnt] # readPrec :: ReadPrec CFsBlkCnt # readListPrec :: ReadPrec [CFsBlkCnt] #
Read CFsFilCnt |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CFsFilCnt # readList :: ReadS [CFsFilCnt] # readPrec :: ReadPrec CFsFilCnt # readListPrec :: ReadPrec [CFsFilCnt] #
Read CId |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CId # readList :: ReadS [CId] # readPrec :: ReadPrec CId # readListPrec :: ReadPrec [CId] #
Read CKey |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CKey # readList :: ReadS [CKey] # readPrec :: ReadPrec CKey # readListPrec :: ReadPrec [CKey] #
Read Fd |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS Fd # readList :: ReadS [Fd] # readPrec :: ReadPrec Fd # readListPrec :: ReadPrec [Fd] #
Read ExitCode |
Instance details Defined in GHC.IO.Exception Methods readsPrec :: Int -> ReadS ExitCode # readList :: ReadS [ExitCode] # readPrec :: ReadPrec ExitCode # readListPrec :: ReadPrec [ExitCode] #
Read BufferMode |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS BufferMode # readList :: ReadS [BufferMode] # readPrec :: ReadPrec BufferMode # readListPrec :: ReadPrec [BufferMode] #
Read Newline |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS Newline # readList :: ReadS [Newline] # readPrec :: ReadPrec Newline # readListPrec :: ReadPrec [Newline] #
Read NewlineMode |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS NewlineMode # readList :: ReadS [NewlineMode] # readPrec :: ReadPrec NewlineMode # readListPrec :: ReadPrec [NewlineMode] #
Read All |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS All # readList :: ReadS [All] # readPrec :: ReadPrec All # readListPrec :: ReadPrec [All] #
Read Any |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS Any # readList :: ReadS [Any] # readPrec :: ReadPrec Any # readListPrec :: ReadPrec [Any] #
Read Fixity |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS Fixity # readList :: ReadS [Fixity] # readPrec :: ReadPrec Fixity # readListPrec :: ReadPrec [Fixity] #
Read Associativity |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS Associativity # readList :: ReadS [Associativity] # readPrec :: ReadPrec Associativity # readListPrec :: ReadPrec [Associativity] #
Read SourceUnpackedness |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS SourceUnpackedness # readList :: ReadS [SourceUnpackedness] # readPrec :: ReadPrec SourceUnpackedness # readListPrec :: ReadPrec [SourceUnpackedness] #
Read SourceStrictness |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS SourceStrictness # readList :: ReadS [SourceStrictness] # readPrec :: ReadPrec SourceStrictness # readListPrec :: ReadPrec [SourceStrictness] #
Read DecidedStrictness |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS DecidedStrictness # readList :: ReadS [DecidedStrictness] # readPrec :: ReadPrec DecidedStrictness # readListPrec :: ReadPrec [DecidedStrictness] #
Read CChar |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CChar # readList :: ReadS [CChar] # readPrec :: ReadPrec CChar # readListPrec :: ReadPrec [CChar] #
Read CSChar |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSChar # readList :: ReadS [CSChar] # readPrec :: ReadPrec CSChar # readListPrec :: ReadPrec [CSChar] #
Read CUChar |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUChar # readList :: ReadS [CUChar] # readPrec :: ReadPrec CUChar # readListPrec :: ReadPrec [CUChar] #
Read CShort |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CShort # readList :: ReadS [CShort] # readPrec :: ReadPrec CShort # readListPrec :: ReadPrec [CShort] #
Read CUShort |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUShort # readList :: ReadS [CUShort] # readPrec :: ReadPrec CUShort # readListPrec :: ReadPrec [CUShort] #
Read CInt |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CInt # readList :: ReadS [CInt] # readPrec :: ReadPrec CInt # readListPrec :: ReadPrec [CInt] #
Read CUInt |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUInt # readList :: ReadS [CUInt] # readPrec :: ReadPrec CUInt # readListPrec :: ReadPrec [CUInt] #
Read CLong |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CLong # readList :: ReadS [CLong] # readPrec :: ReadPrec CLong # readListPrec :: ReadPrec [CLong] #
Read CULong |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CULong # readList :: ReadS [CULong] # readPrec :: ReadPrec CULong # readListPrec :: ReadPrec [CULong] #
Read CLLong |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CLLong # readList :: ReadS [CLLong] # readPrec :: ReadPrec CLLong # readListPrec :: ReadPrec [CLLong] #
Read CULLong |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CULLong # readList :: ReadS [CULLong] # readPrec :: ReadPrec CULLong # readListPrec :: ReadPrec [CULLong] #
Read CBool |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CBool # readList :: ReadS [CBool] # readPrec :: ReadPrec CBool # readListPrec :: ReadPrec [CBool] #
Read CFloat |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CFloat # readList :: ReadS [CFloat] # readPrec :: ReadPrec CFloat # readListPrec :: ReadPrec [CFloat] #
Read CDouble |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CDouble # readList :: ReadS [CDouble] # readPrec :: ReadPrec CDouble # readListPrec :: ReadPrec [CDouble] #
Read CPtrdiff |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CPtrdiff # readList :: ReadS [CPtrdiff] # readPrec :: ReadPrec CPtrdiff # readListPrec :: ReadPrec [CPtrdiff] #
Read CSize |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSize # readList :: ReadS [CSize] # readPrec :: ReadPrec CSize # readListPrec :: ReadPrec [CSize] #
Read CWchar |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CWchar # readList :: ReadS [CWchar] # readPrec :: ReadPrec CWchar # readListPrec :: ReadPrec [CWchar] #
Read CSigAtomic |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSigAtomic # readList :: ReadS [CSigAtomic] # readPrec :: ReadPrec CSigAtomic # readListPrec :: ReadPrec [CSigAtomic] #
Read CClock |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CClock # readList :: ReadS [CClock] # readPrec :: ReadPrec CClock # readListPrec :: ReadPrec [CClock] #
Read CTime |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CTime # readList :: ReadS [CTime] # readPrec :: ReadPrec CTime # readListPrec :: ReadPrec [CTime] #
Read CUSeconds |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUSeconds # readList :: ReadS [CUSeconds] # readPrec :: ReadPrec CUSeconds # readListPrec :: ReadPrec [CUSeconds] #
Read CSUSeconds |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSUSeconds # readList :: ReadS [CSUSeconds] # readPrec :: ReadPrec CSUSeconds # readListPrec :: ReadPrec [CSUSeconds] #
Read CIntPtr |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CIntPtr # readList :: ReadS [CIntPtr] # readPrec :: ReadPrec CIntPtr # readListPrec :: ReadPrec [CIntPtr] #
Read CUIntPtr |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUIntPtr # readList :: ReadS [CUIntPtr] # readPrec :: ReadPrec CUIntPtr # readListPrec :: ReadPrec [CUIntPtr] #
Read CIntMax |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CIntMax # readList :: ReadS [CIntMax] # readPrec :: ReadPrec CIntMax # readListPrec :: ReadPrec [CIntMax] #
Read CUIntMax |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUIntMax # readList :: ReadS [CUIntMax] # readPrec :: ReadPrec CUIntMax # readListPrec :: ReadPrec [CUIntMax] #
Read WordPtr |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS WordPtr # readList :: ReadS [WordPtr] # readPrec :: ReadPrec WordPtr # readListPrec :: ReadPrec [WordPtr] #
Read IntPtr |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS IntPtr # readList :: ReadS [IntPtr] # readPrec :: ReadPrec IntPtr # readListPrec :: ReadPrec [IntPtr] #
Read Lexeme | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Lexeme # readList :: ReadS [Lexeme] # readPrec :: ReadPrec Lexeme # readListPrec :: ReadPrec [Lexeme] #
Read GeneralCategory |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS GeneralCategory # readList :: ReadS [GeneralCategory] # readPrec :: ReadPrec GeneralCategory # readListPrec :: ReadPrec [GeneralCategory] #
Read a => Read [a] | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS [a] # readList :: ReadS [[a]] # readPrec :: ReadPrec [a] # readListPrec :: ReadPrec [[a]] #
Read a => Read (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Maybe a) # readList :: ReadS [Maybe a] # readPrec :: ReadPrec (Maybe a) # readListPrec :: ReadPrec [Maybe a] #
(Integral a, Read a) => Read (Ratio a) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Ratio a) # readList :: ReadS [Ratio a] # readPrec :: ReadPrec (Ratio a) # readListPrec :: ReadPrec [Ratio a] #
Read p => Read (Par1 p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (Par1 p) # readList :: ReadS [Par1 p] # readPrec :: ReadPrec (Par1 p) # readListPrec :: ReadPrec [Par1 p] #
Read a => Read (Complex a) |
Instance details Defined in Data.Complex Methods readsPrec :: Int -> ReadS (Complex a) # readList :: ReadS [Complex a] # readPrec :: ReadPrec (Complex a) # readListPrec :: ReadPrec [Complex a] #
HasResolution a => Read (Fixed a) | Since: base-4.3.0.0
Instance details Defined in Data.Fixed Methods readsPrec :: Int -> ReadS (Fixed a) # readList :: ReadS [Fixed a] # readPrec :: ReadPrec (Fixed a) # readListPrec :: ReadPrec [Fixed a] #
Read a => Read (Min a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Min a) # readList :: ReadS [Min a] # readPrec :: ReadPrec (Min a) # readListPrec :: ReadPrec [Min a] #
Read a => Read (Max a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Max a) # readList :: ReadS [Max a] # readPrec :: ReadPrec (Max a) # readListPrec :: ReadPrec [Max a] #
Read a => Read (First a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (First a) # readList :: ReadS [First a] # readPrec :: ReadPrec (First a) # readListPrec :: ReadPrec [First a] #
Read a => Read (Last a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Last a) # readList :: ReadS [Last a] # readPrec :: ReadPrec (Last a) # readListPrec :: ReadPrec [Last a] #
Read m => Read (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (WrappedMonoid m) # readList :: ReadS [WrappedMonoid m] # readPrec :: ReadPrec (WrappedMonoid m) # readListPrec :: ReadPrec [WrappedMonoid m] #
Read a => Read (Option a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Option a) # readList :: ReadS [Option a] # readPrec :: ReadPrec (Option a) # readListPrec :: ReadPrec [Option a] #
Read a => Read (ZipList a) |
Instance details Defined in Control.Applicative Methods readsPrec :: Int -> ReadS (ZipList a) # readList :: ReadS [ZipList a] # readPrec :: ReadPrec (ZipList a) # readListPrec :: ReadPrec [ZipList a] #
Read a => Read (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods readsPrec :: Int -> ReadS (Identity a) # readList :: ReadS [Identity a] # readPrec :: ReadPrec (Identity a) # readListPrec :: ReadPrec [Identity a] #
Read a => Read (First a) |
Instance details Defined in Data.Monoid Methods readsPrec :: Int -> ReadS (First a) # readList :: ReadS [First a] # readPrec :: ReadPrec (First a) # readListPrec :: ReadPrec [First a] #
Read a => Read (Last a) |
Instance details Defined in Data.Monoid Methods readsPrec :: Int -> ReadS (Last a) # readList :: ReadS [Last a] # readPrec :: ReadPrec (Last a) # readListPrec :: ReadPrec [Last a] #
Read a => Read (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Dual a) # readList :: ReadS [Dual a] # readPrec :: ReadPrec (Dual a) # readListPrec :: ReadPrec [Dual a] #
Read a => Read (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Sum a) # readList :: ReadS [Sum a] # readPrec :: ReadPrec (Sum a) # readListPrec :: ReadPrec [Sum a] #
Read a => Read (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Product a) # readList :: ReadS [Product a] # readPrec :: ReadPrec (Product a) # readListPrec :: ReadPrec [Product a] #
Read a => Read (Down a) | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods readsPrec :: Int -> ReadS (Down a) # readList :: ReadS [Down a] # readPrec :: ReadPrec (Down a) # readListPrec :: ReadPrec [Down a] #
Read a => Read (NonEmpty a) |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (NonEmpty a) # readList :: ReadS [NonEmpty a] # readPrec :: ReadPrec (NonEmpty a) # readListPrec :: ReadPrec [NonEmpty a] #
(Read a, Read b) => Read (Either a b) |
Instance details Defined in Data.Either Methods readsPrec :: Int -> ReadS (Either a b) # readList :: ReadS [Either a b] # readPrec :: ReadPrec (Either a b) # readListPrec :: ReadPrec [Either a b] #
Read (V1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (V1 p) # readList :: ReadS [V1 p] # readPrec :: ReadPrec (V1 p) # readListPrec :: ReadPrec [V1 p] #
Read (U1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (U1 p) # readList :: ReadS [U1 p] # readPrec :: ReadPrec (U1 p) # readListPrec :: ReadPrec [U1 p] #
(Read a, Read b) => Read (a, b) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b) # readList :: ReadS [(a, b)] # readPrec :: ReadPrec (a, b) # readListPrec :: ReadPrec [(a, b)] #
(Ix a, Read a, Read b) => Read (Array a b) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Array a b) # readList :: ReadS [Array a b] # readPrec :: ReadPrec (Array a b) # readListPrec :: ReadPrec [Array a b] #
(Read a, Read b) => Read (Arg a b) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Arg a b) # readList :: ReadS [Arg a b] # readPrec :: ReadPrec (Arg a b) # readListPrec :: ReadPrec [Arg a b] #
Read (Proxy t) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods readsPrec :: Int -> ReadS (Proxy t) # readList :: ReadS [Proxy t] # readPrec :: ReadPrec (Proxy t) # readListPrec :: ReadPrec [Proxy t] #
Read (f p) => Read (Rec1 f p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (Rec1 f p) # readList :: ReadS [Rec1 f p] # readPrec :: ReadPrec (Rec1 f p) # readListPrec :: ReadPrec [Rec1 f p] #
(Read a, Read b, Read c) => Read (a, b, c) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c) # readList :: ReadS [(a, b, c)] # readPrec :: ReadPrec (a, b, c) # readListPrec :: ReadPrec [(a, b, c)] #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) # readList :: ReadS [Const a b] # readPrec :: ReadPrec (Const a b) # readListPrec :: ReadPrec [Const a b] #
Read (f a) => Read (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Alt f a) # readList :: ReadS [Alt f a] # readPrec :: ReadPrec (Alt f a) # readListPrec :: ReadPrec [Alt f a] #
a ~ b => Read (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~: b) # readList :: ReadS [a :~: b] # readPrec :: ReadPrec (a :~: b) # readListPrec :: ReadPrec [a :~: b] #
Read c => Read (K1 i c p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (K1 i c p) # readList :: ReadS [K1 i c p] # readPrec :: ReadPrec (K1 i c p) # readListPrec :: ReadPrec [K1 i c p] #
(Read (f p), Read (g p)) => Read ((f :+: g) p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :+: g) p) # readList :: ReadS [(f :+: g) p] # readPrec :: ReadPrec ((f :+: g) p) # readListPrec :: ReadPrec [(f :+: g) p] #
(Read (f p), Read (g p)) => Read ((f :*: g) p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :*: g) p) # readList :: ReadS [(f :*: g) p] # readPrec :: ReadPrec ((f :*: g) p) # readListPrec :: ReadPrec [(f :*: g) p] #
(Read a, Read b, Read c, Read d) => Read (a, b, c, d) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d) # readList :: ReadS [(a, b, c, d)] # readPrec :: ReadPrec (a, b, c, d) # readListPrec :: ReadPrec [(a, b, c, d)] #
a ~~ b => Read (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~~: b) # readList :: ReadS [a :~~: b] # readPrec :: ReadPrec (a :~~: b) # readListPrec :: ReadPrec [a :~~: b] #
Read (f p) => Read (M1 i c f p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (M1 i c f p) # readList :: ReadS [M1 i c f p] # readPrec :: ReadPrec (M1 i c f p) # readListPrec :: ReadPrec [M1 i c f p] #
Read (f (g p)) => Read ((f :.: g) p) |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :.: g) p) # readList :: ReadS [(f :.: g) p] # readPrec :: ReadPrec ((f :.: g) p) # readListPrec :: ReadPrec [(f :.: g) p] #
(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e) # readList :: ReadS [(a, b, c, d, e)] # readPrec :: ReadPrec (a, b, c, d, e) # readListPrec :: ReadPrec [(a, b, c, d, e)] #
(Read1 f, Read1 g, Read a) => Read (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods readsPrec :: Int -> ReadS (Compose f g a) # readList :: ReadS [Compose f g a] # readPrec :: ReadPrec (Compose f g a) # readListPrec :: ReadPrec [Compose f g a] #
(Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f) # readList :: ReadS [(a, b, c, d, e, f)] # readPrec :: ReadPrec (a, b, c, d, e, f) # readListPrec :: ReadPrec [(a, b, c, d, e, f)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g) # readList :: ReadS [(a, b, c, d, e, f, g)] # readPrec :: ReadPrec (a, b, c, d, e, f, g) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h) # readList :: ReadS [(a, b, c, d, e, f, g, h)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i) # readList :: ReadS [(a, b, c, d, e, f, g, h, i)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] #

class (Num a, Ord a) => Real a where #

Minimal complete definition

toRational

Methods

toRational :: a -> Rational #

the rational equivalent of its real argument with full precision

Instances

Real Int | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Int -> Rational #
Real Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int8 -> Rational #
Real Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int16 -> Rational #
Real Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int32 -> Rational #
Real Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int64 -> Rational #
Real Integer | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Integer -> Rational #
Real Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods toRational :: Natural -> Rational #
Real Word | Since: base-2.1
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational #
Real Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word8 -> Rational #
Real Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word16 -> Rational #
Real Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word32 -> Rational #
Real Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word64 -> Rational #
Real CDev |
Instance details Defined in System.Posix.Types Methods toRational :: CDev -> Rational #
Real CIno |
Instance details Defined in System.Posix.Types Methods toRational :: CIno -> Rational #
Real CMode |
Instance details Defined in System.Posix.Types Methods toRational :: CMode -> Rational #
Real COff |
Instance details Defined in System.Posix.Types Methods toRational :: COff -> Rational #
Real CPid |
Instance details Defined in System.Posix.Types Methods toRational :: CPid -> Rational #
Real CSsize |
Instance details Defined in System.Posix.Types Methods toRational :: CSsize -> Rational #
Real CGid |
Instance details Defined in System.Posix.Types Methods toRational :: CGid -> Rational #
Real CNlink |
Instance details Defined in System.Posix.Types Methods toRational :: CNlink -> Rational #
Real CUid |
Instance details Defined in System.Posix.Types Methods toRational :: CUid -> Rational #
Real CCc |
Instance details Defined in System.Posix.Types Methods toRational :: CCc -> Rational #
Real CSpeed |
Instance details Defined in System.Posix.Types Methods toRational :: CSpeed -> Rational #
Real CTcflag |
Instance details Defined in System.Posix.Types Methods toRational :: CTcflag -> Rational #
Real CRLim |
Instance details Defined in System.Posix.Types Methods toRational :: CRLim -> Rational #
Real CBlkSize |
Instance details Defined in System.Posix.Types Methods toRational :: CBlkSize -> Rational #
Real CBlkCnt |
Instance details Defined in System.Posix.Types Methods toRational :: CBlkCnt -> Rational #
Real CClockId |
Instance details Defined in System.Posix.Types Methods toRational :: CClockId -> Rational #
Real CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods toRational :: CFsBlkCnt -> Rational #
Real CFsFilCnt |
Instance details Defined in System.Posix.Types Methods toRational :: CFsFilCnt -> Rational #
Real CId |
Instance details Defined in System.Posix.Types Methods toRational :: CId -> Rational #
Real CKey |
Instance details Defined in System.Posix.Types Methods toRational :: CKey -> Rational #
Real Fd |
Instance details Defined in System.Posix.Types Methods toRational :: Fd -> Rational #
Real CChar |
Instance details Defined in Foreign.C.Types Methods toRational :: CChar -> Rational #
Real CSChar |
Instance details Defined in Foreign.C.Types Methods toRational :: CSChar -> Rational #
Real CUChar |
Instance details Defined in Foreign.C.Types Methods toRational :: CUChar -> Rational #
Real CShort |
Instance details Defined in Foreign.C.Types Methods toRational :: CShort -> Rational #
Real CUShort |
Instance details Defined in Foreign.C.Types Methods toRational :: CUShort -> Rational #
Real CInt |
Instance details Defined in Foreign.C.Types Methods toRational :: CInt -> Rational #
Real CUInt |
Instance details Defined in Foreign.C.Types Methods toRational :: CUInt -> Rational #
Real CLong |
Instance details Defined in Foreign.C.Types Methods toRational :: CLong -> Rational #
Real CULong |
Instance details Defined in Foreign.C.Types Methods toRational :: CULong -> Rational #
Real CLLong |
Instance details Defined in Foreign.C.Types Methods toRational :: CLLong -> Rational #
Real CULLong |
Instance details Defined in Foreign.C.Types Methods toRational :: CULLong -> Rational #
Real CBool |
Instance details Defined in Foreign.C.Types Methods toRational :: CBool -> Rational #
Real CFloat |
Instance details Defined in Foreign.C.Types Methods toRational :: CFloat -> Rational #
Real CDouble |
Instance details Defined in Foreign.C.Types Methods toRational :: CDouble -> Rational #
Real CPtrdiff |
Instance details Defined in Foreign.C.Types Methods toRational :: CPtrdiff -> Rational #
Real CSize |
Instance details Defined in Foreign.C.Types Methods toRational :: CSize -> Rational #
Real CWchar |
Instance details Defined in Foreign.C.Types Methods toRational :: CWchar -> Rational #
Real CSigAtomic |
Instance details Defined in Foreign.C.Types Methods toRational :: CSigAtomic -> Rational #
Real CClock |
Instance details Defined in Foreign.C.Types Methods toRational :: CClock -> Rational #
Real CTime |
Instance details Defined in Foreign.C.Types Methods toRational :: CTime -> Rational #
Real CUSeconds |
Instance details Defined in Foreign.C.Types Methods toRational :: CUSeconds -> Rational #
Real CSUSeconds |
Instance details Defined in Foreign.C.Types Methods toRational :: CSUSeconds -> Rational #
Real CIntPtr |
Instance details Defined in Foreign.C.Types Methods toRational :: CIntPtr -> Rational #
Real CUIntPtr |
Instance details Defined in Foreign.C.Types Methods toRational :: CUIntPtr -> Rational #
Real CIntMax |
Instance details Defined in Foreign.C.Types Methods toRational :: CIntMax -> Rational #
Real CUIntMax |
Instance details Defined in Foreign.C.Types Methods toRational :: CUIntMax -> Rational #
Real WordPtr |
Instance details Defined in Foreign.Ptr Methods toRational :: WordPtr -> Rational #
Real IntPtr |
Instance details Defined in Foreign.Ptr Methods toRational :: IntPtr -> Rational #
Integral a => Real (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Ratio a -> Rational #
HasResolution a => Real (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods toRational :: Fixed a -> Rational #
Real a => Real (Identity a) |
Instance details Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational #
Real a => Real (Const a b) |
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational #

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 ``decodeFloat` x` yields `(m,n)`, then `x` is equal in value to `m*b^^n`, where `b` is the floating-point radix, and furthermore, either `m` and `n` are both zero or else `b^(d-1) <= `abs` m < b^d`, where `d` is the value of ``floatDigits` x`. In particular, ``decodeFloat` 0 = (0,0)`. If the type contains a negative zero, also ``decodeFloat` (-0.0) = (0,0)`. The result of ``decodeFloat` x` is unspecified if either of ``isNaN` x` or ``isInfinite` x` is `True`.

encodeFloat :: Integer -> Int -> a #

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

exponent :: a -> Int #

`exponent` corresponds to the second component of `decodeFloat`. ``exponent` 0 = 0` and for finite nonzero `x`, ``exponent` x = snd (`decodeFloat` x) + `floatDigits` x`. If `x` is a finite floating-point number, it is equal in value to ``significand` x * b ^^ `exponent` x`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

significand :: a -> a #

The first component of `decodeFloat`, scaled to lie in the open interval (`-1`,`1`), either `0.0` or of absolute value `>= 1/b`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

scaleFloat :: Int -> a -> a #

multiplies a floating-point number by an integer power of the radix

isNaN :: a -> Bool #

`True` if the argument is an IEEE "not-a-number" (NaN) value

isInfinite :: a -> Bool #

`True` if the argument is an IEEE infinity or negative infinity

isDenormalized :: a -> Bool #

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

isNegativeZero :: a -> Bool #

`True` if the argument is an IEEE negative zero

isIEEE :: a -> Bool #

`True` if the argument is an IEEE floating point number

atan2 :: a -> a -> a #

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

Instances

RealFloat Double | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # exponent :: Double -> Int # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isNaN :: Double -> Bool # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # isIEEE :: Double -> Bool # atan2 :: Double -> Double -> Double #
RealFloat Float | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # exponent :: Float -> Int # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isNaN :: Float -> Bool # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # isIEEE :: Float -> Bool # atan2 :: Float -> Float -> Float #
RealFloat CFloat |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CFloat -> Integer # floatDigits :: CFloat -> Int # floatRange :: CFloat -> (Int, Int) # decodeFloat :: CFloat -> (Integer, Int) # encodeFloat :: Integer -> Int -> CFloat # exponent :: CFloat -> Int # significand :: CFloat -> CFloat # scaleFloat :: Int -> CFloat -> CFloat # isNaN :: CFloat -> Bool # isInfinite :: CFloat -> Bool # isDenormalized :: CFloat -> Bool # isNegativeZero :: CFloat -> Bool # isIEEE :: CFloat -> Bool # atan2 :: CFloat -> CFloat -> CFloat #
RealFloat CDouble |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CDouble -> Integer # floatDigits :: CDouble -> Int # floatRange :: CDouble -> (Int, Int) # decodeFloat :: CDouble -> (Integer, Int) # encodeFloat :: Integer -> Int -> CDouble # exponent :: CDouble -> Int # significand :: CDouble -> CDouble # scaleFloat :: Int -> CDouble -> CDouble # isNaN :: CDouble -> Bool # isInfinite :: CDouble -> Bool # isDenormalized :: CDouble -> Bool # isNegativeZero :: CDouble -> Bool # isIEEE :: CDouble -> Bool # atan2 :: CDouble -> CDouble -> CDouble #
RealFloat a => RealFloat (Identity a) |
Instance details Defined in 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 # isNaN :: Identity a -> Bool # isInfinite :: Identity a -> Bool # isDenormalized :: Identity a -> Bool # isNegativeZero :: Identity a -> Bool # isIEEE :: Identity a -> Bool # atan2 :: Identity a -> Identity a -> Identity a #
RealFloat a => RealFloat (Const a b) |
Instance details Defined in 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 # isNaN :: Const a b -> Bool # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # isIEEE :: Const a b -> Bool # atan2 :: Const a b -> Const a b -> Const a b #

class (Real a, Fractional a) => RealFrac a where #

Extracting components of fractions.

Minimal complete definition

properFraction

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 as `x`; and
- `f` is a fraction with the same type and sign as `x`, and with absolute value less than `1`.

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

truncate :: Integral b => a -> b #

``truncate` x` returns the integer nearest `x` between zero and `x`

round :: Integral b => a -> b #

``round` x` returns the nearest integer to `x`; the even integer if `x` is equidistant between two integers

ceiling :: Integral b => a -> b #

``ceiling` x` returns the least integer not less than `x`

floor :: Integral b => a -> b #

``floor` x` returns the greatest integer not greater than `x`

Instances

RealFrac CFloat |
Instance details Defined in Foreign.C.Types Methods properFraction :: Integral b => CFloat -> (b, CFloat) # truncate :: Integral b => CFloat -> b # round :: Integral b => CFloat -> b # ceiling :: Integral b => CFloat -> b # floor :: Integral b => CFloat -> b #
RealFrac CDouble |
Instance details Defined in Foreign.C.Types Methods properFraction :: Integral b => CDouble -> (b, CDouble) # truncate :: Integral b => CDouble -> b # round :: Integral b => CDouble -> b # ceiling :: Integral b => CDouble -> b # floor :: Integral b => CDouble -> b #
Integral a => RealFrac (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods properFraction :: Integral b => Ratio a -> (b, Ratio a) # truncate :: Integral b => Ratio a -> b # round :: Integral b => Ratio a -> b # ceiling :: Integral b => Ratio a -> b # floor :: Integral b => Ratio a -> b #
HasResolution a => RealFrac (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods properFraction :: Integral b => Fixed a -> (b, Fixed a) # truncate :: Integral b => Fixed a -> b # round :: Integral b => Fixed a -> b # ceiling :: Integral b => Fixed a -> b # floor :: Integral b => Fixed a -> b #
RealFrac a => RealFrac (Identity a) |
Instance details Defined in Data.Functor.Identity Methods properFraction :: Integral b => Identity a -> (b, Identity a) # truncate :: Integral b => Identity a -> b # round :: Integral b => Identity a -> b # ceiling :: Integral b => Identity a -> b # floor :: Integral b => Identity a -> b #
RealFrac a => RealFrac (Const a b) |
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) # truncate :: Integral b0 => Const a b -> b0 # round :: Integral b0 => Const a b -> b0 # ceiling :: Integral b0 => Const a b -> b0 # floor :: Integral b0 => Const a b -> b0 #

class Show a where #

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 than `d` (associativity is ignored). Thus, if `d` is `0` then the result is never surrounded in parentheses; if `d` is `11` it is always surrounded in parentheses, unless it is an atomic expression.
- If the constructor is defined using record syntax, then `show` will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

    infixr 5 :^:
    data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of `Show` is equivalent to

    instance (Show a) => Show (Tree a) where

           showsPrec d (Leaf m) = showParen (d > app_prec) $
                showString "Leaf " . showsPrec (app_prec+1) m
             where app_prec = 10

           showsPrec d (u :^: v) = showParen (d > up_prec) $
                showsPrec (up_prec+1) u .
                showString " :^: "      .
                showsPrec (up_prec+1) v
             where up_prec = 5

Note that right-associativity of `:^:` is ignored. For example,

- ``show` (Leaf 1 :^: Leaf 2 :^: Leaf 3)` produces the string `"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"`.

Minimal complete definition

showsPrec | show

Methods

showsPrec #

Arguments

:: Int | the operator precedence of the enclosing context (a number from `0` to `11`). Function application has precedence `10`.
-> a | the value to be converted to a `String`
-> ShowS |

Convert a value to a readable `String`.

`showsPrec` should satisfy the law

    showsPrec d x r ++ s  ==  showsPrec d x (r ++ s)

Derived instances of `Read` and `Show` satisfy the following:

- `(x,"")` is an element of `(`readsPrec` d (`showsPrec` d x ""))`.

That is, `readsPrec` parses the string produced by `showsPrec`, and delivers the value that `showsPrec` started with.

show :: a -> String #

A specialised variant of `showsPrec`, using precedence context zero, and returning an ordinary `String`.

showList :: [a] -> ShowS #

The method `showList` is provided to allow the programmer to give a specialised way of showing lists of values. For example, this is used by the predefined `Show` instance of the `Char` type, where values of type `String` should be shown in double quotes, rather than between square brackets.

Instances

Show Bool |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Bool -> ShowS # show :: Bool -> String # showList :: [Bool] -> ShowS #
Show Char | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS # show :: Char -> String # showList :: [Char] -> ShowS #
Show Int | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Int -> ShowS # show :: Int -> String # showList :: [Int] -> ShowS #
Show Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int8 -> ShowS # show :: Int8 -> String # showList :: [Int8] -> ShowS #
Show Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int16 -> ShowS # show :: Int16 -> String # showList :: [Int16] -> ShowS #
Show Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int32 -> ShowS # show :: Int32 -> String # showList :: [Int32] -> ShowS #
Show Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int64 -> ShowS # show :: Int64 -> String # showList :: [Int64] -> ShowS #
Show Integer | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Integer -> ShowS # show :: Integer -> String # showList :: [Integer] -> ShowS #
Show Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods showsPrec :: Int -> Natural -> ShowS # show :: Natural -> String # showList :: [Natural] -> ShowS #
Show Ordering |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Ordering -> ShowS # show :: Ordering -> String # showList :: [Ordering] -> ShowS #
Show Word | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
Show Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word8 -> ShowS # show :: Word8 -> String # showList :: [Word8] -> ShowS #
Show Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word16 -> ShowS # show :: Word16 -> String # showList :: [Word16] -> ShowS #
Show Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word32 -> ShowS # show :: Word32 -> String # showList :: [Word32] -> ShowS #
Show Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word64 -> ShowS # show :: Word64 -> String # showList :: [Word64] -> ShowS #
Show RuntimeRep |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> RuntimeRep -> ShowS # show :: RuntimeRep -> String # showList :: [RuntimeRep] -> ShowS #
Show VecCount |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> VecCount -> ShowS # show :: VecCount -> String # showList :: [VecCount] -> ShowS #
Show VecElem |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> VecElem -> ShowS # show :: VecElem -> String # showList :: [VecElem] -> ShowS #
Show CallStack | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> CallStack -> ShowS # show :: CallStack -> String # showList :: [CallStack] -> ShowS #
Show SomeTypeRep | Since: base-4.10.0.0
Instance details Defined in Data.Typeable.Internal Methods showsPrec :: Int -> SomeTypeRep -> ShowS # show :: SomeTypeRep -> String # showList :: [SomeTypeRep] -> ShowS #
Show () |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> () -> ShowS # show :: () -> String # showList :: [()] -> ShowS #
Show TyCon | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TyCon -> ShowS # show :: TyCon -> String # showList :: [TyCon] -> ShowS #
Show Module | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Module -> ShowS # show :: Module -> String # showList :: [Module] -> ShowS #
Show TrName | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TrName -> ShowS # show :: TrName -> String # showList :: [TrName] -> ShowS #
Show KindRep |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> KindRep -> ShowS # show :: KindRep -> String # showList :: [KindRep] -> ShowS #
Show TypeLitSort |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TypeLitSort -> ShowS # show :: TypeLitSort -> String # showList :: [TypeLitSort] -> ShowS #
Show HandleType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> HandleType -> ShowS # show :: HandleType -> String # showList :: [HandleType] -> ShowS #
Show Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods showsPrec :: Int -> Void -> ShowS # show :: Void -> String # showList :: [Void] -> ShowS #
Show DataType |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataType -> ShowS # show :: DataType -> String # showList :: [DataType] -> ShowS #
Show Constr | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods showsPrec :: Int -> Constr -> ShowS # show :: Constr -> String # showList :: [Constr] -> ShowS #
Show DataRep |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataRep -> ShowS # show :: DataRep -> String # showList :: [DataRep] -> ShowS #
Show ConstrRep |
Instance details Defined in Data.Data Methods showsPrec :: Int -> ConstrRep -> ShowS # show :: ConstrRep -> String # showList :: [ConstrRep] -> ShowS #
Show Fixity |
Instance details Defined in Data.Data Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #
Show Version |
Instance details Defined in Data.Version Methods showsPrec :: Int -> Version -> ShowS # show :: Version -> String # showList :: [Version] -> ShowS #
Show HandlePosn | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods showsPrec :: Int -> HandlePosn -> ShowS # show :: HandlePosn -> String # showList :: [HandlePosn] -> ShowS #
Show PatternMatchFail | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> PatternMatchFail -> ShowS # show :: PatternMatchFail -> String # showList :: [PatternMatchFail] -> ShowS #
Show RecSelError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecSelError -> ShowS # show :: RecSelError -> String # showList :: [RecSelError] -> ShowS #
Show RecConError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecConError -> ShowS # show :: RecConError -> String # showList :: [RecConError] -> ShowS #
Show RecUpdError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecUpdError -> ShowS # show :: RecUpdError -> String # showList :: [RecUpdError] -> ShowS #
Show NoMethodError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NoMethodError -> ShowS # show :: NoMethodError -> String # showList :: [NoMethodError] -> ShowS #
Show TypeError | Since: base-4.9.0.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> TypeError -> ShowS # show :: TypeError -> String # showList :: [TypeError] -> ShowS #
Show NonTermination | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NonTermination -> ShowS # show :: NonTermination -> String # showList :: [NonTermination] -> ShowS #
Show NestedAtomically | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NestedAtomically -> ShowS # show :: NestedAtomically -> String # showList :: [NestedAtomically] -> ShowS #
Show ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadId -> ShowS # show :: ThreadId -> String # showList :: [ThreadId] -> ShowS #
Show BlockReason |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> BlockReason -> ShowS # show :: BlockReason -> String # showList :: [BlockReason] -> ShowS #
Show ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadStatus -> ShowS # show :: ThreadStatus -> String # showList :: [ThreadStatus] -> ShowS #
Show Dynamic | Since: base-2.1
Instance details Defined in Data.Dynamic Methods showsPrec :: Int -> Dynamic -> ShowS # show :: Dynamic -> String # showList :: [Dynamic] -> ShowS #
Show CDev |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CDev -> ShowS # show :: CDev -> String # showList :: [CDev] -> ShowS #
Show CIno |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CIno -> ShowS # show :: CIno -> String # showList :: [CIno] -> ShowS #
Show CMode |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CMode -> ShowS # show :: CMode -> String # showList :: [CMode] -> ShowS #
Show COff |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> COff -> ShowS # show :: COff -> String # showList :: [COff] -> ShowS #
Show CPid |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CPid -> ShowS # show :: CPid -> String # showList :: [CPid] -> ShowS #
Show CSsize |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CSsize -> ShowS # show :: CSsize -> String # showList :: [CSsize] -> ShowS #
Show CGid |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CGid -> ShowS # show :: CGid -> String # showList :: [CGid] -> ShowS #
Show CNlink |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CNlink -> ShowS # show :: CNlink -> String # showList :: [CNlink] -> ShowS #
Show CUid |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CUid -> ShowS # show :: CUid -> String # showList :: [CUid] -> ShowS #
Show CCc |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CCc -> ShowS # show :: CCc -> String # showList :: [CCc] -> ShowS #
Show CSpeed |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CSpeed -> ShowS # show :: CSpeed -> String # showList :: [CSpeed] -> ShowS #
Show CTcflag |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CTcflag -> ShowS # show :: CTcflag -> String # showList :: [CTcflag] -> ShowS #
Show CRLim |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CRLim -> ShowS # show :: CRLim -> String # showList :: [CRLim] -> ShowS #
Show CBlkSize |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CBlkSize -> ShowS # show :: CBlkSize -> String # showList :: [CBlkSize] -> ShowS #
Show CBlkCnt |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CBlkCnt -> ShowS # show :: CBlkCnt -> String # showList :: [CBlkCnt] -> ShowS #
Show CClockId |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CClockId -> ShowS # show :: CClockId -> String # showList :: [CClockId] -> ShowS #
Show CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CFsBlkCnt -> ShowS # show :: CFsBlkCnt -> String # showList :: [CFsBlkCnt] -> ShowS #
Show CFsFilCnt |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CFsFilCnt -> ShowS # show :: CFsFilCnt -> String # showList :: [CFsFilCnt] -> ShowS #
Show CId |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CId -> ShowS # show :: CId -> String # showList :: [CId] -> ShowS #
Show CKey |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CKey -> ShowS # show :: CKey -> String # showList :: [CKey] -> ShowS #
Show CTimer |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CTimer -> ShowS # show :: CTimer -> String # showList :: [CTimer] -> ShowS #
Show Fd |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> Fd -> ShowS # show :: Fd -> String # showList :: [Fd] -> ShowS #
Show BlockedIndefinitelyOnMVar | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS # show :: BlockedIndefinitelyOnMVar -> String # showList :: [BlockedIndefinitelyOnMVar] -> ShowS #
Show BlockedIndefinitelyOnSTM | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS # show :: BlockedIndefinitelyOnSTM -> String # showList :: [BlockedIndefinitelyOnSTM] -> ShowS #
Show Deadlock | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> Deadlock -> ShowS # show :: Deadlock -> String # showList :: [Deadlock] -> ShowS #
Show AllocationLimitExceeded | Since: base-4.7.1.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AllocationLimitExceeded -> ShowS # show :: AllocationLimitExceeded -> String # showList :: [AllocationLimitExceeded] -> ShowS #
Show CompactionFailed | Since: base-4.10.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> CompactionFailed -> ShowS # show :: CompactionFailed -> String # showList :: [CompactionFailed] -> ShowS #
Show AssertionFailed | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AssertionFailed -> ShowS # show :: AssertionFailed -> String # showList :: [AssertionFailed] -> ShowS #
Show SomeAsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> SomeAsyncException -> ShowS # show :: SomeAsyncException -> String # showList :: [SomeAsyncException] -> ShowS #
Show AsyncException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AsyncException -> ShowS # show :: AsyncException -> String # showList :: [AsyncException] -> ShowS #
Show ArrayException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ArrayException -> ShowS # show :: ArrayException -> String # showList :: [ArrayException] -> ShowS #
Show FixIOException | Since: base-4.11.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> FixIOException -> ShowS # show :: FixIOException -> String # showList :: [FixIOException] -> ShowS #
Show ExitCode |
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ExitCode -> ShowS # show :: ExitCode -> String # showList :: [ExitCode] -> ShowS #
Show IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS # show :: IOErrorType -> String # showList :: [IOErrorType] -> ShowS #
Show Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Handle -> ShowS # show :: Handle -> String # showList :: [Handle] -> ShowS #
Show BufferMode |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> BufferMode -> ShowS # show :: BufferMode -> String # showList :: [BufferMode] -> ShowS #
Show Newline |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Newline -> ShowS # show :: Newline -> String # showList :: [Newline] -> ShowS #
Show NewlineMode |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> NewlineMode -> ShowS # show :: NewlineMode -> String # showList :: [NewlineMode] -> ShowS #
Show MaskingState |
Instance details Defined in GHC.IO Methods showsPrec :: Int -> MaskingState -> ShowS # show :: MaskingState -> String # showList :: [MaskingState] -> ShowS #
Show IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS #
Show ErrorCall | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ErrorCall -> ShowS # show :: ErrorCall -> String # showList :: [ErrorCall] -> ShowS #
Show ArithException | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ArithException -> ShowS # show :: ArithException -> String # showList :: [ArithException] -> ShowS #
Show All |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> All -> ShowS # show :: All -> String # showList :: [All] -> ShowS #
Show Any |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Any -> ShowS # show :: Any -> String # showList :: [Any] -> ShowS #
Show Fixity |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #
Show Associativity |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Associativity -> ShowS # show :: Associativity -> String # showList :: [Associativity] -> ShowS #
Show SourceUnpackedness |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS #
Show SourceStrictness |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS #
Show DecidedStrictness |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS #
Show CChar |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CChar -> ShowS # show :: CChar -> String # showList :: [CChar] -> ShowS #
Show CSChar |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSChar -> ShowS # show :: CSChar -> String # showList :: [CSChar] -> ShowS #
Show CUChar |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUChar -> ShowS # show :: CUChar -> String # showList :: [CUChar] -> ShowS #
Show CShort |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CShort -> ShowS # show :: CShort -> String # showList :: [CShort] -> ShowS #
Show CUShort |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUShort -> ShowS # show :: CUShort -> String # showList :: [CUShort] -> ShowS #
Show CInt |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CInt -> ShowS # show :: CInt -> String # showList :: [CInt] -> ShowS #
Show CUInt |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUInt -> ShowS # show :: CUInt -> String # showList :: [CUInt] -> ShowS #
Show CLong |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CLong -> ShowS # show :: CLong -> String # showList :: [CLong] -> ShowS #
Show CULong |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CULong -> ShowS # show :: CULong -> String # showList :: [CULong] -> ShowS #
Show CLLong |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CLLong -> ShowS # show :: CLLong -> String # showList :: [CLLong] -> ShowS #
Show CULLong |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CULLong -> ShowS # show :: CULLong -> String # showList :: [CULLong] -> ShowS #
Show CBool |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CBool -> ShowS # show :: CBool -> String # showList :: [CBool] -> ShowS #
Show CFloat |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CFloat -> ShowS # show :: CFloat -> String # showList :: [CFloat] -> ShowS #
Show CDouble |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CDouble -> ShowS # show :: CDouble -> String # showList :: [CDouble] -> ShowS #
Show CPtrdiff |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CPtrdiff -> ShowS # show :: CPtrdiff -> String # showList :: [CPtrdiff] -> ShowS #
Show CSize |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSize -> ShowS # show :: CSize -> String # showList :: [CSize] -> ShowS #
Show CWchar |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CWchar -> ShowS # show :: CWchar -> String # showList :: [CWchar] -> ShowS #
Show CSigAtomic |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSigAtomic -> ShowS # show :: CSigAtomic -> String # showList :: [CSigAtomic] -> ShowS #
Show CClock |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CClock -> ShowS # show :: CClock -> String # showList :: [CClock] -> ShowS #
Show CTime |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CTime -> ShowS # show :: CTime -> String # showList :: [CTime] -> ShowS #
Show CUSeconds |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUSeconds -> ShowS # show :: CUSeconds -> String # showList :: [CUSeconds] -> ShowS #
Show CSUSeconds |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSUSeconds -> ShowS # show :: CSUSeconds -> String # showList :: [CSUSeconds] -> ShowS #
Show CIntPtr |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CIntPtr -> ShowS # show :: CIntPtr -> String # showList :: [CIntPtr] -> ShowS #
Show CUIntPtr |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUIntPtr -> ShowS # show :: CUIntPtr -> String # showList :: [CUIntPtr] -> ShowS #
Show CIntMax |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CIntMax -> ShowS # show :: CIntMax -> String # showList :: [CIntMax] -> ShowS #
Show CUIntMax |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUIntMax -> ShowS # show :: CUIntMax -> String # showList :: [CUIntMax] -> ShowS #
Show WordPtr |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> WordPtr -> ShowS # show :: WordPtr -> String # showList :: [WordPtr] -> ShowS #
Show IntPtr |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> IntPtr -> ShowS # show :: IntPtr -> String # showList :: [IntPtr] -> ShowS #
Show Fingerprint | Since: base-4.7.0.0
Instance details Defined in GHC.Fingerprint.Type Methods showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS #
Show GeneralCategory |
Instance details Defined in GHC.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS # show :: GeneralCategory -> String # showList :: [GeneralCategory] -> ShowS #
Show SomeException | Since: base-3.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS #
Show SrcLoc |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> SrcLoc -> ShowS # show :: SrcLoc -> String # showList :: [SrcLoc] -> ShowS #
Show Timeout | Since: base-3.0
Instance details Defined in System.Timeout Methods showsPrec :: Int -> Timeout -> ShowS # show :: Timeout -> String # showList :: [Timeout] -> ShowS #
Show a => Show [a] | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> [a] -> ShowS # show :: [a] -> String # showList :: [[a]] -> ShowS #
Show a => Show (Maybe a) |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Maybe a -> ShowS # show :: Maybe a -> String # showList :: [Maybe a] -> ShowS #
Show a => Show (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods showsPrec :: Int -> Ratio a -> ShowS # show :: Ratio a -> String # showList :: [Ratio a] -> ShowS #
Show (Ptr a) | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> Ptr a -> ShowS # show :: Ptr a -> String # showList :: [Ptr a] -> ShowS #
Show (FunPtr a) | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> FunPtr a -> ShowS # show :: FunPtr a -> String # showList :: [FunPtr a] -> ShowS #
Show p => Show (Par1 p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Par1 p -> ShowS # show :: Par1 p -> String # showList :: [Par1 p] -> ShowS #
Show a => Show (Complex a) |
Instance details Defined in Data.Complex Methods showsPrec :: Int -> Complex a -> ShowS # show :: Complex a -> String # showList :: [Complex a] -> ShowS #
HasResolution a => Show (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods showsPrec :: Int -> Fixed a -> ShowS # show :: Fixed a -> String # showList :: [Fixed a] -> ShowS #
Show a => Show (Min a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Min a -> ShowS # show :: Min a -> String # showList :: [Min a] -> ShowS #
Show a => Show (Max a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Max a -> ShowS # show :: Max a -> String # showList :: [Max a] -> ShowS #
Show a => Show (First a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> First a -> ShowS # show :: First a -> String # showList :: [First a] -> ShowS #
Show a => Show (Last a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Last a -> ShowS # show :: Last a -> String # showList :: [Last a] -> ShowS #
Show m => Show (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> WrappedMonoid m -> ShowS # show :: WrappedMonoid m -> String # showList :: [WrappedMonoid m] -> ShowS #
Show a => Show (Option a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Option a -> ShowS # show :: Option a -> String # showList :: [Option a] -> ShowS #
Show a => Show (ZipList a) |
Instance details Defined in Control.Applicative Methods showsPrec :: Int -> ZipList a -> ShowS # show :: ZipList a -> String # showList :: [ZipList a] -> ShowS #
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods showsPrec :: Int -> Identity a -> ShowS # show :: Identity a -> String # showList :: [Identity a] -> ShowS #
Show (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods showsPrec :: Int -> ForeignPtr a -> ShowS # show :: ForeignPtr a -> String # showList :: [ForeignPtr a] -> ShowS #
Show a => Show (First a) |
Instance details Defined in Data.Monoid Methods showsPrec :: Int -> First a -> ShowS # show :: First a -> String # showList :: [First a] -> ShowS #
Show a => Show (Last a) |
Instance details Defined in Data.Monoid Methods showsPrec :: Int -> Last a -> ShowS # show :: Last a -> String # showList :: [Last a] -> ShowS #
Show a => Show (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Dual a -> ShowS # show :: Dual a -> String # showList :: [Dual a] -> ShowS #
Show a => Show (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Sum a -> ShowS # show :: Sum a -> String # showList :: [Sum a] -> ShowS #
Show a => Show (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Product a -> ShowS # show :: Product a -> String # showList :: [Product a] -> ShowS #
Show a => Show (Down a) | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods showsPrec :: Int -> Down a -> ShowS # show :: Down a -> String # showList :: [Down a] -> ShowS #
Show a => Show (NonEmpty a) |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> NonEmpty a -> ShowS # show :: NonEmpty a -> String # showList :: [NonEmpty a] -> ShowS #
(Show a, Show b) => Show (Either a b) |
Instance details Defined in Data.Either Methods showsPrec :: Int -> Either a b -> ShowS # show :: Either a b -> String # showList :: [Either a b] -> ShowS #
Show (V1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> V1 p -> ShowS # show :: V1 p -> String # showList :: [V1 p] -> ShowS #
Show (U1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> U1 p -> ShowS # show :: U1 p -> String # showList :: [U1 p] -> ShowS #
Show (TypeRep a) |
Instance details Defined in Data.Typeable.Internal Methods showsPrec :: Int -> TypeRep a -> ShowS # show :: TypeRep a -> String # showList :: [TypeRep a] -> ShowS #
(Show a, Show b) => Show (a, b) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b) -> ShowS # show :: (a, b) -> String # showList :: [(a, b)] -> ShowS #
(Ix a, Show a, Show b) => Show (Array a b) | Since: base-2.1
Instance details Defined in GHC.Arr Methods showsPrec :: Int -> Array a b -> ShowS # show :: Array a b -> String # showList :: [Array a b] -> ShowS #
(Show a, Show b) => Show (Arg a b) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Arg a b -> ShowS # show :: Arg a b -> String # showList :: [Arg a b] -> ShowS #
Show (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods showsPrec :: Int -> Proxy s -> ShowS # show :: Proxy s -> String # showList :: [Proxy s] -> ShowS #
Show (ST s a) | Since: base-2.1
Instance details Defined in GHC.ST Methods showsPrec :: Int -> ST s a -> ShowS # show :: ST s a -> String # showList :: [ST s a] -> ShowS #
Show (f p) => Show (Rec1 f p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Rec1 f p -> ShowS # show :: Rec1 f p -> String # showList :: [Rec1 f p] -> ShowS #
Show (URec Char p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS # show :: URec Char p -> String # showList :: [URec Char p] -> ShowS #
Show (URec Double p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Double p -> ShowS # show :: URec Double p -> String # showList :: [URec Double p] -> ShowS #
Show (URec Float p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Float p -> ShowS # show :: URec Float p -> String # showList :: [URec Float p] -> ShowS #
Show (URec Int p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Int p -> ShowS # show :: URec Int p -> String # showList :: [URec Int p] -> ShowS #
Show (URec Word p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
(Show a, Show b, Show c) => Show (a, b, c) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c) -> ShowS # show :: (a, b, c) -> String # showList :: [(a, b, c)] -> ShowS #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS # show :: Const a b -> String # showList :: [Const a b] -> ShowS #
Show (f a) => Show (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Alt f a -> ShowS # show :: Alt f a -> String # showList :: [Alt f a] -> ShowS #
Show (a :~: b) |
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~: b) -> ShowS # show :: (a :~: b) -> String # showList :: [a :~: b] -> ShowS #
Show c => Show (K1 i c p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> K1 i c p -> ShowS # show :: K1 i c p -> String # showList :: [K1 i c p] -> ShowS #
(Show (f p), Show (g p)) => Show ((f :+: g) p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :+: g) p -> ShowS # show :: (f :+: g) p -> String # showList :: [(f :+: g) p] -> ShowS #
(Show (f p), Show (g p)) => Show ((f :*: g) p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :*: g) p -> ShowS # show :: (f :*: g) p -> String # showList :: [(f :*: g) p] -> ShowS #
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d) -> ShowS # show :: (a, b, c, d) -> String # showList :: [(a, b, c, d)] -> ShowS #
Show (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~~: b) -> ShowS # show :: (a :~~: b) -> String # showList :: [a :~~: b] -> ShowS #
Show (f p) => Show (M1 i c f p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> M1 i c f p -> ShowS # show :: M1 i c f p -> String # showList :: [M1 i c f p] -> ShowS #
Show (f (g p)) => Show ((f :.: g) p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :.: g) p -> ShowS # show :: (f :.: g) p -> String # showList :: [(f :.: g) p] -> ShowS #
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e) -> ShowS # show :: (a, b, c, d, e) -> String # showList :: [(a, b, c, d, e)] -> ShowS #
(Show1 f, Show1 g, Show a) => Show (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods showsPrec :: Int -> Compose f g a -> ShowS # show :: Compose f g a -> String # showList :: [Compose f g a] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f) -> ShowS # show :: (a, b, c, d, e, f) -> String # showList :: [(a, b, c, d, e, f)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g) -> ShowS # show :: (a, b, c, d, e, f, g) -> String # showList :: [(a, b, c, d, e, f, g)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h) -> ShowS # show :: (a, b, c, d, e, f, g, h) -> String # showList :: [(a, b, c, d, e, f, g, h)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i) -> ShowS # show :: (a, b, c, d, e, f, g, h, i) -> String # showList :: [(a, b, c, d, e, f, g, h, i)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS #

class Ord a => Ix a where #

The `Ix` class is used to map a contiguous subrange of values in a type onto integers. It is used primarily for array indexing (see the array package).

The first argument `(l,u)` of each of these operations is a pair specifying the lower and upper bounds of a contiguous subrange of values.

An implementation is entitled to assume the following laws about these operations:

- ``inRange` (l,u) i == `elem` i (`range` (l,u))` ``
- ``range` (l,u) `!!` `index` (l,u) i == i`, when ``inRange` (l,u) i`
- ``map` (`index` (l,u)) (`range` (l,u))) == [0..`rangeSize` (l,u)-1]` ``
- ``rangeSize` (l,u) == `length` (`range` (l,u))` ``

Minimal complete definition

range, (index | unsafeIndex), inRange

Methods

range :: (a, a) -> [a] #

The list of values in the subrange defined by a bounding pair.

index :: (a, a) -> a -> Int #

The position of a subscript in the subrange.

inRange :: (a, a) -> a -> Bool #

Returns `True` the given subscript lies in the range defined the bounding pair.

rangeSize :: (a, a) -> Int #

The size of the subrange defined by a bounding pair.

Instances

Ix Bool | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Bool, Bool) -> [Bool] # index :: (Bool, Bool) -> Bool -> Int # unsafeIndex :: (Bool, Bool) -> Bool -> Int inRange :: (Bool, Bool) -> Bool -> Bool # rangeSize :: (Bool, Bool) -> Int # unsafeRangeSize :: (Bool, Bool) -> Int
Ix Char | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Char, Char) -> [Char] # index :: (Char, Char) -> Char -> Int # unsafeIndex :: (Char, Char) -> Char -> Int inRange :: (Char, Char) -> Char -> Bool # rangeSize :: (Char, Char) -> Int # unsafeRangeSize :: (Char, Char) -> Int
Ix Int | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Int, Int) -> [Int] # index :: (Int, Int) -> Int -> Int # unsafeIndex :: (Int, Int) -> Int -> Int inRange :: (Int, Int) -> Int -> Bool # rangeSize :: (Int, Int) -> Int # unsafeRangeSize :: (Int, Int) -> Int
Ix Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int8, Int8) -> [Int8] # index :: (Int8, Int8) -> Int8 -> Int # unsafeIndex :: (Int8, Int8) -> Int8 -> Int inRange :: (Int8, Int8) -> Int8 -> Bool # rangeSize :: (Int8, Int8) -> Int # unsafeRangeSize :: (Int8, Int8) -> Int
Ix Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int16, Int16) -> [Int16] # index :: (Int16, Int16) -> Int16 -> Int # unsafeIndex :: (Int16, Int16) -> Int16 -> Int inRange :: (Int16, Int16) -> Int16 -> Bool # rangeSize :: (Int16, Int16) -> Int # unsafeRangeSize :: (Int16, Int16) -> Int
Ix Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int32, Int32) -> [Int32] # index :: (Int32, Int32) -> Int32 -> Int # unsafeIndex :: (Int32, Int32) -> Int32 -> Int inRange :: (Int32, Int32) -> Int32 -> Bool # rangeSize :: (Int32, Int32) -> Int # unsafeRangeSize :: (Int32, Int32) -> Int
Ix Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int64, Int64) -> [Int64] # index :: (Int64, Int64) -> Int64 -> Int # unsafeIndex :: (Int64, Int64) -> Int64 -> Int inRange :: (Int64, Int64) -> Int64 -> Bool # rangeSize :: (Int64, Int64) -> Int # unsafeRangeSize :: (Int64, Int64) -> Int
Ix Integer | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Integer, Integer) -> [Integer] # index :: (Integer, Integer) -> Integer -> Int # unsafeIndex :: (Integer, Integer) -> Integer -> Int inRange :: (Integer, Integer) -> Integer -> Bool # rangeSize :: (Integer, Integer) -> Int # unsafeRangeSize :: (Integer, Integer) -> Int
Ix Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods range :: (Natural, Natural) -> [Natural] # index :: (Natural, Natural) -> Natural -> Int # unsafeIndex :: (Natural, Natural) -> Natural -> Int inRange :: (Natural, Natural) -> Natural -> Bool # rangeSize :: (Natural, Natural) -> Int # unsafeRangeSize :: (Natural, Natural) -> Int
Ix Ordering | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Ordering, Ordering) -> [Ordering] # index :: (Ordering, Ordering) -> Ordering -> Int # unsafeIndex :: (Ordering, Ordering) -> Ordering -> Int inRange :: (Ordering, Ordering) -> Ordering -> Bool # rangeSize :: (Ordering, Ordering) -> Int # unsafeRangeSize :: (Ordering, Ordering) -> Int
Ix Word | Since: base-4.6.0.0
Instance details Defined in GHC.Arr Methods range :: (Word, Word) -> [Word] # index :: (Word, Word) -> Word -> Int # unsafeIndex :: (Word, Word) -> Word -> Int inRange :: (Word, Word) -> Word -> Bool # rangeSize :: (Word, Word) -> Int # unsafeRangeSize :: (Word, Word) -> Int
Ix Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word8, Word8) -> [Word8] # index :: (Word8, Word8) -> Word8 -> Int # unsafeIndex :: (Word8, Word8) -> Word8 -> Int inRange :: (Word8, Word8) -> Word8 -> Bool # rangeSize :: (Word8, Word8) -> Int # unsafeRangeSize :: (Word8, Word8) -> Int
Ix Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word16, Word16) -> [Word16] # index :: (Word16, Word16) -> Word16 -> Int # unsafeIndex :: (Word16, Word16) -> Word16 -> Int inRange :: (Word16, Word16) -> Word16 -> Bool # rangeSize :: (Word16, Word16) -> Int # unsafeRangeSize :: (Word16, Word16) -> Int
Ix Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word32, Word32) -> [Word32] # index :: (Word32, Word32) -> Word32 -> Int # unsafeIndex :: (Word32, Word32) -> Word32 -> Int inRange :: (Word32, Word32) -> Word32 -> Bool # rangeSize :: (Word32, Word32) -> Int # unsafeRangeSize :: (Word32, Word32) -> Int
Ix Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word64, Word64) -> [Word64] # index :: (Word64, Word64) -> Word64 -> Int # unsafeIndex :: (Word64, Word64) -> Word64 -> Int inRange :: (Word64, Word64) -> Word64 -> Bool # rangeSize :: (Word64, Word64) -> Int # unsafeRangeSize :: (Word64, Word64) -> Int
Ix () | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: ((), ()) -> [()] # index :: ((), ()) -> () -> Int # unsafeIndex :: ((), ()) -> () -> Int inRange :: ((), ()) -> () -> Bool # rangeSize :: ((), ()) -> Int # unsafeRangeSize :: ((), ()) -> Int
Ix Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods range :: (Void, Void) -> [Void] # index :: (Void, Void) -> Void -> Int # unsafeIndex :: (Void, Void) -> Void -> Int inRange :: (Void, Void) -> Void -> Bool # rangeSize :: (Void, Void) -> Int # unsafeRangeSize :: (Void, Void) -> Int
Ix Associativity |
Instance details Defined in GHC.Generics Methods range :: (Associativity, Associativity) -> [Associativity] # index :: (Associativity, Associativity) -> Associativity -> Int # unsafeIndex :: (Associativity, Associativity) -> Associativity -> Int inRange :: (Associativity, Associativity) -> Associativity -> Bool # rangeSize :: (Associativity, Associativity) -> Int # unsafeRangeSize :: (Associativity, Associativity) -> Int
Ix SourceUnpackedness |
Instance details Defined in GHC.Generics Methods range :: (SourceUnpackedness, SourceUnpackedness) -> [SourceUnpackedness] # index :: (SourceUnpackedness, SourceUnpackedness) -> SourceUnpackedness -> Int # unsafeIndex :: (SourceUnpackedness, SourceUnpackedness) -> SourceUnpackedness -> Int inRange :: (SourceUnpackedness, SourceUnpackedness) -> SourceUnpackedness -> Bool # rangeSize :: (SourceUnpackedness, SourceUnpackedness) -> Int # unsafeRangeSize :: (SourceUnpackedness, SourceUnpackedness) -> Int
Ix SourceStrictness |
Instance details Defined in GHC.Generics Methods range :: (SourceStrictness, SourceStrictness) -> [SourceStrictness] # index :: (SourceStrictness, SourceStrictness) -> SourceStrictness -> Int # unsafeIndex :: (SourceStrictness, SourceStrictness) -> SourceStrictness -> Int inRange :: (SourceStrictness, SourceStrictness) -> SourceStrictness -> Bool # rangeSize :: (SourceStrictness, SourceStrictness) -> Int # unsafeRangeSize :: (SourceStrictness, SourceStrictness) -> Int
Ix DecidedStrictness |
Instance details Defined in GHC.Generics Methods range :: (DecidedStrictness, DecidedStrictness) -> [DecidedStrictness] # index :: (DecidedStrictness, DecidedStrictness) -> DecidedStrictness -> Int # unsafeIndex :: (DecidedStrictness, DecidedStrictness) -> DecidedStrictness -> Int inRange :: (DecidedStrictness, DecidedStrictness) -> DecidedStrictness -> Bool # rangeSize :: (DecidedStrictness, DecidedStrictness) -> Int # unsafeRangeSize :: (DecidedStrictness, DecidedStrictness) -> Int
Ix GeneralCategory |
Instance details Defined in GHC.Unicode Methods range :: (GeneralCategory, GeneralCategory) -> [GeneralCategory] # index :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int # unsafeIndex :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int inRange :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Bool # rangeSize :: (GeneralCategory, GeneralCategory) -> Int # unsafeRangeSize :: (GeneralCategory, GeneralCategory) -> Int
Ix a => Ix (Identity a) |
Instance details Defined in Data.Functor.Identity Methods range :: (Identity a, Identity a) -> [Identity a] # index :: (Identity a, Identity a) -> Identity a -> Int # unsafeIndex :: (Identity a, Identity a) -> Identity a -> Int inRange :: (Identity a, Identity a) -> Identity a -> Bool # rangeSize :: (Identity a, Identity a) -> Int # unsafeRangeSize :: (Identity a, Identity a) -> Int
(Ix a, Ix b) => Ix (a, b) | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: ((a, b), (a, b)) -> [(a, b)] # index :: ((a, b), (a, b)) -> (a, b) -> Int # unsafeIndex :: ((a, b), (a, b)) -> (a, b) -> Int inRange :: ((a, b), (a, b)) -> (a, b) -> Bool # rangeSize :: ((a, b), (a, b)) -> Int # unsafeRangeSize :: ((a, b), (a, b)) -> Int
Ix (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods range :: (Proxy s, Proxy s) -> [Proxy s] # index :: (Proxy s, Proxy s) -> Proxy s -> Int # unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool # rangeSize :: (Proxy s, Proxy s) -> Int # unsafeRangeSize :: (Proxy s, Proxy s) -> Int
(Ix a1, Ix a2, Ix a3) => Ix (a1, a2, a3) | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: ((a1, a2, a3), (a1, a2, a3)) -> [(a1, a2, a3)] # index :: ((a1, a2, a3), (a1, a2, a3)) -> (a1, a2, a3) -> Int # unsafeIndex :: ((a1, a2, a3), (a1, a2, a3)) -> (a1, a2, a3) -> Int inRange :: ((a1, a2, a3), (a1, a2, a3)) -> (a1, a2, a3) -> Bool # rangeSize :: ((a1, a2, a3), (a1, a2, a3)) -> Int # unsafeRangeSize :: ((a1, a2, a3), (a1, a2, a3)) -> Int
Ix a => Ix (Const a b) |
Instance details Defined in Data.Functor.Const Methods range :: (Const a b, Const a b) -> [Const a b] # index :: (Const a b, Const a b) -> Const a b -> Int # unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int inRange :: (Const a b, Const a b) -> Const a b -> Bool # rangeSize :: (Const a b, Const a b) -> Int # unsafeRangeSize :: (Const a b, Const a b) -> Int
(Ix a1, Ix a2, Ix a3, Ix a4) => Ix (a1, a2, a3, a4) | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> [(a1, a2, a3, a4)] # index :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> (a1, a2, a3, a4) -> Int # unsafeIndex :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> (a1, a2, a3, a4) -> Int inRange :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> (a1, a2, a3, a4) -> Bool # rangeSize :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> Int # unsafeRangeSize :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> Int
(Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1, a2, a3, a4, a5) | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> [(a1, a2, a3, a4, a5)] # index :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> (a1, a2, a3, a4, a5) -> Int # unsafeIndex :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> (a1, a2, a3, a4, a5) -> Int inRange :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> (a1, a2, a3, a4, a5) -> Bool # rangeSize :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> Int # unsafeRangeSize :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5)) -> Int

class Typeable (a :: k) #

The class `Typeable` allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

class Monad m => MonadFix (m :: * -> *) where #

Monads having fixed points with a 'knot-tying' semantics. Instances of `MonadFix` should satisfy the following laws:

purity
  ``mfix` (`return` . h) = `return` (`fix` h)`
left shrinking (or tightening)
  ``mfix` (\x -> a >>= \y -> f x y) = a >>= \y -> `mfix` (\x -> f x y)`
sliding
  ``mfix` (`liftM` h . f) = `liftM` h (`mfix` (f . h))`, for strict `h`.
nesting
  ``mfix` (\x -> `mfix` (\y -> f x y)) = `mfix` (\x -> f x x)`

This class is used in the translation of the recursive `do` notation supported by GHC and Hugs.

Minimal complete definition

mfix

Methods

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

The fixed point of a monadic computation. ``mfix` f` executes the action `f` only once, with the eventual output fed back as the input. Hence `f` should not be strict, for then ``mfix` f` would diverge.

Instances

MonadFix [] | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> [a]) -> [a] #
MonadFix Maybe | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Maybe a) -> Maybe a #
MonadFix IO | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> IO a) -> IO a #
MonadFix Par1 | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Par1 a) -> Par1 a #
MonadFix Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Min a) -> Min a #
MonadFix Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Max a) -> Max a #
MonadFix First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> First a) -> First a #
MonadFix Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Last a) -> Last a #
MonadFix Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Option a) -> Option a #
MonadFix Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods mfix :: (a -> Identity a) -> Identity a #
MonadFix First | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> First a) -> First a #
MonadFix Last | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Last a) -> Last a #
MonadFix Dual | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Dual a) -> Dual a #
MonadFix Sum | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Sum a) -> Sum a #
MonadFix Product | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Product a) -> Product a #
MonadFix NonEmpty | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> NonEmpty a) -> NonEmpty a #
MonadFix (Either e) | Since: base-4.3.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Either e a) -> Either e a #
MonadFix (ST s) | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> ST s a) -> ST s a #
MonadFix f => MonadFix (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Rec1 f a) -> Rec1 f a #
MonadFix f => MonadFix (Alt f) | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Alt f a) -> Alt f a #
MonadFix ((->) r :: * -> *) | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> r -> a) -> r -> a #
(MonadFix f, MonadFix g) => MonadFix (f :*: g) | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> (f :*: g) a) -> (f :*: g) a #
MonadFix f => MonadFix (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> M1 i c f a) -> M1 i c f a #

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

When a value is bound in `do`-notation, the pattern on the left hand side of `<-` might not match. In this case, this class provides a function to recover.

A `Monad` without a `MonadFail` instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (`~pat`).

Instances of `MonadFail` should satisfy the following law: `fail s` should be a left zero for `>>=`,

    fail s >>= f  =  fail s

If your `Monad` is also `MonadPlus`, a popular definition is

    fail _ = mzero

Since: base-4.9.0.0

Minimal complete definition

fail

Instances

MonadFail [] | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> [a] #
MonadFail Maybe | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a #
MonadFail IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a #
MonadFail ReadPrec | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fail :: String -> ReadPrec a #
MonadFail ReadP | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> ReadP a #
MonadFail P | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> P a #
MonadFail (ST s) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods fail :: String -> ST s a #

class IsString a where #

Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).

Minimal complete definition

fromString

Methods

fromString :: String -> a #

Instances

a ~ Char => IsString [a] | `(a ~ Char)` context was introduced in `4.9.0.0` Since: base-2.1
Instance details Defined in Data.String Methods fromString :: String -> [a] #
IsString a => IsString (Identity a) |
Instance details Defined in Data.String Methods fromString :: String -> Identity a #
IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Const a b #

class Functor f => Applicative (f :: * -> *) where #

A functor with application, providing operations to

- embed pure expressions (`pure`), and
- sequence computations and combine their results (`<*>` and `liftA2`).

A minimal complete definition must include implementations of `pure` and of either `<*>` or `liftA2`. If it defines both, then they must behave the same as their default definitions:

    (<*>) = liftA2 id

    liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

identity

      pure id <*> v = v

composition

      pure (.) <*> u <*> v <*> w = u <*> (v <*> w)

homomorphism

      pure f <*> pure x = pure (f x)

interchange

      u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

-     u *> v = (id <$ u) <*> v

-     u <* v = liftA2 const u v

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

-     fmap f x = pure f <*> x

It may be useful to note that supposing

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

it follows from the above that

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

If `f` is also a `Monad`, it should satisfy

-     pure = return

-     (<*>) = ap

-     (*>) = (>>)

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

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

Sequential application.

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

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

Lift a binary function to actions.

Some functors support an implementation of `liftA2` that is more efficient than the default one. In particular, if `fmap` is an expensive operation, it is likely better to use `liftA2` than to `fmap` over the structure and then use `<*>`.

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

Sequence actions, discarding the value of the first argument.

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

Sequence actions, discarding the value of the second argument.

Instances

Applicative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> [a] # (<*>) :: [a -> b] -> [a] -> [b] # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] # (*>) :: [a] -> [b] -> [b] # (<*) :: [a] -> [b] -> [a] #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # (*>) :: Maybe a -> Maybe b -> Maybe b # (<*) :: Maybe a -> Maybe b -> Maybe a #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a # (<*>) :: IO (a -> b) -> IO a -> IO b # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c # (*>) :: IO a -> IO b -> IO b # (<*) :: IO a -> IO b -> IO a #
Applicative Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Par1 a # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c # (*>) :: Par1 a -> Par1 b -> Par1 b # (<*) :: Par1 a -> Par1 b -> Par1 a #
Applicative Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods pure :: a -> Complex a # (<*>) :: Complex (a -> b) -> Complex a -> Complex b # liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c # (*>) :: Complex a -> Complex b -> Complex b # (<*) :: Complex a -> Complex b -> Complex a #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a # (<*>) :: Min (a -> b) -> Min a -> Min b # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c # (*>) :: Min a -> Min b -> Min b # (<*) :: Min a -> Min b -> Min a #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a # (<*>) :: Max (a -> b) -> Max a -> Max b # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c # (*>) :: Max a -> Max b -> Max b # (<*) :: Max a -> Max b -> Max a #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Option a # (<*>) :: Option (a -> b) -> Option a -> Option b # liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c # (*>) :: Option a -> Option b -> Option b # (<*) :: Option a -> Option b -> Option a #
Applicative ZipList |
    f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
        = 'ZipList' (zipWithN f xs1 ... xsN)
where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:
    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}
Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c # (*>) :: ZipList a -> ZipList b -> ZipList b # (<*) :: ZipList a -> ZipList b -> ZipList a #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a # (<*>) :: Identity (a -> b) -> Identity a -> Identity b # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c # (*>) :: Identity a -> Identity b -> Identity b # (<*) :: Identity a -> Identity b -> Identity a #
Applicative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods pure :: a -> STM a # (<*>) :: STM (a -> b) -> STM a -> STM b # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c # (*>) :: STM a -> STM b -> STM b # (<*) :: STM a -> STM b -> STM a #
Applicative First |
Instance details Defined in Data.Monoid Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative Last |
Instance details Defined in Data.Monoid Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a # (<*>) :: Dual (a -> b) -> Dual a -> Dual b # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c # (*>) :: Dual a -> Dual b -> Dual b # (<*) :: Dual a -> Dual b -> Dual a #
Applicative Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a # (<*>) :: Sum (a -> b) -> Sum a -> Sum b # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c # (*>) :: Sum a -> Sum b -> Sum b # (<*) :: Sum a -> Sum b -> Sum a #
Applicative Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a # (<*>) :: Product (a -> b) -> Product a -> Product b # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c # (*>) :: Product a -> Product b -> Product b # (<*) :: Product a -> Product b -> Product a #
Applicative Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a # (<*>) :: Down (a -> b) -> Down a -> Down b # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c # (*>) :: Down a -> Down b -> Down b # (<*) :: Down a -> Down b -> Down a #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c # (*>) :: ReadP a -> ReadP b -> ReadP b # (<*) :: ReadP a -> ReadP b -> ReadP a #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #
Applicative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> P a # (<*>) :: P (a -> b) -> P a -> P b # liftA2 :: (a -> b -> c) -> P a -> P b -> P c # (*>) :: P a -> P b -> P b # (<*) :: P a -> P b -> P a #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a # (<*>) :: Either e (a -> b) -> Either e a -> Either e b # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c # (*>) :: Either e a -> Either e b -> Either e b # (<*) :: Either e a -> Either e b -> Either e a #
Applicative (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> U1 a # (<*>) :: U1 (a -> b) -> U1 a -> U1 b # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c # (*>) :: U1 a -> U1 b -> U1 b # (<*) :: U1 a -> U1 b -> U1 a #
Monoid a => Applicative ((,) a) | For tuples, the `Monoid` constraint on `a` determines how the first values merge. For example, `String`s concatenate:
    ("hello ", (+15)) <*> ("world!", 2002)
    ("hello world!",2017)
Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, a0) # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) # (*>) :: (a, a0) -> (a, b) -> (a, b) # (<*) :: (a, a0) -> (a, b) -> (a, a0) #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #
Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Applicative (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods pure :: a -> Proxy a # (<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b # liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c # (*>) :: Proxy a -> Proxy b -> Proxy b # (<*) :: Proxy a -> Proxy b -> Proxy a #
Applicative (ST s) | Since: base-4.4.0.0
Instance details Defined in GHC.ST Methods pure :: a -> ST s a # (<*>) :: ST s (a -> b) -> ST s a -> ST s b # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c # (*>) :: ST s a -> ST s b -> ST s b # (<*) :: ST s a -> ST s b -> ST s a #
Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Rec1 f a # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Monoid m => Applicative (Const m :: * -> *) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a # (<*>) :: Const m (a -> b) -> Const m a -> Const m b # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c # (*>) :: Const m a -> Const m b -> Const m b # (<*) :: Const m a -> Const m b -> Const m a #
Applicative f => Applicative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c # (*>) :: Alt f a -> Alt f b -> Alt f b # (<*) :: Alt f a -> Alt f b -> Alt f a #
Applicative ((->) a :: * -> *) | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> a -> a0 # (<*>) :: (a -> a0 -> b) -> (a -> a0) -> a -> b # liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c # (*>) :: (a -> a0) -> (a -> b) -> a -> b # (<*) :: (a -> a0) -> (a -> b) -> a -> a0 #
(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :*: g) a # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> M1 i c f a # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a #
(Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :.: g) a # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a #
(Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c # (*>) :: Compose f g a -> Compose f g b -> Compose f g b # (<*) :: Compose f g a -> Compose f g b -> Compose f g a #

class Foldable (t :: * -> *) where #

Data structures that can be folded.

For example, given a data type

    data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

    instance Foldable Tree where
       foldMap f Empty = mempty
       foldMap f (Leaf x) = f x
       foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define `foldr`:

    instance Foldable Tree where
       foldr f z Empty = z
       foldr f z (Leaf x) = f x z
       foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

`Foldable` instances are expected to satisfy the following laws:

    foldr f z t = appEndo (foldMap (Endo . f) t ) z

    foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z

    fold = foldMap id

    length = getSum . foldMap (Sum . const  1)

`sum`, `product`, `maximum`, and `minimum` should all be essentially equivalent to `foldMap` forms, such as

    sum = getSum . foldMap Sum

but may be less defined.

If the type is also a `Functor` instance, it should satisfy

    foldMap f = fold . fmap f

which implies that

    foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

foldMap | foldr

Methods

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

Combine the elements of a structure using a monoid.

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

Map each element of the structure to a monoid, and combine the results.

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

Right-associative fold of a structure.

In the case of lists, `foldr`, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

    foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, `foldr` can produce a terminating expression from an infinite list.

For a general `Foldable` structure this should be semantically identical to,

    foldr f z = foldr f z . toList

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

Right-associative fold of a structure, but with strict application of the operator.

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

Left-associative fold of a structure.

In the case of lists, `foldl`, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

    foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. This means that `foldl'` will diverge if given an infinite list.

Also note that if you want an efficient left-fold, you probably want to use `foldl'` instead of `foldl`. The reason for this is that latter does not force the "inner" results (e.g. `z `f` x1` in the above example) before applying them to the operator (e.g. to `(`f` x2)`). This results in a thunk chain `O(n)` elements long, which then must be evaluated from the outside-in.

For a general `Foldable` structure this should be semantically identical to,

    foldl f z = foldl f z . toList

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

Left-associative fold of a structure but with strict application of the operator.

This ensures that each step of the fold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite list to a single, monolithic result (e.g. `length`).

For a general `Foldable` structure this should be semantically identical to,

    foldl f z = foldl' f z . toList

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

A variant of `foldr` that has no base case, and thus may only be applied to non-empty structures.

    foldr1 f = foldr1 f . toList

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

A variant of `foldl` that has no base case, and thus may only be applied to non-empty structures.

    foldl1 f = foldl1 f . toList

toList :: t a -> [a] #

List of elements of a structure, from left to right.

null :: t a -> Bool #

Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

length :: t a -> Int #

Returns the size/length of a finite structure as an `Int`. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

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

Does the element occur in the structure?

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

The largest element of a non-empty structure.

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

The least element of a non-empty structure.

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

The `sum` function computes the sum of the numbers of a structure.

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

The `product` function computes the product of the numbers of a structure.

Instances

Foldable [] | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => [m] -> m # foldMap :: Monoid m => (a -> m) -> [a] -> m # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # toList :: [a] -> [a] # null :: [a] -> Bool # length :: [a] -> Int # elem :: Eq a => a -> [a] -> Bool # maximum :: Ord a => [a] -> a # minimum :: Ord a => [a] -> a # sum :: Num a => [a] -> a # product :: Num a => [a] -> a #
Foldable Maybe | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # toList :: Maybe a -> [a] # null :: Maybe a -> Bool # length :: Maybe a -> Int # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # sum :: Num a => Maybe a -> a # product :: Num a => Maybe a -> a #
Foldable Par1 |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # toList :: Par1 a -> [a] # null :: Par1 a -> Bool # length :: Par1 a -> Int # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # minimum :: Ord a => Par1 a -> a # sum :: Num a => Par1 a -> a # product :: Num a => Par1 a -> a #
Foldable Complex |
Instance details Defined in Data.Complex Methods fold :: Monoid m => Complex m -> m # foldMap :: Monoid m => (a -> m) -> Complex a -> m # foldr :: (a -> b -> b) -> b -> Complex a -> b # foldr' :: (a -> b -> b) -> b -> Complex a -> b # foldl :: (b -> a -> b) -> b -> Complex a -> b # foldl' :: (b -> a -> b) -> b -> Complex a -> b # foldr1 :: (a -> a -> a) -> Complex a -> a # foldl1 :: (a -> a -> a) -> Complex a -> a # toList :: Complex a -> [a] # null :: Complex a -> Bool # length :: Complex a -> Int # elem :: Eq a => a -> Complex a -> Bool # maximum :: Ord a => Complex a -> a # minimum :: Ord a => Complex a -> a # sum :: Num a => Complex a -> a # product :: Num a => Complex a -> a #
Foldable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Min m -> m # foldMap :: Monoid m => (a -> m) -> Min a -> m # foldr :: (a -> b -> b) -> b -> Min a -> b # foldr' :: (a -> b -> b) -> b -> Min a -> b # foldl :: (b -> a -> b) -> b -> Min a -> b # foldl' :: (b -> a -> b) -> b -> Min a -> b # foldr1 :: (a -> a -> a) -> Min a -> a # foldl1 :: (a -> a -> a) -> Min a -> a # toList :: Min a -> [a] # null :: Min a -> Bool # length :: Min a -> Int # elem :: Eq a => a -> Min a -> Bool # maximum :: Ord a => Min a -> a # minimum :: Ord a => Min a -> a # sum :: Num a => Min a -> a # product :: Num a => Min a -> a #
Foldable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Max m -> m # foldMap :: Monoid m => (a -> m) -> Max a -> m # foldr :: (a -> b -> b) -> b -> Max a -> b # foldr' :: (a -> b -> b) -> b -> Max a -> b # foldl :: (b -> a -> b) -> b -> Max a -> b # foldl' :: (b -> a -> b) -> b -> Max a -> b # foldr1 :: (a -> a -> a) -> Max a -> a # foldl1 :: (a -> a -> a) -> Max a -> a # toList :: Max a -> [a] # null :: Max a -> Bool # length :: Max a -> Int # elem :: Eq a => a -> Max a -> Bool # maximum :: Ord a => Max a -> a # minimum :: Ord a => Max a -> a # sum :: Num a => Max a -> a # product :: Num a => Max a -> a #
Foldable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Option m -> m # foldMap :: Monoid m => (a -> m) -> Option a -> m # foldr :: (a -> b -> b) -> b -> Option a -> b # foldr' :: (a -> b -> b) -> b -> Option a -> b # foldl :: (b -> a -> b) -> b -> Option a -> b # foldl' :: (b -> a -> b) -> b -> Option a -> b # foldr1 :: (a -> a -> a) -> Option a -> a # foldl1 :: (a -> a -> a) -> Option a -> a # toList :: Option a -> [a] # null :: Option a -> Bool # length :: Option a -> Int # elem :: Eq a => a -> Option a -> Bool # maximum :: Ord a => Option a -> a # minimum :: Ord a => Option a -> a # sum :: Num a => Option a -> a # product :: Num a => Option a -> a #
Foldable ZipList |
Instance details Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # toList :: ZipList a -> [a] # null :: ZipList a -> Bool # length :: ZipList a -> Int # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # sum :: Num a => ZipList a -> a # product :: Num a => ZipList a -> a #
Foldable Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # toList :: Identity a -> [a] # null :: Identity a -> Bool # length :: Identity a -> Int # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # sum :: Num a => Identity a -> a # product :: Num a => Identity a -> a #
Foldable First | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Last | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable Dual | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # toList :: Dual a -> [a] # null :: Dual a -> Bool # length :: Dual a -> Int # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # minimum :: Ord a => Dual a -> a # sum :: Num a => Dual a -> a # product :: Num a => Dual a -> a #
Foldable Sum | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # toList :: Sum a -> [a] # null :: Sum a -> Bool # length :: Sum a -> Int # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # minimum :: Ord a => Sum a -> a # sum :: Num a => Sum a -> a # product :: Num a => Sum a -> a #
Foldable Product | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # toList :: Product a -> [a] # null :: Product a -> Bool # length :: Product a -> Int # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # sum :: Num a => Product a -> a # product :: Num a => Product a -> a #
Foldable NonEmpty | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # toList :: NonEmpty a -> [a] # null :: NonEmpty a -> Bool # length :: NonEmpty a -> Int # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # sum :: Num a => NonEmpty a -> a # product :: Num a => NonEmpty a -> a #
Foldable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # null :: Either a a0 -> Bool # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # sum :: Num a0 => Either a a0 -> a0 # product :: Num a0 => Either a a0 -> a0 #
Foldable (V1 :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # toList :: V1 a -> [a] # null :: V1 a -> Bool # length :: V1 a -> Int # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # minimum :: Ord a => V1 a -> a # sum :: Num a => V1 a -> a # product :: Num a => V1 a -> a #
Foldable (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # toList :: U1 a -> [a] # null :: U1 a -> Bool # length :: U1 a -> Int # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # minimum :: Ord a => U1 a -> a # sum :: Num a => U1 a -> a # product :: Num a => U1 a -> a #
Foldable ((,) a) | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (a, m) -> m # foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # toList :: (a, a0) -> [a0] # null :: (a, a0) -> Bool # length :: (a, a0) -> Int # elem :: Eq a0 => a0 -> (a, a0) -> Bool # maximum :: Ord a0 => (a, a0) -> a0 # minimum :: Ord a0 => (a, a0) -> a0 # sum :: Num a0 => (a, a0) -> a0 # product :: Num a0 => (a, a0) -> a0 #
Foldable (Array i) | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Array i m -> m # foldMap :: Monoid m => (a -> m) -> Array i a -> m # foldr :: (a -> b -> b) -> b -> Array i a -> b # foldr' :: (a -> b -> b) -> b -> Array i a -> b # foldl :: (b -> a -> b) -> b -> Array i a -> b # foldl' :: (b -> a -> b) -> b -> Array i a -> b # foldr1 :: (a -> a -> a) -> Array i a -> a # foldl1 :: (a -> a -> a) -> Array i a -> a # toList :: Array i a -> [a] # null :: Array i a -> Bool # length :: Array i a -> Int # elem :: Eq a => a -> Array i a -> Bool # maximum :: Ord a => Array i a -> a # minimum :: Ord a => Array i a -> a # sum :: Num a => Array i a -> a # product :: Num a => Array i a -> a #
Foldable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Arg a m -> m # foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # toList :: Arg a a0 -> [a0] # null :: Arg a a0 -> Bool # length :: Arg a a0 -> Int # elem :: Eq a0 => a0 -> Arg a a0 -> Bool # maximum :: Ord a0 => Arg a a0 -> a0 # minimum :: Ord a0 => Arg a a0 -> a0 # sum :: Num a0 => Arg a a0 -> a0 # product :: Num a0 => Arg a a0 -> a0 #
Foldable (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # toList :: Proxy a -> [a] # null :: Proxy a -> Bool # length :: Proxy a -> Int # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # sum :: Num a => Proxy a -> a # product :: Num a => Proxy a -> a #
Foldable f => Foldable (Rec1 f) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Rec1 f m -> m # foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m # foldr :: (a -> b -> b) -> b -> Rec1 f a -> b # foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b # foldl :: (b -> a -> b) -> b -> Rec1 f a -> b # foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b # foldr1 :: (a -> a -> a) -> Rec1 f a -> a # foldl1 :: (a -> a -> a) -> Rec1 f a -> a # toList :: Rec1 f a -> [a] # null :: Rec1 f a -> Bool # length :: Rec1 f a -> Int # elem :: Eq a => a -> Rec1 f a -> Bool # maximum :: Ord a => Rec1 f a -> a # minimum :: Ord a => Rec1 f a -> a # sum :: Num a => Rec1 f a -> a # product :: Num a => Rec1 f a -> a #
Foldable (URec Char :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Char m -> m # foldMap :: Monoid m => (a -> m) -> URec Char a -> m # foldr :: (a -> b -> b) -> b -> URec Char a -> b # foldr' :: (a -> b -> b) -> b -> URec Char a -> b # foldl :: (b -> a -> b) -> b -> URec Char a -> b # foldl' :: (b -> a -> b) -> b -> URec Char a -> b # foldr1 :: (a -> a -> a) -> URec Char a -> a # foldl1 :: (a -> a -> a) -> URec Char a -> a # toList :: URec Char a -> [a] # null :: URec Char a -> Bool # length :: URec Char a -> Int # elem :: Eq a => a -> URec Char a -> Bool # maximum :: Ord a => URec Char a -> a # minimum :: Ord a => URec Char a -> a # sum :: Num a => URec Char a -> a # product :: Num a => URec Char a -> a #
Foldable (URec Double :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Double m -> m # foldMap :: Monoid m => (a -> m) -> URec Double a -> m # foldr :: (a -> b -> b) -> b -> URec Double a -> b # foldr' :: (a -> b -> b) -> b -> URec Double a -> b # foldl :: (b -> a -> b) -> b -> URec Double a -> b # foldl' :: (b -> a -> b) -> b -> URec Double a -> b # foldr1 :: (a -> a -> a) -> URec Double a -> a # foldl1 :: (a -> a -> a) -> URec Double a -> a # toList :: URec Double a -> [a] # null :: URec Double a -> Bool # length :: URec Double a -> Int # elem :: Eq a => a -> URec Double a -> Bool # maximum :: Ord a => URec Double a -> a # minimum :: Ord a => URec Double a -> a # sum :: Num a => URec Double a -> a # product :: Num a => URec Double a -> a #
Foldable (URec Float :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Float m -> m # foldMap :: Monoid m => (a -> m) -> URec Float a -> m # foldr :: (a -> b -> b) -> b -> URec Float a -> b # foldr' :: (a -> b -> b) -> b -> URec Float a -> b # foldl :: (b -> a -> b) -> b -> URec Float a -> b # foldl' :: (b -> a -> b) -> b -> URec Float a -> b # foldr1 :: (a -> a -> a) -> URec Float a -> a # foldl1 :: (a -> a -> a) -> URec Float a -> a # toList :: URec Float a -> [a] # null :: URec Float a -> Bool # length :: URec Float a -> Int # elem :: Eq a => a -> URec Float a -> Bool # maximum :: Ord a => URec Float a -> a # minimum :: Ord a => URec Float a -> a # sum :: Num a => URec Float a -> a # product :: Num a => URec Float a -> a #
Foldable (URec Int :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Int m -> m # foldMap :: Monoid m => (a -> m) -> URec Int a -> m # foldr :: (a -> b -> b) -> b -> URec Int a -> b # foldr' :: (a -> b -> b) -> b -> URec Int a -> b # foldl :: (b -> a -> b) -> b -> URec Int a -> b # foldl' :: (b -> a -> b) -> b -> URec Int a -> b # foldr1 :: (a -> a -> a) -> URec Int a -> a # foldl1 :: (a -> a -> a) -> URec Int a -> a # toList :: URec Int a -> [a] # null :: URec Int a -> Bool # length :: URec Int a -> Int # elem :: Eq a => a -> URec Int a -> Bool # maximum :: Ord a => URec Int a -> a # minimum :: Ord a => URec Int a -> a # sum :: Num a => URec Int a -> a # product :: Num a => URec Int a -> a #
Foldable (URec Word :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Word m -> m # foldMap :: Monoid m => (a -> m) -> URec Word a -> m # foldr :: (a -> b -> b) -> b -> URec Word a -> b # foldr' :: (a -> b -> b) -> b -> URec Word a -> b # foldl :: (b -> a -> b) -> b -> URec Word a -> b # foldl' :: (b -> a -> b) -> b -> URec Word a -> b # foldr1 :: (a -> a -> a) -> URec Word a -> a # foldl1 :: (a -> a -> a) -> URec Word a -> a # toList :: URec Word a -> [a] # null :: URec Word a -> Bool # length :: URec Word a -> Int # elem :: Eq a => a -> URec Word a -> Bool # maximum :: Ord a => URec Word a -> a # minimum :: Ord a => URec Word a -> a # sum :: Num a => URec Word a -> a # product :: Num a => URec Word a -> a #
Foldable (URec (Ptr ()) :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec (Ptr ()) m -> m # foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m # foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # toList :: URec (Ptr ()) a -> [a] # null :: URec (Ptr ()) a -> Bool # length :: URec (Ptr ()) a -> Int # elem :: Eq a => a -> URec (Ptr ()) a -> Bool # maximum :: Ord a => URec (Ptr ()) a -> a # minimum :: Ord a => URec (Ptr ()) a -> a # sum :: Num a => URec (Ptr ()) a -> a # product :: Num a => URec (Ptr ()) a -> a #
Foldable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # toList :: Const m a -> [a] # null :: Const m a -> Bool # length :: Const m a -> Int # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # sum :: Num a => Const m a -> a # product :: Num a => Const m a -> a #
Foldable (K1 i c :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # toList :: K1 i c a -> [a] # null :: K1 i c a -> Bool # length :: K1 i c a -> Int # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # sum :: Num a => K1 i c a -> a # product :: Num a => K1 i c a -> a #
(Foldable f, Foldable g) => Foldable (f :+: g) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # null :: (f :+: g) a -> Bool # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # sum :: Num a => (f :+: g) a -> a # product :: Num a => (f :+: g) a -> a #
(Foldable f, Foldable g) => Foldable (f :*: g) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # null :: (f :*: g) a -> Bool # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # sum :: Num a => (f :*: g) a -> a # product :: Num a => (f :*: g) a -> a #
Foldable f => Foldable (M1 i c f) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # toList :: M1 i c f a -> [a] # null :: M1 i c f a -> Bool # length :: M1 i c f a -> Int # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # sum :: Num a => M1 i c f a -> a # product :: Num a => M1 i c f a -> a #
(Foldable f, Foldable g) => Foldable (f :.: g) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # null :: (f :.: g) a -> Bool # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # sum :: Num a => (f :.: g) a -> a # product :: Num a => (f :.: g) a -> a #
(Foldable f, Foldable g) => Foldable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fold :: Monoid m => Compose f g m -> m # foldMap :: Monoid m => (a -> m) -> Compose f g a -> m # foldr :: (a -> b -> b) -> b -> Compose f g a -> b # foldr' :: (a -> b -> b) -> b -> Compose f g a -> b # foldl :: (b -> a -> b) -> b -> Compose f g a -> b # foldl' :: (b -> a -> b) -> b -> Compose f g a -> b # foldr1 :: (a -> a -> a) -> Compose f g a -> a # foldl1 :: (a -> a -> a) -> Compose f g a -> a # toList :: Compose f g a -> [a] # null :: Compose f g a -> Bool # length :: Compose f g a -> Int # elem :: Eq a => a -> Compose f g a -> Bool # maximum :: Ord a => Compose f g a -> a # minimum :: Ord a => Compose f g a -> a # sum :: Num a => Compose f g a -> a # product :: Num a => Compose f g a -> a #

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

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

A definition of `traverse` must satisfy the following laws:

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

A definition of `sequenceA` must satisfy the following laws:

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

where an applicative transformation is a function

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

preserving the `Applicative` operations, i.e.

-     t (pure x) = pure x

-     t (x <*> y) = t x <*> t y

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

      newtype Identity a = Identity a

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

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

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

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

      instance (Applicative f, Applicative g) => Applicative (Compose f g) where
        pure x = Compose (pure (pure x))
        Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)

(The naturality law is implied by parametricity.)

Instances are similar to `Functor`, e.g. given a data type

    data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

    instance Traversable Tree where
       traverse f Empty = pure Empty
       traverse f (Leaf x) = Leaf <$> f x
       traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r

This is suitable even for abstract types, as the laws for `<*>` imply a form of associativity.

The superclass instances should satisfy the following:

- In the `Functor` instance, `fmap` should be equivalent to traversal with the identity applicative functor (`fmapDefault`).
- In the `Foldable` instance, `foldMap` should be equivalent to traversal with a constant applicative functor (`foldMapDefault`).

Minimal complete definition

traverse | sequenceA

Methods

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

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

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

Evaluate each action in the structure from left to right, and and collect the results. For a version that ignores the results see `sequenceA_`.

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

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

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

Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see `sequence_`.

Instances

Traversable [] | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> [a] -> f [b] # sequenceA :: Applicative f => [f a] -> f [a] # mapM :: Monad m => (a -> m b) -> [a] -> m [b] # sequence :: Monad m => [m a] -> m [a] #
Traversable Maybe | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) # sequence :: Monad m => Maybe (m a) -> m (Maybe a) #
Traversable Par1 |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) # sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) # mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) # sequence :: Monad m => Par1 (m a) -> m (Par1 a) #
Traversable Complex |
Instance details Defined in Data.Complex Methods traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) # sequenceA :: Applicative f => Complex (f a) -> f (Complex a) # mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) # sequence :: Monad m => Complex (m a) -> m (Complex a) #
Traversable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) # sequenceA :: Applicative f => Min (f a) -> f (Min a) # mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) # sequence :: Monad m => Min (m a) -> m (Min a) #
Traversable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) # sequenceA :: Applicative f => Max (f a) -> f (Max a) # mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) # sequence :: Monad m => Max (m a) -> m (Max a) #
Traversable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) # sequenceA :: Applicative f => First (f a) -> f (First a) # mapM :: Monad m => (a -> m b) -> First a -> m (First b) # sequence :: Monad m => First (m a) -> m (First a) #
Traversable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # sequenceA :: Applicative f => Last (f a) -> f (Last a) # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # sequence :: Monad m => Last (m a) -> m (Last a) #
Traversable Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) # sequenceA :: Applicative f => Option (f a) -> f (Option a) # mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) # sequence :: Monad m => Option (m a) -> m (Option a) #
Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) # sequence :: Monad m => ZipList (m a) -> m (ZipList a) #
Traversable Identity |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) # sequence :: Monad m => Identity (m a) -> m (Identity a) #
Traversable First | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) # sequenceA :: Applicative f => First (f a) -> f (First a) # mapM :: Monad m => (a -> m b) -> First a -> m (First b) # sequence :: Monad m => First (m a) -> m (First a) #
Traversable Last | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # sequenceA :: Applicative f => Last (f a) -> f (Last a) # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # sequence :: Monad m => Last (m a) -> m (Last a) #
Traversable Dual | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) # sequenceA :: Applicative f => Dual (f a) -> f (Dual a) # mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) # sequence :: Monad m => Dual (m a) -> m (Dual a) #
Traversable Sum | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) # sequenceA :: Applicative f => Sum (f a) -> f (Sum a) # mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) # sequence :: Monad m => Sum (m a) -> m (Sum a) #
Traversable Product | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) # sequenceA :: Applicative f => Product (f a) -> f (Product a) # mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) # sequence :: Monad m => Product (m a) -> m (Product a) #
Traversable NonEmpty | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) # sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) # mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) # sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #
Traversable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) # sequence :: Monad m => Either a (m a0) -> m (Either a a0) #
Traversable (V1 :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) # sequenceA :: Applicative f => V1 (f a) -> f (V1 a) # mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) # sequence :: Monad m => V1 (m a) -> m (V1 a) #
Traversable (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) # sequenceA :: Applicative f => U1 (f a) -> f (U1 a) # mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) # sequence :: Monad m => U1 (m a) -> m (U1 a) #
Traversable ((,) a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) # sequenceA :: Applicative f => (a, f a0) -> f (a, a0) # mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) # sequence :: Monad m => (a, m a0) -> m (a, a0) #
Ix i => Traversable (Array i) | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Array i a -> f (Array i b) # sequenceA :: Applicative f => Array i (f a) -> f (Array i a) # mapM :: Monad m => (a -> m b) -> Array i a -> m (Array i b) # sequence :: Monad m => Array i (m a) -> m (Array i a) #
Traversable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) # sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) # mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) # sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #
Traversable (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) # sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) # mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) # sequence :: Monad m => Proxy (m a) -> m (Proxy a) #
Traversable f => Traversable (Rec1 f) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) # sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) # mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) # sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) #
Traversable (URec Char :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) # sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) # mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) # sequence :: Monad m => URec Char (m a) -> m (URec Char a) #
Traversable (URec Double :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) # sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) # mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) # sequence :: Monad m => URec Double (m a) -> m (URec Double a) #
Traversable (URec Float :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) # sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) # mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) # sequence :: Monad m => URec Float (m a) -> m (URec Float a) #
Traversable (URec Int :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) # sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) # mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) # sequence :: Monad m => URec Int (m a) -> m (URec Int a) #
Traversable (URec Word :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) # sequence :: Monad m => URec Word (m a) -> m (URec Word a) #
Traversable (URec (Ptr ()) :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec (Ptr ()) a -> f (URec (Ptr ()) b) # sequenceA :: Applicative f => URec (Ptr ()) (f a) -> f (URec (Ptr ()) a) # mapM :: Monad m => (a -> m b) -> URec (Ptr ()) a -> m (URec (Ptr ()) b) # sequence :: Monad m => URec (Ptr ()) (m a) -> m (URec (Ptr ()) a) #
Traversable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #
Traversable (K1 i c :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) # sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) # mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) # sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) #
(Traversable f, Traversable g) => Traversable (f :+: g) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) # sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) # mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) # sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) #
(Traversable f, Traversable g) => Traversable (f :*: g) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) # sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) # mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) # sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #
Traversable f => Traversable (M1 i c f) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) # sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) # mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) # sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) #
(Traversable f, Traversable g) => Traversable (f :.: g) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) # sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) # mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) # sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) #
(Traversable f, Traversable g) => Traversable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) # sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) # mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) # sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) #

class Generic a #

Representable types of kind `*`. This class is derivable in GHC with the `DeriveGeneric` flag on.

A `Generic` instance must satisfy the following laws:

    from . to ≡ id
    to . from ≡ id

Minimal complete definition

from, to

Instances

Generic Bool |
Instance details Defined in GHC.Generics Associated Types type Rep Bool :: * -> * # Methods from :: Bool -> Rep Bool x # to :: Rep Bool x -> Bool #
Generic Ordering |
Instance details Defined in GHC.Generics Associated Types type Rep Ordering :: * -> * # Methods from :: Ordering -> Rep Ordering x # to :: Rep Ordering x -> Ordering #
Generic () |
Instance details Defined in GHC.Generics Associated Types type Rep () :: * -> * # Methods from :: () -> Rep () x # to :: Rep () x -> () #
Generic Void |
Instance details Defined in Data.Void Associated Types type Rep Void :: * -> * # Methods from :: Void -> Rep Void x # to :: Rep Void x -> Void #
Generic Version |
Instance details Defined in Data.Version Associated Types type Rep Version :: * -> * # Methods from :: Version -> Rep Version x # to :: Rep Version x -> Version #
Generic ExitCode |
Instance details Defined in GHC.IO.Exception Associated Types type Rep ExitCode :: * -> * # Methods from :: ExitCode -> Rep ExitCode x # to :: Rep ExitCode x -> ExitCode #
Generic All |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep All :: * -> * # Methods from :: All -> Rep All x # to :: Rep All x -> All #
Generic Any |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep Any :: * -> * # Methods from :: Any -> Rep Any x # to :: Rep Any x -> Any #
Generic Fixity |
Instance details Defined in GHC.Generics Associated Types type Rep Fixity :: * -> * # Methods from :: Fixity -> Rep Fixity x # to :: Rep Fixity x -> Fixity #
Generic Associativity |
Instance details Defined in GHC.Generics Associated Types type Rep Associativity :: * -> * # Methods from :: Associativity -> Rep Associativity x # to :: Rep Associativity x -> Associativity #
Generic SourceUnpackedness |
Instance details Defined in GHC.Generics Associated Types type Rep SourceUnpackedness :: * -> * # Methods from :: SourceUnpackedness -> Rep SourceUnpackedness x # to :: Rep SourceUnpackedness x -> SourceUnpackedness #
Generic SourceStrictness |
Instance details Defined in GHC.Generics Associated Types type Rep SourceStrictness :: * -> * # Methods from :: SourceStrictness -> Rep SourceStrictness x # to :: Rep SourceStrictness x -> SourceStrictness #
Generic DecidedStrictness |
Instance details Defined in GHC.Generics Associated Types type Rep DecidedStrictness :: * -> * # Methods from :: DecidedStrictness -> Rep DecidedStrictness x # to :: Rep DecidedStrictness x -> DecidedStrictness #
Generic [a] |
Instance details Defined in GHC.Generics Associated Types type Rep [a] :: * -> * # Methods from :: [a] -> Rep [a] x # to :: Rep [a] x -> [a] #
Generic (Maybe a) |
Instance details Defined in GHC.Generics Associated Types type Rep (Maybe a) :: * -> * # Methods from :: Maybe a -> Rep (Maybe a) x # to :: Rep (Maybe a) x -> Maybe a #
Generic (Par1 p) |
Instance details Defined in GHC.Generics Associated Types type Rep (Par1 p) :: * -> * # Methods from :: Par1 p -> Rep (Par1 p) x # to :: Rep (Par1 p) x -> Par1 p #
Generic (Complex a) |
Instance details Defined in Data.Complex Associated Types type Rep (Complex a) :: * -> * # Methods from :: Complex a -> Rep (Complex a) x # to :: Rep (Complex a) x -> Complex a #
Generic (Min a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Min a) :: * -> * # Methods from :: Min a -> Rep (Min a) x # to :: Rep (Min a) x -> Min a #
Generic (Max a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Max a) :: * -> * # Methods from :: Max a -> Rep (Max a) x # to :: Rep (Max a) x -> Max a #
Generic (First a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (First a) :: * -> * # Methods from :: First a -> Rep (First a) x # to :: Rep (First a) x -> First a #
Generic (Last a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Last a) :: * -> * # Methods from :: Last a -> Rep (Last a) x # to :: Rep (Last a) x -> Last a #
Generic (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Associated Types type Rep (WrappedMonoid m) :: * -> * # Methods from :: WrappedMonoid m -> Rep (WrappedMonoid m) x # to :: Rep (WrappedMonoid m) x -> WrappedMonoid m #
Generic (Option a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Option a) :: * -> * # Methods from :: Option a -> Rep (Option a) x # to :: Rep (Option a) x -> Option a #
Generic (ZipList a) |
Instance details Defined in Control.Applicative Associated Types type Rep (ZipList a) :: * -> * # Methods from :: ZipList a -> Rep (ZipList a) x # to :: Rep (ZipList a) x -> ZipList a #
Generic (Identity a) |
Instance details Defined in Data.Functor.Identity Associated Types type Rep (Identity a) :: * -> * # Methods from :: Identity a -> Rep (Identity a) x # to :: Rep (Identity a) x -> Identity a #
Generic (First a) |
Instance details Defined in Data.Monoid Associated Types type Rep (First a) :: * -> * # Methods from :: First a -> Rep (First a) x # to :: Rep (First a) x -> First a #
Generic (Last a) |
Instance details Defined in Data.Monoid Associated Types type Rep (Last a) :: * -> * # Methods from :: Last a -> Rep (Last a) x # to :: Rep (Last a) x -> Last a #
Generic (Dual a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Dual a) :: * -> * # Methods from :: Dual a -> Rep (Dual a) x # to :: Rep (Dual a) x -> Dual a #
Generic (Endo a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Endo a) :: * -> * # Methods from :: Endo a -> Rep (Endo a) x # to :: Rep (Endo a) x -> Endo a #
Generic (Sum a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Sum a) :: * -> * # Methods from :: Sum a -> Rep (Sum a) x # to :: Rep (Sum a) x -> Sum a #
Generic (Product a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Product a) :: * -> * # Methods from :: Product a -> Rep (Product a) x # to :: Rep (Product a) x -> Product a #
Generic (NonEmpty a) |
Instance details Defined in GHC.Generics Associated Types type Rep (NonEmpty a) :: * -> * # Methods from :: NonEmpty a -> Rep (NonEmpty a) x # to :: Rep (NonEmpty a) x -> NonEmpty a #
Generic (Either a b) |
Instance details Defined in GHC.Generics Associated Types type Rep (Either a b) :: * -> * # Methods from :: Either a b -> Rep (Either a b) x # to :: Rep (Either a b) x -> Either a b #
Generic (V1 p) |
Instance details Defined in GHC.Generics Associated Types type Rep (V1 p) :: * -> * # Methods from :: V1 p -> Rep (V1 p) x # to :: Rep (V1 p) x -> V1 p #
Generic (U1 p) |
Instance details Defined in GHC.Generics Associated Types type Rep (U1 p) :: * -> * # Methods from :: U1 p -> Rep (U1 p) x # to :: Rep (U1 p) x -> U1 p #
Generic (a, b) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b) :: * -> * # Methods from :: (a, b) -> Rep (a, b) x # to :: Rep (a, b) x -> (a, b) #
Generic (Arg a b) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Arg a b) :: * -> * # Methods from :: Arg a b -> Rep (Arg a b) x # to :: Rep (Arg a b) x -> Arg a b #
Generic (WrappedMonad m a) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedMonad m a) :: * -> * # Methods from :: WrappedMonad m a -> Rep (WrappedMonad m a) x # to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #
Generic (Proxy t) |
Instance details Defined in GHC.Generics Associated Types type Rep (Proxy t) :: * -> * # Methods from :: Proxy t -> Rep (Proxy t) x # to :: Rep (Proxy t) x -> Proxy t #
Generic (Rec1 f p) |
Instance details Defined in GHC.Generics Associated Types type Rep (Rec1 f p) :: * -> * # Methods from :: Rec1 f p -> Rep (Rec1 f p) x # to :: Rep (Rec1 f p) x -> Rec1 f p #
Generic (URec (Ptr ()) p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec (Ptr ()) p) :: * -> * # Methods from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x # to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #
Generic (URec Char p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Char p) :: * -> * # Methods from :: URec Char p -> Rep (URec Char p) x # to :: Rep (URec Char p) x -> URec Char p #
Generic (URec Double p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Double p) :: * -> * # Methods from :: URec Double p -> Rep (URec Double p) x # to :: Rep (URec Double p) x -> URec Double p #
Generic (URec Float p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Float p) :: * -> * # Methods from :: URec Float p -> Rep (URec Float p) x # to :: Rep (URec Float p) x -> URec Float p #
Generic (URec Int p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Int p) :: * -> * # Methods from :: URec Int p -> Rep (URec Int p) x # to :: Rep (URec Int p) x -> URec Int p #
Generic (URec Word p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Word p) :: * -> * # Methods from :: URec Word p -> Rep (URec Word p) x # to :: Rep (URec Word p) x -> URec Word p #
Generic (a, b, c) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b, c) :: * -> * # Methods from :: (a, b, c) -> Rep (a, b, c) x # to :: Rep (a, b, c) x -> (a, b, c) #
Generic (WrappedArrow a b c) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: * -> * # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #
Generic (Const a b) |
Instance details Defined in Data.Functor.Const Associated Types type Rep (Const a b) :: * -> * # Methods from :: Const a b -> Rep (Const a b) x # to :: Rep (Const a b) x -> Const a b #
Generic (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Alt f a) :: * -> * # Methods from :: Alt f a -> Rep (Alt f a) x # to :: Rep (Alt f a) x -> Alt f a #
Generic (K1 i c p) |
Instance details Defined in GHC.Generics Associated Types type Rep (K1 i c p) :: * -> * # Methods from :: K1 i c p -> Rep (K1 i c p) x # to :: Rep (K1 i c p) x -> K1 i c p #
Generic ((f :+: g) p) |
Instance details Defined in GHC.Generics Associated Types type Rep ((f :+: g) p) :: * -> * # Methods from :: (f :+: g) p -> Rep ((f :+: g) p) x # to :: Rep ((f :+: g) p) x -> (f :+: g) p #
Generic ((f :*: g) p) |
Instance details Defined in GHC.Generics Associated Types type Rep ((f :*: g) p) :: * -> * # Methods from :: (f :*: g) p -> Rep ((f :*: g) p) x # to :: Rep ((f :*: g) p) x -> (f :*: g) p #
Generic (a, b, c, d) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b, c, d) :: * -> * # Methods from :: (a, b, c, d) -> Rep (a, b, c, d) x # to :: Rep (a, b, c, d) x -> (a, b, c, d) #
Generic (M1 i c f p) |
Instance details Defined in GHC.Generics Associated Types type Rep (M1 i c f p) :: * -> * # Methods from :: M1 i c f p -> Rep (M1 i c f p) x # to :: Rep (M1 i c f p) x -> M1 i c f p #
Generic ((f :.: g) p) |
Instance details Defined in GHC.Generics Associated Types type Rep ((f :.: g) p) :: * -> * # Methods from :: (f :.: g) p -> Rep ((f :.: g) p) x # to :: Rep ((f :.: g) p) x -> (f :.: g) p #
Generic (a, b, c, d, e) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b, c, d, e) :: * -> * # Methods from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x # to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) #
Generic (Compose f g a) |
Instance details Defined in Data.Functor.Compose Associated Types type Rep (Compose f g a) :: * -> * # Methods from :: Compose f g a -> Rep (Compose f g a) x # to :: Rep (Compose f g a) x -> Compose f g a #
Generic (a, b, c, d, e, f) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b, c, d, e, f) :: * -> * # Methods from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x # to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) #
Generic (a, b, c, d, e, f, g) |
Instance details Defined in GHC.Generics Associated Types type Rep (a, b, c, d, e, f, g) :: * -> * # Methods from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x # to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) #

class Semigroup a where #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the associativity law:

-     x <> (y <> z) = (x <> y) <> z

Since: base-4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 #

An associative operation.

sconcat :: NonEmpty a -> a #

Reduce a non-empty list with `<>`

The default definition should be sufficient, but this can be overridden for efficiency.

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

Repeat a value `n` times.

Given that this works on a `Semigroup` it is allowed to fail if you request 0 or fewer repetitions, and the default definition will do so.

By making this a member of the class, idempotent semigroups and monoids can upgrade this to execute in O(1) by picking `stimes = `stimesIdempotent`` or `stimes = `stimesIdempotentMonoid`` respectively.

Instances

Semigroup Ordering | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Ordering -> Ordering -> Ordering # sconcat :: NonEmpty Ordering -> Ordering # stimes :: Integral b => b -> Ordering -> Ordering #
Semigroup () | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: () -> () -> () # sconcat :: NonEmpty () -> () # stimes :: Integral b => b -> () -> () #
Semigroup Void | Since: base-4.9.0.0
Instance details Defined in Data.Void Methods (<>) :: Void -> Void -> Void # sconcat :: NonEmpty Void -> Void # stimes :: Integral b => b -> Void -> Void #
Semigroup All | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: All -> All -> All # sconcat :: NonEmpty All -> All # stimes :: Integral b => b -> All -> All #
Semigroup Any | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Any -> Any -> Any # sconcat :: NonEmpty Any -> Any # stimes :: Integral b => b -> Any -> Any #
Semigroup [a] | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: [a] -> [a] -> [a] # sconcat :: NonEmpty [a] -> [a] # stimes :: Integral b => b -> [a] -> [a] #
Semigroup a => Semigroup (Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Maybe a -> Maybe a -> Maybe a # sconcat :: NonEmpty (Maybe a) -> Maybe a # stimes :: Integral b => b -> Maybe a -> Maybe a #
Semigroup a => Semigroup (IO a) | Since: base-4.10.0.0
Instance details Defined in GHC.Base Methods (<>) :: IO a -> IO a -> IO a # sconcat :: NonEmpty (IO a) -> IO a # stimes :: Integral b => b -> IO a -> IO a #
Ord a => Semigroup (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Min a -> Min a -> Min a # sconcat :: NonEmpty (Min a) -> Min a # stimes :: Integral b => b -> Min a -> Min a #
Ord a => Semigroup (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Max a -> Max a -> Max a # sconcat :: NonEmpty (Max a) -> Max a # stimes :: Integral b => b -> Max a -> Max a #
Semigroup (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: First a -> First a -> First a # sconcat :: NonEmpty (First a) -> First a # stimes :: Integral b => b -> First a -> First a #
Semigroup (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Last a -> Last a -> Last a # sconcat :: NonEmpty (Last a) -> Last a # stimes :: Integral b => b -> Last a -> Last a #
Monoid m => Semigroup (WrappedMonoid m) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # sconcat :: NonEmpty (WrappedMonoid m) -> WrappedMonoid m # stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m #
Semigroup a => Semigroup (Option a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Option a -> Option a -> Option a # sconcat :: NonEmpty (Option a) -> Option a # stimes :: Integral b => b -> Option a -> Option a #
Semigroup a => Semigroup (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (<>) :: Identity a -> Identity a -> Identity a # sconcat :: NonEmpty (Identity a) -> Identity a # stimes :: Integral b => b -> Identity a -> Identity a #
Semigroup (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Monoid Methods (<>) :: First a -> First a -> First a # sconcat :: NonEmpty (First a) -> First a # stimes :: Integral b => b -> First a -> First a #
Semigroup (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Monoid Methods (<>) :: Last a -> Last a -> Last a # sconcat :: NonEmpty (Last a) -> Last a # stimes :: Integral b => b -> Last a -> Last a #
Semigroup a => Semigroup (Dual a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Dual a -> Dual a -> Dual a # sconcat :: NonEmpty (Dual a) -> Dual a # stimes :: Integral b => b -> Dual a -> Dual a #
Semigroup (Endo a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Endo a -> Endo a -> Endo a # sconcat :: NonEmpty (Endo a) -> Endo a # stimes :: Integral b => b -> Endo a -> Endo a #
Num a => Semigroup (Sum a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Sum a -> Sum a -> Sum a # sconcat :: NonEmpty (Sum a) -> Sum a # stimes :: Integral b => b -> Sum a -> Sum a #
Num a => Semigroup (Product a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Product a -> Product a -> Product a # sconcat :: NonEmpty (Product a) -> Product a # stimes :: Integral b => b -> Product a -> Product a #
Semigroup a => Semigroup (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (<>) :: Down a -> Down a -> Down a # sconcat :: NonEmpty (Down a) -> Down a # stimes :: Integral b => b -> Down a -> Down a #
Semigroup (NonEmpty a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a # sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a # stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #
Semigroup b => Semigroup (a -> b) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a -> b) -> (a -> b) -> a -> b # sconcat :: NonEmpty (a -> b) -> a -> b # stimes :: Integral b0 => b0 -> (a -> b) -> a -> b #
Semigroup (Either a b) | Since: base-4.9.0.0
Instance details Defined in Data.Either Methods (<>) :: Either a b -> Either a b -> Either a b # sconcat :: NonEmpty (Either a b) -> Either a b # stimes :: Integral b0 => b0 -> Either a b -> Either a b #
(Semigroup a, Semigroup b) => Semigroup (a, b) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b) -> (a, b) -> (a, b) # sconcat :: NonEmpty (a, b) -> (a, b) # stimes :: Integral b0 => b0 -> (a, b) -> (a, b) #
Semigroup (Proxy s) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods (<>) :: Proxy s -> Proxy s -> Proxy s # sconcat :: NonEmpty (Proxy s) -> Proxy s # stimes :: Integral b => b -> Proxy s -> Proxy s #
Semigroup a => Semigroup (ST s a) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods (<>) :: ST s a -> ST s a -> ST s a # sconcat :: NonEmpty (ST s a) -> ST s a # stimes :: Integral b => b -> ST s a -> ST s a #
(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) # sconcat :: NonEmpty (a, b, c) -> (a, b, c) # stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) #
Semigroup a => Semigroup (Const a b) |
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b # sconcat :: NonEmpty (Const a b) -> Const a b # stimes :: Integral b0 => b0 -> Const a b -> Const a b #
Alternative f => Semigroup (Alt f a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Alt f a -> Alt f a -> Alt f a # sconcat :: NonEmpty (Alt f a) -> Alt f a # stimes :: Integral b => b -> Alt f a -> Alt f a #
(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) # stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) #
(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) # stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) #

class Semigroup a => Monoid a where #

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

-     x <> mempty = x

-     mempty <> x = x

- `x `<>` (y `<>` z) = (x `<>` y) `<>` z` (`Semigroup` law)

-     mconcat = foldr '(<>)' mempty

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

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

NOTE: `Semigroup` is a superclass of `Monoid` since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a #

Identity of `mappend`

mappend :: a -> a -> a #

An associative operation

NOTE: This method is redundant and has the default implementation ``mappend` = '(<>)'` since base-4.11.0.0.

mconcat :: [a] -> a #

Fold a list using the monoid.

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

Instances

Monoid Ordering | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Ordering # mappend :: Ordering -> Ordering -> Ordering # mconcat :: [Ordering] -> Ordering #
Monoid () | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: () # mappend :: () -> () -> () # mconcat :: [()] -> () #
Monoid All | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: All # mappend :: All -> All -> All # mconcat :: [All] -> All #
Monoid Any | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Any # mappend :: Any -> Any -> Any # mconcat :: [Any] -> Any #
Monoid [a] | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: [a] # mappend :: [a] -> [a] -> [a] # mconcat :: [[a]] -> [a] #
Semigroup a => Monoid (Maybe a) | Lift a semigroup into `Maybe` forming a `Monoid` according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup `S` may be turned into a monoid simply by adjoining an element `e` not in `S` and defining `e*e = e` and `e*s = s = s*e` for all `s ∈ S`." Since 4.11.0: constraint on inner `a` value generalised from `Monoid` to `Semigroup`. Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Maybe a # mappend :: Maybe a -> Maybe a -> Maybe a # mconcat :: [Maybe a] -> Maybe a #
Monoid a => Monoid (IO a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mempty :: IO a # mappend :: IO a -> IO a -> IO a # mconcat :: [IO a] -> IO a #
(Ord a, Bounded a) => Monoid (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Min a # mappend :: Min a -> Min a -> Min a # mconcat :: [Min a] -> Min a #
(Ord a, Bounded a) => Monoid (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Max a # mappend :: Max a -> Max a -> Max a # mconcat :: [Max a] -> Max a #
Monoid m => Monoid (WrappedMonoid m) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m #
Semigroup a => Monoid (Option a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Option a # mappend :: Option a -> Option a -> Option a # mconcat :: [Option a] -> Option a #
Monoid a => Monoid (Identity a) |
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a # mappend :: Identity a -> Identity a -> Identity a # mconcat :: [Identity a] -> Identity a #
Monoid (First a) | Since: base-2.1
Instance details Defined in Data.Monoid Methods mempty :: First a # mappend :: First a -> First a -> First a # mconcat :: [First a] -> First a #
Monoid (Last a) | Since: base-2.1
Instance details Defined in Data.Monoid Methods mempty :: Last a # mappend :: Last a -> Last a -> Last a # mconcat :: [Last a] -> Last a #
Monoid a => Monoid (Dual a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Dual a # mappend :: Dual a -> Dual a -> Dual a # mconcat :: [Dual a] -> Dual a #
Monoid (Endo a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Endo a # mappend :: Endo a -> Endo a -> Endo a # mconcat :: [Endo a] -> Endo a #
Num a => Monoid (Sum a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Sum a # mappend :: Sum a -> Sum a -> Sum a # mconcat :: [Sum a] -> Sum a #
Num a => Monoid (Product a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Product a # mappend :: Product a -> Product a -> Product a # mconcat :: [Product a] -> Product a #
Monoid a => Monoid (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods mempty :: Down a # mappend :: Down a -> Down a -> Down a # mconcat :: [Down a] -> Down a #
Monoid b => Monoid (a -> b) | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: a -> b # mappend :: (a -> b) -> (a -> b) -> a -> b # mconcat :: [a -> b] -> a -> b #
(Monoid a, Monoid b) => Monoid (a, b) | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b) # mappend :: (a, b) -> (a, b) -> (a, b) # mconcat :: [(a, b)] -> (a, b) #
Monoid (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods mempty :: Proxy s # mappend :: Proxy s -> Proxy s -> Proxy s # mconcat :: [Proxy s] -> Proxy s #
Monoid a => Monoid (ST s a) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods mempty :: ST s a # mappend :: ST s a -> ST s a -> ST s a # mconcat :: [ST s a] -> ST s a #
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c) # mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) # mconcat :: [(a, b, c)] -> (a, b, c) #
Monoid a => Monoid (Const a b) |
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b # mappend :: Const a b -> Const a b -> Const a b # mconcat :: [Const a b] -> Const a b #
Alternative f => Monoid (Alt f a) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Alt f a # mappend :: Alt f a -> Alt f a -> Alt f a # mconcat :: [Alt f a] -> Alt f a #
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d) # mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # mconcat :: [(a, b, c, d)] -> (a, b, c, d) #
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d, e) # mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

data Bool #

Constructors

False |
True |

Instances

Bounded Bool | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Bool # maxBound :: Bool #
Enum Bool | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Bool -> Bool # pred :: Bool -> Bool # toEnum :: Int -> Bool # fromEnum :: Bool -> Int # enumFrom :: Bool -> [Bool] # enumFromThen :: Bool -> Bool -> [Bool] # enumFromTo :: Bool -> Bool -> [Bool] # enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #
Eq Bool |
Instance details Defined in GHC.Classes Methods (==) :: Bool -> Bool -> Bool # (/=) :: Bool -> Bool -> Bool #
Data Bool | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bool -> c Bool # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool # toConstr :: Bool -> Constr # dataTypeOf :: Bool -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) # gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool #
Ord Bool |
Instance details Defined in GHC.Classes Methods compare :: Bool -> Bool -> Ordering # (<) :: Bool -> Bool -> Bool # (<=) :: Bool -> Bool -> Bool # (>) :: Bool -> Bool -> Bool # (>=) :: Bool -> Bool -> Bool # max :: Bool -> Bool -> Bool # min :: Bool -> Bool -> Bool #
Read Bool | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Bool # readList :: ReadS [Bool] # readPrec :: ReadPrec Bool # readListPrec :: ReadPrec [Bool] #
Show Bool |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Bool -> ShowS # show :: Bool -> String # showList :: [Bool] -> ShowS #
Ix Bool | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Bool, Bool) -> [Bool] # index :: (Bool, Bool) -> Bool -> Int # unsafeIndex :: (Bool, Bool) -> Bool -> Int inRange :: (Bool, Bool) -> Bool -> Bool # rangeSize :: (Bool, Bool) -> Int # unsafeRangeSize :: (Bool, Bool) -> Int
Generic Bool |
Instance details Defined in GHC.Generics Associated Types type Rep Bool :: * -> * # Methods from :: Bool -> Rep Bool x # to :: Rep Bool x -> Bool #
SingKind Bool | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type DemoteRep Bool :: * Methods fromSing :: Sing a -> DemoteRep Bool
Storable Bool | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Bool -> Int # alignment :: Bool -> Int # peekElemOff :: Ptr Bool -> Int -> IO Bool # pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () # peekByteOff :: Ptr b -> Int -> IO Bool # pokeByteOff :: Ptr b -> Int -> Bool -> IO () # peek :: Ptr Bool -> IO Bool # poke :: Ptr Bool -> Bool -> IO () #
Bits Bool | Interpret `Bool` as 1-bit bit-field Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods (.&.) :: Bool -> Bool -> Bool # (.|.) :: Bool -> Bool -> Bool # xor :: Bool -> Bool -> Bool # complement :: Bool -> Bool # shift :: Bool -> Int -> Bool # rotate :: Bool -> Int -> Bool # zeroBits :: Bool # bit :: Int -> Bool # setBit :: Bool -> Int -> Bool # clearBit :: Bool -> Int -> Bool # complementBit :: Bool -> Int -> Bool # testBit :: Bool -> Int -> Bool # bitSizeMaybe :: Bool -> Maybe Int # bitSize :: Bool -> Int # isSigned :: Bool -> Bool # shiftL :: Bool -> Int -> Bool # unsafeShiftL :: Bool -> Int -> Bool # shiftR :: Bool -> Int -> Bool # unsafeShiftR :: Bool -> Int -> Bool # rotateL :: Bool -> Int -> Bool # rotateR :: Bool -> Int -> Bool # popCount :: Bool -> Int #
FiniteBits Bool | Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Bool -> Int # countLeadingZeros :: Bool -> Int # countTrailingZeros :: Bool -> Int #
SingI False | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing False
SingI True | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing True
type Rep Bool |
Instance details Defined in GHC.Generics type Rep Bool = D1 (MetaData "Bool" "GHC.Types" "ghc-prim" False) (C1 (MetaCons "False" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "True" PrefixI False) (U1 :: * -> *))
data Sing (a :: Bool) |
Instance details Defined in GHC.Generics data Sing (a :: Bool) where STrue :: Sing True SFalse :: Sing False
type DemoteRep Bool |
Instance details Defined in GHC.Generics type DemoteRep Bool = Bool

data Char #

The character type `Char` is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type `Char`.

To convert a `Char` to or from the corresponding `Int` value defined by Unicode, use `toEnum` and `fromEnum` from the `Enum` class respectively (or equivalently `ord` and `chr`).

Instances

Bounded Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Char # maxBound :: Char #
Enum Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Char -> Char # pred :: Char -> Char # toEnum :: Int -> Char # fromEnum :: Char -> Int # enumFrom :: Char -> [Char] # enumFromThen :: Char -> Char -> [Char] # enumFromTo :: Char -> Char -> [Char] # enumFromThenTo :: Char -> Char -> Char -> [Char] #
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool # (/=) :: Char -> Char -> Bool #
Data Char | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char # toConstr :: Char -> Constr # dataTypeOf :: Char -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) # gmapT :: (forall b. Data b => b -> b) -> Char -> Char # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering # (<) :: Char -> Char -> Bool # (<=) :: Char -> Char -> Bool # (>) :: Char -> Char -> Bool # (>=) :: Char -> Char -> Bool # max :: Char -> Char -> Char # min :: Char -> Char -> Char #
Read Char | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char # readList :: ReadS [Char] # readPrec :: ReadPrec Char # readListPrec :: ReadPrec [Char] #
Show Char | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS # show :: Char -> String # showList :: [Char] -> ShowS #
Ix Char | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Char, Char) -> [Char] # index :: (Char, Char) -> Char -> Int # unsafeIndex :: (Char, Char) -> Char -> Int inRange :: (Char, Char) -> Char -> Bool # rangeSize :: (Char, Char) -> Int # unsafeRangeSize :: (Char, Char) -> Int
PrintfArg Char | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Char -> FieldFormatter # parseFormat :: Char -> ModifierParser #
IsChar Char | Since: base-2.1
Instance details Defined in Text.Printf Methods toChar :: Char -> Char # fromChar :: Char -> Char #
Storable Char | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Char -> Int # alignment :: Char -> Int # peekElemOff :: Ptr Char -> Int -> IO Char # pokeElemOff :: Ptr Char -> Int -> Char -> IO () # peekByteOff :: Ptr b -> Int -> IO Char # pokeByteOff :: Ptr b -> Int -> Char -> IO () # peek :: Ptr Char -> IO Char # poke :: Ptr Char -> Char -> IO () #
Generic1 (URec Char :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Char) :: k -> * # Methods from1 :: URec Char a -> Rep1 (URec Char) a # to1 :: Rep1 (URec Char) a -> URec Char a #
Functor (URec Char :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b # (<$) :: a -> URec Char b -> URec Char a #
Foldable (URec Char :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Char m -> m # foldMap :: Monoid m => (a -> m) -> URec Char a -> m # foldr :: (a -> b -> b) -> b -> URec Char a -> b # foldr' :: (a -> b -> b) -> b -> URec Char a -> b # foldl :: (b -> a -> b) -> b -> URec Char a -> b # foldl' :: (b -> a -> b) -> b -> URec Char a -> b # foldr1 :: (a -> a -> a) -> URec Char a -> a # foldl1 :: (a -> a -> a) -> URec Char a -> a # toList :: URec Char a -> [a] # null :: URec Char a -> Bool # length :: URec Char a -> Int # elem :: Eq a => a -> URec Char a -> Bool # maximum :: Ord a => URec Char a -> a # minimum :: Ord a => URec Char a -> a # sum :: Num a => URec Char a -> a # product :: Num a => URec Char a -> a #
Traversable (URec Char :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) # sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) # mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) # sequence :: Monad m => URec Char (m a) -> m (URec Char a) #
Eq (URec Char p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool # (/=) :: URec Char p -> URec Char p -> Bool #
Ord (URec Char p) |
Instance details Defined in GHC.Generics Methods compare :: URec Char p -> URec Char p -> Ordering # (<) :: URec Char p -> URec Char p -> Bool # (<=) :: URec Char p -> URec Char p -> Bool # (>) :: URec Char p -> URec Char p -> Bool # (>=) :: URec Char p -> URec Char p -> Bool # max :: URec Char p -> URec Char p -> URec Char p # min :: URec Char p -> URec Char p -> URec Char p #
Show (URec Char p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS # show :: URec Char p -> String # showList :: [URec Char p] -> ShowS #
Generic (URec Char p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Char p) :: * -> * # Methods from :: URec Char p -> Rep (URec Char p) x # to :: Rep (URec Char p) x -> URec Char p #
data URec Char (p :: k) | Used for marking occurrences of `Char#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Char (p :: k) = UChar { uChar# :: Char# }
type Rep1 (URec Char :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec Char :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UChar :: k -> *)))
type Rep (URec Char p) |
Instance details Defined in GHC.Generics type Rep (URec Char p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UChar :: * -> *)))

data Double #

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

Instances

Eq Double |
Instance details Defined in GHC.Classes Methods (==) :: Double -> Double -> Bool # (/=) :: Double -> Double -> Bool #
Floating Double | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double # exp :: Double -> Double # log :: Double -> Double # sqrt :: Double -> Double # (**) :: Double -> Double -> Double # logBase :: Double -> Double -> Double # sin :: Double -> Double # cos :: Double -> Double # tan :: Double -> Double # asin :: Double -> Double # acos :: Double -> Double # atan :: Double -> Double # sinh :: Double -> Double # cosh :: Double -> Double # tanh :: Double -> Double # asinh :: Double -> Double # acosh :: Double -> Double # atanh :: Double -> Double # log1p :: Double -> Double # expm1 :: Double -> Double # log1pexp :: Double -> Double # log1mexp :: Double -> Double #
Data Double | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double # toConstr :: Double -> Constr # dataTypeOf :: Double -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) # gmapT :: (forall b. Data b => b -> b) -> Double -> Double # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double #
Ord Double |
Instance details Defined in GHC.Classes Methods compare :: Double -> Double -> Ordering # (<) :: Double -> Double -> Bool # (<=) :: Double -> Double -> Bool # (>) :: Double -> Double -> Bool # (>=) :: Double -> Double -> Bool # max :: Double -> Double -> Double # min :: Double -> Double -> Double #
Read Double | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Double # readList :: ReadS [Double] # readPrec :: ReadPrec Double # readListPrec :: ReadPrec [Double] #
RealFloat Double | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # exponent :: Double -> Int # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isNaN :: Double -> Bool # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # isIEEE :: Double -> Bool # atan2 :: Double -> Double -> Double #
PrintfArg Double | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Double -> FieldFormatter # parseFormat :: Double -> ModifierParser #
Storable Double | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Double -> Int # alignment :: Double -> Int # peekElemOff :: Ptr Double -> Int -> IO Double # pokeElemOff :: Ptr Double -> Int -> Double -> IO () # peekByteOff :: Ptr b -> Int -> IO Double # pokeByteOff :: Ptr b -> Int -> Double -> IO () # peek :: Ptr Double -> IO Double # poke :: Ptr Double -> Double -> IO () #
Generic1 (URec Double :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Double) :: k -> * # Methods from1 :: URec Double a -> Rep1 (URec Double) a # to1 :: Rep1 (URec Double) a -> URec Double a #
Functor (URec Double :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Double a -> URec Double b # (<$) :: a -> URec Double b -> URec Double a #
Foldable (URec Double :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Double m -> m # foldMap :: Monoid m => (a -> m) -> URec Double a -> m # foldr :: (a -> b -> b) -> b -> URec Double a -> b # foldr' :: (a -> b -> b) -> b -> URec Double a -> b # foldl :: (b -> a -> b) -> b -> URec Double a -> b # foldl' :: (b -> a -> b) -> b -> URec Double a -> b # foldr1 :: (a -> a -> a) -> URec Double a -> a # foldl1 :: (a -> a -> a) -> URec Double a -> a # toList :: URec Double a -> [a] # null :: URec Double a -> Bool # length :: URec Double a -> Int # elem :: Eq a => a -> URec Double a -> Bool # maximum :: Ord a => URec Double a -> a # minimum :: Ord a => URec Double a -> a # sum :: Num a => URec Double a -> a # product :: Num a => URec Double a -> a #
Traversable (URec Double :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) # sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) # mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) # sequence :: Monad m => URec Double (m a) -> m (URec Double a) #
Eq (URec Double p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Double p -> URec Double p -> Bool # (/=) :: URec Double p -> URec Double p -> Bool #
Ord (URec Double p) |
Instance details Defined in GHC.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 # max :: URec Double p -> URec Double p -> URec Double p # min :: URec Double p -> URec Double p -> URec Double p #
Show (URec Double p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Double p -> ShowS # show :: URec Double p -> String # showList :: [URec Double p] -> ShowS #
Generic (URec Double p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Double p) :: * -> * # Methods from :: URec Double p -> Rep (URec Double p) x # to :: Rep (URec Double p) x -> URec Double p #
data URec Double (p :: k) | Used for marking occurrences of `Double#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Double (p :: k) = UDouble { uDouble# :: Double# }
type Rep1 (URec Double :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec Double :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: k -> *)))
type Rep (URec Double p) |
Instance details Defined in GHC.Generics type Rep (URec Double p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: * -> *)))

data Float #

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

Instances

Eq Float |
Instance details Defined in GHC.Classes Methods (==) :: Float -> Float -> Bool # (/=) :: Float -> Float -> Bool #
Floating Float | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float # exp :: Float -> Float # log :: Float -> Float # sqrt :: Float -> Float # (**) :: Float -> Float -> Float # logBase :: Float -> Float -> Float # sin :: Float -> Float # cos :: Float -> Float # tan :: Float -> Float # asin :: Float -> Float # acos :: Float -> Float # atan :: Float -> Float # sinh :: Float -> Float # cosh :: Float -> Float # tanh :: Float -> Float # asinh :: Float -> Float # acosh :: Float -> Float # atanh :: Float -> Float # log1p :: Float -> Float # expm1 :: Float -> Float # log1pexp :: Float -> Float # log1mexp :: Float -> Float #
Data Float | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float # toConstr :: Float -> Constr # dataTypeOf :: Float -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) # gmapT :: (forall b. Data b => b -> b) -> Float -> Float # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float #
Ord Float |
Instance details Defined in GHC.Classes Methods compare :: Float -> Float -> Ordering # (<) :: Float -> Float -> Bool # (<=) :: Float -> Float -> Bool # (>) :: Float -> Float -> Bool # (>=) :: Float -> Float -> Bool # max :: Float -> Float -> Float # min :: Float -> Float -> Float #
Read Float | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Float # readList :: ReadS [Float] # readPrec :: ReadPrec Float # readListPrec :: ReadPrec [Float] #
RealFloat Float | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # exponent :: Float -> Int # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isNaN :: Float -> Bool # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # isIEEE :: Float -> Bool # atan2 :: Float -> Float -> Float #
PrintfArg Float | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Float -> FieldFormatter # parseFormat :: Float -> ModifierParser #
Storable Float | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Float -> Int # alignment :: Float -> Int # peekElemOff :: Ptr Float -> Int -> IO Float # pokeElemOff :: Ptr Float -> Int -> Float -> IO () # peekByteOff :: Ptr b -> Int -> IO Float # pokeByteOff :: Ptr b -> Int -> Float -> IO () # peek :: Ptr Float -> IO Float # poke :: Ptr Float -> Float -> IO () #
Generic1 (URec Float :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Float) :: k -> * # Methods from1 :: URec Float a -> Rep1 (URec Float) a # to1 :: Rep1 (URec Float) a -> URec Float a #
Functor (URec Float :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Float a -> URec Float b # (<$) :: a -> URec Float b -> URec Float a #
Foldable (URec Float :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Float m -> m # foldMap :: Monoid m => (a -> m) -> URec Float a -> m # foldr :: (a -> b -> b) -> b -> URec Float a -> b # foldr' :: (a -> b -> b) -> b -> URec Float a -> b # foldl :: (b -> a -> b) -> b -> URec Float a -> b # foldl' :: (b -> a -> b) -> b -> URec Float a -> b # foldr1 :: (a -> a -> a) -> URec Float a -> a # foldl1 :: (a -> a -> a) -> URec Float a -> a # toList :: URec Float a -> [a] # null :: URec Float a -> Bool # length :: URec Float a -> Int # elem :: Eq a => a -> URec Float a -> Bool # maximum :: Ord a => URec Float a -> a # minimum :: Ord a => URec Float a -> a # sum :: Num a => URec Float a -> a # product :: Num a => URec Float a -> a #
Traversable (URec Float :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) # sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) # mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) # sequence :: Monad m => URec Float (m a) -> m (URec Float a) #
Eq (URec Float p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Float p -> URec Float p -> Bool # (/=) :: URec Float p -> URec Float p -> Bool #
Ord (URec Float p) |
Instance details Defined in GHC.Generics Methods compare :: URec Float p -> URec Float p -> Ordering # (<) :: URec Float p -> URec Float p -> Bool # (<=) :: URec Float p -> URec Float p -> Bool # (>) :: URec Float p -> URec Float p -> Bool # (>=) :: URec Float p -> URec Float p -> Bool # max :: URec Float p -> URec Float p -> URec Float p # min :: URec Float p -> URec Float p -> URec Float p #
Show (URec Float p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Float p -> ShowS # show :: URec Float p -> String # showList :: [URec Float p] -> ShowS #
Generic (URec Float p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Float p) :: * -> * # Methods from :: URec Float p -> Rep (URec Float p) x # to :: Rep (URec Float p) x -> URec Float p #
data URec Float (p :: k) | Used for marking occurrences of `Float#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Float (p :: k) = UFloat { uFloat# :: Float# }
type Rep1 (URec Float :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec Float :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: k -> *)))
type Rep (URec Float p) |
Instance details Defined in GHC.Generics type Rep (URec Float p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: * -> *)))

data Int #

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

Bounded Int | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Int # maxBound :: Int #
Enum Int | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Int -> Int # pred :: Int -> Int # toEnum :: Int -> Int # fromEnum :: Int -> Int # enumFrom :: Int -> [Int] # enumFromThen :: Int -> Int -> [Int] # enumFromTo :: Int -> Int -> [Int] # enumFromThenTo :: Int -> Int -> Int -> [Int] #
Eq Int |
Instance details Defined in GHC.Classes Methods (==) :: Int -> Int -> Bool # (/=) :: Int -> Int -> Bool #
Integral Int | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Int -> Int -> Int # rem :: Int -> Int -> Int # div :: Int -> Int -> Int # mod :: Int -> Int -> Int # quotRem :: Int -> Int -> (Int, Int) # divMod :: Int -> Int -> (Int, Int) # toInteger :: Int -> Integer #
Data Int | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int -> c Int # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int # toConstr :: Int -> Constr # dataTypeOf :: Int -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) # gmapT :: (forall b. Data b => b -> b) -> Int -> Int # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int #
Num Int | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Int -> Int -> Int # (-) :: Int -> Int -> Int # (*) :: Int -> Int -> Int # negate :: Int -> Int # abs :: Int -> Int # signum :: Int -> Int # fromInteger :: Integer -> Int #
Ord Int |
Instance details Defined in GHC.Classes Methods compare :: Int -> Int -> Ordering # (<) :: Int -> Int -> Bool # (<=) :: Int -> Int -> Bool # (>) :: Int -> Int -> Bool # (>=) :: Int -> Int -> Bool # max :: Int -> Int -> Int # min :: Int -> Int -> Int #
Read Int | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Int # readList :: ReadS [Int] # readPrec :: ReadPrec Int # readListPrec :: ReadPrec [Int] #
Real Int | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Int -> Rational #
Show Int | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Int -> ShowS # show :: Int -> String # showList :: [Int] -> ShowS #
Ix Int | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Int, Int) -> [Int] # index :: (Int, Int) -> Int -> Int # unsafeIndex :: (Int, Int) -> Int -> Int inRange :: (Int, Int) -> Int -> Bool # rangeSize :: (Int, Int) -> Int # unsafeRangeSize :: (Int, Int) -> Int
PrintfArg Int | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int -> FieldFormatter # parseFormat :: Int -> ModifierParser #
Storable Int | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int -> Int # alignment :: Int -> Int # peekElemOff :: Ptr Int -> Int -> IO Int # pokeElemOff :: Ptr Int -> Int -> Int -> IO () # peekByteOff :: Ptr b -> Int -> IO Int # pokeByteOff :: Ptr b -> Int -> Int -> IO () # peek :: Ptr Int -> IO Int # poke :: Ptr Int -> Int -> IO () #
Bits Int | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Int -> Int -> Int # (.|.) :: Int -> Int -> Int # xor :: Int -> Int -> Int # complement :: Int -> Int # shift :: Int -> Int -> Int # rotate :: Int -> Int -> Int # zeroBits :: Int # bit :: Int -> Int # setBit :: Int -> Int -> Int # clearBit :: Int -> Int -> Int # complementBit :: Int -> Int -> Int # testBit :: Int -> Int -> Bool # bitSizeMaybe :: Int -> Maybe Int # bitSize :: Int -> Int # isSigned :: Int -> Bool # shiftL :: Int -> Int -> Int # unsafeShiftL :: Int -> Int -> Int # shiftR :: Int -> Int -> Int # unsafeShiftR :: Int -> Int -> Int # rotateL :: Int -> Int -> Int # rotateR :: Int -> Int -> Int # popCount :: Int -> Int #
FiniteBits Int | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Int -> Int # countLeadingZeros :: Int -> Int # countTrailingZeros :: Int -> Int #
Generic1 (URec Int :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Int) :: k -> * # Methods from1 :: URec Int a -> Rep1 (URec Int) a # to1 :: Rep1 (URec Int) a -> URec Int a #
Functor (URec Int :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Int a -> URec Int b # (<$) :: a -> URec Int b -> URec Int a #
Foldable (URec Int :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Int m -> m # foldMap :: Monoid m => (a -> m) -> URec Int a -> m # foldr :: (a -> b -> b) -> b -> URec Int a -> b # foldr' :: (a -> b -> b) -> b -> URec Int a -> b # foldl :: (b -> a -> b) -> b -> URec Int a -> b # foldl' :: (b -> a -> b) -> b -> URec Int a -> b # foldr1 :: (a -> a -> a) -> URec Int a -> a # foldl1 :: (a -> a -> a) -> URec Int a -> a # toList :: URec Int a -> [a] # null :: URec Int a -> Bool # length :: URec Int a -> Int # elem :: Eq a => a -> URec Int a -> Bool # maximum :: Ord a => URec Int a -> a # minimum :: Ord a => URec Int a -> a # sum :: Num a => URec Int a -> a # product :: Num a => URec Int a -> a #
Traversable (URec Int :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) # sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) # mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) # sequence :: Monad m => URec Int (m a) -> m (URec Int a) #
Eq (URec Int p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Int p -> URec Int p -> Bool # (/=) :: URec Int p -> URec Int p -> Bool #
Ord (URec Int p) |
Instance details Defined in GHC.Generics Methods compare :: URec Int p -> URec Int p -> Ordering # (<) :: URec Int p -> URec Int p -> Bool # (<=) :: URec Int p -> URec Int p -> Bool # (>) :: URec Int p -> URec Int p -> Bool # (>=) :: URec Int p -> URec Int p -> Bool # max :: URec Int p -> URec Int p -> URec Int p # min :: URec Int p -> URec Int p -> URec Int p #
Show (URec Int p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Int p -> ShowS # show :: URec Int p -> String # showList :: [URec Int p] -> ShowS #
Generic (URec Int p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Int p) :: * -> * # Methods from :: URec Int p -> Rep (URec Int p) x # to :: Rep (URec Int p) x -> URec Int p #
data URec Int (p :: k) | Used for marking occurrences of `Int#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Int (p :: k) = UInt { uInt# :: Int# }
type Rep1 (URec Int :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec Int :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: k -> *)))
type Rep (URec Int p) |
Instance details Defined in GHC.Generics type Rep (URec Int p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: * -> *)))

data Int8 #

8-bit signed integer type

Instances

Bounded Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int8 # maxBound :: Int8 #
Enum Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int8 -> Int8 # pred :: Int8 -> Int8 # toEnum :: Int -> Int8 # fromEnum :: Int8 -> Int # enumFrom :: Int8 -> [Int8] # enumFromThen :: Int8 -> Int8 -> [Int8] # enumFromTo :: Int8 -> Int8 -> [Int8] # enumFromThenTo :: Int8 -> Int8 -> Int8 -> [Int8] #
Eq Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int8 -> Int8 -> Bool # (/=) :: Int8 -> Int8 -> Bool #
Integral Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int8 -> Int8 -> Int8 # rem :: Int8 -> Int8 -> Int8 # div :: Int8 -> Int8 -> Int8 # mod :: Int8 -> Int8 -> Int8 # quotRem :: Int8 -> Int8 -> (Int8, Int8) # divMod :: Int8 -> Int8 -> (Int8, Int8) # toInteger :: Int8 -> Integer #
Data Int8 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int8 -> c Int8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int8 # toConstr :: Int8 -> Constr # dataTypeOf :: Int8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int8) # gmapT :: (forall b. Data b => b -> b) -> Int8 -> Int8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int8 -> m Int8 #
Num Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int8 -> Int8 -> Int8 # (-) :: Int8 -> Int8 -> Int8 # (*) :: Int8 -> Int8 -> Int8 # negate :: Int8 -> Int8 # abs :: Int8 -> Int8 # signum :: Int8 -> Int8 # fromInteger :: Integer -> Int8 #
Ord Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int8 -> Int8 -> Ordering # (<) :: Int8 -> Int8 -> Bool # (<=) :: Int8 -> Int8 -> Bool # (>) :: Int8 -> Int8 -> Bool # (>=) :: Int8 -> Int8 -> Bool # max :: Int8 -> Int8 -> Int8 # min :: Int8 -> Int8 -> Int8 #
Read Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int8 # readList :: ReadS [Int8] # readPrec :: ReadPrec Int8 # readListPrec :: ReadPrec [Int8] #
Real Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int8 -> Rational #
Show Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int8 -> ShowS # show :: Int8 -> String # showList :: [Int8] -> ShowS #
Ix Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int8, Int8) -> [Int8] # index :: (Int8, Int8) -> Int8 -> Int # unsafeIndex :: (Int8, Int8) -> Int8 -> Int inRange :: (Int8, Int8) -> Int8 -> Bool # rangeSize :: (Int8, Int8) -> Int # unsafeRangeSize :: (Int8, Int8) -> Int
PrintfArg Int8 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int8 -> FieldFormatter # parseFormat :: Int8 -> ModifierParser #
Storable Int8 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int8 -> Int # alignment :: Int8 -> Int # peekElemOff :: Ptr Int8 -> Int -> IO Int8 # pokeElemOff :: Ptr Int8 -> Int -> Int8 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int8 # pokeByteOff :: Ptr b -> Int -> Int8 -> IO () # peek :: Ptr Int8 -> IO Int8 # poke :: Ptr Int8 -> Int8 -> IO () #
Bits Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int8 -> Int8 -> Int8 # (.|.) :: Int8 -> Int8 -> Int8 # xor :: Int8 -> Int8 -> Int8 # complement :: Int8 -> Int8 # shift :: Int8 -> Int -> Int8 # rotate :: Int8 -> Int -> Int8 # zeroBits :: Int8 # bit :: Int -> Int8 # setBit :: Int8 -> Int -> Int8 # clearBit :: Int8 -> Int -> Int8 # complementBit :: Int8 -> Int -> Int8 # testBit :: Int8 -> Int -> Bool # bitSizeMaybe :: Int8 -> Maybe Int # bitSize :: Int8 -> Int # isSigned :: Int8 -> Bool # shiftL :: Int8 -> Int -> Int8 # unsafeShiftL :: Int8 -> Int -> Int8 # shiftR :: Int8 -> Int -> Int8 # unsafeShiftR :: Int8 -> Int -> Int8 # rotateL :: Int8 -> Int -> Int8 # rotateR :: Int8 -> Int -> Int8 # popCount :: Int8 -> Int #
FiniteBits Int8 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int8 -> Int # countLeadingZeros :: Int8 -> Int # countTrailingZeros :: Int8 -> Int #

data Int16 #

16-bit signed integer type

Instances

Bounded Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int16 # maxBound :: Int16 #
Enum Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int16 -> Int16 # pred :: Int16 -> Int16 # toEnum :: Int -> Int16 # fromEnum :: Int16 -> Int # enumFrom :: Int16 -> [Int16] # enumFromThen :: Int16 -> Int16 -> [Int16] # enumFromTo :: Int16 -> Int16 -> [Int16] # enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] #
Eq Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int16 -> Int16 -> Bool # (/=) :: Int16 -> Int16 -> Bool #
Integral Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int16 -> Int16 -> Int16 # rem :: Int16 -> Int16 -> Int16 # div :: Int16 -> Int16 -> Int16 # mod :: Int16 -> Int16 -> Int16 # quotRem :: Int16 -> Int16 -> (Int16, Int16) # divMod :: Int16 -> Int16 -> (Int16, Int16) # toInteger :: Int16 -> Integer #
Data Int16 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int16 -> c Int16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int16 # toConstr :: Int16 -> Constr # dataTypeOf :: Int16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int16) # gmapT :: (forall b. Data b => b -> b) -> Int16 -> Int16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int16 -> m Int16 #
Num Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int16 -> Int16 -> Int16 # (-) :: Int16 -> Int16 -> Int16 # (*) :: Int16 -> Int16 -> Int16 # negate :: Int16 -> Int16 # abs :: Int16 -> Int16 # signum :: Int16 -> Int16 # fromInteger :: Integer -> Int16 #
Ord Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int16 -> Int16 -> Ordering # (<) :: Int16 -> Int16 -> Bool # (<=) :: Int16 -> Int16 -> Bool # (>) :: Int16 -> Int16 -> Bool # (>=) :: Int16 -> Int16 -> Bool # max :: Int16 -> Int16 -> Int16 # min :: Int16 -> Int16 -> Int16 #
Read Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int16 # readList :: ReadS [Int16] # readPrec :: ReadPrec Int16 # readListPrec :: ReadPrec [Int16] #
Real Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int16 -> Rational #
Show Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int16 -> ShowS # show :: Int16 -> String # showList :: [Int16] -> ShowS #
Ix Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int16, Int16) -> [Int16] # index :: (Int16, Int16) -> Int16 -> Int # unsafeIndex :: (Int16, Int16) -> Int16 -> Int inRange :: (Int16, Int16) -> Int16 -> Bool # rangeSize :: (Int16, Int16) -> Int # unsafeRangeSize :: (Int16, Int16) -> Int
PrintfArg Int16 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int16 -> FieldFormatter # parseFormat :: Int16 -> ModifierParser #
Storable Int16 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int16 -> Int # alignment :: Int16 -> Int # peekElemOff :: Ptr Int16 -> Int -> IO Int16 # pokeElemOff :: Ptr Int16 -> Int -> Int16 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int16 # pokeByteOff :: Ptr b -> Int -> Int16 -> IO () # peek :: Ptr Int16 -> IO Int16 # poke :: Ptr Int16 -> Int16 -> IO () #
Bits Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int16 -> Int16 -> Int16 # (.|.) :: Int16 -> Int16 -> Int16 # xor :: Int16 -> Int16 -> Int16 # complement :: Int16 -> Int16 # shift :: Int16 -> Int -> Int16 # rotate :: Int16 -> Int -> Int16 # zeroBits :: Int16 # bit :: Int -> Int16 # setBit :: Int16 -> Int -> Int16 # clearBit :: Int16 -> Int -> Int16 # complementBit :: Int16 -> Int -> Int16 # testBit :: Int16 -> Int -> Bool # bitSizeMaybe :: Int16 -> Maybe Int # bitSize :: Int16 -> Int # isSigned :: Int16 -> Bool # shiftL :: Int16 -> Int -> Int16 # unsafeShiftL :: Int16 -> Int -> Int16 # shiftR :: Int16 -> Int -> Int16 # unsafeShiftR :: Int16 -> Int -> Int16 # rotateL :: Int16 -> Int -> Int16 # rotateR :: Int16 -> Int -> Int16 # popCount :: Int16 -> Int #
FiniteBits Int16 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int16 -> Int # countLeadingZeros :: Int16 -> Int # countTrailingZeros :: Int16 -> Int #

data Int32 #

32-bit signed integer type

Instances

Bounded Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int32 # maxBound :: Int32 #
Enum Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int32 -> Int32 # pred :: Int32 -> Int32 # toEnum :: Int -> Int32 # fromEnum :: Int32 -> Int # enumFrom :: Int32 -> [Int32] # enumFromThen :: Int32 -> Int32 -> [Int32] # enumFromTo :: Int32 -> Int32 -> [Int32] # enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] #
Eq Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int32 -> Int32 -> Bool # (/=) :: Int32 -> Int32 -> Bool #
Integral Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int32 -> Int32 -> Int32 # rem :: Int32 -> Int32 -> Int32 # div :: Int32 -> Int32 -> Int32 # mod :: Int32 -> Int32 -> Int32 # quotRem :: Int32 -> Int32 -> (Int32, Int32) # divMod :: Int32 -> Int32 -> (Int32, Int32) # toInteger :: Int32 -> Integer #
Data Int32 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int32 -> c Int32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int32 # toConstr :: Int32 -> Constr # dataTypeOf :: Int32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int32) # gmapT :: (forall b. Data b => b -> b) -> Int32 -> Int32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int32 -> m Int32 #
Num Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int32 -> Int32 -> Int32 # (-) :: Int32 -> Int32 -> Int32 # (*) :: Int32 -> Int32 -> Int32 # negate :: Int32 -> Int32 # abs :: Int32 -> Int32 # signum :: Int32 -> Int32 # fromInteger :: Integer -> Int32 #
Ord Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int32 -> Int32 -> Ordering # (<) :: Int32 -> Int32 -> Bool # (<=) :: Int32 -> Int32 -> Bool # (>) :: Int32 -> Int32 -> Bool # (>=) :: Int32 -> Int32 -> Bool # max :: Int32 -> Int32 -> Int32 # min :: Int32 -> Int32 -> Int32 #
Read Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int32 # readList :: ReadS [Int32] # readPrec :: ReadPrec Int32 # readListPrec :: ReadPrec [Int32] #
Real Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int32 -> Rational #
Show Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int32 -> ShowS # show :: Int32 -> String # showList :: [Int32] -> ShowS #
Ix Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int32, Int32) -> [Int32] # index :: (Int32, Int32) -> Int32 -> Int # unsafeIndex :: (Int32, Int32) -> Int32 -> Int inRange :: (Int32, Int32) -> Int32 -> Bool # rangeSize :: (Int32, Int32) -> Int # unsafeRangeSize :: (Int32, Int32) -> Int
PrintfArg Int32 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int32 -> FieldFormatter # parseFormat :: Int32 -> ModifierParser #
Storable Int32 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int32 -> Int # alignment :: Int32 -> Int # peekElemOff :: Ptr Int32 -> Int -> IO Int32 # pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int32 # pokeByteOff :: Ptr b -> Int -> Int32 -> IO () # peek :: Ptr Int32 -> IO Int32 # poke :: Ptr Int32 -> Int32 -> IO () #
Bits Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int32 -> Int32 -> Int32 # (.|.) :: Int32 -> Int32 -> Int32 # xor :: Int32 -> Int32 -> Int32 # complement :: Int32 -> Int32 # shift :: Int32 -> Int -> Int32 # rotate :: Int32 -> Int -> Int32 # zeroBits :: Int32 # bit :: Int -> Int32 # setBit :: Int32 -> Int -> Int32 # clearBit :: Int32 -> Int -> Int32 # complementBit :: Int32 -> Int -> Int32 # testBit :: Int32 -> Int -> Bool # bitSizeMaybe :: Int32 -> Maybe Int # bitSize :: Int32 -> Int # isSigned :: Int32 -> Bool # shiftL :: Int32 -> Int -> Int32 # unsafeShiftL :: Int32 -> Int -> Int32 # shiftR :: Int32 -> Int -> Int32 # unsafeShiftR :: Int32 -> Int -> Int32 # rotateL :: Int32 -> Int -> Int32 # rotateR :: Int32 -> Int -> Int32 # popCount :: Int32 -> Int #
FiniteBits Int32 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int32 -> Int # countLeadingZeros :: Int32 -> Int # countTrailingZeros :: Int32 -> Int #

data Int64 #

64-bit signed integer type

Instances

Bounded Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int64 # maxBound :: Int64 #
Enum Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int64 -> Int64 # pred :: Int64 -> Int64 # toEnum :: Int -> Int64 # fromEnum :: Int64 -> Int # enumFrom :: Int64 -> [Int64] # enumFromThen :: Int64 -> Int64 -> [Int64] # enumFromTo :: Int64 -> Int64 -> [Int64] # enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] #
Eq Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int64 -> Int64 -> Bool # (/=) :: Int64 -> Int64 -> Bool #
Integral Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int64 -> Int64 -> Int64 # rem :: Int64 -> Int64 -> Int64 # div :: Int64 -> Int64 -> Int64 # mod :: Int64 -> Int64 -> Int64 # quotRem :: Int64 -> Int64 -> (Int64, Int64) # divMod :: Int64 -> Int64 -> (Int64, Int64) # toInteger :: Int64 -> Integer #
Data Int64 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int64 -> c Int64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int64 # toConstr :: Int64 -> Constr # dataTypeOf :: Int64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int64) # gmapT :: (forall b. Data b => b -> b) -> Int64 -> Int64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Int64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int64 -> m Int64 #
Num Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int64 -> Int64 -> Int64 # (-) :: Int64 -> Int64 -> Int64 # (*) :: Int64 -> Int64 -> Int64 # negate :: Int64 -> Int64 # abs :: Int64 -> Int64 # signum :: Int64 -> Int64 # fromInteger :: Integer -> Int64 #
Ord Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int64 -> Int64 -> Ordering # (<) :: Int64 -> Int64 -> Bool # (<=) :: Int64 -> Int64 -> Bool # (>) :: Int64 -> Int64 -> Bool # (>=) :: Int64 -> Int64 -> Bool # max :: Int64 -> Int64 -> Int64 # min :: Int64 -> Int64 -> Int64 #
Read Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int64 # readList :: ReadS [Int64] # readPrec :: ReadPrec Int64 # readListPrec :: ReadPrec [Int64] #
Real Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int64 -> Rational #
Show Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int64 -> ShowS # show :: Int64 -> String # showList :: [Int64] -> ShowS #
Ix Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods range :: (Int64, Int64) -> [Int64] # index :: (Int64, Int64) -> Int64 -> Int # unsafeIndex :: (Int64, Int64) -> Int64 -> Int inRange :: (Int64, Int64) -> Int64 -> Bool # rangeSize :: (Int64, Int64) -> Int # unsafeRangeSize :: (Int64, Int64) -> Int
PrintfArg Int64 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int64 -> FieldFormatter # parseFormat :: Int64 -> ModifierParser #
Storable Int64 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int64 -> Int # alignment :: Int64 -> Int # peekElemOff :: Ptr Int64 -> Int -> IO Int64 # pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int64 # pokeByteOff :: Ptr b -> Int -> Int64 -> IO () # peek :: Ptr Int64 -> IO Int64 # poke :: Ptr Int64 -> Int64 -> IO () #
Bits Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int64 -> Int64 -> Int64 # (.|.) :: Int64 -> Int64 -> Int64 # xor :: Int64 -> Int64 -> Int64 # complement :: Int64 -> Int64 # shift :: Int64 -> Int -> Int64 # rotate :: Int64 -> Int -> Int64 # zeroBits :: Int64 # bit :: Int -> Int64 # setBit :: Int64 -> Int -> Int64 # clearBit :: Int64 -> Int -> Int64 # complementBit :: Int64 -> Int -> Int64 # testBit :: Int64 -> Int -> Bool # bitSizeMaybe :: Int64 -> Maybe Int # bitSize :: Int64 -> Int # isSigned :: Int64 -> Bool # shiftL :: Int64 -> Int -> Int64 # unsafeShiftL :: Int64 -> Int -> Int64 # shiftR :: Int64 -> Int -> Int64 # unsafeShiftR :: Int64 -> Int -> Int64 # rotateL :: Int64 -> Int -> Int64 # rotateR :: Int64 -> Int -> Int64 # popCount :: Int64 -> Int #
FiniteBits Int64 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int64 -> Int # countLeadingZeros :: Int64 -> Int # countTrailingZeros :: Int64 -> Int #

data Integer #

Invariant: `Jn#` and `Jp#` are used iff value doesn't fit in `S#`

Useful properties resulting from the invariants:

-     abs (S# _) <= abs (Jp# _)

-     abs (S# _) <  abs (Jn# _)

Instances

Enum Integer | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Integer -> Integer # pred :: Integer -> Integer # toEnum :: Int -> Integer # fromEnum :: Integer -> Int # enumFrom :: Integer -> [Integer] # enumFromThen :: Integer -> Integer -> [Integer] # enumFromTo :: Integer -> Integer -> [Integer] # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] #
Eq Integer |
Instance details Defined in GHC.Integer.Type Methods (==) :: Integer -> Integer -> Bool # (/=) :: Integer -> Integer -> Bool #
Integral Integer | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Integer -> Integer -> Integer # rem :: Integer -> Integer -> Integer # div :: Integer -> Integer -> Integer # mod :: Integer -> Integer -> Integer # quotRem :: Integer -> Integer -> (Integer, Integer) # divMod :: Integer -> Integer -> (Integer, Integer) # toInteger :: Integer -> Integer #
Data Integer | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer # toConstr :: Integer -> Constr # dataTypeOf :: Integer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer #
Num Integer | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Integer -> Integer -> Integer # (-) :: Integer -> Integer -> Integer # (*) :: Integer -> Integer -> Integer # negate :: Integer -> Integer # abs :: Integer -> Integer # signum :: Integer -> Integer # fromInteger :: Integer -> Integer #
Ord Integer |
Instance details Defined in GHC.Integer.Type Methods compare :: Integer -> Integer -> Ordering # (<) :: Integer -> Integer -> Bool # (<=) :: Integer -> Integer -> Bool # (>) :: Integer -> Integer -> Bool # (>=) :: Integer -> Integer -> Bool # max :: Integer -> Integer -> Integer # min :: Integer -> Integer -> Integer #
Read Integer | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Integer # readList :: ReadS [Integer] # readPrec :: ReadPrec Integer # readListPrec :: ReadPrec [Integer] #
Real Integer | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Integer -> Rational #
Show Integer | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Integer -> ShowS # show :: Integer -> String # showList :: [Integer] -> ShowS #
Ix Integer | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Integer, Integer) -> [Integer] # index :: (Integer, Integer) -> Integer -> Int # unsafeIndex :: (Integer, Integer) -> Integer -> Int inRange :: (Integer, Integer) -> Integer -> Bool # rangeSize :: (Integer, Integer) -> Int # unsafeRangeSize :: (Integer, Integer) -> Int
PrintfArg Integer | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Integer -> FieldFormatter # parseFormat :: Integer -> ModifierParser #
Bits Integer | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # zeroBits :: Integer # bit :: Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # bitSize :: Integer -> Int # isSigned :: Integer -> Bool # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # rotateR :: Integer -> Int -> Integer # popCount :: Integer -> Int #

data Natural #

Type representing arbitrary-precision non-negative integers.

    >>> 2^20 :: Natural
    1267650600228229401496703205376

Operations whose result would be negative ``throw` (`Underflow` :: `ArithException`)`,

    >>> -1 :: Natural
    *** Exception: arithmetic underflow

Since: base-4.8.0.0

Instances

Enum Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods succ :: Natural -> Natural # pred :: Natural -> Natural # toEnum :: Int -> Natural # fromEnum :: Natural -> Int # enumFrom :: Natural -> [Natural] # enumFromThen :: Natural -> Natural -> [Natural] # enumFromTo :: Natural -> Natural -> [Natural] # enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] #
Eq Natural |
Instance details Defined in GHC.Natural Methods (==) :: Natural -> Natural -> Bool # (/=) :: Natural -> Natural -> Bool #
Integral Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods quot :: Natural -> Natural -> Natural # rem :: Natural -> Natural -> Natural # div :: Natural -> Natural -> Natural # mod :: Natural -> Natural -> Natural # quotRem :: Natural -> Natural -> (Natural, Natural) # divMod :: Natural -> Natural -> (Natural, Natural) # toInteger :: Natural -> Integer #
Data Natural | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Natural -> c Natural # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Natural # toConstr :: Natural -> Constr # dataTypeOf :: Natural -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Natural) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Natural) # gmapT :: (forall b. Data b => b -> b) -> Natural -> Natural # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Natural -> r # gmapQ :: (forall d. Data d => d -> u) -> Natural -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Natural -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Natural -> m Natural #
Num Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods (+) :: Natural -> Natural -> Natural # (-) :: Natural -> Natural -> Natural # (*) :: Natural -> Natural -> Natural # negate :: Natural -> Natural # abs :: Natural -> Natural # signum :: Natural -> Natural # fromInteger :: Integer -> Natural #
Ord Natural |
Instance details Defined in GHC.Natural Methods compare :: Natural -> Natural -> Ordering # (<) :: Natural -> Natural -> Bool # (<=) :: Natural -> Natural -> Bool # (>) :: Natural -> Natural -> Bool # (>=) :: Natural -> Natural -> Bool # max :: Natural -> Natural -> Natural # min :: Natural -> Natural -> Natural #
Read Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods readsPrec :: Int -> ReadS Natural # readList :: ReadS [Natural] # readPrec :: ReadPrec Natural # readListPrec :: ReadPrec [Natural] #
Real Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods toRational :: Natural -> Rational #
Show Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods showsPrec :: Int -> Natural -> ShowS # show :: Natural -> String # showList :: [Natural] -> ShowS #
Ix Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods range :: (Natural, Natural) -> [Natural] # index :: (Natural, Natural) -> Natural -> Int # unsafeIndex :: (Natural, Natural) -> Natural -> Int inRange :: (Natural, Natural) -> Natural -> Bool # rangeSize :: (Natural, Natural) -> Int # unsafeRangeSize :: (Natural, Natural) -> Int
PrintfArg Natural | Since: base-4.8.0.0
Instance details Defined in Text.Printf Methods formatArg :: Natural -> FieldFormatter # parseFormat :: Natural -> ModifierParser #
Bits Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods (.&.) :: Natural -> Natural -> Natural # (.|.) :: Natural -> Natural -> Natural # xor :: Natural -> Natural -> Natural # complement :: Natural -> Natural # shift :: Natural -> Int -> Natural # rotate :: Natural -> Int -> Natural # zeroBits :: Natural # bit :: Int -> Natural # setBit :: Natural -> Int -> Natural # clearBit :: Natural -> Int -> Natural # complementBit :: Natural -> Int -> Natural # testBit :: Natural -> Int -> Bool # bitSizeMaybe :: Natural -> Maybe Int # bitSize :: Natural -> Int # isSigned :: Natural -> Bool # shiftL :: Natural -> Int -> Natural # unsafeShiftL :: Natural -> Int -> Natural # shiftR :: Natural -> Int -> Natural # unsafeShiftR :: Natural -> Int -> Natural # rotateL :: Natural -> Int -> Natural # rotateR :: Natural -> Int -> Natural # popCount :: Natural -> Int #

data Maybe a #

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

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

Constructors

Nothing |
Just a |

Instances

Monad Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b # (>>) :: Maybe a -> Maybe b -> Maybe b # return :: a -> Maybe a # fail :: String -> Maybe a #
Functor Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
MonadFix Maybe | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Maybe a) -> Maybe a #
MonadFail Maybe | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # (*>) :: Maybe a -> Maybe b -> Maybe b # (<*) :: Maybe a -> Maybe b -> Maybe a #
Foldable Maybe | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # toList :: Maybe a -> [a] # null :: Maybe a -> Bool # length :: Maybe a -> Int # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # sum :: Num a => Maybe a -> a # product :: Num a => Maybe a -> a #
Traversable Maybe | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) # sequence :: Monad m => Maybe (m a) -> m (Maybe a) #
Eq1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #
Ord1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #
Read1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] #
Show1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #
Alternative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a # (<|>) :: Maybe a -> Maybe a -> Maybe a # some :: Maybe a -> Maybe [a] # many :: Maybe a -> Maybe [a] #
MonadPlus Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a # mplus :: Maybe a -> Maybe a -> Maybe a #
Eq a => Eq (Maybe a) |
Instance details Defined in GHC.Base Methods (==) :: Maybe a -> Maybe a -> Bool # (/=) :: Maybe a -> Maybe a -> Bool #
Data a => Data (Maybe a) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) # toConstr :: Maybe a -> Constr # dataTypeOf :: Maybe a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) # gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #
Ord a => Ord (Maybe a) |
Instance details Defined in GHC.Base Methods compare :: Maybe a -> Maybe a -> Ordering # (<) :: Maybe a -> Maybe a -> Bool # (<=) :: Maybe a -> Maybe a -> Bool # (>) :: Maybe a -> Maybe a -> Bool # (>=) :: Maybe a -> Maybe a -> Bool # max :: Maybe a -> Maybe a -> Maybe a # min :: Maybe a -> Maybe a -> Maybe a #
Read a => Read (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Maybe a) # readList :: ReadS [Maybe a] # readPrec :: ReadPrec (Maybe a) # readListPrec :: ReadPrec [Maybe a] #
Show a => Show (Maybe a) |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Maybe a -> ShowS # show :: Maybe a -> String # showList :: [Maybe a] -> ShowS #
Generic (Maybe a) |
Instance details Defined in GHC.Generics Associated Types type Rep (Maybe a) :: * -> * # Methods from :: Maybe a -> Rep (Maybe a) x # to :: Rep (Maybe a) x -> Maybe a #
Semigroup a => Semigroup (Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Maybe a -> Maybe a -> Maybe a # sconcat :: NonEmpty (Maybe a) -> Maybe a # stimes :: Integral b => b -> Maybe a -> Maybe a #
Semigroup a => Monoid (Maybe a) | Lift a semigroup into `Maybe` forming a `Monoid` according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup `S` may be turned into a monoid simply by adjoining an element `e` not in `S` and defining `e*e = e` and `e*s = s = s*e` for all `s ∈ S`." Since 4.11.0: constraint on inner `a` value generalised from `Monoid` to `Semigroup`. Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Maybe a # mappend :: Maybe a -> Maybe a -> Maybe a # mconcat :: [Maybe a] -> Maybe a #
SingKind a => SingKind (Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type DemoteRep (Maybe a) :: * Methods fromSing :: Sing a0 -> DemoteRep (Maybe a)
Generic1 Maybe |
Instance details Defined in GHC.Generics Associated Types type Rep1 Maybe :: k -> * # Methods from1 :: Maybe a -> Rep1 Maybe a # to1 :: Rep1 Maybe a -> Maybe a #
SingI (Nothing :: Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing Nothing
SingI a2 => SingI (Just a2 :: Maybe a1) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing (Just a2)
type Rep (Maybe a) |
Instance details Defined in GHC.Generics type Rep (Maybe a) = D1 (MetaData "Maybe" "GHC.Base" "base" False) (C1 (MetaCons "Nothing" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Just" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
data Sing (b :: Maybe a) |
Instance details Defined in GHC.Generics data Sing (b :: Maybe a) where SNothing :: Sing (Nothing :: Maybe a) SJust :: Sing (Just a1)
type DemoteRep (Maybe a) |
Instance details Defined in GHC.Generics type DemoteRep (Maybe a) = Maybe (DemoteRep a)
type Rep1 Maybe |
Instance details Defined in GHC.Generics type Rep1 Maybe = D1 (MetaData "Maybe" "GHC.Base" "base" False) (C1 (MetaCons "Nothing" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Just" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

data Ordering #

Constructors

LT |
EQ |
GT |

Instances

Bounded Ordering | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Ordering # maxBound :: Ordering #
Enum Ordering | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Ordering -> Ordering # pred :: Ordering -> Ordering # toEnum :: Int -> Ordering # fromEnum :: Ordering -> Int # enumFrom :: Ordering -> [Ordering] # enumFromThen :: Ordering -> Ordering -> [Ordering] # enumFromTo :: Ordering -> Ordering -> [Ordering] # enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] #
Eq Ordering |
Instance details Defined in GHC.Classes Methods (==) :: Ordering -> Ordering -> Bool # (/=) :: Ordering -> Ordering -> Bool #
Data Ordering | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering # toConstr :: Ordering -> Constr # dataTypeOf :: Ordering -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) # gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering #
Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering # (<) :: Ordering -> Ordering -> Bool # (<=) :: Ordering -> Ordering -> Bool # (>) :: Ordering -> Ordering -> Bool # (>=) :: Ordering -> Ordering -> Bool # max :: Ordering -> Ordering -> Ordering # min :: Ordering -> Ordering -> Ordering #
Read Ordering | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Ordering # readList :: ReadS [Ordering] # readPrec :: ReadPrec Ordering # readListPrec :: ReadPrec [Ordering] #
Show Ordering |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Ordering -> ShowS # show :: Ordering -> String # showList :: [Ordering] -> ShowS #
Ix Ordering | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Ordering, Ordering) -> [Ordering] # index :: (Ordering, Ordering) -> Ordering -> Int # unsafeIndex :: (Ordering, Ordering) -> Ordering -> Int inRange :: (Ordering, Ordering) -> Ordering -> Bool # rangeSize :: (Ordering, Ordering) -> Int # unsafeRangeSize :: (Ordering, Ordering) -> Int
Generic Ordering |
Instance details Defined in GHC.Generics Associated Types type Rep Ordering :: * -> * # Methods from :: Ordering -> Rep Ordering x # to :: Rep Ordering x -> Ordering #
Semigroup Ordering | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Ordering -> Ordering -> Ordering # sconcat :: NonEmpty Ordering -> Ordering # stimes :: Integral b => b -> Ordering -> Ordering #
Monoid Ordering | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Ordering # mappend :: Ordering -> Ordering -> Ordering # mconcat :: [Ordering] -> Ordering #
type Rep Ordering |
Instance details Defined in GHC.Generics type Rep Ordering = D1 (MetaData "Ordering" "GHC.Types" "ghc-prim" False) (C1 (MetaCons "LT" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "EQ" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "GT" PrefixI False) (U1 :: * -> *)))

data Ratio a #

Rational numbers, with numerator and denominator of some `Integral` type.

Instances

Integral a => Enum (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods succ :: Ratio a -> Ratio a # pred :: Ratio a -> Ratio a # toEnum :: Int -> Ratio a # fromEnum :: Ratio a -> Int # enumFrom :: Ratio a -> [Ratio a] # enumFromThen :: Ratio a -> Ratio a -> [Ratio a] # enumFromTo :: Ratio a -> Ratio a -> [Ratio a] # enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] #
Eq a => Eq (Ratio a) |
Instance details Defined in GHC.Real Methods (==) :: Ratio a -> Ratio a -> Bool # (/=) :: Ratio a -> Ratio a -> Bool #
Integral a => Fractional (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (/) :: Ratio a -> Ratio a -> Ratio a # recip :: Ratio a -> Ratio a # fromRational :: Rational -> Ratio a #
(Data a, Integral a) => Data (Ratio a) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ratio a -> c (Ratio a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ratio a) # toConstr :: Ratio a -> Constr # dataTypeOf :: Ratio a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ratio a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ratio a)) # gmapT :: (forall b. Data b => b -> b) -> Ratio a -> Ratio a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ratio a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ratio a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ratio a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ratio a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ratio a -> m (Ratio a) #
Integral a => Num (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (+) :: Ratio a -> Ratio a -> Ratio a # (-) :: Ratio a -> Ratio a -> Ratio a # (*) :: Ratio a -> Ratio a -> Ratio a # negate :: Ratio a -> Ratio a # abs :: Ratio a -> Ratio a # signum :: Ratio a -> Ratio a # fromInteger :: Integer -> Ratio a #
Integral a => Ord (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods compare :: Ratio a -> Ratio a -> Ordering # (<) :: Ratio a -> Ratio a -> Bool # (<=) :: Ratio a -> Ratio a -> Bool # (>) :: Ratio a -> Ratio a -> Bool # (>=) :: Ratio a -> Ratio a -> Bool # max :: Ratio a -> Ratio a -> Ratio a # min :: Ratio a -> Ratio a -> Ratio a #
(Integral a, Read a) => Read (Ratio a) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Ratio a) # readList :: ReadS [Ratio a] # readPrec :: ReadPrec (Ratio a) # readListPrec :: ReadPrec [Ratio a] #
Integral a => Real (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Ratio a -> Rational #
Integral a => RealFrac (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods properFraction :: Integral b => Ratio a -> (b, Ratio a) # truncate :: Integral b => Ratio a -> b # round :: Integral b => Ratio a -> b # ceiling :: Integral b => Ratio a -> b # floor :: Integral b => Ratio a -> b #
Show a => Show (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods showsPrec :: Int -> Ratio a -> ShowS # show :: Ratio a -> String # showList :: [Ratio a] -> ShowS #
(Storable a, Integral a) => Storable (Ratio a) | Since: base-4.8.0.0
Instance details Defined in Foreign.Storable Methods sizeOf :: Ratio a -> Int # alignment :: Ratio a -> Int # peekElemOff :: Ptr (Ratio a) -> Int -> IO (Ratio a) # pokeElemOff :: Ptr (Ratio a) -> Int -> Ratio a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Ratio a) # pokeByteOff :: Ptr b -> Int -> Ratio a -> IO () # peek :: Ptr (Ratio a) -> IO (Ratio a) # poke :: Ptr (Ratio a) -> Ratio a -> IO () #

type Rational = Ratio Integer #

Arbitrary-precision rational numbers, represented as a ratio of two `Integer` values. A rational number may be constructed using the `%` operator.

data RealWorld #

`RealWorld` is deeply magical. It is primitive, but it is not unlifted (hence `ptrArg`). We never manipulate values of type `RealWorld`; it's only used in the type system, to parameterise `State#`.

data StablePtr a #

A stable pointer is a reference to a Haskell expression that is guaranteed not to be affected by garbage collection, i.e., it will neither be deallocated nor will the value of the stable pointer itself change during garbage collection (ordinary references may be relocated during garbage collection). Consequently, stable pointers can be passed to foreign code, which can treat it as an opaque reference to a Haskell value.

A value of type `StablePtr a` is a stable pointer to a Haskell expression of type `a`.

Instances

Eq (StablePtr a) | Since: base-2.1
Instance details Defined in GHC.Stable Methods (==) :: StablePtr a -> StablePtr a -> Bool # (/=) :: StablePtr a -> StablePtr a -> Bool #
Storable (StablePtr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: StablePtr a -> Int # alignment :: StablePtr a -> Int # peekElemOff :: Ptr (StablePtr a) -> Int -> IO (StablePtr a) # pokeElemOff :: Ptr (StablePtr a) -> Int -> StablePtr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (StablePtr a) # pokeByteOff :: Ptr b -> Int -> StablePtr a -> IO () # peek :: Ptr (StablePtr a) -> IO (StablePtr a) # poke :: Ptr (StablePtr a) -> StablePtr a -> IO () #

data IO a #

A value of type ``IO` a` is a computation which, when performed, does some I/O before returning a value of type `a`.

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

Monad IO | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b # (>>) :: IO a -> IO b -> IO b # return :: a -> IO a # fail :: String -> IO a #
Functor IO | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
MonadFix IO | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> IO a) -> IO a #
MonadFail IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a # (<*>) :: IO (a -> b) -> IO a -> IO b # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c # (*>) :: IO a -> IO b -> IO b # (<*) :: IO a -> IO b -> IO a #
MonadIO IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a #
Alternative IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a # (<|>) :: IO a -> IO a -> IO a # some :: IO a -> IO [a] # many :: IO a -> IO [a] #
MonadPlus IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a # mplus :: IO a -> IO a -> IO a #
Semigroup a => Semigroup (IO a) | Since: base-4.10.0.0
Instance details Defined in GHC.Base Methods (<>) :: IO a -> IO a -> IO a # sconcat :: NonEmpty (IO a) -> IO a # stimes :: Integral b => b -> IO a -> IO a #
Monoid a => Monoid (IO a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mempty :: IO a # mappend :: IO a -> IO a -> IO a # mconcat :: [IO a] -> IO a #
a ~ () => PrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> IO a
a ~ () => HPrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods hspr :: Handle -> String -> [UPrintf] -> IO a

data Word #

A `Word` is an unsigned integral type, with the same size as `Int`.

Instances

Bounded Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Word # maxBound :: Word #
Enum Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Word -> Word # pred :: Word -> Word # toEnum :: Int -> Word # fromEnum :: Word -> Int # enumFrom :: Word -> [Word] # enumFromThen :: Word -> Word -> [Word] # enumFromTo :: Word -> Word -> [Word] # enumFromThenTo :: Word -> Word -> Word -> [Word] #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool # (/=) :: Word -> Word -> Bool #
Integral Word | Since: base-2.1
Instance details Defined in GHC.Real Methods quot :: Word -> Word -> Word # rem :: Word -> Word -> Word # div :: Word -> Word -> Word # mod :: Word -> Word -> Word # quotRem :: Word -> Word -> (Word, Word) # divMod :: Word -> Word -> (Word, Word) # toInteger :: Word -> Integer #
Data Word | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word # toConstr :: Word -> Constr # dataTypeOf :: Word -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) # gmapT :: (forall b. Data b => b -> b) -> Word -> Word # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word #
Num Word | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word # (-) :: Word -> Word -> Word # (*) :: Word -> Word -> Word # negate :: Word -> Word # abs :: Word -> Word # signum :: Word -> Word # fromInteger :: Integer -> Word #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering # (<) :: Word -> Word -> Bool # (<=) :: Word -> Word -> Bool # (>) :: Word -> Word -> Bool # (>=) :: Word -> Word -> Bool # max :: Word -> Word -> Word # min :: Word -> Word -> Word #
Read Word | Since: base-4.5.0.0
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word # readList :: ReadS [Word] # readPrec :: ReadPrec Word # readListPrec :: ReadPrec [Word] #
Real Word | Since: base-2.1
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational #
Show Word | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
Ix Word | Since: base-4.6.0.0
Instance details Defined in GHC.Arr Methods range :: (Word, Word) -> [Word] # index :: (Word, Word) -> Word -> Int # unsafeIndex :: (Word, Word) -> Word -> Int inRange :: (Word, Word) -> Word -> Bool # rangeSize :: (Word, Word) -> Int # unsafeRangeSize :: (Word, Word) -> Int
PrintfArg Word | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word -> FieldFormatter # parseFormat :: Word -> ModifierParser #
Storable Word | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word -> Int # alignment :: Word -> Int # peekElemOff :: Ptr Word -> Int -> IO Word # pokeElemOff :: Ptr Word -> Int -> Word -> IO () # peekByteOff :: Ptr b -> Int -> IO Word # pokeByteOff :: Ptr b -> Int -> Word -> IO () # peek :: Ptr Word -> IO Word # poke :: Ptr Word -> Word -> IO () #
Bits Word | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # xor :: Word -> Word -> Word # complement :: Word -> Word # shift :: Word -> Int -> Word # rotate :: Word -> Int -> Word # zeroBits :: Word # bit :: Int -> Word # setBit :: Word -> Int -> Word # clearBit :: Word -> Int -> Word # complementBit :: Word -> Int -> Word # testBit :: Word -> Int -> Bool # bitSizeMaybe :: Word -> Maybe Int # bitSize :: Word -> Int # isSigned :: Word -> Bool # shiftL :: Word -> Int -> Word # unsafeShiftL :: Word -> Int -> Word # shiftR :: Word -> Int -> Word # unsafeShiftR :: Word -> Int -> Word # rotateL :: Word -> Int -> Word # rotateR :: Word -> Int -> Word # popCount :: Word -> Int #
FiniteBits Word | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int #
Generic1 (URec Word :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Word) :: k -> * # Methods from1 :: URec Word a -> Rep1 (URec Word) a # to1 :: Rep1 (URec Word) a -> URec Word a #
Functor (URec Word :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Foldable (URec Word :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Word m -> m # foldMap :: Monoid m => (a -> m) -> URec Word a -> m # foldr :: (a -> b -> b) -> b -> URec Word a -> b # foldr' :: (a -> b -> b) -> b -> URec Word a -> b # foldl :: (b -> a -> b) -> b -> URec Word a -> b # foldl' :: (b -> a -> b) -> b -> URec Word a -> b # foldr1 :: (a -> a -> a) -> URec Word a -> a # foldl1 :: (a -> a -> a) -> URec Word a -> a # toList :: URec Word a -> [a] # null :: URec Word a -> Bool # length :: URec Word a -> Int # elem :: Eq a => a -> URec Word a -> Bool # maximum :: Ord a => URec Word a -> a # minimum :: Ord a => URec Word a -> a # sum :: Num a => URec Word a -> a # product :: Num a => URec Word a -> a #
Traversable (URec Word :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) # sequence :: Monad m => URec Word (m a) -> m (URec Word a) #
Eq (URec Word p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool # (/=) :: URec Word p -> URec Word p -> Bool #
Ord (URec Word p) |
Instance details Defined in GHC.Generics Methods compare :: URec Word p -> URec Word p -> Ordering # (<) :: URec Word p -> URec Word p -> Bool # (<=) :: URec Word p -> URec Word p -> Bool # (>) :: URec Word p -> URec Word p -> Bool # (>=) :: URec Word p -> URec Word p -> Bool # max :: URec Word p -> URec Word p -> URec Word p # min :: URec Word p -> URec Word p -> URec Word p #
Show (URec Word p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
Generic (URec Word p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Word p) :: * -> * # Methods from :: URec Word p -> Rep (URec Word p) x # to :: Rep (URec Word p) x -> URec Word p #
data URec Word (p :: k) | Used for marking occurrences of `Word#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Word (p :: k) = UWord { uWord# :: Word# }
type Rep1 (URec Word :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec Word :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UWord :: k -> *)))
type Rep (URec Word p) |
Instance details Defined in GHC.Generics type Rep (URec Word p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UWord :: * -> *)))

data Word8 #

8-bit unsigned integer type

Instances

Bounded Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word8 # maxBound :: Word8 #
Enum Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word8 -> Word8 # pred :: Word8 -> Word8 # toEnum :: Int -> Word8 # fromEnum :: Word8 -> Int # enumFrom :: Word8 -> [Word8] # enumFromThen :: Word8 -> Word8 -> [Word8] # enumFromTo :: Word8 -> Word8 -> [Word8] # enumFromThenTo :: Word8 -> Word8 -> Word8 -> [Word8] #
Eq Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word8 -> Word8 -> Bool # (/=) :: Word8 -> Word8 -> Bool #
Integral Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word8 -> Word8 -> Word8 # rem :: Word8 -> Word8 -> Word8 # div :: Word8 -> Word8 -> Word8 # mod :: Word8 -> Word8 -> Word8 # quotRem :: Word8 -> Word8 -> (Word8, Word8) # divMod :: Word8 -> Word8 -> (Word8, Word8) # toInteger :: Word8 -> Integer #
Data Word8 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word8 -> c Word8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word8 # toConstr :: Word8 -> Constr # dataTypeOf :: Word8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word8) # gmapT :: (forall b. Data b => b -> b) -> Word8 -> Word8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 #
Num Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word8 -> Word8 -> Word8 # (-) :: Word8 -> Word8 -> Word8 # (*) :: Word8 -> Word8 -> Word8 # negate :: Word8 -> Word8 # abs :: Word8 -> Word8 # signum :: Word8 -> Word8 # fromInteger :: Integer -> Word8 #
Ord Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word8 -> Word8 -> Ordering # (<) :: Word8 -> Word8 -> Bool # (<=) :: Word8 -> Word8 -> Bool # (>) :: Word8 -> Word8 -> Bool # (>=) :: Word8 -> Word8 -> Bool # max :: Word8 -> Word8 -> Word8 # min :: Word8 -> Word8 -> Word8 #
Read Word8 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word8 # readList :: ReadS [Word8] # readPrec :: ReadPrec Word8 # readListPrec :: ReadPrec [Word8] #
Real Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word8 -> Rational #
Show Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word8 -> ShowS # show :: Word8 -> String # showList :: [Word8] -> ShowS #
Ix Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word8, Word8) -> [Word8] # index :: (Word8, Word8) -> Word8 -> Int # unsafeIndex :: (Word8, Word8) -> Word8 -> Int inRange :: (Word8, Word8) -> Word8 -> Bool # rangeSize :: (Word8, Word8) -> Int # unsafeRangeSize :: (Word8, Word8) -> Int
PrintfArg Word8 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word8 -> FieldFormatter # parseFormat :: Word8 -> ModifierParser #
Storable Word8 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word8 -> Int # alignment :: Word8 -> Int # peekElemOff :: Ptr Word8 -> Int -> IO Word8 # pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word8 # pokeByteOff :: Ptr b -> Int -> Word8 -> IO () # peek :: Ptr Word8 -> IO Word8 # poke :: Ptr Word8 -> Word8 -> IO () #
Bits Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word8 -> Word8 -> Word8 # (.|.) :: Word8 -> Word8 -> Word8 # xor :: Word8 -> Word8 -> Word8 # complement :: Word8 -> Word8 # shift :: Word8 -> Int -> Word8 # rotate :: Word8 -> Int -> Word8 # zeroBits :: Word8 # bit :: Int -> Word8 # setBit :: Word8 -> Int -> Word8 # clearBit :: Word8 -> Int -> Word8 # complementBit :: Word8 -> Int -> Word8 # testBit :: Word8 -> Int -> Bool # bitSizeMaybe :: Word8 -> Maybe Int # bitSize :: Word8 -> Int # isSigned :: Word8 -> Bool # shiftL :: Word8 -> Int -> Word8 # unsafeShiftL :: Word8 -> Int -> Word8 # shiftR :: Word8 -> Int -> Word8 # unsafeShiftR :: Word8 -> Int -> Word8 # rotateL :: Word8 -> Int -> Word8 # rotateR :: Word8 -> Int -> Word8 # popCount :: Word8 -> Int #
FiniteBits Word8 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word8 -> Int # countLeadingZeros :: Word8 -> Int # countTrailingZeros :: Word8 -> Int #

data Word16 #

16-bit unsigned integer type

Instances

Bounded Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word16 # maxBound :: Word16 #
Enum Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word16 -> Word16 # pred :: Word16 -> Word16 # toEnum :: Int -> Word16 # fromEnum :: Word16 -> Int # enumFrom :: Word16 -> [Word16] # enumFromThen :: Word16 -> Word16 -> [Word16] # enumFromTo :: Word16 -> Word16 -> [Word16] # enumFromThenTo :: Word16 -> Word16 -> Word16 -> [Word16] #
Eq Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word16 -> Word16 -> Bool # (/=) :: Word16 -> Word16 -> Bool #
Integral Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word16 -> Word16 -> Word16 # rem :: Word16 -> Word16 -> Word16 # div :: Word16 -> Word16 -> Word16 # mod :: Word16 -> Word16 -> Word16 # quotRem :: Word16 -> Word16 -> (Word16, Word16) # divMod :: Word16 -> Word16 -> (Word16, Word16) # toInteger :: Word16 -> Integer #
Data Word16 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word16 -> c Word16 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word16 # toConstr :: Word16 -> Constr # dataTypeOf :: Word16 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word16) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word16) # gmapT :: (forall b. Data b => b -> b) -> Word16 -> Word16 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word16 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word16 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word16 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word16 -> m Word16 #
Num Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word16 -> Word16 -> Word16 # (-) :: Word16 -> Word16 -> Word16 # (*) :: Word16 -> Word16 -> Word16 # negate :: Word16 -> Word16 # abs :: Word16 -> Word16 # signum :: Word16 -> Word16 # fromInteger :: Integer -> Word16 #
Ord Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word16 -> Word16 -> Ordering # (<) :: Word16 -> Word16 -> Bool # (<=) :: Word16 -> Word16 -> Bool # (>) :: Word16 -> Word16 -> Bool # (>=) :: Word16 -> Word16 -> Bool # max :: Word16 -> Word16 -> Word16 # min :: Word16 -> Word16 -> Word16 #
Read Word16 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word16 # readList :: ReadS [Word16] # readPrec :: ReadPrec Word16 # readListPrec :: ReadPrec [Word16] #
Real Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word16 -> Rational #
Show Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word16 -> ShowS # show :: Word16 -> String # showList :: [Word16] -> ShowS #
Ix Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word16, Word16) -> [Word16] # index :: (Word16, Word16) -> Word16 -> Int # unsafeIndex :: (Word16, Word16) -> Word16 -> Int inRange :: (Word16, Word16) -> Word16 -> Bool # rangeSize :: (Word16, Word16) -> Int # unsafeRangeSize :: (Word16, Word16) -> Int
PrintfArg Word16 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word16 -> FieldFormatter # parseFormat :: Word16 -> ModifierParser #
Storable Word16 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word16 -> Int # alignment :: Word16 -> Int # peekElemOff :: Ptr Word16 -> Int -> IO Word16 # pokeElemOff :: Ptr Word16 -> Int -> Word16 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word16 # pokeByteOff :: Ptr b -> Int -> Word16 -> IO () # peek :: Ptr Word16 -> IO Word16 # poke :: Ptr Word16 -> Word16 -> IO () #
Bits Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word16 -> Word16 -> Word16 # (.|.) :: Word16 -> Word16 -> Word16 # xor :: Word16 -> Word16 -> Word16 # complement :: Word16 -> Word16 # shift :: Word16 -> Int -> Word16 # rotate :: Word16 -> Int -> Word16 # zeroBits :: Word16 # bit :: Int -> Word16 # setBit :: Word16 -> Int -> Word16 # clearBit :: Word16 -> Int -> Word16 # complementBit :: Word16 -> Int -> Word16 # testBit :: Word16 -> Int -> Bool # bitSizeMaybe :: Word16 -> Maybe Int # bitSize :: Word16 -> Int # isSigned :: Word16 -> Bool # shiftL :: Word16 -> Int -> Word16 # unsafeShiftL :: Word16 -> Int -> Word16 # shiftR :: Word16 -> Int -> Word16 # unsafeShiftR :: Word16 -> Int -> Word16 # rotateL :: Word16 -> Int -> Word16 # rotateR :: Word16 -> Int -> Word16 # popCount :: Word16 -> Int #
FiniteBits Word16 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word16 -> Int # countLeadingZeros :: Word16 -> Int # countTrailingZeros :: Word16 -> Int #

data Word32 #

32-bit unsigned integer type

Instances

Bounded Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word32 # maxBound :: Word32 #
Enum Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word32 -> Word32 # pred :: Word32 -> Word32 # toEnum :: Int -> Word32 # fromEnum :: Word32 -> Int # enumFrom :: Word32 -> [Word32] # enumFromThen :: Word32 -> Word32 -> [Word32] # enumFromTo :: Word32 -> Word32 -> [Word32] # enumFromThenTo :: Word32 -> Word32 -> Word32 -> [Word32] #
Eq Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word32 -> Word32 -> Bool # (/=) :: Word32 -> Word32 -> Bool #
Integral Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word32 -> Word32 -> Word32 # rem :: Word32 -> Word32 -> Word32 # div :: Word32 -> Word32 -> Word32 # mod :: Word32 -> Word32 -> Word32 # quotRem :: Word32 -> Word32 -> (Word32, Word32) # divMod :: Word32 -> Word32 -> (Word32, Word32) # toInteger :: Word32 -> Integer #
Data Word32 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word32 -> c Word32 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word32 # toConstr :: Word32 -> Constr # dataTypeOf :: Word32 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word32) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word32) # gmapT :: (forall b. Data b => b -> b) -> Word32 -> Word32 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word32 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word32 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word32 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word32 -> m Word32 #
Num Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word32 -> Word32 -> Word32 # (-) :: Word32 -> Word32 -> Word32 # (*) :: Word32 -> Word32 -> Word32 # negate :: Word32 -> Word32 # abs :: Word32 -> Word32 # signum :: Word32 -> Word32 # fromInteger :: Integer -> Word32 #
Ord Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word32 -> Word32 -> Ordering # (<) :: Word32 -> Word32 -> Bool # (<=) :: Word32 -> Word32 -> Bool # (>) :: Word32 -> Word32 -> Bool # (>=) :: Word32 -> Word32 -> Bool # max :: Word32 -> Word32 -> Word32 # min :: Word32 -> Word32 -> Word32 #
Read Word32 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word32 # readList :: ReadS [Word32] # readPrec :: ReadPrec Word32 # readListPrec :: ReadPrec [Word32] #
Real Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word32 -> Rational #
Show Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word32 -> ShowS # show :: Word32 -> String # showList :: [Word32] -> ShowS #
Ix Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word32, Word32) -> [Word32] # index :: (Word32, Word32) -> Word32 -> Int # unsafeIndex :: (Word32, Word32) -> Word32 -> Int inRange :: (Word32, Word32) -> Word32 -> Bool # rangeSize :: (Word32, Word32) -> Int # unsafeRangeSize :: (Word32, Word32) -> Int
PrintfArg Word32 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word32 -> FieldFormatter # parseFormat :: Word32 -> ModifierParser #
Storable Word32 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word32 -> Int # alignment :: Word32 -> Int # peekElemOff :: Ptr Word32 -> Int -> IO Word32 # pokeElemOff :: Ptr Word32 -> Int -> Word32 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word32 # pokeByteOff :: Ptr b -> Int -> Word32 -> IO () # peek :: Ptr Word32 -> IO Word32 # poke :: Ptr Word32 -> Word32 -> IO () #
Bits Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word32 -> Word32 -> Word32 # (.|.) :: Word32 -> Word32 -> Word32 # xor :: Word32 -> Word32 -> Word32 # complement :: Word32 -> Word32 # shift :: Word32 -> Int -> Word32 # rotate :: Word32 -> Int -> Word32 # zeroBits :: Word32 # bit :: Int -> Word32 # setBit :: Word32 -> Int -> Word32 # clearBit :: Word32 -> Int -> Word32 # complementBit :: Word32 -> Int -> Word32 # testBit :: Word32 -> Int -> Bool # bitSizeMaybe :: Word32 -> Maybe Int # bitSize :: Word32 -> Int # isSigned :: Word32 -> Bool # shiftL :: Word32 -> Int -> Word32 # unsafeShiftL :: Word32 -> Int -> Word32 # shiftR :: Word32 -> Int -> Word32 # unsafeShiftR :: Word32 -> Int -> Word32 # rotateL :: Word32 -> Int -> Word32 # rotateR :: Word32 -> Int -> Word32 # popCount :: Word32 -> Int #
FiniteBits Word32 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word32 -> Int # countLeadingZeros :: Word32 -> Int # countTrailingZeros :: Word32 -> Int #

data Word64 #

64-bit unsigned integer type

Instances

Bounded Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word64 # maxBound :: Word64 #
Enum Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word64 -> Word64 # pred :: Word64 -> Word64 # toEnum :: Int -> Word64 # fromEnum :: Word64 -> Int # enumFrom :: Word64 -> [Word64] # enumFromThen :: Word64 -> Word64 -> [Word64] # enumFromTo :: Word64 -> Word64 -> [Word64] # enumFromThenTo :: Word64 -> Word64 -> Word64 -> [Word64] #
Eq Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word64 -> Word64 -> Bool # (/=) :: Word64 -> Word64 -> Bool #
Integral Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word64 -> Word64 -> Word64 # rem :: Word64 -> Word64 -> Word64 # div :: Word64 -> Word64 -> Word64 # mod :: Word64 -> Word64 -> Word64 # quotRem :: Word64 -> Word64 -> (Word64, Word64) # divMod :: Word64 -> Word64 -> (Word64, Word64) # toInteger :: Word64 -> Integer #
Data Word64 | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word64 -> c Word64 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word64 # toConstr :: Word64 -> Constr # dataTypeOf :: Word64 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word64) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word64) # gmapT :: (forall b. Data b => b -> b) -> Word64 -> Word64 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word64 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word64 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word64 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word64 -> m Word64 #
Num Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word64 -> Word64 -> Word64 # (-) :: Word64 -> Word64 -> Word64 # (*) :: Word64 -> Word64 -> Word64 # negate :: Word64 -> Word64 # abs :: Word64 -> Word64 # signum :: Word64 -> Word64 # fromInteger :: Integer -> Word64 #
Ord Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word64 -> Word64 -> Ordering # (<) :: Word64 -> Word64 -> Bool # (<=) :: Word64 -> Word64 -> Bool # (>) :: Word64 -> Word64 -> Bool # (>=) :: Word64 -> Word64 -> Bool # max :: Word64 -> Word64 -> Word64 # min :: Word64 -> Word64 -> Word64 #
Read Word64 | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word64 # readList :: ReadS [Word64] # readPrec :: ReadPrec Word64 # readListPrec :: ReadPrec [Word64] #
Real Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word64 -> Rational #
Show Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word64 -> ShowS # show :: Word64 -> String # showList :: [Word64] -> ShowS #
Ix Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods range :: (Word64, Word64) -> [Word64] # index :: (Word64, Word64) -> Word64 -> Int # unsafeIndex :: (Word64, Word64) -> Word64 -> Int inRange :: (Word64, Word64) -> Word64 -> Bool # rangeSize :: (Word64, Word64) -> Int # unsafeRangeSize :: (Word64, Word64) -> Int
PrintfArg Word64 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word64 -> FieldFormatter # parseFormat :: Word64 -> ModifierParser #
Storable Word64 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word64 -> Int # alignment :: Word64 -> Int # peekElemOff :: Ptr Word64 -> Int -> IO Word64 # pokeElemOff :: Ptr Word64 -> Int -> Word64 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word64 # pokeByteOff :: Ptr b -> Int -> Word64 -> IO () # peek :: Ptr Word64 -> IO Word64 # poke :: Ptr Word64 -> Word64 -> IO () #
Bits Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word64 -> Word64 -> Word64 # (.|.) :: Word64 -> Word64 -> Word64 # xor :: Word64 -> Word64 -> Word64 # complement :: Word64 -> Word64 # shift :: Word64 -> Int -> Word64 # rotate :: Word64 -> Int -> Word64 # zeroBits :: Word64 # bit :: Int -> Word64 # setBit :: Word64 -> Int -> Word64 # clearBit :: Word64 -> Int -> Word64 # complementBit :: Word64 -> Int -> Word64 # testBit :: Word64 -> Int -> Bool # bitSizeMaybe :: Word64 -> Maybe Int # bitSize :: Word64 -> Int # isSigned :: Word64 -> Bool # shiftL :: Word64 -> Int -> Word64 # unsafeShiftL :: Word64 -> Int -> Word64 # shiftR :: Word64 -> Int -> Word64 # unsafeShiftR :: Word64 -> Int -> Word64 # rotateL :: Word64 -> Int -> Word64 # rotateR :: Word64 -> Int -> Word64 # popCount :: Word64 -> Int #
FiniteBits Word64 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word64 -> Int # countLeadingZeros :: Word64 -> Int # countTrailingZeros :: Word64 -> Int #

data Ptr a #

A value of type ``Ptr` a` represents a pointer to an object, or an array of objects, which may be marshalled to or from Haskell values of type `a`.

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

Generic1 (URec (Ptr ()) :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec (Ptr ())) :: k -> * # Methods from1 :: URec (Ptr ()) a -> Rep1 (URec (Ptr ())) a # to1 :: Rep1 (URec (Ptr ())) a -> URec (Ptr ()) a #
Eq (Ptr a) |
Instance details Defined in GHC.Ptr Methods (==) :: Ptr a -> Ptr a -> Bool # (/=) :: Ptr a -> Ptr a -> Bool #
Data a => Data (Ptr a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ptr a -> c (Ptr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ptr a) # toConstr :: Ptr a -> Constr # dataTypeOf :: Ptr a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ptr a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ptr a)) # gmapT :: (forall b. Data b => b -> b) -> Ptr a -> Ptr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ptr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ptr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) #
Ord (Ptr a) |
Instance details Defined in GHC.Ptr Methods compare :: Ptr a -> Ptr a -> Ordering # (<) :: Ptr a -> Ptr a -> Bool # (<=) :: Ptr a -> Ptr a -> Bool # (>) :: Ptr a -> Ptr a -> Bool # (>=) :: Ptr a -> Ptr a -> Bool # max :: Ptr a -> Ptr a -> Ptr a # min :: Ptr a -> Ptr a -> Ptr a #
Show (Ptr a) | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> Ptr a -> ShowS # show :: Ptr a -> String # showList :: [Ptr a] -> ShowS #
Storable (Ptr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Ptr a -> Int # alignment :: Ptr a -> Int # peekElemOff :: Ptr (Ptr a) -> Int -> IO (Ptr a) # pokeElemOff :: Ptr (Ptr a) -> Int -> Ptr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Ptr a) # pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () # peek :: Ptr (Ptr a) -> IO (Ptr a) # poke :: Ptr (Ptr a) -> Ptr a -> IO () #
Functor (URec (Ptr ()) :: * -> *) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b # (<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #
Foldable (URec (Ptr ()) :: * -> *) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec (Ptr ()) m -> m # foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m # foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # toList :: URec (Ptr ()) a -> [a] # null :: URec (Ptr ()) a -> Bool # length :: URec (Ptr ()) a -> Int # elem :: Eq a => a -> URec (Ptr ()) a -> Bool # maximum :: Ord a => URec (Ptr ()) a -> a # minimum :: Ord a => URec (Ptr ()) a -> a # sum :: Num a => URec (Ptr ()) a -> a # product :: Num a => URec (Ptr ()) a -> a #
Traversable (URec (Ptr ()) :: * -> *) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec (Ptr ()) a -> f (URec (Ptr ()) b) # sequenceA :: Applicative f => URec (Ptr ()) (f a) -> f (URec (Ptr ()) a) # mapM :: Monad m => (a -> m b) -> URec (Ptr ()) a -> m (URec (Ptr ()) b) # sequence :: Monad m => URec (Ptr ()) (m a) -> m (URec (Ptr ()) a) #
Eq (URec (Ptr ()) p) |
Instance details Defined in GHC.Generics Methods (==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #
Ord (URec (Ptr ()) p) |
Instance details Defined in GHC.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 #
Generic (URec (Ptr ()) p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec (Ptr ()) p) :: * -> * # Methods from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x # to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #
data URec (Ptr ()) (p :: k) | Used for marking occurrences of `Addr#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# }
type Rep1 (URec (Ptr ()) :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (URec (Ptr ()) :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UAddr" PrefixI True) (S1 (MetaSel (Just "uAddr#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UAddr :: k -> *)))
type Rep (URec (Ptr ()) p) |
Instance details Defined in GHC.Generics type Rep (URec (Ptr ()) p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UAddr" PrefixI True) (S1 (MetaSel (Just "uAddr#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UAddr :: * -> *)))

data FunPtr a #

A value of type ``FunPtr` a` is a pointer to a function callable from foreign code. The type `a` 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`, ``StablePtr` a` or a renaming of any of these using `newtype`.
- the return type is either a marshallable foreign type or has the form ``IO` t` where `t` is a marshallable foreign type or `()`.

A value of type ``FunPtr` a` may be a pointer to a foreign function, either returned by another foreign function or imported with a a static address import like

    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

Eq (FunPtr a) |
Instance details Defined in GHC.Ptr Methods (==) :: FunPtr a -> FunPtr a -> Bool # (/=) :: FunPtr a -> FunPtr a -> Bool #
Ord (FunPtr a) |
Instance details Defined in GHC.Ptr Methods compare :: FunPtr a -> FunPtr a -> Ordering # (<) :: FunPtr a -> FunPtr a -> Bool # (<=) :: FunPtr a -> FunPtr a -> Bool # (>) :: FunPtr a -> FunPtr a -> Bool # (>=) :: FunPtr a -> FunPtr a -> Bool # max :: FunPtr a -> FunPtr a -> FunPtr a # min :: FunPtr a -> FunPtr a -> FunPtr a #
Show (FunPtr a) | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> FunPtr a -> ShowS # show :: FunPtr a -> String # showList :: [FunPtr a] -> ShowS #
Storable (FunPtr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: FunPtr a -> Int # alignment :: FunPtr a -> Int # peekElemOff :: Ptr (FunPtr a) -> Int -> IO (FunPtr a) # pokeElemOff :: Ptr (FunPtr a) -> Int -> FunPtr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (FunPtr a) # pokeByteOff :: Ptr b -> Int -> FunPtr a -> IO () # peek :: Ptr (FunPtr a) -> IO (FunPtr a) # poke :: Ptr (FunPtr a) -> FunPtr a -> IO () #

data Either a b #

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

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

#### Examples

Expand

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

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

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

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

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

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

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

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

    >>> parseMultiple
    Right 3

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

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

    >>> parseMultiple
    Left "parse error"

Constructors

Left a |
Right b |

Instances

Bifunctor Either | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d # first :: (a -> b) -> Either a c -> Either b c # second :: (b -> c) -> Either a b -> Either a c #
Eq2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool #
Ord2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering #
Read2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] #
Show2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS #
Monad (Either e) | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b # (>>) :: Either e a -> Either e b -> Either e b # return :: a -> Either e a # fail :: String -> Either e a #
Functor (Either a) | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
MonadFix (Either e) | Since: base-4.3.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Either e a) -> Either e a #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a # (<*>) :: Either e (a -> b) -> Either e a -> Either e b # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c # (*>) :: Either e a -> Either e b -> Either e b # (<*) :: Either e a -> Either e b -> Either e a #
Foldable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # null :: Either a a0 -> Bool # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # sum :: Num a0 => Either a a0 -> a0 # product :: Num a0 => Either a a0 -> a0 #
Traversable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) # sequence :: Monad m => Either a (m a0) -> m (Either a a0) #
Eq a => Eq1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool #
Ord a => Ord1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering #
Read a => Read1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] #
Show a => Show1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS #
Generic1 (Either a :: * -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (Either a) :: k -> * # Methods from1 :: Either a a0 -> Rep1 (Either a) a0 # to1 :: Rep1 (Either a) a0 -> Either a a0 #
(Eq a, Eq b) => Eq (Either a b) |
Instance details Defined in Data.Either Methods (==) :: Either a b -> Either a b -> Bool # (/=) :: Either a b -> Either a b -> Bool #
(Data a, Data b) => Data (Either a b) | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Either a b -> c (Either a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) # toConstr :: Either a b -> Constr # dataTypeOf :: Either a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) #
(Ord a, Ord b) => Ord (Either a b) |
Instance details Defined in Data.Either Methods compare :: Either a b -> Either a b -> Ordering # (<) :: Either a b -> Either a b -> Bool # (<=) :: Either a b -> Either a b -> Bool # (>) :: Either a b -> Either a b -> Bool # (>=) :: Either a b -> Either a b -> Bool # max :: Either a b -> Either a b -> Either a b # min :: Either a b -> Either a b -> Either a b #
(Read a, Read b) => Read (Either a b) |
Instance details Defined in Data.Either Methods readsPrec :: Int -> ReadS (Either a b) # readList :: ReadS [Either a b] # readPrec :: ReadPrec (Either a b) # readListPrec :: ReadPrec [Either a b] #
(Show a, Show b) => Show (Either a b) |
Instance details Defined in Data.Either Methods showsPrec :: Int -> Either a b -> ShowS # show :: Either a b -> String # showList :: [Either a b] -> ShowS #
Generic (Either a b) |
Instance details Defined in GHC.Generics Associated Types type Rep (Either a b) :: * -> * # Methods from :: Either a b -> Rep (Either a b) x # to :: Rep (Either a b) x -> Either a b #
Semigroup (Either a b) | Since: base-4.9.0.0
Instance details Defined in Data.Either Methods (<>) :: Either a b -> Either a b -> Either a b # sconcat :: NonEmpty (Either a b) -> Either a b # stimes :: Integral b0 => b0 -> Either a b -> Either a b #
type Rep1 (Either a :: * -> *) |
Instance details Defined in GHC.Generics type Rep1 (Either a :: * -> *) = D1 (MetaData "Either" "Data.Either" "base" False) (C1 (MetaCons "Left" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :+: C1 (MetaCons "Right" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Either a b) |
Instance details Defined in GHC.Generics type Rep (Either a b) = D1 (MetaData "Either" "Data.Either" "base" False) (C1 (MetaCons "Left" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :+: C1 (MetaCons "Right" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 b)))

class a ~R# b => Coercible (a :: k0) (b :: k0) #

`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-4.7.0.0

data TyCon #

Instances

Eq TyCon |
Instance details Defined in GHC.Classes Methods (==) :: TyCon -> TyCon -> Bool # (/=) :: TyCon -> TyCon -> Bool #
Ord TyCon |
Instance details Defined in GHC.Classes Methods compare :: TyCon -> TyCon -> Ordering # (<) :: TyCon -> TyCon -> Bool # (<=) :: TyCon -> TyCon -> Bool # (>) :: TyCon -> TyCon -> Bool # (>=) :: TyCon -> TyCon -> Bool # max :: TyCon -> TyCon -> TyCon # min :: TyCon -> TyCon -> TyCon #
Show TyCon | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TyCon -> ShowS # show :: TyCon -> String # showList :: [TyCon] -> ShowS #

untangle :: Addr# -> String -> String #

ioException :: IOException -> IO a #

heapOverflow :: SomeException #

stackOverflow :: SomeException #

cannotCompactMutable :: SomeException #

cannotCompactPinned :: SomeException #

cannotCompactFunction :: SomeException #

allocationLimitExceeded :: SomeException #

blockedIndefinitelyOnSTM :: SomeException #

blockedIndefinitelyOnMVar :: SomeException #

unsupportedOperation :: IOError #

phase :: RealFloat a => Complex a -> a #

The phase of a complex number, in the range `(-`pi`, `pi`]`. If the magnitude is zero, then so is the phase.

magnitude :: RealFloat a => Complex a -> a #

The nonnegative magnitude of a complex number.

polar :: RealFloat a => Complex a -> (a, a) #

The function `polar` takes a complex number and returns a (magnitude, phase) pair in canonical form: the magnitude is nonnegative, and the phase in the range `(-`pi`, `pi`]`; if the magnitude is zero, then so is the phase.

cis :: Floating a => a -> Complex a #

``cis` t` is a complex value with magnitude `1` and phase `t` (modulo `2*`pi``).

mkPolar :: Floating a => a -> a -> Complex a #

Form a complex number from polar components of magnitude and phase.

conjugate :: Num a => Complex a -> Complex a #

The conjugate of a complex number.

imagPart :: Complex a -> a #

Extracts the imaginary part of a complex number.

realPart :: Complex a -> a #

Extracts the real part of a complex number.

data Complex a #

Complex numbers are an algebraic type.

For a complex number `z`, ``abs` z` is a number with the magnitude of `z`, but oriented in the positive real direction, whereas ``signum` z` has the phase of `z`, but unit magnitude.

The `Foldable` and `Traversable` instances traverse the real part first.

Constructors

!a :+ !a infix 6 | forms a complex number from its real and imaginary rectangular components.

Instances

Monad Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods (>>=) :: Complex a -> (a -> Complex b) -> Complex b # (>>) :: Complex a -> Complex b -> Complex b # return :: a -> Complex a # fail :: String -> Complex a #
Functor Complex |
Instance details Defined in Data.Complex Methods fmap :: (a -> b) -> Complex a -> Complex b # (<$) :: a -> Complex b -> Complex a #
Applicative Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods pure :: a -> Complex a # (<*>) :: Complex (a -> b) -> Complex a -> Complex b # liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c # (*>) :: Complex a -> Complex b -> Complex b # (<*) :: Complex a -> Complex b -> Complex a #
Foldable Complex |
Instance details Defined in Data.Complex Methods fold :: Monoid m => Complex m -> m # foldMap :: Monoid m => (a -> m) -> Complex a -> m # foldr :: (a -> b -> b) -> b -> Complex a -> b # foldr' :: (a -> b -> b) -> b -> Complex a -> b # foldl :: (b -> a -> b) -> b -> Complex a -> b # foldl' :: (b -> a -> b) -> b -> Complex a -> b # foldr1 :: (a -> a -> a) -> Complex a -> a # foldl1 :: (a -> a -> a) -> Complex a -> a # toList :: Complex a -> [a] # null :: Complex a -> Bool # length :: Complex a -> Int # elem :: Eq a => a -> Complex a -> Bool # maximum :: Ord a => Complex a -> a # minimum :: Ord a => Complex a -> a # sum :: Num a => Complex a -> a # product :: Num a => Complex a -> a #
Traversable Complex |
Instance details Defined in Data.Complex Methods traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) # sequenceA :: Applicative f => Complex (f a) -> f (Complex a) # mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) # sequence :: Monad m => Complex (m a) -> m (Complex a) #
Eq a => Eq (Complex a) |
Instance details Defined in Data.Complex Methods (==) :: Complex a -> Complex a -> Bool # (/=) :: Complex a -> Complex a -> Bool #
RealFloat a => Floating (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods pi :: Complex a # 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 # log1pexp :: Complex a -> Complex a # log1mexp :: Complex a -> Complex a #
RealFloat a => Fractional (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods (/) :: Complex a -> Complex a -> Complex a # recip :: Complex a -> Complex a # fromRational :: Rational -> Complex a #
Data a => Data (Complex a) |
Instance details Defined in Data.Complex Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a) # toConstr :: Complex a -> Constr # dataTypeOf :: Complex a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a)) # gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r # gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #
RealFloat a => Num (Complex a) | Since: base-2.1
Instance details Defined in Data.Complex Methods (+) :: Complex a -> Complex a -> Complex a # (-) :: Complex a -> Complex a -> Complex a # (*) :: Complex a -> Complex a -> Complex a # negate :: Complex a -> Complex a # abs :: Complex a -> Complex a # signum :: Complex a -> Complex a # fromInteger :: Integer -> Complex a #
Read a => Read (Complex a) |
Instance details Defined in Data.Complex Methods readsPrec :: Int -> ReadS (Complex a) # readList :: ReadS [Complex a] # readPrec :: ReadPrec (Complex a) # readListPrec :: ReadPrec [Complex a] #
Show a => Show (Complex a) |
Instance details Defined in Data.Complex Methods showsPrec :: Int -> Complex a -> ShowS # show :: Complex a -> String # showList :: [Complex a] -> ShowS #
Generic (Complex a) |
Instance details Defined in Data.Complex Associated Types type Rep (Complex a) :: * -> * # Methods from :: Complex a -> Rep (Complex a) x # to :: Rep (Complex a) x -> Complex a #
Storable a => Storable (Complex a) | Since: base-4.8.0.0
Instance details Defined in Data.Complex Methods sizeOf :: Complex a -> Int # alignment :: Complex a -> Int # peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a) # pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Complex a) # pokeByteOff :: Ptr b -> Int -> Complex a -> IO () # peek :: Ptr (Complex a) -> IO (Complex a) # poke :: Ptr (Complex a) -> Complex a -> IO () #
Generic1 Complex |
Instance details Defined in Data.Complex Associated Types type Rep1 Complex :: k -> * # Methods from1 :: Complex a -> Rep1 Complex a # to1 :: Rep1 Complex a -> Complex a #
type Rep (Complex a) |
Instance details Defined in Data.Complex type Rep (Complex a) = D1 (MetaData "Complex" "Data.Complex" "base" False) (C1 (MetaCons ":+" (InfixI NotAssociative 6) False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))
type Rep1 Complex |
Instance details Defined in Data.Complex type Rep1 Complex = D1 (MetaData "Complex" "Data.Complex" "base" False) (C1 (MetaCons ":+" (InfixI NotAssociative 6) False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1 :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1))

showFixed :: HasResolution a => Bool -> Fixed a -> String #

First arg is whether to chop off trailing zeros

mod' :: Real a => a -> a -> a #

generalisation of `mod` to any instance of Real

divMod' :: (Real a, Integral b) => a -> a -> (b, a) #

generalisation of `divMod` to any instance of Real

div' :: (Real a, Integral b) => a -> a -> b #

generalisation of `div` to any instance of Real

newtype Fixed a #

The type parameter should be an instance of `HasResolution`.

Constructors

MkFixed Integer | Since: base-4.7.0.0

Instances

Enum (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods succ :: Fixed a -> Fixed a # pred :: Fixed a -> Fixed a # toEnum :: Int -> Fixed a # fromEnum :: Fixed a -> Int # enumFrom :: Fixed a -> [Fixed a] # enumFromThen :: Fixed a -> Fixed a -> [Fixed a] # enumFromTo :: Fixed a -> Fixed a -> [Fixed a] # enumFromThenTo :: Fixed a -> Fixed a -> Fixed a -> [Fixed a] #
Eq (Fixed a) |
Instance details Defined in Data.Fixed Methods (==) :: Fixed a -> Fixed a -> Bool # (/=) :: Fixed a -> Fixed a -> Bool #
HasResolution a => Fractional (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods (/) :: Fixed a -> Fixed a -> Fixed a # recip :: Fixed a -> Fixed a # fromRational :: Rational -> Fixed a #
Typeable a => Data (Fixed a) | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixed a -> c (Fixed a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Fixed a) # toConstr :: Fixed a -> Constr # dataTypeOf :: Fixed a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Fixed a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Fixed a)) # gmapT :: (forall b. Data b => b -> b) -> Fixed a -> Fixed a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixed a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixed a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) #
HasResolution a => Num (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods (+) :: Fixed a -> Fixed a -> Fixed a # (-) :: Fixed a -> Fixed a -> Fixed a # (*) :: Fixed a -> Fixed a -> Fixed a # negate :: Fixed a -> Fixed a # abs :: Fixed a -> Fixed a # signum :: Fixed a -> Fixed a # fromInteger :: Integer -> Fixed a #
Ord (Fixed a) |
Instance details Defined in Data.Fixed Methods compare :: Fixed a -> Fixed a -> Ordering # (<) :: Fixed a -> Fixed a -> Bool # (<=) :: Fixed a -> Fixed a -> Bool # (>) :: Fixed a -> Fixed a -> Bool # (>=) :: Fixed a -> Fixed a -> Bool # max :: Fixed a -> Fixed a -> Fixed a # min :: Fixed a -> Fixed a -> Fixed a #
HasResolution a => Read (Fixed a) | Since: base-4.3.0.0
Instance details Defined in Data.Fixed Methods readsPrec :: Int -> ReadS (Fixed a) # readList :: ReadS [Fixed a] # readPrec :: ReadPrec (Fixed a) # readListPrec :: ReadPrec [Fixed a] #
HasResolution a => Real (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods toRational :: Fixed a -> Rational #
HasResolution a => RealFrac (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods properFraction :: Integral b => Fixed a -> (b, Fixed a) # truncate :: Integral b => Fixed a -> b # round :: Integral b => Fixed a -> b # ceiling :: Integral b => Fixed a -> b # floor :: Integral b => Fixed a -> b #
HasResolution a => Show (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods showsPrec :: Int -> Fixed a -> ShowS # show :: Fixed a -> String # showList :: [Fixed a] -> ShowS #

class HasResolution a where #

Minimal complete definition

resolution

Methods

resolution :: p a -> Integer #

Instances

HasResolution E0 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E0 -> Integer #
HasResolution E1 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E1 -> Integer #
HasResolution E2 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E2 -> Integer #
HasResolution E3 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E3 -> Integer #
HasResolution E6 | Since: base-2.1
Instance details Defined in Data.Fixed Methods resolution :: p E6 -> Integer #
HasResolution E9 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E9 -> Integer #
HasResolution E12 | Since: base-2.1
Instance details Defined in Data.Fixed Methods resolution :: p E12 -> Integer #

data E0 #

Instances

HasResolution E0 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E0 -> Integer #

type Uni = Fixed E0 #

resolution of 1, this works the same as Integer

data E1 #

Instances

HasResolution E1 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E1 -> Integer #

type Deci = Fixed E1 #

resolution of 10^-1 = .1

data E2 #

Instances

HasResolution E2 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E2 -> Integer #

type Centi = Fixed E2 #

resolution of 10^-2 = .01, useful for many monetary currencies

data E3 #

Instances

HasResolution E3 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E3 -> Integer #

type Milli = Fixed E3 #

resolution of 10^-3 = .001

data E6 #

Instances

HasResolution E6 | Since: base-2.1
Instance details Defined in Data.Fixed Methods resolution :: p E6 -> Integer #

type Micro = Fixed E6 #

resolution of 10^-6 = .000001

data E9 #

Instances

HasResolution E9 | Since: base-4.1.0.0
Instance details Defined in Data.Fixed Methods resolution :: p E9 -> Integer #

type Nano = Fixed E9 #

resolution of 10^-9 = .000000001

data E12 #

Instances

HasResolution E12 | Since: base-2.1
Instance details Defined in Data.Fixed Methods resolution :: p E12 -> Integer #

type Pico = Fixed E12 #

resolution of 10^-12 = .000000000001

newtype Compose (f :: k -> *) (g :: k1 -> k) (a :: k1) :: forall k k1. (k -> *) -> (k1 -> k) -> k1 -> * infixr 9 #

Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.

Constructors

Compose infixr 9 |
Fields getCompose :: f (g a)

Instances

Functor f => Generic1 (Compose f g :: k -> *) |
Instance details Defined in Data.Functor.Compose Associated Types type Rep1 (Compose f g) :: k -> * # Methods from1 :: Compose f g a -> Rep1 (Compose f g) a # to1 :: Rep1 (Compose f g) a -> Compose f g a #
(Functor f, Functor g) => Functor (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b # (<$) :: a -> Compose f g b -> Compose f g a #
(Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c # (*>) :: Compose f g a -> Compose f g b -> Compose f g b # (<*) :: Compose f g a -> Compose f g b -> Compose f g a #
(Foldable f, Foldable g) => Foldable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fold :: Monoid m => Compose f g m -> m # foldMap :: Monoid m => (a -> m) -> Compose f g a -> m # foldr :: (a -> b -> b) -> b -> Compose f g a -> b # foldr' :: (a -> b -> b) -> b -> Compose f g a -> b # foldl :: (b -> a -> b) -> b -> Compose f g a -> b # foldl' :: (b -> a -> b) -> b -> Compose f g a -> b # foldr1 :: (a -> a -> a) -> Compose f g a -> a # foldl1 :: (a -> a -> a) -> Compose f g a -> a # toList :: Compose f g a -> [a] # null :: Compose f g a -> Bool # length :: Compose f g a -> Int # elem :: Eq a => a -> Compose f g a -> Bool # maximum :: Ord a => Compose f g a -> a # minimum :: Ord a => Compose f g a -> a # sum :: Num a => Compose f g a -> a # product :: Num a => Compose f g a -> a #
(Traversable f, Traversable g) => Traversable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) # sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) # mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) # sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) #
(Eq1 f, Eq1 g) => Eq1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftEq :: (a -> b -> Bool) -> Compose f g a -> Compose f g b -> Bool #
(Ord1 f, Ord1 g) => Ord1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftCompare :: (a -> b -> Ordering) -> Compose f g a -> Compose f g b -> Ordering #
(Read1 f, Read1 g) => Read1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Compose f g a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Compose f g a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Compose f g a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Compose f g a] #
(Show1 f, Show1 g) => Show1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Compose f g a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Compose f g a] -> ShowS #
(Alternative f, Applicative g) => Alternative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods empty :: Compose f g a # (<|>) :: Compose f g a -> Compose f g a -> Compose f g a # some :: Compose f g a -> Compose f g [a] # many :: Compose f g a -> Compose f g [a] #
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods (==) :: Compose f g a -> Compose f g a -> Bool # (/=) :: Compose f g a -> Compose f g a -> Bool #
(Typeable a, Typeable f, Typeable g, Typeable k1, Typeable k2, Data (f (g a))) => Data (Compose f g a) |
Instance details Defined in Data.Functor.Compose Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Compose f g a -> c (Compose f g a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Compose f g a) # toConstr :: Compose f g a -> Constr # dataTypeOf :: Compose f g a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Compose f g a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Compose f g a)) # gmapT :: (forall b. Data b => b -> b) -> Compose f g a -> Compose f g a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r # gmapQ :: (forall d. Data d => d -> u) -> Compose f g a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Compose f g a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) #
(Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods compare :: Compose f g a -> Compose f g a -> Ordering # (<) :: Compose f g a -> Compose f g a -> Bool # (<=) :: Compose f g a -> Compose f g a -> Bool # (>) :: Compose f g a -> Compose f g a -> Bool # (>=) :: Compose f g a -> Compose f g a -> Bool # max :: Compose f g a -> Compose f g a -> Compose f g a # min :: Compose f g a -> Compose f g a -> Compose f g a #
(Read1 f, Read1 g, Read a) => Read (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods readsPrec :: Int -> ReadS (Compose f g a) # readList :: ReadS [Compose f g a] # readPrec :: ReadPrec (Compose f g a) # readListPrec :: ReadPrec [Compose f g a] #
(Show1 f, Show1 g, Show a) => Show (Compose f g a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods showsPrec :: Int -> Compose f g a -> ShowS # show :: Compose f g a -> String # showList :: [Compose f g a] -> ShowS #
Generic (Compose f g a) |
Instance details Defined in Data.Functor.Compose Associated Types type Rep (Compose f g a) :: * -> * # Methods from :: Compose f g a -> Rep (Compose f g a) x # to :: Rep (Compose f g a) x -> Compose f g a #
type Rep1 (Compose f g :: k -> *) |
Instance details Defined in Data.Functor.Compose type Rep1 (Compose f g :: k -> *) = D1 (MetaData "Compose" "Data.Functor.Compose" "base" True) (C1 (MetaCons "Compose" PrefixI True) (S1 (MetaSel (Just "getCompose") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (f :.: Rec1 g)))
type Rep (Compose f g a) |
Instance details Defined in Data.Functor.Compose type Rep (Compose f g a) = D1 (MetaData "Compose" "Data.Functor.Compose" "base" True) (C1 (MetaCons "Compose" PrefixI True) (S1 (MetaSel (Just "getCompose") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (g a)))))

vacuous :: Functor f => f Void -> f a #

If `Void` is uninhabited then any `Functor` that holds only values of type `Void` is holding no values.

Since: base-4.8.0.0

absurd :: Void -> a #

Since `Void` values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet".

    >>> let x :: Either Void Int; x = Right 5
    >>> :{
    case x of
        Right r -> r
        Left l  -> absurd l
    :}
    5

Since: base-4.8.0.0

data Void #

Uninhabited data type

Since: base-4.8.0.0

Instances

Eq Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods (==) :: Void -> Void -> Bool # (/=) :: Void -> Void -> Bool #
Data Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Void -> c Void # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Void # toConstr :: Void -> Constr # dataTypeOf :: Void -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Void) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Void) # gmapT :: (forall b. Data b => b -> b) -> Void -> Void # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQ :: (forall d. Data d => d -> u) -> Void -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Void -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void #
Ord Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods compare :: Void -> Void -> Ordering # (<) :: Void -> Void -> Bool # (<=) :: Void -> Void -> Bool # (>) :: Void -> Void -> Bool # (>=) :: Void -> Void -> Bool # max :: Void -> Void -> Void # min :: Void -> Void -> Void #
Read Void | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors. Since: base-4.8.0.0
Instance details Defined in Data.Void Methods readsPrec :: Int -> ReadS Void # readList :: ReadS [Void] # readPrec :: ReadPrec Void # readListPrec :: ReadPrec [Void] #
Show Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods showsPrec :: Int -> Void -> ShowS # show :: Void -> String # showList :: [Void] -> ShowS #
Ix Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods range :: (Void, Void) -> [Void] # index :: (Void, Void) -> Void -> Int # unsafeIndex :: (Void, Void) -> Void -> Int inRange :: (Void, Void) -> Void -> Bool # rangeSize :: (Void, Void) -> Int # unsafeRangeSize :: (Void, Void) -> Int
Generic Void |
Instance details Defined in Data.Void Associated Types type Rep Void :: * -> * # Methods from :: Void -> Rep Void x # to :: Rep Void x -> Void #
Semigroup Void | Since: base-4.9.0.0
Instance details Defined in Data.Void Methods (<>) :: Void -> Void -> Void # sconcat :: NonEmpty Void -> Void # stimes :: Integral b => b -> Void -> Void #
Exception Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String #
type Rep Void | Since: base-4.8.0.0
Instance details Defined in Data.Void type Rep Void = D1 (MetaData "Void" "Data.Void" "base" False) (V1 :: * -> *)

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

Fold an `Option` case-wise, just like `maybe`.

mtimesDefault :: (Integral b, Monoid a) => b -> a -> a #

Repeat a value `n` times.

    mtimesDefault n a = a <> a <> ... <> a  -- using <> (n-1) times

Implemented using `stimes` and `mempty`.

This is a suitable definition for an `mtimes` member of `Monoid`.

diff :: Semigroup m => m -> Endo m #

This lets you use a difference list of a `Semigroup` as a `Monoid`.

cycle1 :: Semigroup m => m -> m #

A generalization of `cycle` to an arbitrary `Semigroup`. May fail to terminate for some values in some semigroups.

newtype Min a #

Constructors

Min |
Fields getMin :: a

Instances

Monad Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Min a -> (a -> Min b) -> Min b # (>>) :: Min a -> Min b -> Min b # return :: a -> Min a # fail :: String -> Min a #
Functor Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b # (<$) :: a -> Min b -> Min a #
MonadFix Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Min a) -> Min a #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a # (<*>) :: Min (a -> b) -> Min a -> Min b # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c # (*>) :: Min a -> Min b -> Min b # (<*) :: Min a -> Min b -> Min a #
Foldable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Min m -> m # foldMap :: Monoid m => (a -> m) -> Min a -> m # foldr :: (a -> b -> b) -> b -> Min a -> b # foldr' :: (a -> b -> b) -> b -> Min a -> b # foldl :: (b -> a -> b) -> b -> Min a -> b # foldl' :: (b -> a -> b) -> b -> Min a -> b # foldr1 :: (a -> a -> a) -> Min a -> a # foldl1 :: (a -> a -> a) -> Min a -> a # toList :: Min a -> [a] # null :: Min a -> Bool # length :: Min a -> Int # elem :: Eq a => a -> Min a -> Bool # maximum :: Ord a => Min a -> a # minimum :: Ord a => Min a -> a # sum :: Num a => Min a -> a # product :: Num a => Min a -> a #
Traversable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) # sequenceA :: Applicative f => Min (f a) -> f (Min a) # mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) # sequence :: Monad m => Min (m a) -> m (Min a) #
Bounded a => Bounded (Min a) |
Instance details Defined in Data.Semigroup Methods minBound :: Min a # maxBound :: Min a #
Enum a => Enum (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Min a -> Min a # pred :: Min a -> Min a # toEnum :: Int -> Min a # fromEnum :: Min a -> Int # enumFrom :: Min a -> [Min a] # enumFromThen :: Min a -> Min a -> [Min a] # enumFromTo :: Min a -> Min a -> [Min a] # enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] #
Eq a => Eq (Min a) |
Instance details Defined in Data.Semigroup Methods (==) :: Min a -> Min a -> Bool # (/=) :: Min a -> Min a -> Bool #
Data a => Data (Min a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Min a -> c (Min a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Min a) # toConstr :: Min a -> Constr # dataTypeOf :: Min a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Min a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Min a)) # gmapT :: (forall b. Data b => b -> b) -> Min a -> Min a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r # gmapQ :: (forall d. Data d => d -> u) -> Min a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Min a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #
Num a => Num (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Min a -> Min a -> Min a # (-) :: Min a -> Min a -> Min a # (*) :: Min a -> Min a -> Min a # negate :: Min a -> Min a # abs :: Min a -> Min a # signum :: Min a -> Min a # fromInteger :: Integer -> Min a #
Ord a => Ord (Min a) |
Instance details Defined in Data.Semigroup Methods compare :: Min a -> Min a -> Ordering # (<) :: Min a -> Min a -> Bool # (<=) :: Min a -> Min a -> Bool # (>) :: Min a -> Min a -> Bool # (>=) :: Min a -> Min a -> Bool # max :: Min a -> Min a -> Min a # min :: Min a -> Min a -> Min a #
Read a => Read (Min a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Min a) # readList :: ReadS [Min a] # readPrec :: ReadPrec (Min a) # readListPrec :: ReadPrec [Min a] #
Show a => Show (Min a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Min a -> ShowS # show :: Min a -> String # showList :: [Min a] -> ShowS #
Generic (Min a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Min a) :: * -> * # Methods from :: Min a -> Rep (Min a) x # to :: Rep (Min a) x -> Min a #
Ord a => Semigroup (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Min a -> Min a -> Min a # sconcat :: NonEmpty (Min a) -> Min a # stimes :: Integral b => b -> Min a -> Min a #
(Ord a, Bounded a) => Monoid (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Min a # mappend :: Min a -> Min a -> Min a # mconcat :: [Min a] -> Min a #
Generic1 Min |
Instance details Defined in Data.Semigroup Associated Types type Rep1 Min :: k -> * # Methods from1 :: Min a -> Rep1 Min a # to1 :: Rep1 Min a -> Min a #
type Rep (Min a) |
Instance details Defined in Data.Semigroup type Rep (Min a) = D1 (MetaData "Min" "Data.Semigroup" "base" True) (C1 (MetaCons "Min" PrefixI True) (S1 (MetaSel (Just "getMin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Min |
Instance details Defined in Data.Semigroup type Rep1 Min = D1 (MetaData "Min" "Data.Semigroup" "base" True) (C1 (MetaCons "Min" PrefixI True) (S1 (MetaSel (Just "getMin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Max a #

Constructors

Max |
Fields getMax :: a

Instances

Monad Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Max a -> (a -> Max b) -> Max b # (>>) :: Max a -> Max b -> Max b # return :: a -> Max a # fail :: String -> Max a #
Functor Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b # (<$) :: a -> Max b -> Max a #
MonadFix Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Max a) -> Max a #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a # (<*>) :: Max (a -> b) -> Max a -> Max b # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c # (*>) :: Max a -> Max b -> Max b # (<*) :: Max a -> Max b -> Max a #
Foldable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Max m -> m # foldMap :: Monoid m => (a -> m) -> Max a -> m # foldr :: (a -> b -> b) -> b -> Max a -> b # foldr' :: (a -> b -> b) -> b -> Max a -> b # foldl :: (b -> a -> b) -> b -> Max a -> b # foldl' :: (b -> a -> b) -> b -> Max a -> b # foldr1 :: (a -> a -> a) -> Max a -> a # foldl1 :: (a -> a -> a) -> Max a -> a # toList :: Max a -> [a] # null :: Max a -> Bool # length :: Max a -> Int # elem :: Eq a => a -> Max a -> Bool # maximum :: Ord a => Max a -> a # minimum :: Ord a => Max a -> a # sum :: Num a => Max a -> a # product :: Num a => Max a -> a #
Traversable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) # sequenceA :: Applicative f => Max (f a) -> f (Max a) # mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) # sequence :: Monad m => Max (m a) -> m (Max a) #
Bounded a => Bounded (Max a) |
Instance details Defined in Data.Semigroup Methods minBound :: Max a # maxBound :: Max a #
Enum a => Enum (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Max a -> Max a # pred :: Max a -> Max a # toEnum :: Int -> Max a # fromEnum :: Max a -> Int # enumFrom :: Max a -> [Max a] # enumFromThen :: Max a -> Max a -> [Max a] # enumFromTo :: Max a -> Max a -> [Max a] # enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] #
Eq a => Eq (Max a) |
Instance details Defined in Data.Semigroup Methods (==) :: Max a -> Max a -> Bool # (/=) :: Max a -> Max a -> Bool #
Data a => Data (Max a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Max a -> c (Max a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Max a) # toConstr :: Max a -> Constr # dataTypeOf :: Max a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Max a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Max a)) # gmapT :: (forall b. Data b => b -> b) -> Max a -> Max a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r # gmapQ :: (forall d. Data d => d -> u) -> Max a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Max a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #
Num a => Num (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Max a -> Max a -> Max a # (-) :: Max a -> Max a -> Max a # (*) :: Max a -> Max a -> Max a # negate :: Max a -> Max a # abs :: Max a -> Max a # signum :: Max a -> Max a # fromInteger :: Integer -> Max a #
Ord a => Ord (Max a) |
Instance details Defined in Data.Semigroup Methods compare :: Max a -> Max a -> Ordering # (<) :: Max a -> Max a -> Bool # (<=) :: Max a -> Max a -> Bool # (>) :: Max a -> Max a -> Bool # (>=) :: Max a -> Max a -> Bool # max :: Max a -> Max a -> Max a # min :: Max a -> Max a -> Max a #
Read a => Read (Max a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Max a) # readList :: ReadS [Max a] # readPrec :: ReadPrec (Max a) # readListPrec :: ReadPrec [Max a] #
Show a => Show (Max a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Max a -> ShowS # show :: Max a -> String # showList :: [Max a] -> ShowS #
Generic (Max a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Max a) :: * -> * # Methods from :: Max a -> Rep (Max a) x # to :: Rep (Max a) x -> Max a #
Ord a => Semigroup (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Max a -> Max a -> Max a # sconcat :: NonEmpty (Max a) -> Max a # stimes :: Integral b => b -> Max a -> Max a #
(Ord a, Bounded a) => Monoid (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Max a # mappend :: Max a -> Max a -> Max a # mconcat :: [Max a] -> Max a #
Generic1 Max |
Instance details Defined in Data.Semigroup Associated Types type Rep1 Max :: k -> * # Methods from1 :: Max a -> Rep1 Max a # to1 :: Rep1 Max a -> Max a #
type Rep (Max a) |
Instance details Defined in Data.Semigroup type Rep (Max a) = D1 (MetaData "Max" "Data.Semigroup" "base" True) (C1 (MetaCons "Max" PrefixI True) (S1 (MetaSel (Just "getMax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Max |
Instance details Defined in Data.Semigroup type Rep1 Max = D1 (MetaData "Max" "Data.Semigroup" "base" True) (C1 (MetaCons "Max" PrefixI True) (S1 (MetaSel (Just "getMax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

data Arg a b #

`Arg` isn't itself a `Semigroup` in its own right, but it can be placed inside `Min` and `Max` to compute an arg min or arg max.

Constructors

Arg a b |

Instances

Bitraversable Arg | Since: base-4.10.0.0
Instance details Defined in Data.Semigroup Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Arg a b -> f (Arg c d) #
Bifoldable Arg | Since: base-4.10.0.0
Instance details Defined in Data.Semigroup Methods bifold :: Monoid m => Arg m m -> m # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Arg a b -> m # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Arg a b -> c # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Arg a b -> c #
Bifunctor Arg | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d # first :: (a -> b) -> Arg a c -> Arg b c # second :: (b -> c) -> Arg a b -> Arg a c #
Functor (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b # (<$) :: a0 -> Arg a b -> Arg a a0 #
Foldable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Arg a m -> m # foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # toList :: Arg a a0 -> [a0] # null :: Arg a a0 -> Bool # length :: Arg a a0 -> Int # elem :: Eq a0 => a0 -> Arg a a0 -> Bool # maximum :: Ord a0 => Arg a a0 -> a0 # minimum :: Ord a0 => Arg a a0 -> a0 # sum :: Num a0 => Arg a a0 -> a0 # product :: Num a0 => Arg a a0 -> a0 #
Traversable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) # sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) # mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) # sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #
Generic1 (Arg a :: * -> *) |
Instance details Defined in Data.Semigroup Associated Types type Rep1 (Arg a) :: k -> * # Methods from1 :: Arg a a0 -> Rep1 (Arg a) a0 # to1 :: Rep1 (Arg a) a0 -> Arg a a0 #
Eq a => Eq (Arg a b) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (==) :: Arg a b -> Arg a b -> Bool # (/=) :: Arg a b -> Arg a b -> Bool #
(Data a, Data b) => Data (Arg a b) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Arg a b -> c (Arg a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Arg a b) # toConstr :: Arg a b -> Constr # dataTypeOf :: Arg a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Arg a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Arg a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Arg a b -> Arg a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Arg a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Arg a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) #
Ord a => Ord (Arg a b) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Arg a b -> Arg a b -> Ordering # (<) :: Arg a b -> Arg a b -> Bool # (<=) :: Arg a b -> Arg a b -> Bool # (>) :: Arg a b -> Arg a b -> Bool # (>=) :: Arg a b -> Arg a b -> Bool # max :: Arg a b -> Arg a b -> Arg a b # min :: Arg a b -> Arg a b -> Arg a b #
(Read a, Read b) => Read (Arg a b) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Arg a b) # readList :: ReadS [Arg a b] # readPrec :: ReadPrec (Arg a b) # readListPrec :: ReadPrec [Arg a b] #
(Show a, Show b) => Show (Arg a b) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Arg a b -> ShowS # show :: Arg a b -> String # showList :: [Arg a b] -> ShowS #
Generic (Arg a b) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Arg a b) :: * -> * # Methods from :: Arg a b -> Rep (Arg a b) x # to :: Rep (Arg a b) x -> Arg a b #
type Rep1 (Arg a :: * -> *) |
Instance details Defined in Data.Semigroup type Rep1 (Arg a :: * -> *) = D1 (MetaData "Arg" "Data.Semigroup" "base" False) (C1 (MetaCons "Arg" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Arg a b) |
Instance details Defined in Data.Semigroup type Rep (Arg a b) = D1 (MetaData "Arg" "Data.Semigroup" "base" False) (C1 (MetaCons "Arg" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 b)))

type ArgMin a b = Min (Arg a b) #

type ArgMax a b = Max (Arg a b) #

newtype First a #

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

Constructors

First |
Fields getFirst :: a

Instances

Monad First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a # fail :: String -> First a #
Functor First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
MonadFix First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> First a) -> First a #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Foldable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Traversable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) # sequenceA :: Applicative f => First (f a) -> f (First a) # mapM :: Monad m => (a -> m b) -> First a -> m (First b) # sequence :: Monad m => First (m a) -> m (First a) #
Bounded a => Bounded (First a) |
Instance details Defined in Data.Semigroup Methods minBound :: First a # maxBound :: First a #
Enum a => Enum (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: First a -> First a # pred :: First a -> First a # toEnum :: Int -> First a # fromEnum :: First a -> Int # enumFrom :: First a -> [First a] # enumFromThen :: First a -> First a -> [First a] # enumFromTo :: First a -> First a -> [First a] # enumFromThenTo :: First a -> First a -> First a -> [First a] #
Eq a => Eq (First a) |
Instance details Defined in Data.Semigroup Methods (==) :: First a -> First a -> Bool # (/=) :: First a -> First a -> Bool #
Data a => Data (First a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) # toConstr :: First a -> Constr # dataTypeOf :: First a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) # gmapT :: (forall b. Data b => b -> b) -> First a -> First a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r # gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #
Ord a => Ord (First a) |
Instance details Defined in Data.Semigroup Methods compare :: First a -> First a -> Ordering # (<) :: First a -> First a -> Bool # (<=) :: First a -> First a -> Bool # (>) :: First a -> First a -> Bool # (>=) :: First a -> First a -> Bool # max :: First a -> First a -> First a # min :: First a -> First a -> First a #
Read a => Read (First a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (First a) # readList :: ReadS [First a] # readPrec :: ReadPrec (First a) # readListPrec :: ReadPrec [First a] #
Show a => Show (First a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> First a -> ShowS # show :: First a -> String # showList :: [First a] -> ShowS #
Generic (First a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (First a) :: * -> * # Methods from :: First a -> Rep (First a) x # to :: Rep (First a) x -> First a #
Semigroup (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: First a -> First a -> First a # sconcat :: NonEmpty (First a) -> First a # stimes :: Integral b => b -> First a -> First a #
Generic1 First |
Instance details Defined in Data.Semigroup Associated Types type Rep1 First :: k -> * # Methods from1 :: First a -> Rep1 First a # to1 :: Rep1 First a -> First a #
type Rep (First a) |
Instance details Defined in Data.Semigroup type Rep (First a) = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 First |
Instance details Defined in Data.Semigroup type Rep1 First = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Last a #

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

Constructors

Last |
Fields getLast :: a

Instances

Monad Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a # fail :: String -> Last a #
Functor Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
MonadFix Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Last a) -> Last a #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Foldable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Traversable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # sequenceA :: Applicative f => Last (f a) -> f (Last a) # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # sequence :: Monad m => Last (m a) -> m (Last a) #
Bounded a => Bounded (Last a) |
Instance details Defined in Data.Semigroup Methods minBound :: Last a # maxBound :: Last a #
Enum a => Enum (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Last a -> Last a # pred :: Last a -> Last a # toEnum :: Int -> Last a # fromEnum :: Last a -> Int # enumFrom :: Last a -> [Last a] # enumFromThen :: Last a -> Last a -> [Last a] # enumFromTo :: Last a -> Last a -> [Last a] # enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] #
Eq a => Eq (Last a) |
Instance details Defined in Data.Semigroup Methods (==) :: Last a -> Last a -> Bool # (/=) :: Last a -> Last a -> Bool #
Data a => Data (Last a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) # toConstr :: Last a -> Constr # dataTypeOf :: Last a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) # gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r # gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #
Ord a => Ord (Last a) |
Instance details Defined in Data.Semigroup Methods compare :: Last a -> Last a -> Ordering # (<) :: Last a -> Last a -> Bool # (<=) :: Last a -> Last a -> Bool # (>) :: Last a -> Last a -> Bool # (>=) :: Last a -> Last a -> Bool # max :: Last a -> Last a -> Last a # min :: Last a -> Last a -> Last a #
Read a => Read (Last a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Last a) # readList :: ReadS [Last a] # readPrec :: ReadPrec (Last a) # readListPrec :: ReadPrec [Last a] #
Show a => Show (Last a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Last a -> ShowS # show :: Last a -> String # showList :: [Last a] -> ShowS #
Generic (Last a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Last a) :: * -> * # Methods from :: Last a -> Rep (Last a) x # to :: Rep (Last a) x -> Last a #
Semigroup (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Last a -> Last a -> Last a # sconcat :: NonEmpty (Last a) -> Last a # stimes :: Integral b => b -> Last a -> Last a #
Generic1 Last |
Instance details Defined in Data.Semigroup Associated Types type Rep1 Last :: k -> * # Methods from1 :: Last a -> Rep1 Last a # to1 :: Rep1 Last a -> Last a #
type Rep (Last a) |
Instance details Defined in Data.Semigroup type Rep (Last a) = D1 (MetaData "Last" "Data.Semigroup" "base" True) (C1 (MetaCons "Last" PrefixI True) (S1 (MetaSel (Just "getLast") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Last |
Instance details Defined in Data.Semigroup type Rep1 Last = D1 (MetaData "Last" "Data.Semigroup" "base" True) (C1 (MetaCons "Last" PrefixI True) (S1 (MetaSel (Just "getLast") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype WrappedMonoid m #

Provide a Semigroup for an arbitrary Monoid.

NOTE: This is not needed anymore since `Semigroup` became a superclass of `Monoid` in base-4.11 and this newtype be deprecated at some point in the future.

Constructors

WrapMonoid |
Fields unwrapMonoid :: m

Instances

Bounded m => Bounded (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods minBound :: WrappedMonoid m # maxBound :: WrappedMonoid m #
Enum a => Enum (WrappedMonoid a) | Since: base-4.9.0.0
Instance details 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] #
Eq m => Eq (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #
Data m => Data (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonoid m -> c (WrappedMonoid m) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonoid m) # toConstr :: WrappedMonoid m -> Constr # dataTypeOf :: WrappedMonoid m -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonoid m)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonoid m)) # gmapT :: (forall b. Data b => b -> b) -> WrappedMonoid m -> WrappedMonoid m # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r # gmapQ :: (forall d. Data d => d -> u) -> WrappedMonoid m -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonoid m -> u # gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) # gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) # gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #
Ord m => Ord (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #
Read m => Read (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (WrappedMonoid m) # readList :: ReadS [WrappedMonoid m] # readPrec :: ReadPrec (WrappedMonoid m) # readListPrec :: ReadPrec [WrappedMonoid m] #
Show m => Show (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> WrappedMonoid m -> ShowS # show :: WrappedMonoid m -> String # showList :: [WrappedMonoid m] -> ShowS #
Generic (WrappedMonoid m) |
Instance details Defined in Data.Semigroup Associated Types type Rep (WrappedMonoid m) :: * -> * # Methods from :: WrappedMonoid m -> Rep (WrappedMonoid m) x # to :: Rep (WrappedMonoid m) x -> WrappedMonoid m #
Monoid m => Semigroup (WrappedMonoid m) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # sconcat :: NonEmpty (WrappedMonoid m) -> WrappedMonoid m # stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m #
Monoid m => Monoid (WrappedMonoid m) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m #
Generic1 WrappedMonoid |
Instance details Defined in Data.Semigroup Associated Types type Rep1 WrappedMonoid :: k -> * # Methods from1 :: WrappedMonoid a -> Rep1 WrappedMonoid a # to1 :: Rep1 WrappedMonoid a -> WrappedMonoid a #
type Rep (WrappedMonoid m) |
Instance details Defined in Data.Semigroup type Rep (WrappedMonoid m) = D1 (MetaData "WrappedMonoid" "Data.Semigroup" "base" True) (C1 (MetaCons "WrapMonoid" PrefixI True) (S1 (MetaSel (Just "unwrapMonoid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 m)))
type Rep1 WrappedMonoid |
Instance details Defined in Data.Semigroup type Rep1 WrappedMonoid = D1 (MetaData "WrappedMonoid" "Data.Semigroup" "base" True) (C1 (MetaCons "WrapMonoid" PrefixI True) (S1 (MetaSel (Just "unwrapMonoid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Option a #

`Option` is effectively `Maybe` with a better instance of `Monoid`, built off of an underlying `Semigroup` instead of an underlying `Monoid`.

Ideally, this type would not exist at all and we would just fix the `Monoid` instance of `Maybe`

Constructors

Option |
Fields getOption :: Maybe a

Instances

Monad Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Option a -> (a -> Option b) -> Option b # (>>) :: Option a -> Option b -> Option b # return :: a -> Option a # fail :: String -> Option a #
Functor Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Option a -> Option b # (<$) :: a -> Option b -> Option a #
MonadFix Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mfix :: (a -> Option a) -> Option a #
Applicative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Option a # (<*>) :: Option (a -> b) -> Option a -> Option b # liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c # (*>) :: Option a -> Option b -> Option b # (<*) :: Option a -> Option b -> Option a #
Foldable Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Option m -> m # foldMap :: Monoid m => (a -> m) -> Option a -> m # foldr :: (a -> b -> b) -> b -> Option a -> b # foldr' :: (a -> b -> b) -> b -> Option a -> b # foldl :: (b -> a -> b) -> b -> Option a -> b # foldl' :: (b -> a -> b) -> b -> Option a -> b # foldr1 :: (a -> a -> a) -> Option a -> a # foldl1 :: (a -> a -> a) -> Option a -> a # toList :: Option a -> [a] # null :: Option a -> Bool # length :: Option a -> Int # elem :: Eq a => a -> Option a -> Bool # maximum :: Ord a => Option a -> a # minimum :: Ord a => Option a -> a # sum :: Num a => Option a -> a # product :: Num a => Option a -> a #
Traversable Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) # sequenceA :: Applicative f => Option (f a) -> f (Option a) # mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) # sequence :: Monad m => Option (m a) -> m (Option a) #
Alternative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods empty :: Option a # (<|>) :: Option a -> Option a -> Option a # some :: Option a -> Option [a] # many :: Option a -> Option [a] #
MonadPlus Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mzero :: Option a # mplus :: Option a -> Option a -> Option a #
Eq a => Eq (Option a) |
Instance details Defined in Data.Semigroup Methods (==) :: Option a -> Option a -> Bool # (/=) :: Option a -> Option a -> Bool #
Data a => Data (Option a) |
Instance details Defined in Data.Semigroup Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Option a -> c (Option a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Option a) # toConstr :: Option a -> Constr # dataTypeOf :: Option a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Option a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Option a)) # gmapT :: (forall b. Data b => b -> b) -> Option a -> Option a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r # gmapQ :: (forall d. Data d => d -> u) -> Option a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Option a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) #
Ord a => Ord (Option a) |
Instance details Defined in Data.Semigroup Methods compare :: Option a -> Option a -> Ordering # (<) :: Option a -> Option a -> Bool # (<=) :: Option a -> Option a -> Bool # (>) :: Option a -> Option a -> Bool # (>=) :: Option a -> Option a -> Bool # max :: Option a -> Option a -> Option a # min :: Option a -> Option a -> Option a #
Read a => Read (Option a) |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Option a) # readList :: ReadS [Option a] # readPrec :: ReadPrec (Option a) # readListPrec :: ReadPrec [Option a] #
Show a => Show (Option a) |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Option a -> ShowS # show :: Option a -> String # showList :: [Option a] -> ShowS #
Generic (Option a) |
Instance details Defined in Data.Semigroup Associated Types type Rep (Option a) :: * -> * # Methods from :: Option a -> Rep (Option a) x # to :: Rep (Option a) x -> Option a #
Semigroup a => Semigroup (Option a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Option a -> Option a -> Option a # sconcat :: NonEmpty (Option a) -> Option a # stimes :: Integral b => b -> Option a -> Option a #
Semigroup a => Monoid (Option a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Option a # mappend :: Option a -> Option a -> Option a # mconcat :: [Option a] -> Option a #
Generic1 Option |
Instance details Defined in Data.Semigroup Associated Types type Rep1 Option :: k -> * # Methods from1 :: Option a -> Rep1 Option a # to1 :: Rep1 Option a -> Option a #
type Rep (Option a) |
Instance details Defined in Data.Semigroup type Rep (Option a) = D1 (MetaData "Option" "Data.Semigroup" "base" True) (C1 (MetaCons "Option" PrefixI True) (S1 (MetaSel (Just "getOption") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a))))
type Rep1 Option |
Instance details Defined in Data.Semigroup type Rep1 Option = D1 (MetaData "Option" "Data.Semigroup" "base" True) (C1 (MetaCons "Option" PrefixI True) (S1 (MetaSel (Just "getOption") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 Maybe)))

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

The `sortWith` function sorts a list of elements using the user supplied function to project something out of each element

tyconModule :: String -> String #

Gets the module of a type constructor: take *.*.*... before name

tyconUQname :: String -> String #

Gets the unqualified type constructor: drop *.*.*... before name

isNorepType :: DataType -> Bool #

Test for a non-representable type

mkNoRepType :: String -> DataType #

Constructs a non-representation for a non-representable type

mkCharConstr :: DataType -> Char -> Constr #

Makes a constructor for `Char`.

mkRealConstr :: (Real a, Show a) => DataType -> a -> Constr #

mkIntegralConstr :: (Integral a, Show a) => DataType -> a -> Constr #

mkCharType :: String -> DataType #

Constructs the `Char` type

mkFloatType :: String -> DataType #

Constructs the `Float` type

mkIntType :: String -> DataType #

Constructs the `Int` type

maxConstrIndex :: DataType -> ConIndex #

Gets the maximum constructor index of an algebraic datatype

constrIndex :: Constr -> ConIndex #

Gets the index of a constructor (algebraic datatypes only)

indexConstr :: DataType -> ConIndex -> Constr #

Gets the constructor for an index (algebraic datatypes only)

isAlgType :: DataType -> Bool #

Test for an algebraic type

readConstr :: DataType -> String -> Maybe Constr #

Lookup a constructor via a string

showConstr :: Constr -> String #

Gets the string for a constructor

constrFixity :: Constr -> Fixity #

Gets the fixity of a constructor

constrFields :: Constr -> [String] #

Gets the field labels of a constructor. The list of labels is returned in the same order as they were given in the original constructor declaration.

dataTypeConstrs :: DataType -> [Constr] #

Gets the constructors of an algebraic datatype

mkConstr :: DataType -> String -> [String] -> Fixity -> Constr #

Constructs a constructor

mkDataType :: String -> [Constr] -> DataType #

Constructs an algebraic datatype

repConstr :: DataType -> ConstrRep -> Constr #

Look up a constructor by its representation

constrRep :: Constr -> ConstrRep #

Gets the public presentation of constructors

constrType :: Constr -> DataType #

Gets the datatype of a constructor

dataTypeRep :: DataType -> DataRep #

Gets the public presentation of a datatype

dataTypeName :: DataType -> String #

Gets the type constructor including the module

fromConstrM :: (Monad m, Data a) => (forall d. Data d => m d) -> Constr -> m a #

Monadic variation on `fromConstrB`

fromConstrB :: Data a => (forall d. Data d => d) -> Constr -> a #

Build a term and use a generic function for subterms

fromConstr :: Data a => Constr -> a #

Build a term skeleton

data DataType #

Representation of datatypes. A package of constructor representations with names of type and module.

Instances

Show DataType |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataType -> ShowS # show :: DataType -> String # showList :: [DataType] -> ShowS #

data Constr #

Representation of constructors. Note that equality on constructors with different types may not work -- i.e. the constructors for `False` and `Nothing` may compare equal.

Instances

Eq Constr | Equality of constructors Since: base-4.0.0.0
Instance details Defined in Data.Data Methods (==) :: Constr -> Constr -> Bool # (/=) :: Constr -> Constr -> Bool #
Show Constr | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods showsPrec :: Int -> Constr -> ShowS # show :: Constr -> String # showList :: [Constr] -> ShowS #

data DataRep #

Public representation of datatypes

Constructors

AlgRep [Constr] |
IntRep |
FloatRep |
CharRep |
NoRep |

Instances

Eq DataRep |
Instance details Defined in Data.Data Methods (==) :: DataRep -> DataRep -> Bool # (/=) :: DataRep -> DataRep -> Bool #
Show DataRep |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataRep -> ShowS # show :: DataRep -> String # showList :: [DataRep] -> ShowS #

data ConstrRep #

Public representation of constructors

Constructors

AlgConstr ConIndex |
IntConstr Integer |
FloatConstr Rational |
CharConstr Char |

Instances

Eq ConstrRep |
Instance details Defined in Data.Data Methods (==) :: ConstrRep -> ConstrRep -> Bool # (/=) :: ConstrRep -> ConstrRep -> Bool #
Show ConstrRep |
Instance details Defined in Data.Data Methods showsPrec :: Int -> ConstrRep -> ShowS # show :: ConstrRep -> String # showList :: [ConstrRep] -> ShowS #

type ConIndex = Int #

Unique index for datatype constructors, counting from 1 in the order they are given in the program text.

data Fixity #

Fixity of constructors

Constructors

Prefix |
Infix |

Instances

Eq Fixity |
Instance details Defined in Data.Data Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #
Show Fixity |
Instance details Defined in Data.Data Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #

timeout :: Int -> IO a -> IO (Maybe a) #

Wrap an `IO` computation to time out and return `Nothing` in case no result is available within `n` microseconds (`1/10^6` seconds). In case a result is available before the timeout expires, `Just a` is returned. A negative timeout interval means "wait indefinitely". When specifying long timeouts, be careful not to exceed `maxBound :: Int`.

    >>> timeout 1000000 (threadDelay 1000 *> pure "finished on time")
    Just "finished on time"

    >>> timeout 10000 (threadDelay 100000 *> pure "finished on time")
    Nothing

The design of this combinator was guided by the objective that `timeout n f` should behave exactly the same as `f` as long as `f` doesn't time out. This means that `f` has the same `myThreadId` it would have without the timeout wrapper. Any exceptions `f` might throw cancel the timeout and propagate further up. It also possible for `f` to receive exceptions thrown to it by another thread.

A tricky implementation detail is the question of how to abort an `IO` computation. This combinator relies on asynchronous exceptions internally. The technique works very well for computations executing inside of the Haskell runtime system, but it doesn't work at all for non-Haskell code. Foreign function calls, for example, cannot be timed out with this combinator simply because an arbitrary C function cannot receive asynchronous exceptions. When `timeout` is used to wrap an FFI call that blocks, no timeout event can be delivered until the FFI call returns, which pretty much negates the purpose of the combinator. In practice, however, this limitation is less severe than it may sound. Standard I/O functions like `hGetBuf`, `hPutBuf`, Network.Socket.accept, or `hWaitForInput` appear to be blocking, but they really don't because the runtime system uses scheduling mechanisms like `select(2)` to perform asynchronous I/O, so it is possible to interrupt standard socket I/O or file I/O using this combinator.

threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) #

Returns an STM action that can be used to wait until data can be written to a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.

Since: base-4.7.0.0

threadWaitReadSTM :: Fd -> IO (STM (), IO ()) #

Returns an STM action that can be used to wait for data to read from a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.

Since: base-4.7.0.0

threadWaitWrite :: Fd -> IO () #

Block the current thread until data can be written to the given file descriptor (GHC only).

This will throw an `IOError` if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with `threadWaitWrite`, use `closeFdWith`.

threadWaitRead :: Fd -> IO () #

Block the current thread until data is available to read on the given file descriptor (GHC only).

This will throw an `IOError` if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with `threadWaitRead`, use `closeFdWith`.

runInUnboundThread :: IO a -> IO a #

Run the `IO` computation passed as the first argument. If the calling thread is bound, an unbound thread is created temporarily using `forkIO`. `runInBoundThread` doesn't finish until the `IO` computation finishes.

Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need its main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap its `main` action in `runInUnboundThread`.

Note that exceptions which are thrown to the current thread are thrown in turn to the thread that is executing the given computation. This ensures there's always a way of killing the forked thread.

runInBoundThread :: IO a -> IO a #

Run the `IO` computation passed as the first argument. If the calling thread is not bound, a bound thread is created temporarily. `runInBoundThread` doesn't finish until the `IO` computation finishes.

You can wrap a series of foreign function calls that rely on thread-local state with `runInBoundThread` so that you can use them without knowing whether the current thread is bound.

isCurrentThreadBound :: IO Bool #

Returns `True` if the calling thread is bound, that is, if it is safe to use foreign libraries that rely on thread-local state from the calling thread.

forkOSWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId #

Like `forkIOWithUnmask`, but the child thread is a bound thread, as with `forkOS`.

forkOS :: IO () -> IO ThreadId #

Like `forkIO`, this sparks off a new thread to run the `IO` computation passed as the first argument, and returns the `ThreadId` of the newly created thread.

However, `forkOS` creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent).

Using `forkOS` instead of `forkIO` makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use `forkOS` instead of `forkIO` to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the `-threaded` option when linking your program, and to make sure the foreign import is not marked `unsafe`.

forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId #

Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.

    forkFinally action and_then =
      mask $ \restore ->
        forkIO $ try (restore action) >>= and_then

This function is useful for informing the parent when a child terminates, for example.

Since: base-4.6.0.0

rtsSupportsBoundThreads :: Bool #

`True` if bound threads are supported. If `rtsSupportsBoundThreads` is `False`, `isCurrentThreadBound` will always return `False` and both `forkOS` and `runInBoundThread` will fail.

writeList2Chan :: Chan a -> [a] -> IO () #

Write an entire list of items to a `Chan`.

getChanContents :: Chan a -> IO [a] #

Return a lazy list representing the contents of the supplied `Chan`, much like `hGetContents`.

dupChan :: Chan a -> IO (Chan a) #

Duplicate a `Chan`: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, where data written by anyone is seen by everyone else.

(Note that a duplicated channel is not equal to its original. So: `fmap (c /=) $ dupChan c` returns `True` for all `c`.)

readChan :: Chan a -> IO a #

Read the next value from the `Chan`. Blocks when the channel is empty. Since the read end of a channel is an `MVar`, this operation inherits fairness guarantees of `MVar`s (e.g. threads blocked in this operation are woken up in FIFO order).

Throws `BlockedIndefinitelyOnMVar` when the channel is empty and no other thread holds a reference to the channel.

writeChan :: Chan a -> a -> IO () #

Write a value to a `Chan`.

newChan :: IO (Chan a) #

Build and returns a new instance of `Chan`.

data Chan a #

`Chan` is an abstract type representing an unbounded FIFO channel.

Instances

Eq (Chan a) |
Instance details Defined in Control.Concurrent.Chan Methods (==) :: Chan a -> Chan a -> Bool # (/=) :: Chan a -> Chan a -> Bool #

signalQSem :: QSem -> IO () #

Signal that a unit of the `QSem` is available

waitQSem :: QSem -> IO () #

Wait for a unit to become available

newQSem :: Int -> IO QSem #

Build a new `QSem` with a supplied initial quantity. The initial quantity must be at least 0.

data QSem #

`QSem` is a quantity semaphore in which the resource is aqcuired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked `waitQSem` calls.

The pattern

      bracket_ waitQSem signalQSem (...)

is safe; it never loses a unit of the resource.

signalQSemN :: QSemN -> Int -> IO () #

Signal that a given quantity is now available from the `QSemN`.

waitQSemN :: QSemN -> Int -> IO () #

Wait for the specified quantity to become available

newQSemN :: Int -> IO QSemN #

Build a new `QSemN` with a supplied initial quantity. The initial quantity must be at least 0.

data QSemN #

`QSemN` is a quantity semaphore in which the resource is aqcuired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked `waitQSemN` calls.

The pattern

      bracket_ (waitQSemN n) (signalQSemN n) (...)

is safe; it never loses any of the resource.

class Bifunctor (p :: * -> * -> *) where #

A bifunctor is a type constructor that takes two type arguments and is a functor in both arguments. That is, unlike with `Functor`, a type constructor such as `Either` does not need to be partially applied for a `Bifunctor` instance, and the methods in this class permit mapping functions over the `Left` value or the `Right` value, or both at the same time.

Formally, the class `Bifunctor` represents a bifunctor from `Hask` -> `Hask`.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

You can define a `Bifunctor` by either defining `bimap` or by defining both `first` and `second`.

If you supply `bimap`, you should ensure that:

    bimap id id ≡ id

If you supply `first` and `second`, ensure:

    first id ≡ id
    second id ≡ id

If you supply both, you should also ensure:

    bimap f g ≡ first f . second g

These ensure by parametricity:

    bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
    first  (f . g) ≡ first  f . first  g
    second (f . g) ≡ second f . second g

Since: base-4.8.0.0

Minimal complete definition

bimap | first, second

Methods

bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #

Map over both arguments at the same time.

    bimap f g ≡ first f . second g

#### Examples

Expand

    >>> bimap toUpper (+1) ('j', 3)
    ('J',4)

    >>> bimap toUpper (+1) (Left 'j')
    Left 'J'

    >>> bimap toUpper (+1) (Right 3)
    Right 4

first :: (a -> b) -> p a c -> p b c #

Map covariantly over the first argument.

    first f ≡ bimap f id

#### Examples

Expand

    >>> first toUpper ('j', 3)
    ('J',3)

    >>> first toUpper (Left 'j')
    Left 'J'

second :: (b -> c) -> p a b -> p a c #

Map covariantly over the second argument.

    second ≡ bimap id

#### Examples

Expand

    >>> second (+1) ('j', 3)
    ('j',4)

    >>> second (+1) (Right 3)
    Right 4

Instances

Bifunctor Either | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d # first :: (a -> b) -> Either a c -> Either b c # second :: (b -> c) -> Either a b -> Either a c #
Bifunctor (,) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) # first :: (a -> b) -> (a, c) -> (b, c) # second :: (b -> c) -> (a, b) -> (a, c) #
Bifunctor Arg | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d # first :: (a -> b) -> Arg a c -> Arg b c # second :: (b -> c) -> Arg a b -> Arg a c #
Bifunctor ((,,) x1) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) # first :: (a -> b) -> (x1, a, c) -> (x1, b, c) # second :: (b -> c) -> (x1, a, b) -> (x1, a, c) #
Bifunctor (Const :: * -> * -> *) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d # first :: (a -> b) -> Const a c -> Const b c # second :: (b -> c) -> Const a b -> Const a c #
Bifunctor (K1 i :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d # first :: (a -> b) -> K1 i a c -> K1 i b c # second :: (b -> c) -> K1 i a b -> K1 i a c #
Bifunctor ((,,,) x1 x2) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) # first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) # second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) #
Bifunctor ((,,,,) x1 x2 x3) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) # first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) # second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) #
Bifunctor ((,,,,,) x1 x2 x3 x4) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) # first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) # second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) #
Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) # first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) # second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) #

showsBinary1 :: (Show1 f, Show1 g, Show a) => String -> Int -> f a -> g a -> ShowS #

``showsBinary1` n d x y` produces the string representation of a binary data constructor with name `n` and arguments `x` and `y`, in precedence context `d`.

Since: base-4.9.0.0

showsUnary1 :: (Show1 f, Show a) => String -> Int -> f a -> ShowS #

``showsUnary1` n d x` produces the string representation of a unary data constructor with name `n` and argument `x`, in precedence context `d`.

Since: base-4.9.0.0

showsUnary :: Show a => String -> Int -> a -> ShowS #

``showsUnary` n d x` produces the string representation of a unary data constructor with name `n` and argument `x`, in precedence context `d`.

Since: base-4.9.0.0

readsBinary1 :: (Read1 f, Read1 g, Read a) => String -> (f a -> g a -> t) -> String -> ReadS t #

``readsBinary1` n c n'` matches the name of a binary data constructor and then parses its arguments using `readsPrec1`.

Since: base-4.9.0.0

readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS t #

``readsUnary1` n c n'` matches the name of a unary data constructor and then parses its argument using `readsPrec1`.

Since: base-4.9.0.0

readsUnary :: Read a => String -> (a -> t) -> String -> ReadS t #

``readsUnary` n c n'` matches the name of a unary data constructor and then parses its argument using `readsPrec`.

Since: base-4.9.0.0

showsBinaryWith :: (Int -> a -> ShowS) -> (Int -> b -> ShowS) -> String -> Int -> a -> b -> ShowS #

``showsBinaryWith` sp1 sp2 n d x y` produces the string representation of a binary data constructor with name `n` and arguments `x` and `y`, in precedence context `d`.

Since: base-4.9.0.0

showsUnaryWith :: (Int -> a -> ShowS) -> String -> Int -> a -> ShowS #

``showsUnaryWith` sp n d x` produces the string representation of a unary data constructor with name `n` and argument `x`, in precedence context `d`.

Since: base-4.9.0.0

readBinaryWith :: ReadPrec a -> ReadPrec b -> String -> (a -> b -> t) -> ReadPrec t #

``readBinaryWith` rp1 rp2 n c'` matches the name of a binary data constructor and then parses its arguments using `rp1` and `rp2` respectively.

Since: base-4.10.0.0

readsBinaryWith :: (Int -> ReadS a) -> (Int -> ReadS b) -> String -> (a -> b -> t) -> String -> ReadS t #

``readsBinaryWith` rp1 rp2 n c n'` matches the name of a binary data constructor and then parses its arguments using `rp1` and `rp2` respectively.

Since: base-4.9.0.0

readUnaryWith :: ReadPrec a -> String -> (a -> t) -> ReadPrec t #

``readUnaryWith` rp n c'` matches the name of a unary data constructor and then parses its argument using `rp`.

Since: base-4.10.0.0

readsUnaryWith :: (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t #

``readsUnaryWith` rp n c n'` matches the name of a unary data constructor and then parses its argument using `rp`.

Since: base-4.9.0.0

readData :: ReadPrec a -> ReadPrec a #

``readData` p` is a parser for datatypes where each alternative begins with a data constructor. It parses the constructor and passes it to `p`. Parsers for various constructors can be constructed with `readUnaryWith` and `readBinaryWith`, and combined with '(|)' from the `Alternative` class.

Since: base-4.10.0.0

readsData :: (String -> ReadS a) -> Int -> ReadS a #

``readsData` p d` is a parser for datatypes where each alternative begins with a data constructor. It parses the constructor and passes it to `p`. Parsers for various constructors can be constructed with `readsUnary`, `readsUnary1` and `readsBinary1`, and combined with `mappend` from the `Monoid` class.

Since: base-4.9.0.0

showsPrec2 :: (Show2 f, Show a, Show b) => Int -> f a b -> ShowS #

Lift the standard `showsPrec` function through the type constructor.

Since: base-4.9.0.0

liftReadListPrec2Default :: Read2 f => ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [f a b] #

A possible replacement definition for the `liftReadListPrec2` method, defined using `liftReadPrec2`.

Since: base-4.10.0.0

liftReadList2Default :: Read2 f => (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [f a b] #

A possible replacement definition for the `liftReadList2` method. This is only needed for `Read2` instances where `liftReadListPrec2` isn't defined as `liftReadListPrec2Default`.

Since: base-4.10.0.0

readPrec2 :: (Read2 f, Read a, Read b) => ReadPrec (f a b) #

Lift the standard `readPrec` function through the type constructor.

Since: base-4.10.0.0

readsPrec2 :: (Read2 f, Read a, Read b) => Int -> ReadS (f a b) #

Lift the standard `readsPrec` function through the type constructor.

Since: base-4.9.0.0

compare2 :: (Ord2 f, Ord a, Ord b) => f a b -> f a b -> Ordering #

Lift the standard `compare` function through the type constructor.

Since: base-4.9.0.0

eq2 :: (Eq2 f, Eq a, Eq b) => f a b -> f a b -> Bool #

Lift the standard `(`==`)` function through the type constructor.

Since: base-4.9.0.0

showsPrec1 :: (Show1 f, Show a) => Int -> f a -> ShowS #

Lift the standard `showsPrec` and `showList` functions through the type constructor.

Since: base-4.9.0.0

liftReadListPrecDefault :: Read1 f => ReadPrec a -> ReadPrec [a] -> ReadPrec [f a] #

A possible replacement definition for the `liftReadListPrec` method, defined using `liftReadPrec`.

Since: base-4.10.0.0

liftReadListDefault :: Read1 f => (Int -> ReadS a) -> ReadS [a] -> ReadS [f a] #

A possible replacement definition for the `liftReadList` method. This is only needed for `Read1` instances where `liftReadListPrec` isn't defined as `liftReadListPrecDefault`.

Since: base-4.10.0.0

readPrec1 :: (Read1 f, Read a) => ReadPrec (f a) #

Lift the standard `readPrec` and `readListPrec` functions through the type constructor.

Since: base-4.10.0.0

readsPrec1 :: (Read1 f, Read a) => Int -> ReadS (f a) #

Lift the standard `readsPrec` and `readList` functions through the type constructor.

Since: base-4.9.0.0

compare1 :: (Ord1 f, Ord a) => f a -> f a -> Ordering #

Lift the standard `compare` function through the type constructor.

Since: base-4.9.0.0

eq1 :: (Eq1 f, Eq a) => f a -> f a -> Bool #

Lift the standard `(`==`)` function through the type constructor.

Since: base-4.9.0.0

class Eq1 (f :: * -> *) where #

Lifting of the `Eq` class to unary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftEq

Methods

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

Lift an equality test through the type constructor.

The function will usually be applied to an equality function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second.

Since: base-4.9.0.0

Instances

Eq1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> [a] -> [b] -> Bool #
Eq1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #
Eq1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool #
Eq1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool #
Eq a => Eq1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool #
Eq a => Eq1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> (a, a0) -> (a, b) -> Bool #
Eq1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #
Eq a => Eq1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool #
(Eq1 f, Eq1 g) => Eq1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftEq :: (a -> b -> Bool) -> Compose f g a -> Compose f g b -> Bool #

class Eq1 f => Ord1 (f :: * -> *) where #

Lifting of the `Ord` class to unary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftCompare

Methods

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

Lift a `compare` function through the type constructor.

The function will usually be applied to a comparison function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second.

Since: base-4.9.0.0

Instances

Ord1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> [a] -> [b] -> Ordering #
Ord1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #
Ord1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering #
Ord1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering #
Ord a => Ord1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering #
Ord a => Ord1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> (a, a0) -> (a, b) -> Ordering #
Ord1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #
Ord a => Ord1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering #
(Ord1 f, Ord1 g) => Ord1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftCompare :: (a -> b -> Ordering) -> Compose f g a -> Compose f g b -> Ordering #

class Read1 (f :: * -> *) where #

Lifting of the `Read` class to unary type constructors.

Both `liftReadsPrec` and `liftReadPrec` exist to match the interface provided in the `Read` type class, but it is recommended to implement `Read1` instances using `liftReadPrec` as opposed to `liftReadsPrec`, since the former is more efficient than the latter. For example:

    instance Read1 T where
      liftReadPrec     = ...
      liftReadListPrec = liftReadListPrecDefault

For more information, refer to the documentation for the `Read` class.

Since: base-4.9.0.0

Minimal complete definition

liftReadsPrec | liftReadPrec

Methods

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

`readsPrec` function for an application of the type constructor based on `readsPrec` and `readList` functions for the argument type.

Since: base-4.9.0.0

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

`readList` function for an application of the type constructor based on `readsPrec` and `readList` functions for the argument type. The default implementation using standard list syntax is correct for most types.

Since: base-4.9.0.0

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (f a) #

`readPrec` function for an application of the type constructor based on `readPrec` and `readListPrec` functions for the argument type.

Since: base-4.10.0.0

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [f a] #

`readListPrec` function for an application of the type constructor based on `readPrec` and `readListPrec` functions for the argument type.

The default definition uses `liftReadList`. Instances that define `liftReadPrec` should also define `liftReadListPrec` as `liftReadListPrecDefault`.

Since: base-4.10.0.0

Instances

Read1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS [a] # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [[a]] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [a] # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [[a]] #
Read1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] #
Read1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Identity a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Identity a] #
Read1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmpty a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmpty a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmpty a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmpty a] #
Read a => Read1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] #
Read a => Read1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (a, a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [(a, a0)] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (a, a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [(a, a0)] #
Read1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #
Read a => Read1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] #
(Read1 f, Read1 g) => Read1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Compose f g a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Compose f g a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Compose f g a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Compose f g a] #

class Show1 (f :: * -> *) where #

Lifting of the `Show` class to unary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftShowsPrec

Methods

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

`showsPrec` function for an application of the type constructor based on `showsPrec` and `showList` functions for the argument type.

Since: base-4.9.0.0

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

`showList` function for an application of the type constructor based on `showsPrec` and `showList` functions for the argument type. The default implementation using standard list syntax is correct for most types.

Since: base-4.9.0.0

Instances

Show1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> [a] -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [[a]] -> ShowS #
Show1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #
Show1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS #
Show1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS #
Show a => Show1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS #
Show a => Show1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> (a, a0) -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [(a, a0)] -> ShowS #
Show1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #
Show a => Show1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS #
(Show1 f, Show1 g) => Show1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Compose f g a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Compose f g a] -> ShowS #

class Eq2 (f :: * -> * -> *) where #

Lifting of the `Eq` class to binary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftEq2

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> f a c -> f b d -> Bool #

Lift equality tests through the type constructor.

The function will usually be applied to equality functions, but the more general type ensures that the implementation uses them to compare elements of the first container with elements of the second.

Since: base-4.9.0.0

Instances

Eq2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool #
Eq2 (,) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> (a, c) -> (b, d) -> Bool #
Eq2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const a c -> Const b d -> Bool #

class Eq2 f => Ord2 (f :: * -> * -> *) where #

Lifting of the `Ord` class to binary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftCompare2

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> f a c -> f b d -> Ordering #

Lift `compare` functions through the type constructor.

The function will usually be applied to comparison functions, but the more general type ensures that the implementation uses them to compare elements of the first container with elements of the second.

Since: base-4.9.0.0

Instances

Ord2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering #
Ord2 (,) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> (a, c) -> (b, d) -> Ordering #
Ord2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const a c -> Const b d -> Ordering #

class Read2 (f :: * -> * -> *) where #

Lifting of the `Read` class to binary type constructors.

Both `liftReadsPrec2` and `liftReadPrec2` exist to match the interface provided in the `Read` type class, but it is recommended to implement `Read2` instances using `liftReadPrec2` as opposed to `liftReadsPrec2`, since the former is more efficient than the latter. For example:

    instance Read2 T where
      liftReadPrec2     = ...
      liftReadListPrec2 = liftReadListPrec2Default

For more information, refer to the documentation for the `Read` class. @since 4.9.0.0

Minimal complete definition

liftReadsPrec2 | liftReadPrec2

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (f a b) #

`readsPrec` function for an application of the type constructor based on `readsPrec` and `readList` functions for the argument types.

Since: base-4.9.0.0

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [f a b] #

`readList` function for an application of the type constructor based on `readsPrec` and `readList` functions for the argument types. The default implementation using standard list syntax is correct for most types.

Since: base-4.9.0.0

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (f a b) #

`readPrec` function for an application of the type constructor based on `readPrec` and `readListPrec` functions for the argument types.

Since: base-4.10.0.0

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [f a b] #

`readListPrec` function for an application of the type constructor based on `readPrec` and `readListPrec` functions for the argument types.

The default definition uses `liftReadList2`. Instances that define `liftReadPrec2` should also define `liftReadListPrec2` as `liftReadListPrec2Default`.

Since: base-4.10.0.0

Instances

Read2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] #
Read2 (,) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (a, b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [(a, b)] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (a, b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [(a, b)] #
Read2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] #

class Show2 (f :: * -> * -> *) where #

Lifting of the `Show` class to binary type constructors.

Since: base-4.9.0.0

Minimal complete definition

liftShowsPrec2

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> f a b -> ShowS #

`showsPrec` function for an application of the type constructor based on `showsPrec` and `showList` functions for the argument types.

Since: base-4.9.0.0

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [f a b] -> ShowS #

`showList` function for an application of the type constructor based on `showsPrec` and `showList` functions for the argument types. The default implementation using standard list syntax is correct for most types.

Since: base-4.9.0.0

Instances

Show2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS #
Show2 (,) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> (a, b) -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [(a, b)] -> ShowS #
Show2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS #

class Monad m => MonadIO (m :: * -> *) where #

Monads in which `IO` computations may be embedded. Any monad built by applying a sequence of monad transformers to the `IO` monad will be an instance of this class.

Instances should satisfy the following laws, which state that `liftIO` is a transformer of monads:

-     liftIO . return = return

-     liftIO (m >>= f) = liftIO m >>= (liftIO . f)

Minimal complete definition

liftIO

Methods

liftIO :: IO a -> m a #

Lift a computation from the `IO` monad.

Instances

MonadIO IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a #

approxRational :: RealFrac a => a -> a -> Rational #

`approxRational`, applied to two real fractional numbers `x` and `epsilon`, returns the simplest rational number within `epsilon` of `x`. A rational number `y` is said to be simpler than another `y'` if

- ``abs` (`numerator` y) <= `abs` (`numerator` y')`, and
- ``denominator` y <= `denominator` y'`.

Any real interval contains a unique simplest rational; in particular, note that `0/1` is the simplest rational of all.

modifySTRef' :: STRef s a -> (a -> a) -> ST s () #

Strict version of `modifySTRef`

Since: base-4.6.0.0

modifySTRef :: STRef s a -> (a -> a) -> ST s () #

Mutate the contents of an `STRef`.

    >>> :{
    runST (do
        ref <- newSTRef ""
        modifySTRef ref (const "world")
        modifySTRef ref (++ "!")
        modifySTRef ref ("Hello, " ++)
        readSTRef ref )
    :}
    "Hello, world!"

Be warned that `modifySTRef` does not apply the function strictly. This means if the program calls `modifySTRef` many times, but seldomly uses the value, thunks will pile up in memory resulting in a space leak. This is a common mistake made when using an STRef as a counter. For example, the following will leak memory and may produce a stack overflow:

    >>> import Control.Monad (replicateM_)
    >>> :{
    print (runST (do
        ref <- newSTRef 0
        replicateM_ 1000 $ modifySTRef ref (+1)
        readSTRef ref ))
    :}
    1000

To avoid this problem, use `modifySTRef'` instead.

hashUnique :: Unique -> Int #

Hashes a `Unique` into an `Int`. Two `Unique`s may hash to the same value, although in practice this is unlikely. The `Int` returned makes a good hash key.

newUnique :: IO Unique #

Creates a new object of type `Unique`. The value returned will not compare equal to any other value of type `Unique` returned by previous calls to `newUnique`. There is no limit on the number of times `newUnique` may be called.

data Unique #

An abstract unique object. Objects of type `Unique` may be compared for equality and ordering and hashed into `Int`.

    >>> :{
    do x <- newUnique
       print (x == x)
       y <- newUnique
       print (x == y)
    :}
    True
    False

Instances

Eq Unique |
Instance details Defined in Data.Unique Methods (==) :: Unique -> Unique -> Bool # (/=) :: Unique -> Unique -> Bool #
Ord Unique |
Instance details Defined in Data.Unique Methods compare :: Unique -> Unique -> Ordering # (<) :: Unique -> Unique -> Bool # (<=) :: Unique -> Unique -> Bool # (>) :: Unique -> Unique -> Bool # (>=) :: Unique -> Unique -> Bool # max :: Unique -> Unique -> Unique # min :: Unique -> Unique -> Unique #

getEnvironment :: IO [(String, String)] #

`getEnvironment` retrieves the entire environment as a list of `(key,value)` pairs.

If an environment entry does not contain an `'='` character, the `key` is the whole entry and the `value` is the empty string.

withProgName :: String -> IO a -> IO a #

`withProgName` `name act` - while executing action `act`, have `getProgName` return `name`.

withArgs :: [String] -> IO a -> IO a #

`withArgs` `args act` - while executing action `act`, have `getArgs` return `args`.

unsetEnv :: String -> IO () #

`unsetEnv name` removes the specified environment variable from the environment of the current process.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: base-4.7.0.0

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

`setEnv name value` sets the specified environment variable to `value`.

Early versions of this function operated under the mistaken belief that setting an environment variable to the empty string on Windows removes that environment variable from the environment. For the sake of compatibility, it adopted that behavior on POSIX. In particular

    setEnv name ""

has the same effect as

    unsetEnv name

If you'd like to be able to set environment variables to blank strings, use `setEnv`.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: base-4.7.0.0

lookupEnv :: String -> IO (Maybe String) #

Return the value of the environment variable `var`, or `Nothing` if there is no such value.

For POSIX users, this is equivalent to `getEnv`.

Since: base-4.6.0.0

getEnv :: String -> IO String #

Computation `getEnv` `var` returns the value of the environment variable `var`. For the inverse, the `setEnv` function can be used.

This computation may fail with:

- `isDoesNotExistError` if the environment variable does not exist.

getProgName :: IO String #

Computation `getProgName` returns the name of the program as it was invoked.

However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really `FOO.EXE`, and that is what `getProgName` will return.

getArgs :: IO [String] #

Computation `getArgs` returns a list of the program's command line arguments (not including the program name).

getExecutablePath :: IO FilePath #

Returns the absolute pathname of the current executable.

Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)

Since base 4.11.0.0, `getExecutablePath` resolves symlinks on Windows. If an executable is launched through a symlink, `getExecutablePath` returns the absolute path of the original executable.

Since: base-4.6.0.0

die :: String -> IO a #

Write given error message to `stderr` and terminate with `exitFailure`.

Since: base-4.8.0.0

exitSuccess :: IO a #

The computation `exitSuccess` is equivalent to `exitWith` `ExitSuccess`, It terminates the program successfully.

exitFailure :: IO a #

The computation `exitFailure` is equivalent to `exitWith` `(``ExitFailure` exitfail`)`, where exitfail is implementation-dependent.

exitWith :: ExitCode -> IO a #

Computation `exitWith` `code` throws `ExitCode` `code`. Normally this terminates the program, returning `code` to the program's caller.

On program termination, the standard `Handle`s `stdout` and `stderr` are flushed automatically; any other buffered `Handle`s need to be flushed manually, otherwise the buffered data will be discarded.

A program that fails in any other way is treated as if it had called `exitFailure`. A program that terminates successfully without calling `exitWith` explicitly is treated as if it had called `exitWith` `ExitSuccess`.

As an `ExitCode` is not an `IOError`, `exitWith` bypasses the error handling in the `IO` monad and cannot be intercepted by `catch` from the Prelude. However it is a `SomeException`, and can be caught using the functions of Control.Exception. This means that cleanup computations added with `bracket` (from Control.Exception) are also executed properly on `exitWith`.

Note: in GHC, `exitWith` should be called from the main program thread in order to exit the process. When called from another thread, `exitWith` will throw an `ExitException` as normal, but the exception will not cause the process itself to exit.

performGC :: IO () #

Triggers an immediate major garbage collection.

performMajorGC :: IO () #

Triggers an immediate major garbage collection.

Since: base-4.7.0.0

performMinorGC :: IO () #

Triggers an immediate minor garbage collection.

Since: base-4.7.0.0

eqStableName :: StableName a -> StableName b -> Bool #

Equality on `StableName` that does not require that the types of the arguments match.

Since: base-4.7.0.0

hashStableName :: StableName a -> Int #

Convert a `StableName` to an `Int`. The `Int` returned is not necessarily unique; several `StableName`s may map to the same `Int` (in practice however, the chances of this are small, so the result of `hashStableName` makes a good hash key).

makeStableName :: a -> IO (StableName a) #

Makes a `StableName` for an arbitrary object. The object passed as the first argument is not evaluated by `makeStableName`.

data StableName a #

An abstract name for an object, that supports equality and hashing.

Stable names have the following property:

- If `sn1 :: StableName` and `sn2 :: StableName` and `sn1 == sn2` then `sn1` and `sn2` were created by calls to `makeStableName` on the same object.

The reverse is not necessarily true: if two stable names are not equal, then the objects they name may still be equal. Note in particular that `makeStableName` may return a different `StableName` after an object is evaluated.

Stable Names are similar to Stable Pointers (Foreign.StablePtr), but differ in the following ways:

- There is no `freeStableName` operation, unlike Foreign.StablePtrs. Stable names are reclaimed by the runtime system when they are no longer needed.
- There is no `deRefStableName` operation. You can't get back from a stable name to the original Haskell object. The reason for this is that the existence of a stable name for an object does not guarantee the existence of the object itself; it can still be garbage collected.

Instances

Eq (StableName a) | Since: base-2.1
Instance details Defined in System.Mem.StableName Methods (==) :: StableName a -> StableName a -> Bool # (/=) :: StableName a -> StableName a -> Bool #

hPrintf :: HPrintfType r => Handle -> String -> r #

Similar to `printf`, except that output is via the specified `Handle`. The return type is restricted to `(`IO` a)`.

printf :: PrintfType r => String -> r #

Format a variable number of arguments with the C-style formatting string.

    >>> printf "%s, %d, %.4f" "hello" 123 pi
    hello, 123, 3.1416

The return value is either `String` or `(`IO` a)` (which should be `(`IO` '()')`, but Haskell's type system makes this hard).

The format string consists of ordinary characters and conversion specifications, which specify how to format one of the arguments to `printf` in the output string. A format specification is introduced by the `%` character; this character can be self-escaped into the format string using `%%`. A format specification ends with a /format character/ that provides the primary information about how to format the value. The rest of the conversion specification is optional. In order, one may have flag characters, a width specifier, a precision specifier, and type-specific modifier characters.

Unlike C `printf(3)`, the formatting of this `printf` is driven by the argument type; formatting is type specific. The types formatted by `printf` "out of the box" are:

- `Integral` types, including `Char`
- `String`
- `RealFloat` types

`printf` is also extensible to support other types: see below.

A conversion specification begins with the character `%`, followed by zero or more of the following flags:

    -      left adjust (default is right adjust)
    +      always use a sign (+ or -) for signed conversions
    space  leading space for positive numbers in signed conversions
    0      pad with zeros rather than spaces
    #      use an \"alternate form\": see below

When both flags are given, `-` overrides `0` and `+` overrides space. A negative width specifier in a `*` conversion is treated as positive but implies the left adjust flag.

The "alternate form" for unsigned radix conversions is as in C `printf(3)`:

    %o           prefix with a leading 0 if needed
    %x           prefix with a leading 0x if nonzero
    %X           prefix with a leading 0X if nonzero
    %b           prefix with a leading 0b if nonzero
    %[eEfFgG]    ensure that the number contains a decimal point

Any flags are followed optionally by a field width:

    num    field width
    *      as num, but taken from argument list

The field width is a minimum, not a maximum: it will be expanded as needed to avoid mutilating a value.

Any field width is followed optionally by a precision:

    .num   precision
    .      same as .0
    .*     as num, but taken from argument list

Negative precision is taken as 0. The meaning of the precision depends on the conversion type.

    Integral    minimum number of digits to show
    RealFloat   number of digits after the decimal point
    String      maximum number of characters

The precision for Integral types is accomplished by zero-padding. If both precision and zero-pad are given for an Integral field, the zero-pad is ignored.

Any precision is followed optionally for Integral types by a width modifier; the only use of this modifier being to set the implicit size of the operand for conversion of a negative operand to unsigned:

    hh     Int8
    h      Int16
    l      Int32
    ll     Int64
    L      Int64

The specification ends with a format character:

    c      character               Integral
    d      decimal                 Integral
    o      octal                   Integral
    x      hexadecimal             Integral
    X      hexadecimal             Integral
    b      binary                  Integral
    u      unsigned decimal        Integral
    f      floating point          RealFloat
    F      floating point          RealFloat
    g      general format float    RealFloat
    G      general format float    RealFloat
    e      exponent format float   RealFloat
    E      exponent format float   RealFloat
    s      string                  String
    v      default format          any type

The "%v" specifier is provided for all built-in types, and should be provided for user-defined type formatters as well. It picks a "best" representation for the given type. For the built-in types the "%v" specifier is converted as follows:

    c      Char
    u      other unsigned Integral
    d      other signed Integral
    g      RealFloat
    s      String

Mismatch between the argument types and the format string, as well as any other syntactic or semantic errors in the format string, will cause an exception to be thrown at runtime.

Note that the formatting for `RealFloat` types is currently a bit different from that of C `printf(3)`, conforming instead to `showEFloat`, `showFFloat` and `showGFloat` (and their alternate versions `showFFloatAlt` and `showGFloatAlt`). This is hard to fix: the fixed versions would format in a backward-incompatible way. In any case the Haskell behavior is generally more sensible than the C behavior. A brief summary of some key differences:

- Haskell `printf` never uses the default "6-digit" precision used by C printf.
- Haskell `printf` treats the "precision" specifier as indicating the number of digits after the decimal point.
- Haskell `printf` prints the exponent of e-format numbers without a gratuitous plus sign, and with the minimum possible number of digits.
- Haskell `printf` will place a zero after a decimal point when possible.

mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a #

Direct `MonadPlus` equivalent of `filter` ``filter`` = `(mfilter:: (a -> Bool) -> [a] -> [a]` applicable to any `MonadPlus`, for example `mfilter odd (Just 1) == Just 1` `mfilter odd (Just 2) == Nothing`

(<$!>) :: Monad m => (a -> b) -> m a -> m b infixl 4 #

Strict version of `<$>`.

Since: base-4.8.0.0

unless :: Applicative f => Bool -> f () -> f () #

The reverse of `when`.

replicateM_ :: Applicative m => Int -> m a -> m () #

Like `replicateM`, but discards the result.

replicateM :: Applicative m => Int -> m a -> m [a] #

``replicateM` n act` performs the action `n` times, gathering the results.

foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #

Like `foldM`, but discards the result.

foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

The `foldM` function is analogous to `foldl`, except that its result is encapsulated in a monad. Note that `foldM` works from left-to-right over the list arguments. This could be an issue where `(`>>`)` and the `folded function' are not commutative.

    foldM f a1 [x1, x2, ..., xm]

    ==

    do
      a2 <- f a1 x1
      a3 <- f a2 x2
      ...
      f am xm

If right-to-left evaluation is required, the input list should be reversed.

Note: `foldM` is the same as `foldlM`

zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #

`zipWithM_` is the extension of `zipWithM` which ignores the final result.

zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #

The `zipWithM` function generalizes `zipWith` to arbitrary applicative functors.

mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) #

The `mapAndUnzipM` function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state-transforming monad.

forever :: Applicative f => f a -> f b #

``forever` act` repeats the action infinitely.

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 #

Right-to-left Kleisli composition of monads. `(`>=>`)`, with the arguments flipped.

Note how this operator resembles function composition `(`.`)`:

    (.)   ::            (b ->   c) -> (a ->   b) -> a ->   c
    (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #

Left-to-right Kleisli composition of monads.

filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #

This generalizes the list-based `filter` function.

makeVersion :: [Int] -> Version #

Construct tag-less `Version`

Since: base-4.8.0.0

parseVersion :: ReadP Version #

A parser for versions in the format produced by `showVersion`.

showVersion :: Version -> String #

Provides one possible concrete representation for `Version`. For a version with `versionBranch` `= [1,2,3]` and `versionTags` `= ["tag1","tag2"]`, the output will be `1.2.3-tag1-tag2`.

data Version #

A `Version` represents the version of a software entity.

An instance of `Eq` is provided, which implements exact equality modulo reordering of the tags in the `versionTags` field.

An instance of `Ord` is also provided, which gives lexicographic ordering on the `versionBranch` fields (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.). This is expected to be sufficient for many uses, but note that you may need to use a more specific ordering for your versioning scheme. For example, some versioning schemes may include pre-releases which have tags `"pre1"`, `"pre2"`, and so on, and these would need to be taken into account when determining ordering. In some cases, date ordering may be more appropriate, so the application would have to look for `date` tags in the `versionTags` field and compare those. The bottom line is, don't always assume that `compare` and other `Ord` operations are the right thing for every `Version`.

Similarly, concrete representations of versions may differ. One possible concrete representation is provided (see `showVersion` and `parseVersion`), but depending on the application a different concrete representation may be more appropriate.

Constructors

Version |
Fields versionBranch :: [Int] The numeric branch for this version. This reflects the fact that most software versions are tree-structured; there is a main trunk which is tagged with versions at various points (1,2,3...), and the first branch off the trunk after version 3 is 3.1, the second branch off the trunk after version 3 is 3.2, and so on. The tree can be branched arbitrarily, just by adding more digits. We represent the branch as a list of `Int`, so version 3.2.1 becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of `Ord` for `[Int]`) gives the natural ordering of branches. versionTags :: [String] A version can be tagged with an arbitrary list of strings. The interpretation of the list of tags is entirely dependent on the entity that this version applies to.

Instances

IsList Version | Since: base-4.8.0.0
Instance details Defined in GHC.Exts Associated Types type Item Version :: * # Methods fromList :: [Item Version] -> Version # fromListN :: Int -> [Item Version] -> Version # toList :: Version -> [Item Version] #
Eq Version | Since: base-2.1
Instance details Defined in Data.Version Methods (==) :: Version -> Version -> Bool # (/=) :: Version -> Version -> Bool #
Data Version | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version # toConstr :: Version -> Constr # dataTypeOf :: Version -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) # gmapT :: (forall b. Data b => b -> b) -> Version -> Version # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version #
Ord Version | Since: base-2.1
Instance details Defined in Data.Version Methods compare :: Version -> Version -> Ordering # (<) :: Version -> Version -> Bool # (<=) :: Version -> Version -> Bool # (>) :: Version -> Version -> Bool # (>=) :: Version -> Version -> Bool # max :: Version -> Version -> Version # min :: Version -> Version -> Version #
Read Version |
Instance details Defined in Data.Version Methods readsPrec :: Int -> ReadS Version # readList :: ReadS [Version] # readPrec :: ReadPrec Version # readListPrec :: ReadPrec [Version] #
Show Version |
Instance details Defined in Data.Version Methods showsPrec :: Int -> Version -> ShowS # show :: Version -> String # showList :: [Version] -> ShowS #
Generic Version |
Instance details Defined in Data.Version Associated Types type Rep Version :: * -> * # Methods from :: Version -> Rep Version x # to :: Rep Version x -> Version #
type Rep Version |
Instance details Defined in Data.Version type Rep Version = D1 (MetaData "Version" "Data.Version" "base" False) (C1 (MetaCons "Version" PrefixI True) (S1 (MetaSel (Just "versionBranch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]) :*: S1 (MetaSel (Just "versionTags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])))
type Item Version |
Instance details Defined in GHC.Exts type Item Version = Int

traceMarkerIO :: String -> IO () #

The `traceMarkerIO` function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime.

Compared to `traceMarker`, `traceMarkerIO` sequences the event with respect to other IO actions.

Since: base-4.7.0.0

traceMarker :: String -> a -> a #

The `traceMarker` function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. The `String` is the name of the marker. The name is just used in the profiling tools to help you keep clear which marker is which.

This function is suitable for use in pure code. In an IO context use `traceMarkerIO` instead.

Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses `traceMarker`.

Since: base-4.7.0.0

traceEventIO :: String -> IO () #

The `traceEventIO` function emits a message to the eventlog, if eventlog profiling is available and enabled at runtime.

Compared to `traceEvent`, `traceEventIO` sequences the event with respect to other IO actions.

Since: base-4.5.0.0

traceEvent :: String -> a -> a #

The `traceEvent` function behaves like `trace` with the difference that the message is emitted to the eventlog, if eventlog profiling is available and enabled at runtime.

It is suitable for use in pure code. In an IO context use `traceEventIO` instead.

Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses `traceEvent`.

Since: base-4.5.0.0

traceStack :: String -> a -> a #

like `trace`, but additionally prints a call stack if one is available.

In the current GHC implementation, the call stack is only available if the program was compiled with `-prof`; otherwise `traceStack` behaves exactly like `trace`. Entries in the call stack correspond to `SCC` annotations, so it is a good idea to use `-fprof-auto` or `-fprof-auto-calls` to add SCC annotations automatically.

Since: base-4.5.0.0

traceShowM :: (Show a, Applicative f) => a -> f () #

Like `traceM`, but uses `show` on the argument to convert it to a `String`.

    >>> :{
    do
        x <- Just 3
        traceShowM x
        y <- pure 12
        traceShowM y
        pure (x*2 + y)
    :}
    3
    12
    Just 18

Since: base-4.7.0.0

traceM :: Applicative f => String -> f () #

Like `trace` but returning unit in an arbitrary `Applicative` context. Allows for convenient use in do-notation.

Note that the application of `traceM` is not an action in the `Applicative` context, as `traceIO` is in the `IO` type. While the fresh bindings in the following example will force the `traceM` expressions to be reduced every time the `do`-block is executed, `traceM "not crashed"` would only be reduced once, and the message would only be printed once. If your monad is in `MonadIO`, `liftIO . traceIO` may be a better option.

    >>> :{
    do
        x <- Just 3
        traceM ("x: " ++ show x)
        y <- pure 12
        traceM ("y: " ++ show y)
        pure (x*2 + y)
    :}
    x: 3
    y: 12
    Just 18

Since: base-4.7.0.0

traceShowId :: Show a => a -> a #

Like `traceShow` but returns the shown value instead of a third value.

    >>> traceShowId (1+2+3, "hello" ++ "world")
    (6,"helloworld")
    (6,"helloworld")

Since: base-4.7.0.0

traceShow :: Show a => a -> b -> b #

Like `trace`, but uses `show` on the argument to convert it to a `String`.

This makes it convenient for printing the values of interesting variables or expressions inside a function. For example here we print the value of the variables `x` and `y`:

    >>> let f x y = traceShow (x,y) (x + y) in f (1+2) 5
    (3,5)
    8

traceId :: String -> String #

Like `trace` but returns the message instead of a third value.

    >>> traceId "hello"
    "hello
    hello"

Since: base-4.7.0.0

putTraceMsg :: String -> IO () #

traceIO :: String -> IO () #

The `traceIO` function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.

Since: base-4.5.0.0

isSubsequenceOf :: Eq a => [a] -> [a] -> Bool #

The `isSubsequenceOf` function takes two lists and returns `True` if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively.

``isSubsequenceOf` x y` is equivalent to ``elem` x (`subsequences` y)`.

#### Examples

Expand

    >>> isSubsequenceOf "GHC" "The Glorious Haskell Compiler"
    True
    >>> isSubsequenceOf ['a','d'..'z'] ['a'..'z']
    True
    >>> isSubsequenceOf [1..10] [10,9..0]
    False

Since: base-4.8.0.0

foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m #

This function may be used as a value for `foldMap` in a `Foldable` instance.

    foldMapDefault f ≡ getConst . traverse (Const . f)

fmapDefault :: Traversable t => (a -> b) -> t a -> t b #

This function may be used as a value for `fmap` in a `Functor` instance, provided that `traverse` is defined. (Using `fmapDefault` with a `Traversable` instance defined only by `sequenceA` will result in infinite recursion.)

    fmapDefault f ≡ runIdentity . traverse (Identity . f)

mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) #

The `mapAccumR` function behaves like a combination of `fmap` and `foldr`; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.

mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) #

The `mapAccumL` function behaves like a combination of `fmap` and `foldl`; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.

forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #

`forM` is `mapM` with its arguments flipped. For a version that ignores the results see `forM_`.

for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b) #

`for` is `traverse` with its arguments flipped. For a version that ignores the results see `for_`.

optional :: Alternative f => f a -> f (Maybe a) #

One or none.

newtype WrappedMonad (m :: * -> *) a #

Constructors

WrapMonad |
Fields unwrapMonad :: m a

Instances

Monad m => Monad (WrappedMonad m) |
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a #
Monad m => Functor (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a # some :: WrappedMonad m a -> WrappedMonad m [a] # many :: WrappedMonad m a -> WrappedMonad m [a] #
Generic1 (WrappedMonad m :: * -> *) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedMonad m) :: k -> * # Methods from1 :: WrappedMonad m a -> Rep1 (WrappedMonad m) a # to1 :: Rep1 (WrappedMonad m) a -> WrappedMonad m a #
Generic (WrappedMonad m a) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedMonad m a) :: * -> * # Methods from :: WrappedMonad m a -> Rep (WrappedMonad m a) x # to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #
type Rep1 (WrappedMonad m :: * -> *) |
Instance details Defined in Control.Applicative type Rep1 (WrappedMonad m :: * -> *) = D1 (MetaData "WrappedMonad" "Control.Applicative" "base" True) (C1 (MetaCons "WrapMonad" PrefixI True) (S1 (MetaSel (Just "unwrapMonad") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 m)))
type Rep (WrappedMonad m a) |
Instance details Defined in Control.Applicative type Rep (WrappedMonad m a) = D1 (MetaData "WrappedMonad" "Control.Applicative" "base" True) (C1 (MetaCons "WrapMonad" PrefixI True) (S1 (MetaSel (Just "unwrapMonad") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (m a))))

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

Constructors

WrapArrow |
Fields unwrapArrow :: a b c

Instances

Generic1 (WrappedArrow a b :: * -> *) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> * # Methods from1 :: WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 # to1 :: Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 #
Arrow a => Functor (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] #
Generic (WrappedArrow a b c) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: * -> * # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #
type Rep1 (WrappedArrow a b :: * -> *) |
Instance details Defined in Control.Applicative type Rep1 (WrappedArrow a b :: * -> *) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 (a b))))
type Rep (WrappedArrow a b c) |
Instance details Defined in Control.Applicative type Rep (WrappedArrow a b c) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a b c))))

newtype ZipList a #

Lists, but with an `Applicative` functor based on zipping.

Constructors

ZipList |
Fields getZipList :: [a]

Instances

Functor ZipList |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b # (<$) :: a -> ZipList b -> ZipList a #
Applicative ZipList |
    f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
        = 'ZipList' (zipWithN f xs1 ... xsN)
where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:
    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}
Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c # (*>) :: ZipList a -> ZipList b -> ZipList b # (<*) :: ZipList a -> ZipList b -> ZipList a #
Foldable ZipList |
Instance details Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # toList :: ZipList a -> [a] # null :: ZipList a -> Bool # length :: ZipList a -> Int # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # sum :: Num a => ZipList a -> a # product :: Num a => ZipList a -> a #
Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) # sequence :: Monad m => ZipList (m a) -> m (ZipList a) #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a # (<|>) :: ZipList a -> ZipList a -> ZipList a # some :: ZipList a -> ZipList [a] # many :: ZipList a -> ZipList [a] #
Eq a => Eq (ZipList a) |
Instance details Defined in Control.Applicative Methods (==) :: ZipList a -> ZipList a -> Bool # (/=) :: ZipList a -> ZipList a -> Bool #
Ord a => Ord (ZipList a) |
Instance details Defined in Control.Applicative Methods compare :: ZipList a -> ZipList a -> Ordering # (<) :: ZipList a -> ZipList a -> Bool # (<=) :: ZipList a -> ZipList a -> Bool # (>) :: ZipList a -> ZipList a -> Bool # (>=) :: ZipList a -> ZipList a -> Bool # max :: ZipList a -> ZipList a -> ZipList a # min :: ZipList a -> ZipList a -> ZipList a #
Read a => Read (ZipList a) |
Instance details Defined in Control.Applicative Methods readsPrec :: Int -> ReadS (ZipList a) # readList :: ReadS [ZipList a] # readPrec :: ReadPrec (ZipList a) # readListPrec :: ReadPrec [ZipList a] #
Show a => Show (ZipList a) |
Instance details Defined in Control.Applicative Methods showsPrec :: Int -> ZipList a -> ShowS # show :: ZipList a -> String # showList :: [ZipList a] -> ShowS #
Generic (ZipList a) |
Instance details Defined in Control.Applicative Associated Types type Rep (ZipList a) :: * -> * # Methods from :: ZipList a -> Rep (ZipList a) x # to :: Rep (ZipList a) x -> ZipList a #
Generic1 ZipList |
Instance details Defined in Control.Applicative Associated Types type Rep1 ZipList :: k -> * # Methods from1 :: ZipList a -> Rep1 ZipList a # to1 :: Rep1 ZipList a -> ZipList a #
type Rep (ZipList a) |
Instance details Defined in Control.Applicative type Rep (ZipList a) = D1 (MetaData "ZipList" "Control.Applicative" "base" True) (C1 (MetaCons "ZipList" PrefixI True) (S1 (MetaSel (Just "getZipList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [a])))
type Rep1 ZipList |
Instance details Defined in Control.Applicative type Rep1 ZipList = D1 (MetaData "ZipList" "Control.Applicative" "base" True) (C1 (MetaCons "ZipList" PrefixI True) (S1 (MetaSel (Just "getZipList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 [])))

leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) #

Any instance of `ArrowApply` can be made into an instance of `ArrowChoice` by defining `left` = `leftApp`.

(^<<) :: Arrow a => (c -> d) -> a b c -> a b d infixr 1 #

Postcomposition with a pure function (right-to-left variant).

(<<^) :: Arrow a => a c d -> (b -> c) -> a b d infixr 1 #

Precomposition with a pure function (right-to-left variant).

(>>^) :: Arrow a => a b c -> (c -> d) -> a b d infixr 1 #

Postcomposition with a pure function.

(^>>) :: Arrow a => (b -> c) -> a c d -> a b d infixr 1 #

Precomposition with a pure function.

returnA :: Arrow a => a b b #

The identity arrow, which plays the role of `return` in arrow notation.

class Category a => Arrow (a :: * -> * -> *) where #

The basic arrow class.

Instances should satisfy the following laws:

-     arr id = id

-     arr (f >>> g) = arr f >>> arr g

-     first (arr f) = arr (first f)

-     first (f >>> g) = first f >>> first g

-     first f >>> arr fst = arr fst >>> f

-     first f >>> arr (id *** g) = arr (id *** g) >>> first f

-     first (first f) >>> arr assoc = arr assoc >>> first f

where

    assoc ((a,b),c) = (a,(b,c))

The other combinators have sensible default definitions, which may be overridden for efficiency.

Minimal complete definition

arr, (first | (***))

Methods

arr :: (b -> c) -> a b c #

Lift a function to an arrow.

(***) :: a b c -> a b' c' -> a (b, b') (c, c') infixr 3 #

Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

(&&&) :: a b c -> a b c' -> a b (c, c') infixr 3 #

Fanout: send the input to both argument arrows and combine their output.

The default definition may be overridden with a more efficient version if desired.

Instances

Monad m => Arrow (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods arr :: (b -> c) -> Kleisli m b c # first :: Kleisli m b c -> Kleisli m (b, d) (c, d) # second :: Kleisli m b c -> Kleisli m (d, b) (d, c) # (***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') # (&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #
Arrow ((->) :: * -> * -> *) | Since: base-2.1
Instance details Defined in Control.Arrow Methods arr :: (b -> c) -> b -> c # first :: (b -> c) -> (b, d) -> (c, d) # second :: (b -> c) -> (d, b) -> (d, c) # (***) :: (b -> c) -> (b' -> c') -> (b, b') -> (c, c') # (&&&) :: (b -> c) -> (b -> c') -> b -> (c, c') #

newtype Kleisli (m :: * -> *) a b #

Kleisli arrows of a monad.

Constructors

Kleisli |
Fields runKleisli :: a -> m b

Instances

Monad m => Arrow (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods arr :: (b -> c) -> Kleisli m b c # first :: Kleisli m b c -> Kleisli m (b, d) (c, d) # second :: Kleisli m b c -> Kleisli m (d, b) (d, c) # (***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') # (&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #
MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods zeroArrow :: Kleisli m b c #
MonadPlus m => ArrowPlus (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods (<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #
Monad m => ArrowChoice (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) # right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) # (+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') # (|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #
Monad m => ArrowApply (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods app :: Kleisli m (Kleisli m b c, b) c #
MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the `>>=` operation is strict) this instance will not satisfy the right-tightening law required by the `ArrowLoop` class. Since: base-2.1
Instance details Defined in Control.Arrow Methods loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #
Monad m => Category (Kleisli m :: * -> * -> *) | Since: base-3.0
Instance details Defined in Control.Arrow Methods id :: Kleisli m a a # (.) :: Kleisli m b c -> Kleisli m a b -> Kleisli m a c #

class Arrow a => ArrowZero (a :: * -> * -> *) where #

Minimal complete definition

zeroArrow

Methods

zeroArrow :: a b c #

Instances

MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods zeroArrow :: Kleisli m b c #

class ArrowZero a => ArrowPlus (a :: * -> * -> *) where #

A monoid on arrows.

Minimal complete definition

(<+>)

Methods

(<+>) :: a b c -> a b c -> a b c infixr 5 #

An associative operation with identity `zeroArrow`.

Instances

MonadPlus m => ArrowPlus (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods (<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #

class Arrow a => ArrowChoice (a :: * -> * -> *) where #

Choice, for arrows that support it. This class underlies the `if` and `case` constructs in arrow notation.

Instances should satisfy the following laws:

-     left (arr f) = arr (left f)

-     left (f >>> g) = left f >>> left g

-     f >>> arr Left = arr Left >>> left f

-     left f >>> arr (id +++ g) = arr (id +++ g) >>> left f

-     left (left f) >>> arr assocsum = arr assocsum >>> left f

where

    assocsum (Left (Left x)) = Left x
    assocsum (Left (Right y)) = Right (Left y)
    assocsum (Right z) = Right (Right z)

The other combinators have sensible default definitions, which may be overridden for efficiency.

Methods

left :: a b c -> a (Either b d) (Either c d) #

Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.

right :: a b c -> a (Either d b) (Either d c) #

A mirror image of `left`.

The default definition may be overridden with a more efficient version if desired.

(+++) :: a b c -> a b' c' -> a (Either b b') (Either c c') infixr 2 #

Split the input between the two argument arrows, retagging and merging their outputs. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

(|||) :: a b d -> a c d -> a (Either b c) d infixr 2 #

Fanin: Split the input between the two argument arrows and merge their outputs.

The default definition may be overridden with a more efficient version if desired.

Instances

Monad m => ArrowChoice (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) # right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) # (+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') # (|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #
ArrowChoice ((->) :: * -> * -> *) | Since: base-2.1
Instance details Defined in Control.Arrow Methods left :: (b -> c) -> Either b d -> Either c d # right :: (b -> c) -> Either d b -> Either d c # (+++) :: (b -> c) -> (b' -> c') -> Either b b' -> Either c c' # (|||) :: (b -> d) -> (c -> d) -> Either b c -> d #

class Arrow a => ArrowApply (a :: * -> * -> *) where #

Some arrows allow application of arrow inputs to other inputs. Instances should satisfy the following laws:

-     first (arr (\x -> arr (\y -> (x,y)))) >>> app = id

-     first (arr (g >>>)) >>> app = second g >>> app

-     first (arr (>>> h)) >>> app = app >>> h

Such arrows are equivalent to monads (see `ArrowMonad`).

Minimal complete definition

app

Methods

app :: a (a b c, b) c #

Instances

Monad m => ArrowApply (Kleisli m) | Since: base-2.1
Instance details Defined in Control.Arrow Methods app :: Kleisli m (Kleisli m b c, b) c #
ArrowApply ((->) :: * -> * -> *) | Since: base-2.1
Instance details Defined in Control.Arrow Methods app :: (b -> c, b) -> c #

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

The `ArrowApply` class is equivalent to `Monad`: any monad gives rise to a `Kleisli` arrow, and any instance of `ArrowApply` defines a monad.

Constructors

ArrowMonad (a () b) |

Instances

ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1
Instance details Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # fail :: String -> ArrowMonad a a0 #
Arrow a => Functor (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 #
ArrowPlus a => Alternative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods empty :: ArrowMonad a a0 # (<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 # some :: ArrowMonad a a0 -> ArrowMonad a [a0] # many :: ArrowMonad a a0 -> ArrowMonad a [a0] #
(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods mzero :: ArrowMonad a a0 # mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 #

class Arrow a => ArrowLoop (a :: * -> * -> *) where #

The `loop` operator expresses computations in which an output value is fed back as input, although the computation occurs only once. It underlies the `rec` value recursion construct in arrow notation. `loop` should satisfy the following laws:

extension
  ``loop` (`arr` f) = `arr` (\ b -> `fst` (`fix` (\ (c,d) -> f (b,d))))`
left tightening
  ``loop` (`first` h >>> f) = h >>> `loop` f`
right tightening
  ``loop` (f >>> `first` h) = `loop` f >>> h`
sliding
  ``loop` (f >>> `arr` (`id` *** k)) = `loop` (`arr` (`id` *** k) >>> f)`
vanishing
  ``loop` (`loop` f) = `loop` (`arr` unassoc >>> f >>> `arr` assoc)`
superposing
  ``second` (`loop` f) = `loop` (`arr` assoc >>> `second` f >>> `arr` unassoc)`

where

    assoc ((a,b),c) = (a,(b,c))
    unassoc (a,(b,c)) = ((a,b),c)

Minimal complete definition

loop

Methods

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

Instances

MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the `>>=` operation is strict) this instance will not satisfy the right-tightening law required by the `ArrowLoop` class. Since: base-2.1
Instance details Defined in Control.Arrow Methods loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #
ArrowLoop ((->) :: * -> * -> *) | Since: base-2.1
Instance details Defined in Control.Arrow Methods loop :: ((b, d) -> (c, d)) -> b -> c #

newtype Identity a #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Constructors

Identity |
Fields runIdentity :: a

Instances

Monad Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b # (>>) :: Identity a -> Identity b -> Identity b # return :: a -> Identity a # fail :: String -> Identity a #
Functor Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b # (<$) :: a -> Identity b -> Identity a #
MonadFix Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods mfix :: (a -> Identity a) -> Identity a #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a # (<*>) :: Identity (a -> b) -> Identity a -> Identity b # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c # (*>) :: Identity a -> Identity b -> Identity b # (<*) :: Identity a -> Identity b -> Identity a #
Foldable Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # toList :: Identity a -> [a] # null :: Identity a -> Bool # length :: Identity a -> Int # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # sum :: Num a => Identity a -> a # product :: Num a => Identity a -> a #
Traversable Identity |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) # sequence :: Monad m => Identity (m a) -> m (Identity a) #
Eq1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool #
Ord1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering #
Read1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Identity a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Identity a] #
Show1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS #
Bounded a => Bounded (Identity a) |
Instance details Defined in Data.Functor.Identity Methods minBound :: Identity a # maxBound :: Identity a #
Enum a => Enum (Identity a) |
Instance details Defined in Data.Functor.Identity Methods succ :: Identity a -> Identity a # pred :: Identity a -> Identity a # toEnum :: Int -> 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] #
Eq a => Eq (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (==) :: Identity a -> Identity a -> Bool # (/=) :: Identity a -> Identity a -> Bool #
Floating a => Floating (Identity a) |
Instance details Defined in Data.Functor.Identity Methods pi :: Identity a # 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 # log1pexp :: Identity a -> Identity a # log1mexp :: Identity a -> Identity a #
Fractional a => Fractional (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (/) :: Identity a -> Identity a -> Identity a # recip :: Identity a -> Identity a # fromRational :: Rational -> Identity a #
Integral a => Integral (Identity a) |
Instance details Defined in 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) # toInteger :: Identity a -> Integer #
Data a => Data (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) # toConstr :: Identity a -> Constr # dataTypeOf :: Identity a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) # gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r # gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #
Num a => Num (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (+) :: Identity a -> Identity a -> Identity a # (-) :: Identity a -> Identity a -> Identity a # (*) :: Identity a -> Identity a -> Identity a # negate :: Identity a -> Identity a # abs :: Identity a -> Identity a # signum :: Identity a -> Identity a # fromInteger :: Integer -> Identity a #
Ord a => Ord (Identity a) |
Instance details Defined in Data.Functor.Identity Methods compare :: Identity a -> Identity a -> Ordering # (<) :: Identity a -> Identity a -> Bool # (<=) :: Identity a -> Identity a -> Bool # (>) :: Identity a -> Identity a -> Bool # (>=) :: Identity a -> Identity a -> Bool # max :: Identity a -> Identity a -> Identity a # min :: Identity a -> Identity a -> Identity a #
Read a => Read (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods readsPrec :: Int -> ReadS (Identity a) # readList :: ReadS [Identity a] # readPrec :: ReadPrec (Identity a) # readListPrec :: ReadPrec [Identity a] #
Real a => Real (Identity a) |
Instance details Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational #
RealFloat a => RealFloat (Identity a) |
Instance details Defined in 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 # isNaN :: Identity a -> Bool # isInfinite :: Identity a -> Bool # isDenormalized :: Identity a -> Bool # isNegativeZero :: Identity a -> Bool # isIEEE :: Identity a -> Bool # atan2 :: Identity a -> Identity a -> Identity a #
RealFrac a => RealFrac (Identity a) |
Instance details Defined in Data.Functor.Identity Methods properFraction :: Integral b => Identity a -> (b, Identity a) # truncate :: Integral b => Identity a -> b # round :: Integral b => Identity a -> b # ceiling :: Integral b => Identity a -> b # floor :: Integral b => Identity a -> b #
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods showsPrec :: Int -> Identity a -> ShowS # show :: Identity a -> String # showList :: [Identity a] -> ShowS #
Ix a => Ix (Identity a) |
Instance details Defined in Data.Functor.Identity Methods range :: (Identity a, Identity a) -> [Identity a] # index :: (Identity a, Identity a) -> Identity a -> Int # unsafeIndex :: (Identity a, Identity a) -> Identity a -> Int inRange :: (Identity a, Identity a) -> Identity a -> Bool # rangeSize :: (Identity a, Identity a) -> Int # unsafeRangeSize :: (Identity a, Identity a) -> Int
IsString a => IsString (Identity a) |
Instance details Defined in Data.String Methods fromString :: String -> Identity a #
Generic (Identity a) |
Instance details Defined in Data.Functor.Identity Associated Types type Rep (Identity a) :: * -> * # Methods from :: Identity a -> Rep (Identity a) x # to :: Rep (Identity a) x -> Identity a #
Semigroup a => Semigroup (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (<>) :: Identity a -> Identity a -> Identity a # sconcat :: NonEmpty (Identity a) -> Identity a # stimes :: Integral b => b -> Identity a -> Identity a #
Monoid a => Monoid (Identity a) |
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a # mappend :: Identity a -> Identity a -> Identity a # mconcat :: [Identity a] -> Identity a #
Storable a => Storable (Identity a) |
Instance details Defined in Data.Functor.Identity Methods sizeOf :: Identity a -> Int # alignment :: Identity a -> Int # peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) # pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Identity a) # pokeByteOff :: Ptr b -> Int -> Identity a -> IO () # peek :: Ptr (Identity a) -> IO (Identity a) # poke :: Ptr (Identity a) -> Identity a -> IO () #
Bits a => Bits (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (.&.) :: Identity a -> Identity a -> Identity a # (.|.) :: Identity a -> Identity a -> Identity a # xor :: Identity a -> Identity a -> Identity a # complement :: Identity a -> Identity a # shift :: Identity a -> Int -> Identity a # rotate :: Identity a -> Int -> Identity a # zeroBits :: Identity a # bit :: Int -> Identity a # setBit :: Identity a -> Int -> Identity a # clearBit :: Identity a -> Int -> Identity a # complementBit :: Identity a -> Int -> Identity a # testBit :: Identity a -> Int -> Bool # bitSizeMaybe :: Identity a -> Maybe Int # bitSize :: Identity a -> Int # isSigned :: Identity a -> Bool # shiftL :: Identity a -> Int -> Identity a # unsafeShiftL :: Identity a -> Int -> Identity a # shiftR :: Identity a -> Int -> Identity a # unsafeShiftR :: Identity a -> Int -> Identity a # rotateL :: Identity a -> Int -> Identity a # rotateR :: Identity a -> Int -> Identity a # popCount :: Identity a -> Int #
FiniteBits a => FiniteBits (Identity a) |
Instance details Defined in Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int # countLeadingZeros :: Identity a -> Int # countTrailingZeros :: Identity a -> Int #
Generic1 Identity |
Instance details Defined in Data.Functor.Identity Associated Types type Rep1 Identity :: k -> * # Methods from1 :: Identity a -> Rep1 Identity a # to1 :: Rep1 Identity a -> Identity a #
type Rep (Identity a) |
Instance details Defined in Data.Functor.Identity type Rep (Identity a) = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Identity |
Instance details Defined in Data.Functor.Identity type Rep1 Identity = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

readIO :: Read a => String -> IO a #

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

readLn :: Read a => IO a #

The `readLn` function combines `getLine` and `readIO`.

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

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

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

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

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

The computation `writeFile` `file str` function writes the string `str`, to the file `file`.

readFile :: FilePath -> IO String #

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

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

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

getContents :: IO String #

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

getLine :: IO String #

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

getChar :: IO Char #

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

putStrLn :: String -> IO () #

The same as `putStr`, but adds a newline character.

putStr :: String -> IO () #

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

putChar :: Char -> IO () #

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

hClose :: Handle -> IO () #

Computation `hClose` `hdl` makes handle `hdl` closed. Before the computation finishes, if `hdl` is writable its buffer is flushed as for `hFlush`. Performing `hClose` on a handle that has already been closed has no effect; doing so is not an error. All other operations on a closed handle will fail. If `hClose` fails for any reason, any further operations (apart from `hClose`) on the handle will still fail as if `hdl` had been successfully closed.

registerDelay :: Int -> IO (TVar Bool) #

Set the value of returned TVar to True after a given number of microseconds. The caveats associated with threadDelay also apply.

threadDelay :: Int -> IO () #

Suspends the current thread for a given number of microseconds (GHC only).

There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.

closeFdWith #

Arguments

:: (Fd -> IO ()) | Low-level action that performs the real close.
-> Fd | File descriptor to close.
-> IO () |

Close a file descriptor in a concurrency-safe way (GHC only). If you are using `threadWaitRead` or `threadWaitWrite` to perform blocking I/O, you must use this function to close file descriptors, or blocked threads may not be woken.

Any threads that are blocked on the file descriptor via `threadWaitRead` or `threadWaitWrite` will be unblocked by having IO exceptions thrown.

ioManagerCapabilitiesChanged :: IO () #

ensureIOManagerIsRunning :: IO () #

runHandlers :: ForeignPtr Word8 -> Signal -> IO () #

setHandler :: Signal -> Maybe (HandlerFun, Dynamic) -> IO (Maybe (HandlerFun, Dynamic)) #

type Signal = CInt #

type HandlerFun = ForeignPtr Word8 -> IO () #

mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a)) #

Make a `Weak` pointer to an `MVar`, using the second argument as a finalizer to run when `MVar` is garbage-collected

Since: base-4.6.0.0

addMVarFinalizer :: MVar a -> IO () -> IO () #

modifyMVarMasked :: MVar a -> (a -> IO (a, b)) -> IO b #

Like `modifyMVar`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.6.0.0

modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO () #

Like `modifyMVar_`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.6.0.0

modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b #

A slight variation on `modifyMVar_` that allows a value to be returned (`b`) in addition to the modified value of the `MVar`.

modifyMVar_ :: MVar a -> (a -> IO a) -> IO () #

An exception-safe wrapper for modifying the contents of an `MVar`. Like `withMVar`, `modifyMVar` will replace the original contents of the `MVar` if an exception is raised during the operation. This function is only atomic if there are no other producers for this `MVar`.

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

Like `withMVar`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.7.0.0

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

`withMVar` is an exception-safe wrapper for operating on the contents of an `MVar`. This operation is exception-safe: it will replace the original contents of the `MVar` if an exception is raised (see Control.Exception). However, it is only atomic if there are no other producers for this `MVar`.

swapMVar :: MVar a -> a -> IO a #

Take a value from an `MVar`, put a new value into the `MVar` and return the value taken. This function is atomic only if there are no other producers for this `MVar`.

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

A slightly faster version of `fixIO` that may not be safe to use with multiple threads. The unsafety arises when used like this:

     unsafeFixIO $ \r -> do
        forkIO (print r)
        return (...)

In this case, the child thread will receive a `NonTermination` exception instead of waiting for the value of `r` to be computed.

Since: base-4.5.0.0

allowInterrupt :: IO () #

When invoked inside `mask`, this function allows a masked asynchronous exception to be raised, if one exists. It is equivalent to performing an interruptible operation (see #interruptible), but does not involve any actual blocking.

When called outside `mask`, or inside `uninterruptibleMask`, this function has no effect.

Since: base-4.4.0.0

catches :: IO a -> [Handler a] -> IO a #

Sometimes you want to catch two different sorts of exception. You could do something like

    f = expr `catch` \ (ex :: ArithException) -> handleArith ex
             `catch` \ (ex :: IOException)    -> handleIO    ex

However, there are a couple of problems with this approach. The first is that having two exception handlers is inefficient. However, the more serious issue is that the second exception handler will catch exceptions in the first, e.g. in the example above, if `handleArith` throws an `IOException` then the second exception handler will catch it.

Instead, we provide a function `catches`, which would be used thus:

    f = expr `catches` [Handler (\ (ex :: ArithException) -> handleArith ex),
                        Handler (\ (ex :: IOException)    -> handleIO    ex)]

data Handler a where #

You need this when using `catches`.

Constructors

Handler :: Handler a |

Instances

Functor Handler | Since: base-4.6.0.0
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #

catchIOError :: IO a -> (IOError -> IO a) -> IO a #

The `catchIOError` function establishes a handler that receives any `IOError` raised in the action protected by `catchIOError`. An `IOError` is caught by the most recent handler established by one of the exception handling functions. These handlers are not selective: all `IOError`s are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in

    f = catchIOError g (\e -> if IO.isEOFError e then return [] else ioError e)

the function `f` returns `[]` when an end-of-file exception (cf. `isEOFError`) occurs in `g`; otherwise, the exception is propagated to the next outer handler.

When an exception propagates outside the main program, the Haskell system prints the associated `IOError` value and exits the program.

Non-I/O exceptions are not caught by this variant; to catch all exceptions, use `catch` from Control.Exception.

Since: base-4.4.0.0

annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError #

Adds a location description and maybe a file path and file handle to an `IOError`. If any of the file handle or file path is not given the corresponding value in the `IOError` remains unaltered.

modifyIOError :: (IOError -> IOError) -> IO a -> IO a #

Catch any `IOError` that occurs in the computation and throw a modified version.

ioeSetFileName :: IOError -> FilePath -> IOError #

ioeSetHandle :: IOError -> Handle -> IOError #

ioeSetLocation :: IOError -> String -> IOError #

ioeSetErrorString :: IOError -> String -> IOError #

ioeSetErrorType :: IOError -> IOErrorType -> IOError #

ioeGetFileName :: IOError -> Maybe FilePath #

ioeGetHandle :: IOError -> Maybe Handle #

ioeGetLocation :: IOError -> String #

ioeGetErrorString :: IOError -> String #

ioeGetErrorType :: IOError -> IOErrorType #

isUserErrorType :: IOErrorType -> Bool #

I/O error that is programmer-defined.

isPermissionErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.

isIllegalOperationErrorType :: IOErrorType -> Bool #

I/O error where the operation is not possible.

isEOFErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because the end of file has been reached.

isFullErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because the device is full.

isAlreadyInUseErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.

isDoesNotExistErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because one of its arguments does not exist.

isAlreadyExistsErrorType :: IOErrorType -> Bool #

I/O error where the operation failed because one of its arguments already exists.

userErrorType :: IOErrorType #

I/O error that is programmer-defined.

permissionErrorType :: IOErrorType #

I/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.

illegalOperationErrorType :: IOErrorType #

I/O error where the operation is not possible.

eofErrorType :: IOErrorType #

I/O error where the operation failed because the end of file has been reached.

fullErrorType :: IOErrorType #

I/O error where the operation failed because the device is full.

alreadyInUseErrorType :: IOErrorType #

I/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.

doesNotExistErrorType :: IOErrorType #

I/O error where the operation failed because one of its arguments does not exist.

alreadyExistsErrorType :: IOErrorType #

I/O error where the operation failed because one of its arguments already exists.

isUserError :: IOError -> Bool #

A programmer-defined error value constructed using `userError`.

isPermissionError :: IOError -> Bool #

An error indicating that an `IO` operation failed because the user does not have sufficient operating system privilege to perform that operation.

isIllegalOperation :: IOError -> Bool #

An error indicating that an `IO` operation failed because the operation was not possible. Any computation which returns an `IO` result may fail with `isIllegalOperation`. In some cases, an implementation will not be able to distinguish between the possible error causes. In this case it should fail with `isIllegalOperation`.

isEOFError :: IOError -> Bool #

An error indicating that an `IO` operation failed because the end of file has been reached.

isFullError :: IOError -> Bool #

An error indicating that an `IO` operation failed because the device is full.

isAlreadyInUseError :: IOError -> Bool #

An error indicating that an `IO` operation failed because one of its arguments is a single-use resource, which is already being used (for example, opening the same file twice for writing might give this error).

isDoesNotExistError :: IOError -> Bool #

An error indicating that an `IO` operation failed because one of its arguments does not exist.

isAlreadyExistsError :: IOError -> Bool #

An error indicating that an `IO` operation failed because one of its arguments already exists.

mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError #

Construct an `IOError` of the given type where the second argument describes the error location and the third and fourth argument contain the file handle and file path of the file involved in the error if applicable.

tryIOError :: IO a -> IO (Either IOError a) #

The construct `tryIOError` `comp` exposes IO errors which occur within a computation, and which are not fully handled.

Non-I/O exceptions are not caught by this variant; to catch all exceptions, use `try` from Control.Exception.

Since: base-4.4.0.0

bracketOnError #

Arguments

:: IO a | computation to run first ("acquire resource")
-> (a -> IO b) | computation to run last ("release resource")
-> (a -> IO c) | computation to run in-between
-> IO c |

Like `bracket`, but only performs the final action if there was an exception raised by the in-between computation.

bracket_ :: IO a -> IO b -> IO c -> IO c #

A variant of `bracket` where the return value from the first computation is not required.

finally #

Arguments

:: IO a | computation to run first
-> IO b | computation to run afterward (even if an exception was raised)
-> IO a |

A specialised variant of `bracket` with just a computation to run afterward.

bracket #

Arguments

:: IO a | computation to run first ("acquire resource")
-> (a -> IO b) | computation to run last ("release resource")
-> (a -> IO c) | computation to run in-between
-> IO c |

When you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use `bracket`, because `bracket` will install the necessary exception handler to release the resource in the event that an exception is raised during the computation. If an exception is raised, then `bracket` will re-raise the exception (after performing the release).

A common example is opening a file:

    bracket
      (openFile "filename" ReadMode)
      (hClose)
      (\fileHandle -> do { ... })

The arguments to `bracket` are in this order so that we can partially apply it, e.g.:

    withFile name mode = bracket (openFile name mode) hClose

onException :: IO a -> IO b -> IO a #

Like `finally`, but only performs the final action if there was an exception raised by the computation.

tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a) #

A variant of `try` that takes an exception predicate to select which exceptions are caught (c.f. `catchJust`). If the exception does not match the predicate, it is re-thrown.

try :: Exception e => IO a -> IO (Either e a) #

Similar to `catch`, but returns an `Either` result which is `(`Right` a)` if no exception of type `e` was raised, or `(`Left` ex)` if an exception of type `e` was raised and its value is `ex`. If any other type of exception is raised than it will be propogated up to the next enclosing exception handler.

     try a = catch (Right `liftM` a) (return . Left)

mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a #

This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".

handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a #

A version of `catchJust` with the arguments swapped around (see `handle`).

handle :: Exception e => (e -> IO a) -> IO a -> IO a #

A version of `catch` with the arguments swapped around; useful in situations where the code for the handler is shorter. For example:

      do handle (\NonTermination -> exitWith (ExitFailure 1)) $
         ...

catchJust #

Arguments

:: Exception e |
=> (e -> Maybe b) | Predicate to select exceptions
-> IO a | Computation to run
-> (b -> IO a) | Handler
-> IO a |

The function `catchJust` is like `catch`, but it takes an extra argument which is an exception predicate, a function which selects which type of exceptions we're interested in.

    catchJust (\e -> if isDoesNotExistErrorType (ioeGetErrorType e) then Just () else Nothing)
              (readFile f)
              (\_ -> do hPutStrLn stderr ("No such file: " ++ show f)
                        return "")

Any other exceptions which are not matched by the predicate are re-raised, and may be caught by an enclosing `catch`, `catchJust`, etc.

newtype PatternMatchFail #

A pattern match failed. The `String` gives information about the source location of the pattern.

Constructors

PatternMatchFail String |

Instances

Show PatternMatchFail | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> PatternMatchFail -> ShowS # show :: PatternMatchFail -> String # showList :: [PatternMatchFail] -> ShowS #
Exception PatternMatchFail | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException # fromException :: SomeException -> Maybe PatternMatchFail # displayException :: PatternMatchFail -> String #

newtype RecSelError #

A record selector was applied to a constructor without the appropriate field. This can only happen with a datatype with multiple constructors, where some fields are in one constructor but not another. The `String` gives information about the source location of the record selector.

Constructors

RecSelError String |

Instances

Show RecSelError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecSelError -> ShowS # show :: RecSelError -> String # showList :: [RecSelError] -> ShowS #
Exception RecSelError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecSelError -> SomeException # fromException :: SomeException -> Maybe RecSelError # displayException :: RecSelError -> String #

newtype RecConError #

An uninitialised record field was used. The `String` gives information about the source location where the record was constructed.

Constructors

RecConError String |

Instances

Show RecConError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecConError -> ShowS # show :: RecConError -> String # showList :: [RecConError] -> ShowS #
Exception RecConError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecConError -> SomeException # fromException :: SomeException -> Maybe RecConError # displayException :: RecConError -> String #

newtype RecUpdError #

A record update was performed on a constructor without the appropriate field. This can only happen with a datatype with multiple constructors, where some fields are in one constructor but not another. The `String` gives information about the source location of the record update.

Constructors

RecUpdError String |

Instances

Show RecUpdError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecUpdError -> ShowS # show :: RecUpdError -> String # showList :: [RecUpdError] -> ShowS #
Exception RecUpdError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecUpdError -> SomeException # fromException :: SomeException -> Maybe RecUpdError # displayException :: RecUpdError -> String #

newtype NoMethodError #

A class method without a definition (neither a default definition, nor a definition in the appropriate instance) was called. The `String` gives information about which method it was.

Constructors

NoMethodError String |

Instances

Show NoMethodError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NoMethodError -> ShowS # show :: NoMethodError -> String # showList :: [NoMethodError] -> ShowS #
Exception NoMethodError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NoMethodError -> SomeException # fromException :: SomeException -> Maybe NoMethodError # displayException :: NoMethodError -> String #

newtype TypeError #

An expression that didn't typecheck during compile time was called. This is only possible with -fdefer-type-errors. The `String` gives details about the failed type check.

Since: base-4.9.0.0

Constructors

TypeError String |

Instances

Show TypeError | Since: base-4.9.0.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> TypeError -> ShowS # show :: TypeError -> String # showList :: [TypeError] -> ShowS #
Exception TypeError | Since: base-4.9.0.0
Instance details Defined in Control.Exception.Base Methods toException :: TypeError -> SomeException # fromException :: SomeException -> Maybe TypeError # displayException :: TypeError -> String #

data NonTermination #

Thrown when the runtime system detects that the computation is guaranteed not to terminate. Note that there is no guarantee that the runtime system will notice whether any given computation is guaranteed to terminate or not.

Constructors

NonTermination |

Instances

Show NonTermination | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NonTermination -> ShowS # show :: NonTermination -> String # showList :: [NonTermination] -> ShowS #
Exception NonTermination | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NonTermination -> SomeException # fromException :: SomeException -> Maybe NonTermination # displayException :: NonTermination -> String #

data NestedAtomically #

Thrown when the program attempts to call `atomically`, from the `stm` package, inside another call to `atomically`.

Constructors

NestedAtomically |

Instances

Show NestedAtomically | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NestedAtomically -> ShowS # show :: NestedAtomically -> String # showList :: [NestedAtomically] -> ShowS #
Exception NestedAtomically | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NestedAtomically -> SomeException # fromException :: SomeException -> Maybe NestedAtomically # displayException :: NestedAtomically -> String #

getUncaughtExceptionHandler :: IO (SomeException -> IO ()) #

setUncaughtExceptionHandler :: (SomeException -> IO ()) -> IO () #

reportError :: SomeException -> IO () #

reportStackOverflow :: IO () #

writeTVar :: TVar a -> a -> STM () #

Write the supplied value into a `TVar`.

readTVar :: TVar a -> STM a #

Return the current value stored in a `TVar`.

readTVarIO :: TVar a -> IO a #

Return the current value stored in a `TVar`. This is equivalent to

     readTVarIO = atomically . readTVar

but works much faster, because it doesn't perform a complete transaction, it just reads the current value of the `TVar`.

newTVarIO :: a -> IO (TVar a) #

`IO` version of `newTVar`. This is useful for creating top-level `TVar`s using `unsafePerformIO`, because using `atomically` inside `unsafePerformIO` isn't possible.

newTVar :: a -> STM (TVar a) #

Create a new `TVar` holding a value supplied

always :: STM Bool -> STM () #

`always` is a variant of `alwaysSucceeds` in which the invariant is expressed as an `STM Bool` action that must return `True`. Returning `False` or raising an exception are both treated as invariant failures.

alwaysSucceeds :: STM a -> STM () #

`alwaysSucceeds` adds a new invariant that must be true when passed to `alwaysSucceeds`, at the end of the current transaction, and at the end of every subsequent transaction. If it fails at any of those points then the transaction violating it is aborted and the exception raised by the invariant is propagated.

catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a #

Exception handling within STM actions.

throwSTM :: Exception e => e -> STM a #

A variant of `throw` that can only be used within the `STM` monad.

Throwing an exception in `STM` aborts the transaction and propagates the exception.

Although `throwSTM` has a type that is an instance of the type of `throw`, the two functions are subtly different:

    throw e    `seq` x  ===> throw e
    throwSTM e `seq` x  ===> x

The first example will cause the exception `e` to be raised, whereas the second one won't. In fact, `throwSTM` will only cause an exception to be raised when it is used within the `STM` monad. The `throwSTM` variant should be used in preference to `throw` to raise an exception within the `STM` monad because it guarantees ordering with respect to other `STM` operations, whereas `throw` does not.

orElse :: STM a -> STM a -> STM a #

Compose two alternative STM actions (GHC only).

If the first action completes without retrying then it forms the result of the `orElse`. Otherwise, if the first action retries, then the second action is tried in its place. If both actions retry then the `orElse` as a whole retries.

retry :: STM a #

Retry execution of the current memory transaction because it has seen values in `TVar`s which mean that it should not continue (e.g. the `TVar`s represent a shared buffer that is now empty). The implementation may block the thread until one of the `TVar`s that it has read from has been updated. (GHC only)

atomically :: STM a -> IO a #

Perform a series of STM actions atomically.

Using `atomically` inside an `unsafePerformIO` or `unsafeInterleaveIO` subverts some of guarantees that STM provides. It makes it possible to run a transaction inside of another transaction, depending on when the thunk is evaluated. If a nested transaction is attempted, an exception is thrown by the runtime. It is possible to safely use `atomically` inside `unsafePerformIO` or `unsafeInterleaveIO`, but the typechecker does not rule out programs that may attempt nested transactions, meaning that the programmer must take special care to prevent these.

However, there are functions for creating transactional variables that can always be safely called in `unsafePerformIO`. See: `newTVarIO`, `newTChanIO`, `newBroadcastTChanIO`, `newTQueueIO`, `newTBQueueIO`, and `newTMVarIO`.

Using `unsafePerformIO` inside of `atomically` is also dangerous but for different reasons. See `unsafeIOToSTM` for more on this.

unsafeIOToSTM :: IO a -> STM a #

Unsafely performs IO in the STM monad. Beware: this is a highly dangerous thing to do.

- The STM implementation will often run transactions multiple times, so you need to be prepared for this if your IO has any side effects.
- The STM implementation will abort transactions that are known to be invalid and need to be restarted. This may happen in the middle of `unsafeIOToSTM`, so make sure you don't acquire any resources that need releasing (exception handlers are ignored when aborting the transaction). That includes doing any IO using Handles, for example. Getting this wrong will probably lead to random deadlocks.
- The transaction may have seen an inconsistent view of memory when the IO runs. Invariants that you expect to be true throughout your program may not be true inside a transaction, due to the way transactions are implemented. Normally this wouldn't be visible to the programmer, but using `unsafeIOToSTM` can expose it.

newStablePtrPrimMVar :: MVar () -> IO (StablePtr PrimMVar) #

Make a StablePtr that can be passed to the C function `hs_try_putmvar()`. The RTS wants a `StablePtr` to the underlying `MVar#`, but a `StablePtr#` can only refer to lifted types, so we have to cheat by coercing.

mkWeakThreadId :: ThreadId -> IO (Weak ThreadId) #

Make a weak pointer to a `ThreadId`. It can be important to do this if you want to hold a reference to a `ThreadId` while still allowing the thread to receive the `BlockedIndefinitely` family of exceptions (e.g. `BlockedIndefinitelyOnMVar`). Holding a normal `ThreadId` reference will prevent the delivery of `BlockedIndefinitely` exceptions because the reference could be used as the target of `throwTo` at any time, which would unblock the thread.

Holding a `Weak ThreadId`, on the other hand, will not prevent the thread from receiving `BlockedIndefinitely` exceptions. It is still possible to throw an exception to a `Weak ThreadId`, but the caller must use `deRefWeak` first to determine whether the thread still exists.

Since: base-4.6.0.0

threadCapability :: ThreadId -> IO (Int, Bool) #

Returns the number of the capability on which the thread is currently running, and a boolean indicating whether the thread is locked to that capability or not. A thread is locked to a capability if it was created with `forkOn`.

Since: base-4.4.0.0

threadStatus :: ThreadId -> IO ThreadStatus #

runSparks :: IO () #

Internal function used by the RTS to run sparks.

par :: a -> b -> b infixr 0 #

pseq :: a -> b -> b infixr 0 #

labelThread :: ThreadId -> String -> IO () #

`labelThread` stores a string as identifier for this thread if you built a RTS with debugging support. This identifier will be used in the debugging output to make distinction of different threads easier (otherwise you only have the thread state object's address in the heap).

Other applications like the graphical Concurrent Haskell Debugger (http://www.informatik.uni-kiel.de/~fhu/chd/) may choose to overload `labelThread` for their purposes as well.

yield :: IO () #

The `yield` action allows (forces, in a co-operative multitasking implementation) a context-switch to any other currently runnable threads (if any), and is occasionally useful when implementing concurrency abstractions.

myThreadId :: IO ThreadId #

Returns the `ThreadId` of the calling thread (GHC only).

throwTo :: Exception e => ThreadId -> e -> IO () #

`throwTo` raises an arbitrary exception in the target thread (GHC only).

Exception delivery synchronizes between the source and target thread: `throwTo` does not return until the exception has been raised in the target thread. The calling thread can thus be certain that the target thread has received the exception. Exception delivery is also atomic with respect to other exceptions. Atomicity is a useful property to have when dealing with race conditions: e.g. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other.

Whatever work the target thread was doing when the exception was raised is not lost: the computation is suspended until required by another thread.

If the target thread is currently making a foreign call, then the exception will not be raised (and hence `throwTo` will not return) until the call has completed. This is the case regardless of whether the call is inside a `mask` or not. However, in GHC a foreign call can be annotated as `interruptible`, in which case a `throwTo` will cause the RTS to attempt to cause the call to return; see the GHC documentation for more details.

Important note: the behaviour of `throwTo` differs from that described in the paper "Asynchronous exceptions in Haskell" (http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, `throwTo` is non-blocking; but the library implementation adopts a more synchronous design in which `throwTo` does not return until the exception is received by the target thread. The trade-off is discussed in Section 9 of the paper. Like any blocking operation, `throwTo` is therefore interruptible (see Section 5.3 of the paper). Unlike other interruptible operations, however, `throwTo` is always interruptible, even if it does not actually block.

There is no guarantee that the exception will be delivered promptly, although the runtime will endeavour to ensure that arbitrary delays don't occur. In GHC, an exception can only be raised when a thread reaches a safe point, where a safe point is where memory allocation occurs. Some loops do not perform any memory allocation inside the loop and therefore cannot be interrupted by a `throwTo`.

If the target of `throwTo` is the calling thread, then the behaviour is the same as `throwIO`, except that the exception is thrown as an asynchronous exception. This means that if there is an enclosing pure computation, which would be the case if the current IO operation is inside `unsafePerformIO` or `unsafeInterleaveIO`, that computation is not permanently replaced by the exception, but is suspended as if it had received an asynchronous exception.

Note that if `throwTo` is called with the current thread as the target, the exception will be thrown even if the thread is currently inside `mask` or `uninterruptibleMask`.

killThread :: ThreadId -> IO () #

`killThread` raises the `ThreadKilled` exception in the given thread (GHC only).

    killThread tid = throwTo tid ThreadKilled

childHandler :: SomeException -> IO () #

numSparks :: IO Int #

Returns the number of sparks currently in the local spark pool

getNumProcessors :: IO Int #

Returns the number of CPUs that the machine has

Since: base-4.5.0.0

setNumCapabilities :: Int -> IO () #

Set the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. The number passed to `forkOn` is interpreted modulo this value. The initial value is given by the `+RTS -N` runtime flag.

This is also the number of threads that will participate in parallel garbage collection. It is strongly recommended that the number of capabilities is not set larger than the number of physical processor cores, and it may often be beneficial to leave one or more cores free to avoid contention with other processes in the machine.

Since: base-4.5.0.0

getNumCapabilities :: IO Int #

Returns the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. To change this value, use `setNumCapabilities`.

Since: base-4.4.0.0

numCapabilities :: Int #

the value passed to the `+RTS -N` flag. This is the number of Haskell threads that can run truly simultaneously at any given time, and is typically set to the number of physical processor cores on the machine.

Strictly speaking it is better to use `getNumCapabilities`, because the number of capabilities might vary at runtime.

forkOnWithUnmask :: Int -> ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId #

Like `forkIOWithUnmask`, but the child thread is pinned to the given CPU, as with `forkOn`.

Since: base-4.4.0.0

forkOn :: Int -> IO () -> IO ThreadId #

Like `forkIO`, but lets you specify on which capability the thread should run. Unlike a `forkIO` thread, a thread created by `forkOn` will stay on the same capability for its entire lifetime (`forkIO` threads can migrate between capabilities according to the scheduling policy). `forkOn` is useful for overriding the scheduling policy when you know in advance how best to distribute the threads.

The `Int` argument specifies a capability number (see `getNumCapabilities`). Typically capabilities correspond to physical processors, but the exact behaviour is implementation-dependent. The value passed to `forkOn` is interpreted modulo the total number of capabilities as returned by `getNumCapabilities`.

GHC note: the number of capabilities is specified by the `+RTS -N` option when the program is started. Capabilities can be fixed to actual processor cores with `+RTS -qa` if the underlying operating system supports that, although in practice this is usually unnecessary (and may actually degrade performance in some cases - experimentation is recommended).

Since: base-4.4.0.0

forkIOWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId #

Like `forkIO`, but the child thread is passed a function that can be used to unmask asynchronous exceptions. This function is typically used in the following way

     ... mask_ $ forkIOWithUnmask $ \unmask ->
                    catch (unmask ...) handler

so that the exception handler in the child thread is established with asynchronous exceptions masked, meanwhile the main body of the child thread is executed in the unmasked state.

Note that the unmask function passed to the child thread should only be used in that thread; the behaviour is undefined if it is invoked in a different thread.

Since: base-4.4.0.0

forkIO :: IO () -> IO ThreadId #

Creates a new thread to run the `IO` computation passed as the first argument, and returns the `ThreadId` of the newly created thread.

The new thread will be a lightweight, unbound thread. Foreign calls made by this thread are not guaranteed to be made by any particular OS thread; if you need foreign calls to be made by a particular OS thread, then use `forkOS` instead.

The new thread inherits the masked state of the parent (see `mask`).

The newly created thread has an exception handler that discards the exceptions `BlockedIndefinitelyOnMVar`, `BlockedIndefinitelyOnSTM`, and `ThreadKilled`, and passes all other exceptions to the uncaught exception handler.

disableAllocationLimit :: IO () #

Disable allocation limit processing for the current thread.

Since: base-4.8.0.0

enableAllocationLimit :: IO () #

Enables the allocation counter to be treated as a limit for the current thread. When the allocation limit is enabled, if the allocation counter counts down below zero, the thread will be sent the `AllocationLimitExceeded` asynchronous exception. When this happens, the counter is reinitialised (by default to 100K, but tunable with the `+RTS -xq` option) so that it can handle the exception and perform any necessary clean up. If it exhausts this additional allowance, another `AllocationLimitExceeded` exception is sent, and so forth. Like other asynchronous exceptions, the `AllocationLimitExceeded` exception is deferred while the thread is inside `mask` or an exception handler in `catch`.

Note that memory allocation is unrelated to live memory, also known as heap residency. A thread can allocate a large amount of memory and retain anything between none and all of it. It is better to think of the allocation limit as a limit on CPU time, rather than a limit on memory.

Compared to using timeouts, allocation limits don't count time spent blocked or in foreign calls.

Since: base-4.8.0.0

getAllocationCounter :: IO Int64 #

Return the current value of the allocation counter for the current thread.

Since: base-4.8.0.0

setAllocationCounter :: Int64 -> IO () #

Every thread has an allocation counter that tracks how much memory has been allocated by the thread. The counter is initialized to zero, and `setAllocationCounter` sets the current value. The allocation counter counts *down*, so in the absence of a call to `setAllocationCounter` its value is the negation of the number of bytes of memory allocated by the thread.

There are two things that you can do with this counter:

- Use it as a simple profiling mechanism, with `getAllocationCounter`.
- Use it as a resource limit. See `enableAllocationLimit`.

Allocation accounting is accurate only to about 4Kbytes.

Since: base-4.8.0.0

reportHeapOverflow :: IO () #

data ThreadId #

A `ThreadId` is an abstract type representing a handle to a thread. `ThreadId` is an instance of `Eq`, `Ord` and `Show`, where the `Ord` instance implements an arbitrary total ordering over `ThreadId`s. The `Show` instance lets you convert an arbitrary-valued `ThreadId` to string form; showing a `ThreadId` value is occasionally useful when debugging or diagnosing the behaviour of a concurrent program.

Note: in GHC, if you have a `ThreadId`, you essentially have a pointer to the thread itself. This means the thread itself can't be garbage collected until you drop the `ThreadId`. This misfeature will hopefully be corrected at a later date.

Constructors

ThreadId ThreadId# |

Instances

Eq ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadId -> ThreadId -> Bool # (/=) :: ThreadId -> ThreadId -> Bool #
Ord ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadId -> ThreadId -> Ordering # (<) :: ThreadId -> ThreadId -> Bool # (<=) :: ThreadId -> ThreadId -> Bool # (>) :: ThreadId -> ThreadId -> Bool # (>=) :: ThreadId -> ThreadId -> Bool # max :: ThreadId -> ThreadId -> ThreadId # min :: ThreadId -> ThreadId -> ThreadId #
Show ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadId -> ShowS # show :: ThreadId -> String # showList :: [ThreadId] -> ShowS #

data BlockReason #

Constructors

BlockedOnMVar | blocked on `MVar`
BlockedOnBlackHole | blocked on a computation in progress by another thread
BlockedOnException | blocked in `throwTo`
BlockedOnSTM | blocked in `retry` in an STM transaction
BlockedOnForeignCall | currently in a foreign call
BlockedOnOther | blocked on some other resource. Without `-threaded`, I/O and `threadDelay` show up as `BlockedOnOther`, with `-threaded` they show up as `BlockedOnMVar`.

Instances

Eq BlockReason |
Instance details Defined in GHC.Conc.Sync Methods (==) :: BlockReason -> BlockReason -> Bool # (/=) :: BlockReason -> BlockReason -> Bool #
Ord BlockReason |
Instance details Defined in GHC.Conc.Sync Methods compare :: BlockReason -> BlockReason -> Ordering # (<) :: BlockReason -> BlockReason -> Bool # (<=) :: BlockReason -> BlockReason -> Bool # (>) :: BlockReason -> BlockReason -> Bool # (>=) :: BlockReason -> BlockReason -> Bool # max :: BlockReason -> BlockReason -> BlockReason # min :: BlockReason -> BlockReason -> BlockReason #
Show BlockReason |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> BlockReason -> ShowS # show :: BlockReason -> String # showList :: [BlockReason] -> ShowS #

data ThreadStatus #

The current status of a thread

Constructors

ThreadRunning | the thread is currently runnable or running
ThreadFinished | the thread has finished
ThreadBlocked BlockReason | the thread is blocked on some resource
ThreadDied | the thread received an uncaught exception

Instances

Eq ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadStatus -> ThreadStatus -> Bool # (/=) :: ThreadStatus -> ThreadStatus -> Bool #
Ord ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadStatus -> ThreadStatus -> Ordering # (<) :: ThreadStatus -> ThreadStatus -> Bool # (<=) :: ThreadStatus -> ThreadStatus -> Bool # (>) :: ThreadStatus -> ThreadStatus -> Bool # (>=) :: ThreadStatus -> ThreadStatus -> Bool # max :: ThreadStatus -> ThreadStatus -> ThreadStatus # min :: ThreadStatus -> ThreadStatus -> ThreadStatus #
Show ThreadStatus |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadStatus -> ShowS # show :: ThreadStatus -> String # showList :: [ThreadStatus] -> ShowS #

data PrimMVar #

newtype STM a #

A monad supporting atomic memory transactions.

Constructors

STM (State# RealWorld -> (#State# RealWorld, a#)) |

Instances

Monad STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods (>>=) :: STM a -> (a -> STM b) -> STM b # (>>) :: STM a -> STM b -> STM b # return :: a -> STM a # fail :: String -> STM a #
Functor STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b # (<$) :: a -> STM b -> STM a #
Applicative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods pure :: a -> STM a # (<*>) :: STM (a -> b) -> STM a -> STM b # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c # (*>) :: STM a -> STM b -> STM b # (<*) :: STM a -> STM b -> STM a #
Alternative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods empty :: STM a # (<|>) :: STM a -> STM a -> STM a # some :: STM a -> STM [a] # many :: STM a -> STM [a] #
MonadPlus STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods mzero :: STM a # mplus :: STM a -> STM a -> STM a #

data TVar a #

Shared memory locations that support atomic memory transactions.

Constructors

TVar (TVar# RealWorld a) |

Instances

Eq (TVar a) | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: TVar a -> TVar a -> Bool # (/=) :: TVar a -> TVar a -> Bool #

dynTypeRep :: Dynamic -> SomeTypeRep #

dynApp :: Dynamic -> Dynamic -> Dynamic #

dynApply :: Dynamic -> Dynamic -> Maybe Dynamic #

fromDynamic #

Arguments

:: Typeable a |
=> Dynamic | the dynamically-typed object
-> Maybe a | returns: ``Just` a`, if the dynamically-typed object has the correct type (and `a` is its value), or `Nothing` otherwise.

Converts a `Dynamic` object back into an ordinary Haskell value of the correct type. See also `fromDyn`.

fromDyn #

Arguments

:: Typeable a |
=> Dynamic | the dynamically-typed object
-> a | a default value
-> a | returns: the value of the first argument, if it has the correct type, otherwise the value of the second argument.

Converts a `Dynamic` object back into an ordinary Haskell value of the correct type. See also `fromDynamic`.

data Dynamic where #

A value of type `Dynamic` is an object encapsulated together with its type.

A `Dynamic` may only represent a monomorphic value; an attempt to create a value of type `Dynamic` from a polymorphically-typed expression will result in an ambiguity error (see `toDyn`).

`Show`ing a value of type `Dynamic` returns a pretty-printed representation of the object's type; useful for debugging.

Constructors

Dynamic :: Dynamic |

Instances

Show Dynamic | Since: base-2.1
Instance details Defined in Data.Dynamic Methods showsPrec :: Int -> Dynamic -> ShowS # show :: Dynamic -> String # showList :: [Dynamic] -> ShowS #
Exception Dynamic | Since: base-4.0.0.0
Instance details Defined in Data.Dynamic Methods toException :: Dynamic -> SomeException # fromException :: SomeException -> Maybe Dynamic # displayException :: Dynamic -> String #

ioError :: IOError -> IO a #

Raise an `IOError` in the `IO` monad.

asyncExceptionFromException :: Exception e => SomeException -> Maybe e #

Since: base-4.7.0.0

asyncExceptionToException :: Exception e => e -> SomeException #

Since: base-4.7.0.0

data BlockedIndefinitelyOnMVar #

The thread is blocked on an `MVar`, but there are no other references to the `MVar` so it can't ever continue.

Constructors

BlockedIndefinitelyOnMVar |

Instances

Show BlockedIndefinitelyOnMVar | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS # show :: BlockedIndefinitelyOnMVar -> String # showList :: [BlockedIndefinitelyOnMVar] -> ShowS #
Exception BlockedIndefinitelyOnMVar | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnMVar -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar # displayException :: BlockedIndefinitelyOnMVar -> String #

data BlockedIndefinitelyOnSTM #

The thread is waiting to retry an STM transaction, but there are no other references to any `TVar`s involved, so it can't ever continue.

Constructors

BlockedIndefinitelyOnSTM |

Instances

Show BlockedIndefinitelyOnSTM | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS # show :: BlockedIndefinitelyOnSTM -> String # showList :: [BlockedIndefinitelyOnSTM] -> ShowS #
Exception BlockedIndefinitelyOnSTM | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnSTM -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM # displayException :: BlockedIndefinitelyOnSTM -> String #

data Deadlock #

There are no runnable threads, so the program is deadlocked. The `Deadlock` exception is raised in the main thread only.

Constructors

Deadlock |

Instances

Show Deadlock | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> Deadlock -> ShowS # show :: Deadlock -> String # showList :: [Deadlock] -> ShowS #
Exception Deadlock | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String #

data AllocationLimitExceeded #

This thread has exceeded its allocation limit. See `setAllocationCounter` and `enableAllocationLimit`.

Since: base-4.8.0.0

Constructors

AllocationLimitExceeded |

Instances

Show AllocationLimitExceeded | Since: base-4.7.1.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AllocationLimitExceeded -> ShowS # show :: AllocationLimitExceeded -> String # showList :: [AllocationLimitExceeded] -> ShowS #
Exception AllocationLimitExceeded | Since: base-4.8.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AllocationLimitExceeded -> SomeException # fromException :: SomeException -> Maybe AllocationLimitExceeded # displayException :: AllocationLimitExceeded -> String #

newtype CompactionFailed #

Compaction found an object that cannot be compacted. Functions cannot be compacted, nor can mutable objects or pinned objects. See `compact`.

Since: base-4.10.0.0

Constructors

CompactionFailed String |

Instances

Show CompactionFailed | Since: base-4.10.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> CompactionFailed -> ShowS # show :: CompactionFailed -> String # showList :: [CompactionFailed] -> ShowS #
Exception CompactionFailed | Since: base-4.10.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # displayException :: CompactionFailed -> String #

newtype AssertionFailed #

`assert` was applied to `False`.

Constructors

AssertionFailed String |

Instances

Show AssertionFailed | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AssertionFailed -> ShowS # show :: AssertionFailed -> String # showList :: [AssertionFailed] -> ShowS #
Exception AssertionFailed | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String #

data SomeAsyncException where #

Superclass for asynchronous exceptions.

Since: base-4.7.0.0

Constructors

SomeAsyncException :: SomeAsyncException |

Instances

Show SomeAsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> SomeAsyncException -> ShowS # show :: SomeAsyncException -> String # showList :: [SomeAsyncException] -> ShowS #
Exception SomeAsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # displayException :: SomeAsyncException -> String #

data AsyncException #

Asynchronous exceptions.

Constructors

StackOverflow | The current thread's stack exceeded its limit. Since an exception has been raised, the thread's stack will certainly be below its limit again, but the programmer should take remedial action immediately.
HeapOverflow | The program's heap is reaching its limit, and the program should take action to reduce the amount of live data it has. Notes: It is undefined which thread receives this exception. GHC currently throws this to the same thread that receives `UserInterrupt`, but this may change in the future. The GHC RTS currently can only recover from heap overflow if it detects that an explicit memory limit (set via RTS flags). has been exceeded. Currently, failure to allocate memory from the operating system results in immediate termination of the program.
ThreadKilled | This exception is raised by another thread calling `killThread`, or by the system if it needs to terminate the thread for some reason.
UserInterrupt | This exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console).

Instances

Eq AsyncException |
Instance details Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool #
Ord AsyncException |
Instance details Defined in GHC.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering # (<) :: AsyncException -> AsyncException -> Bool # (<=) :: AsyncException -> AsyncException -> Bool # (>) :: AsyncException -> AsyncException -> Bool # (>=) :: AsyncException -> AsyncException -> Bool # max :: AsyncException -> AsyncException -> AsyncException # min :: AsyncException -> AsyncException -> AsyncException #
Show AsyncException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AsyncException -> ShowS # show :: AsyncException -> String # showList :: [AsyncException] -> ShowS #
Exception AsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String #

data ArrayException #

Exceptions generated by array operations

Constructors

IndexOutOfBounds String | An attempt was made to index an array outside its declared bounds.
UndefinedElement String | An attempt was made to evaluate an element of an array that had not been initialized.

Instances

Eq ArrayException |
Instance details Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool #
Ord ArrayException |
Instance details Defined in GHC.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering # (<) :: ArrayException -> ArrayException -> Bool # (<=) :: ArrayException -> ArrayException -> Bool # (>) :: ArrayException -> ArrayException -> Bool # (>=) :: ArrayException -> ArrayException -> Bool # max :: ArrayException -> ArrayException -> ArrayException # min :: ArrayException -> ArrayException -> ArrayException #
Show ArrayException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ArrayException -> ShowS # show :: ArrayException -> String # showList :: [ArrayException] -> ShowS #
Exception ArrayException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String #

data FixIOException #

The exception thrown when an infinite cycle is detected in `fixIO`.

Since: base-4.11.0.0

Constructors

FixIOException |

Instances

Show FixIOException | Since: base-4.11.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> FixIOException -> ShowS # show :: FixIOException -> String # showList :: [FixIOException] -> ShowS #
Exception FixIOException | Since: base-4.11.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: FixIOException -> SomeException # fromException :: SomeException -> Maybe FixIOException # displayException :: FixIOException -> String #

data ExitCode #

Defines the exit codes that a program can return.

Constructors

ExitSuccess | indicates successful termination;
ExitFailure Int | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).

Instances

Eq ExitCode |
Instance details Defined in GHC.IO.Exception Methods (==) :: ExitCode -> ExitCode -> Bool # (/=) :: ExitCode -> ExitCode -> Bool #
Ord ExitCode |
Instance details Defined in GHC.IO.Exception Methods compare :: ExitCode -> ExitCode -> Ordering # (<) :: ExitCode -> ExitCode -> Bool # (<=) :: ExitCode -> ExitCode -> Bool # (>) :: ExitCode -> ExitCode -> Bool # (>=) :: ExitCode -> ExitCode -> Bool # max :: ExitCode -> ExitCode -> ExitCode # min :: ExitCode -> ExitCode -> ExitCode #
Read ExitCode |
Instance details Defined in GHC.IO.Exception Methods readsPrec :: Int -> ReadS ExitCode # readList :: ReadS [ExitCode] # readPrec :: ReadPrec ExitCode # readListPrec :: ReadPrec [ExitCode] #
Show ExitCode |
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ExitCode -> ShowS # show :: ExitCode -> String # showList :: [ExitCode] -> ShowS #
Generic ExitCode |
Instance details Defined in GHC.IO.Exception Associated Types type Rep ExitCode :: * -> * # Methods from :: ExitCode -> Rep ExitCode x # to :: Rep ExitCode x -> ExitCode #
Exception ExitCode | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String #
type Rep ExitCode |
Instance details Defined in GHC.IO.Exception type Rep ExitCode = D1 (MetaData "ExitCode" "GHC.IO.Exception" "base" False) (C1 (MetaCons "ExitSuccess" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "ExitFailure" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

data IOErrorType #

An abstract type that contains a value for each variant of `IOError`.

Constructors

AlreadyExists |
NoSuchThing |
ResourceBusy |
ResourceExhausted |
EOF |
IllegalOperation |
PermissionDenied |
UserError |
UnsatisfiedConstraints |
SystemError |
ProtocolError |
OtherError |
InvalidArgument |
InappropriateType |
HardwareFault |
UnsupportedOperation |
TimeExpired |
ResourceVanished |
Interrupted |

Instances

Eq IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOErrorType -> IOErrorType -> Bool # (/=) :: IOErrorType -> IOErrorType -> Bool #
Show IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS # show :: IOErrorType -> String # showList :: [IOErrorType] -> ShowS #

data Handle #

Haskell defines operations to read and write characters from and to files, represented by values of type `Handle`. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the `Show` and `Eq` classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to `==` only to itself; no attempt is made to compare the internal state of different handles for equality.

Instances

Eq Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Handle -> Handle -> Bool # (/=) :: Handle -> Handle -> Bool #
Show Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Handle -> ShowS # show :: Handle -> String # showList :: [Handle] -> ShowS #

atomicWriteIORef :: IORef a -> a -> IO () #

Variant of `writeIORef` with the "barrier to reordering" property that `atomicModifyIORef` has.

Since: base-4.6.0.0

atomicModifyIORef' :: IORef a -> (a -> (a, b)) -> IO b #

Strict version of `atomicModifyIORef`. This forces both the value stored in the `IORef` as well as the value returned.

Since: base-4.6.0.0

atomicModifyIORef :: IORef a -> (a -> (a, b)) -> IO b #

Atomically modifies the contents of an `IORef`.

This function is useful for using `IORef` in a safe way in a multithreaded program. If you only have one `IORef`, then using `atomicModifyIORef` to access and modify it will prevent race conditions.

Extending the atomicity to multiple `IORef`s is problematic, so it is recommended that if you need to do anything more complicated then using `MVar` instead is a good idea.

`atomicModifyIORef` does not apply the function strictly. This is important to know even if all you are doing is replacing the value. For example, this will leak memory:

    ref <- newIORef '1'
    forever $ atomicModifyIORef ref (\_ -> ('2', ()))

Use `atomicModifyIORef'` or `atomicWriteIORef` to avoid this problem.

modifyIORef' :: IORef a -> (a -> a) -> IO () #

Strict version of `modifyIORef`

Since: base-4.6.0.0

modifyIORef :: IORef a -> (a -> a) -> IO () #

Mutate the contents of an `IORef`.

Be warned that `modifyIORef` does not apply the function strictly. This means if the program calls `modifyIORef` many times, but seldomly uses the value, thunks will pile up in memory resulting in a space leak. This is a common mistake made when using an IORef as a counter. For example, the following will likely produce a stack overflow:

    ref <- newIORef 0
    replicateM_ 1000000 $ modifyIORef ref (+1)
    readIORef ref >>= print

To avoid this problem, use `modifyIORef'` instead.

mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a)) #

Make a `Weak` pointer to an `IORef`, using the second argument as a finalizer to run when `IORef` is garbage-collected

mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a) #

This function is similar to `mallocArray0`, but yields a memory area that has a finalizer attached that releases the memory area. As with `mallocForeignPtr`, it is not guaranteed that the block of memory was allocated by `malloc`.

mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a) #

This function is similar to `mallocArray`, but yields a memory area that has a finalizer attached that releases the memory area. As with `mallocForeignPtr`, it is not guaranteed that the block of memory was allocated by `malloc`.

newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a) #

This variant of `newForeignPtr` adds a finalizer that expects an environment in addition to the finalized pointer. The environment that will be passed to the finalizer is fixed by the second argument to `newForeignPtrEnv`.

withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b #

This is a way to look at the pointer living inside a foreign object. This function takes a function which is applied to that pointer. The resulting `IO` action is then executed. The foreign object is kept alive at least during the whole action, even if it is not used directly inside. Note that it is not safe to return the pointer from the action and use it after the action completes. All uses of the pointer should be inside the `withForeignPtr` bracket. The reason for this unsafeness is the same as for `unsafeForeignPtrToPtr` below: the finalizer may run earlier than expected, because the compiler can only track usage of the `ForeignPtr` object, not a `Ptr` object made from it.

This function is normally used for marshalling data to or from the object pointed to by the `ForeignPtr`, using the operations from the `Storable` class.

newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a) #

Turns a plain memory reference into a foreign pointer, and associates a finalizer with the reference. The finalizer will be executed after the last reference to the foreign object is dropped. There is no guarantee of promptness, however the finalizer will be executed before the program exits.

finalizeForeignPtr :: ForeignPtr a -> IO () #

Causes the finalizers associated with a foreign pointer to be run immediately.

plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b #

Advances the given address by the given offset in bytes.

The new `ForeignPtr` shares the finalizer of the original, equivalent from a finalization standpoint to just creating another reference to the original. That is, the finalizer will not be called before the new `ForeignPtr` is unreachable, nor will it be called an additional time due to this call, and the finalizer will be called with the same address that it would have had this call not happened, *not* the new address.

Since: base-4.10.0.0

castForeignPtr :: ForeignPtr a -> ForeignPtr b #

This function casts a `ForeignPtr` parameterised by one type into another type.

touchForeignPtr :: ForeignPtr a -> IO () #

This function ensures that the foreign object in question is alive at the given place in the sequence of IO actions. In particular `withForeignPtr` does a `touchForeignPtr` after it executes the user action.

Note that this function should not be used to express dependencies between finalizers on `ForeignPtr`s. For example, if the finalizer for a `ForeignPtr` `F1` calls `touchForeignPtr` on a second `ForeignPtr` `F2`, then the only guarantee is that the finalizer for `F2` is never started before the finalizer for `F1`. They might be started together if for example both `F1` and `F2` are otherwise unreachable, and in that case the scheduler might end up running the finalizer for `F2` first.

In general, it is not recommended to use finalizers on separate objects with ordering constraints between them. To express the ordering robustly requires explicit synchronisation using `MVar`s between the finalizers, but even then the runtime sometimes runs multiple finalizers sequentially in a single thread (for performance reasons), so synchronisation between finalizers could result in artificial deadlock. Another alternative is to use explicit reference counting.

newForeignPtr_ :: Ptr a -> IO (ForeignPtr a) #

Turns a plain memory reference into a foreign pointer that may be associated with finalizers by using `addForeignPtrFinalizer`.

addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO () #

Like `addForeignPtrFinalizerEnv` but allows the finalizer to be passed an additional environment parameter to be passed to the finalizer. The environment passed to the finalizer is fixed by the second argument to `addForeignPtrFinalizerEnv`

addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO () #

This function adds a finalizer to the given foreign object. The finalizer will run before all other finalizers for the same object which have already been registered.

mallocForeignPtrBytes :: Int -> IO (ForeignPtr a) #

This function is similar to `mallocForeignPtr`, except that the size of the memory required is given explicitly as a number of bytes.

mallocForeignPtr :: Storable a => IO (ForeignPtr a) #

Allocate some memory and return a `ForeignPtr` to it. The memory will be released automatically when the `ForeignPtr` is discarded.

`mallocForeignPtr` is equivalent to

       do { p <- malloc; newForeignPtr finalizerFree p }

although it may be implemented differently internally: you may not assume that the memory returned by `mallocForeignPtr` has been allocated with `malloc`.

GHC notes: `mallocForeignPtr` has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the `ForeignPtr` does not require a finalizer to free the memory. Use of `mallocForeignPtr` and associated functions is strongly recommended in preference to `newForeignPtr` with a finalizer.

data ForeignPtr a #

The type `ForeignPtr` represents references to objects that are maintained in a foreign language, i.e., that are not part of the data structures usually managed by the Haskell storage manager. The essential difference between `ForeignPtr`s and vanilla memory references of type `Ptr a` is that the former may be associated with finalizers. A finalizer is a routine that is invoked when the Haskell storage manager detects that - within the Haskell heap and stack - there are no more references left that are pointing to the `ForeignPtr`. Typically, the finalizer will, then, invoke routines in the foreign language that free the resources bound by the foreign object.

The `ForeignPtr` is parameterised in the same way as `Ptr`. The type argument of `ForeignPtr` should normally be an instance of class `Storable`.

Instances

Eq (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods (==) :: ForeignPtr a -> ForeignPtr a -> Bool # (/=) :: ForeignPtr a -> ForeignPtr a -> Bool #
Data a => Data (ForeignPtr a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ForeignPtr a -> c (ForeignPtr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ForeignPtr a) # toConstr :: ForeignPtr a -> Constr # dataTypeOf :: ForeignPtr a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ForeignPtr a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ForeignPtr a)) # gmapT :: (forall b. Data b => b -> b) -> ForeignPtr a -> ForeignPtr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ForeignPtr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ForeignPtr a -> r # gmapQ :: (forall d. Data d => d -> u) -> ForeignPtr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ForeignPtr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ForeignPtr a -> m (ForeignPtr a) #
Ord (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods compare :: ForeignPtr a -> ForeignPtr a -> Ordering # (<) :: ForeignPtr a -> ForeignPtr a -> Bool # (<=) :: ForeignPtr a -> ForeignPtr a -> Bool # (>) :: ForeignPtr a -> ForeignPtr a -> Bool # (>=) :: ForeignPtr a -> ForeignPtr a -> Bool # max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a # min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a #
Show (ForeignPtr a) | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods showsPrec :: Int -> ForeignPtr a -> ShowS # show :: ForeignPtr a -> String # showList :: [ForeignPtr a] -> ShowS #

type FinalizerPtr a = FunPtr (Ptr a -> IO ()) #

A finalizer is represented as a pointer to a foreign function that, at finalisation time, gets as an argument a plain pointer variant of the foreign pointer that the finalizer is associated with.

Note that the foreign function must use the `ccall` calling convention.

type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ()) #

writeIORef :: IORef a -> a -> IO () #

Write a new value into an `IORef`

readIORef :: IORef a -> IO a #

Read the value of an `IORef`

newIORef :: a -> IO (IORef a) #

Build a new `IORef`

data IORef a #

A mutable variable in the `IO` monad

Instances

Eq (IORef a) | Pointer equality. Since: base-4.1.0.0
Instance details Defined in GHC.IORef Methods (==) :: IORef a -> IORef a -> Bool # (/=) :: IORef a -> IORef a -> Bool #

evaluate :: a -> IO a #

Evaluate the argument to weak head normal form.

`evaluate` is typically used to uncover any exceptions that a lazy value may contain, and possibly handle them.

`evaluate` only evaluates to weak head normal form. If deeper evaluation is needed, the `force` function from `Control.DeepSeq` may be handy:

    evaluate $ force x

There is a subtle difference between ``evaluate` x` and ``return` `$!` x`, analogous to the difference between `throwIO` and `throw`. If the lazy value `x` throws an exception, ``return` `$!` x` will fail to return an `IO` action and will throw an exception instead. ``evaluate` x`, on the other hand, always produces an `IO` action; that action will throw an exception upon execution iff `x` throws an exception upon evaluation.

The practical implication of this difference is that due to the imprecise exceptions semantics,

    (return $! error "foo") >> error "bar"

may throw either `"foo"` or `"bar"`, depending on the optimizations performed by the compiler. On the other hand,

    evaluate (error "foo") >> error "bar"

is guaranteed to throw `"foo"`.

The rule of thumb is to use `evaluate` to force or handle exceptions in lazy values. If, on the other hand, you are forcing a lazy value for efficiency reasons only and do not care about exceptions, you may use ``return` `$!` x`.

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

Like `mask`, but the masked computation is not interruptible (see Control.Exception). THIS SHOULD BE USED WITH GREAT CARE, because if a thread executing in `uninterruptibleMask` blocks for any reason, then the thread (and possibly the program, if this is the main thread) will be unresponsive and unkillable. This function should only be necessary if you need to mask exceptions around an interruptible operation, and you can guarantee that the interruptible operation will only block for a short period of time.

uninterruptibleMask_ :: IO a -> IO a #

Like `uninterruptibleMask`, but does not pass a `restore` action to the argument.

mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

Executes an IO computation with asynchronous exceptions masked. That is, any thread which attempts to raise an exception in the current thread with `throwTo` will be blocked until asynchronous exceptions are unmasked again.

The argument passed to `mask` is a function that takes as its argument another function, which can be used to restore the prevailing masking state within the context of the masked computation. For example, a common way to use `mask` is to protect the acquisition of a resource:

    mask $ \restore -> do
        x <- acquire
        restore (do_something_with x) `onException` release
        release

This code guarantees that `acquire` is paired with `release`, by masking asynchronous exceptions for the critical parts. (Rather than write this code yourself, it would be better to use `bracket` which abstracts the general pattern).

Note that the `restore` action passed to the argument to `mask` does not necessarily unmask asynchronous exceptions, it just restores the masking state to that of the enclosing context. Thus if asynchronous exceptions are already masked, `mask` cannot be used to unmask exceptions again. This is so that if you call a library function with exceptions masked, you can be sure that the library call will not be able to unmask exceptions again. If you are writing library code and need to use asynchronous exceptions, the only way is to create a new thread; see `forkIOWithUnmask`.

Asynchronous exceptions may still be received while in the masked state if the masked thread blocks in certain ways; see Control.Exception.

Threads created by `forkIO` inherit the `MaskingState` from the parent; that is, to start a thread in the `MaskedInterruptible` state, use `mask_ $ forkIO ...`. This is particularly useful if you need to establish an exception handler in the forked thread before any asynchronous exceptions are received. To create a a new thread in an unmasked state use `forkIOWithUnmask`.

mask_ :: IO a -> IO a #

Like `mask`, but does not pass a `restore` action to the argument.

getMaskingState :: IO MaskingState #

Returns the `MaskingState` for the current thread.

interruptible :: IO a -> IO a #

Allow asynchronous exceptions to be raised even inside `mask`, making the operation interruptible (see the discussion of "Interruptible operations" in `Exception`).

When called outside `mask`, or inside `uninterruptibleMask`, this function has no effect.

Since: base-4.9.0.0

throwIO :: Exception e => e -> IO a #

A variant of `throw` that can only be used within the `IO` monad.

Although `throwIO` has a type that is an instance of the type of `throw`, the two functions are subtly different:

    throw e   `seq` x  ===> throw e
    throwIO e `seq` x  ===> x

The first example will cause the exception `e` to be raised, whereas the second one won't. In fact, `throwIO` will only cause an exception to be raised when it is used within the `IO` monad. The `throwIO` variant should be used in preference to `throw` to raise an exception within the `IO` monad because it guarantees ordering with respect to other `IO` operations, whereas `throw` does not.

catch #

Arguments

:: Exception e |
=> IO a | The computation to run
-> (e -> IO a) | Handler to invoke if an exception is raised
-> IO a |

This is the simplest of the exception-catching functions. It takes a single argument, runs it, and if an exception is raised the "handler" is executed, with the value of the exception passed as an argument. Otherwise, the result is returned as normal. For example:

      catch (readFile f)
            (\e -> do let err = show (e :: IOException)
                      hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err)
                      return "")

Note that we have to give a type signature to `e`, or the program will not typecheck as the type is ambiguous. While it is possible to catch exceptions of any type, see the section "Catching all exceptions" (in Control.Exception) for an explanation of the problems with doing so.

For catching exceptions in pure (non-`IO`) expressions, see the function `evaluate`.

Note that due to Haskell's unspecified evaluation order, an expression may throw one of several possible exceptions: consider the expression `(error "urk") + (1 `div` 0)`. Does the expression throw `ErrorCall "urk"`, or `DivideByZero`?

The answer is "it might throw either"; the choice is non-deterministic. If you are catching any type of exception then you might catch either. If you are calling `catch` with type `IO Int -> (ArithException -> IO Int) -> IO Int` then the handler may get run with `DivideByZero` as an argument, or an `ErrorCall "urk"` exception may be propogated further up. If you call it again, you might get a the opposite behaviour. This is ok, because `catch` is an `IO` computation.

stToIO :: ST RealWorld a -> IO a #

Embed a strict state transformer in an `IO` action. The `RealWorld` parameter indicates that the internal state used by the `ST` computation is a special one supplied by the `IO` monad, and thus distinct from those used by invocations of `runST`.

type FilePath = String #

File and directory names are values of type `String`, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

data MaskingState #

Describes the behaviour of a thread when an asynchronous exception is received.

Constructors

Unmasked | asynchronous exceptions are unmasked (the normal state)
MaskedInterruptible | the state during `mask`: asynchronous exceptions are masked, but blocking operations may still be interrupted
MaskedUninterruptible | the state during `uninterruptibleMask`: asynchronous exceptions are masked, and blocking operations may not be interrupted

Instances

Eq MaskingState |
Instance details Defined in GHC.IO Methods (==) :: MaskingState -> MaskingState -> Bool # (/=) :: MaskingState -> MaskingState -> Bool #
Show MaskingState |
Instance details Defined in GHC.IO Methods showsPrec :: Int -> MaskingState -> ShowS # show :: MaskingState -> String # showList :: [MaskingState] -> ShowS #

userError :: String -> IOError #

Construct an `IOError` value with a string describing the error. The `fail` method of the `IO` instance of the `Monad` class raises a `userError`, thus:

    instance Monad IO where
      ...
      fail s = ioError (userError s)

data IOException #

Exceptions that occur in the `IO` monad. An `IOException` records a more specific error type, a descriptive string and maybe the handle that was used when the error was flagged.

Constructors

IOError |
Fields ioe_handle :: Maybe Handle ioe_type :: IOErrorType ioe_location :: String ioe_description :: String ioe_errno :: Maybe CInt ioe_filename :: Maybe FilePath

Instances

Eq IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOException -> IOException -> Bool # (/=) :: IOException -> IOException -> Bool #
Show IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS #
Exception IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String #

type IOError = IOException #

The Haskell 2010 type for exceptions in the `IO` monad. Any I/O operation may raise an `IOError` instead of returning a result. For a more general type of exception, including also those that arise in pure code, see `Exception`.

In Haskell 2010, this is an opaque type.

throw :: Exception e => e -> a #

Throw an exception. Exceptions may be thrown from purely functional code, but may only be caught within the `IO` monad.

class (Typeable e, Show e) => Exception e where #

Any type that you wish to throw or catch as an exception must be an instance of the `Exception` class. The simplest case is a new exception type directly below the root:

    data MyException = ThisException | ThatException
        deriving Show

    instance Exception MyException

The default method definitions in the `Exception` class do what we need in this case. You can now throw and catch `ThisException` and `ThatException` as exceptions:

    *Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
    Caught ThisException

In more complicated examples, you may wish to define a whole hierarchy of exceptions:

    ---------------------------------------------------------------------
    -- Make the root exception type for all the exceptions in a compiler

    data SomeCompilerException = forall e . Exception e => SomeCompilerException e

    instance Show SomeCompilerException where
        show (SomeCompilerException e) = show e

    instance Exception SomeCompilerException

    compilerExceptionToException :: Exception e => e -> SomeException
    compilerExceptionToException = toException . SomeCompilerException

    compilerExceptionFromException :: Exception e => SomeException -> Maybe e
    compilerExceptionFromException x = do
        SomeCompilerException a <- fromException x
        cast a

    ---------------------------------------------------------------------
    -- Make a subhierarchy for exceptions in the frontend of the compiler

    data SomeFrontendException = forall e . Exception e => SomeFrontendException e

    instance Show SomeFrontendException where
        show (SomeFrontendException e) = show e

    instance Exception SomeFrontendException where
        toException = compilerExceptionToException
        fromException = compilerExceptionFromException

    frontendExceptionToException :: Exception e => e -> SomeException
    frontendExceptionToException = toException . SomeFrontendException

    frontendExceptionFromException :: Exception e => SomeException -> Maybe e
    frontendExceptionFromException x = do
        SomeFrontendException a <- fromException x
        cast a

    ---------------------------------------------------------------------
    -- Make an exception type for a particular frontend compiler exception

    data MismatchedParentheses = MismatchedParentheses
        deriving Show

    instance Exception MismatchedParentheses where
        toException   = frontendExceptionToException
        fromException = frontendExceptionFromException

We can now catch a `MismatchedParentheses` exception as `MismatchedParentheses`, `SomeFrontendException` or `SomeCompilerException`, but not other types, e.g. `IOException`:

    *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
    Caught MismatchedParentheses
    *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
    Caught MismatchedParentheses
    *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
    Caught MismatchedParentheses
    *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
    *** Exception: MismatchedParentheses

Methods

toException :: e -> SomeException #

fromException :: SomeException -> Maybe e #

displayException :: e -> String #

Render this exception value in a human-friendly manner.

Default implementation: ``show``.

Since: base-4.8.0.0

Instances

Exception Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String #
Exception PatternMatchFail | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException # fromException :: SomeException -> Maybe PatternMatchFail # displayException :: PatternMatchFail -> String #
Exception RecSelError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecSelError -> SomeException # fromException :: SomeException -> Maybe RecSelError # displayException :: RecSelError -> String #
Exception RecConError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecConError -> SomeException # fromException :: SomeException -> Maybe RecConError # displayException :: RecConError -> String #
Exception RecUpdError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: RecUpdError -> SomeException # fromException :: SomeException -> Maybe RecUpdError # displayException :: RecUpdError -> String #
Exception NoMethodError | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NoMethodError -> SomeException # fromException :: SomeException -> Maybe NoMethodError # displayException :: NoMethodError -> String #
Exception TypeError | Since: base-4.9.0.0
Instance details Defined in Control.Exception.Base Methods toException :: TypeError -> SomeException # fromException :: SomeException -> Maybe TypeError # displayException :: TypeError -> String #
Exception NonTermination | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NonTermination -> SomeException # fromException :: SomeException -> Maybe NonTermination # displayException :: NonTermination -> String #
Exception NestedAtomically | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods toException :: NestedAtomically -> SomeException # fromException :: SomeException -> Maybe NestedAtomically # displayException :: NestedAtomically -> String #
Exception Dynamic | Since: base-4.0.0.0
Instance details Defined in Data.Dynamic Methods toException :: Dynamic -> SomeException # fromException :: SomeException -> Maybe Dynamic # displayException :: Dynamic -> String #
Exception BlockedIndefinitelyOnMVar | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnMVar -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar # displayException :: BlockedIndefinitelyOnMVar -> String #
Exception BlockedIndefinitelyOnSTM | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnSTM -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM # displayException :: BlockedIndefinitelyOnSTM -> String #
Exception Deadlock | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String #
Exception AllocationLimitExceeded | Since: base-4.8.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AllocationLimitExceeded -> SomeException # fromException :: SomeException -> Maybe AllocationLimitExceeded # displayException :: AllocationLimitExceeded -> String #
Exception CompactionFailed | Since: base-4.10.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # displayException :: CompactionFailed -> String #
Exception AssertionFailed | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String #
Exception SomeAsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # displayException :: SomeAsyncException -> String #
Exception AsyncException | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String #
Exception ArrayException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String #
Exception FixIOException | Since: base-4.11.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: FixIOException -> SomeException # fromException :: SomeException -> Maybe FixIOException # displayException :: FixIOException -> String #
Exception ExitCode | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String #
Exception IOException | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String #
Exception ErrorCall | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String #
Exception ArithException | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String #
Exception SomeException | Since: base-3.0
Instance details Defined in GHC.Exception Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String #
Exception Timeout | Since: base-4.7.0.0
Instance details Defined in System.Timeout Methods toException :: Timeout -> SomeException # fromException :: SomeException -> Maybe Timeout # displayException :: Timeout -> String #

data ErrorCall #

This is thrown when the user calls `error`. The first `String` is the argument given to `error`, second `String` is the location.

Constructors

ErrorCallWithLocation String String |

Bundled Patterns

pattern ErrorCall :: String -> ErrorCall |

Instances

Eq ErrorCall |
Instance details Defined in GHC.Exception Methods (==) :: ErrorCall -> ErrorCall -> Bool # (/=) :: ErrorCall -> ErrorCall -> Bool #
Ord ErrorCall |
Instance details Defined in GHC.Exception Methods compare :: ErrorCall -> ErrorCall -> Ordering # (<) :: ErrorCall -> ErrorCall -> Bool # (<=) :: ErrorCall -> ErrorCall -> Bool # (>) :: ErrorCall -> ErrorCall -> Bool # (>=) :: ErrorCall -> ErrorCall -> Bool # max :: ErrorCall -> ErrorCall -> ErrorCall # min :: ErrorCall -> ErrorCall -> ErrorCall #
Show ErrorCall | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ErrorCall -> ShowS # show :: ErrorCall -> String # showList :: [ErrorCall] -> ShowS #
Exception ErrorCall | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String #

data ArithException #

Arithmetic exceptions.

Constructors

Overflow |
Underflow |
LossOfPrecision |
DivideByZero |
Denormal |
RatioZeroDenominator | Since: base-4.6.0.0

Instances

Eq ArithException |
Instance details Defined in GHC.Exception Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool #
Ord ArithException |
Instance details Defined in GHC.Exception Methods compare :: ArithException -> ArithException -> Ordering # (<) :: ArithException -> ArithException -> Bool # (<=) :: ArithException -> ArithException -> Bool # (>) :: ArithException -> ArithException -> Bool # (>=) :: ArithException -> ArithException -> Bool # max :: ArithException -> ArithException -> ArithException # min :: ArithException -> ArithException -> ArithException #
Show ArithException | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ArithException -> ShowS # show :: ArithException -> String # showList :: [ArithException] -> ShowS #
Exception ArithException | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String #

typeOf7 :: Typeable t => t a b c d e f g -> TypeRep #

typeOf6 :: Typeable t => t a b c d e f -> TypeRep #

typeOf5 :: Typeable t => t a b c d e -> TypeRep #

typeOf4 :: Typeable t => t a b c d -> TypeRep #

typeOf3 :: Typeable t => t a b c -> TypeRep #

typeOf2 :: Typeable t => t a b -> TypeRep #

typeOf1 :: Typeable t => t a -> TypeRep #

rnfTypeRep :: TypeRep -> () #

Force a `TypeRep` to normal form.

typeRepFingerprint :: TypeRep -> Fingerprint #

Takes a value of type `a` and returns a concrete representation of that type.

Since: base-4.7.0.0

typeRepTyCon :: TypeRep -> TyCon #

Observe the type constructor of a quantified type representation.

typeRepArgs :: TypeRep -> [TypeRep] #

Observe the argument types of a type representation

splitTyConApp :: TypeRep -> (TyCon, [TypeRep]) #

Splits a type constructor application. Note that if the type constructor is polymorphic, this will not return the kinds that were used.

mkFunTy :: TypeRep -> TypeRep -> TypeRep #

Build a function type.

funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep #

Applies a type to a function type. Returns: `Just u` if the first argument represents a function of type `t -> u` and the second argument represents a function of type `t`. Otherwise, returns `Nothing`.

gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b)) #

Cast over `k1 -> k2 -> k3`

gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a)) #

Cast over `k1 -> k2`

gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b) #

A flexible variation parameterised in a type constructor

eqT :: (Typeable a, Typeable b) => Maybe (a :~: b) #

Extract a witness of equality of two types

Since: base-4.7.0.0

cast :: (Typeable a, Typeable b) => a -> Maybe b #

The type-safe cast operation

showsTypeRep :: TypeRep -> ShowS #

Show a type representation

typeRep :: Typeable a => proxy a -> TypeRep #

Takes a value of type `a` and returns a concrete representation of that type.

Since: base-4.7.0.0

typeOf :: Typeable a => a -> TypeRep #

Observe a type representation for the type of a value.

type TypeRep = SomeTypeRep #

A quantified type representation.

rnfTyCon :: TyCon -> () #

tyConFingerprint :: TyCon -> Fingerprint #

tyConName :: TyCon -> String #

tyConModule :: TyCon -> String #

tyConPackage :: TyCon -> String #

newtype Const a (b :: k) :: forall k. * -> k -> * #

The `Const` functor.

Constructors

Const |
Fields getConst :: a

Instances

Generic1 (Const a :: k -> *) |
Instance details Defined in Data.Functor.Const Associated Types type Rep1 (Const a) :: k -> * # Methods from1 :: Const a a0 -> Rep1 (Const a) a0 # to1 :: Rep1 (Const a) a0 -> Const a a0 #
Bifunctor (Const :: * -> * -> *) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d # first :: (a -> b) -> Const a c -> Const b c # second :: (b -> c) -> Const a b -> Const a c #
Eq2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const a c -> Const b d -> Bool #
Ord2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const a c -> Const b d -> Ordering #
Read2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] #
Show2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS #
Functor (Const m :: * -> *) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Monoid m => Applicative (Const m :: * -> *) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a # (<*>) :: Const m (a -> b) -> Const m a -> Const m b # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c # (*>) :: Const m a -> Const m b -> Const m b # (<*) :: Const m a -> Const m b -> Const m a #
Foldable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # toList :: Const m a -> [a] # null :: Const m a -> Bool # length :: Const m a -> Int # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # sum :: Num a => Const m a -> a # product :: Num a => Const m a -> a #
Traversable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #
Eq a => Eq1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool #
Ord a => Ord1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering #
Read a => Read1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] #
Show a => Show1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS #
Bounded a => Bounded (Const a b) |
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b # maxBound :: Const a b #
Enum a => Enum (Const a b) |
Instance details Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # toEnum :: Int -> 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] #
Eq a => Eq (Const a b) |
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool # (/=) :: Const a b -> Const a b -> Bool #
Floating a => Floating (Const a b) |
Instance details Defined in Data.Functor.Const Methods pi :: Const a b # 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 # log1pexp :: Const a b -> Const a b # log1mexp :: Const a b -> Const a b #
Fractional a => Fractional (Const a b) |
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b # recip :: Const a b -> Const a b # fromRational :: Rational -> Const a b #
Integral a => Integral (Const a b) |
Instance details Defined in 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) # toInteger :: Const a b -> Integer #
(Typeable k, Data a, Typeable b) => Data (Const a b) | Since: base-4.10.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Const a b -> c (Const a b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Const a b) # toConstr :: Const a b -> Constr # dataTypeOf :: Const a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Const a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Const a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Const a b -> Const a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Const a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Const a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) #
Num a => Num (Const a b) |
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b # (-) :: Const a b -> Const a b -> Const a b # (*) :: Const a b -> Const a b -> Const a b # negate :: Const a b -> Const a b # abs :: Const a b -> Const a b # signum :: Const a b -> Const a b # fromInteger :: Integer -> Const a b #
Ord a => Ord (Const a b) |
Instance details Defined in Data.Functor.Const Methods compare :: Const a b -> Const a b -> Ordering # (<) :: Const a b -> Const a b -> Bool # (<=) :: Const a b -> Const a b -> Bool # (>) :: Const a b -> Const a b -> Bool # (>=) :: Const a b -> Const a b -> Bool # max :: Const a b -> Const a b -> Const a b # min :: Const a b -> Const a b -> Const a b #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) # readList :: ReadS [Const a b] # readPrec :: ReadPrec (Const a b) # readListPrec :: ReadPrec [Const a b] #
Real a => Real (Const a b) |
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational #
RealFloat a => RealFloat (Const a b) |
Instance details Defined in 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 # isNaN :: Const a b -> Bool # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # isIEEE :: Const a b -> Bool # atan2 :: Const a b -> Const a b -> Const a b #
RealFrac a => RealFrac (Const a b) |
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) # truncate :: Integral b0 => Const a b -> b0 # round :: Integral b0 => Const a b -> b0 # ceiling :: Integral b0 => Const a b -> b0 # floor :: Integral b0 => Const a b -> b0 #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS # show :: Const a b -> String # showList :: [Const a b] -> ShowS #
Ix a => Ix (Const a b) |
Instance details Defined in Data.Functor.Const Methods range :: (Const a b, Const a b) -> [Const a b] # index :: (Const a b, Const a b) -> Const a b -> Int # unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int inRange :: (Const a b, Const a b) -> Const a b -> Bool # rangeSize :: (Const a b, Const a b) -> Int # unsafeRangeSize :: (Const a b, Const a b) -> Int
IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Const a b #
Generic (Const a b) |
Instance details Defined in Data.Functor.Const Associated Types type Rep (Const a b) :: * -> * # Methods from :: Const a b -> Rep (Const a b) x # to :: Rep (Const a b) x -> Const a b #
Semigroup a => Semigroup (Const a b) |
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b # sconcat :: NonEmpty (Const a b) -> Const a b # stimes :: Integral b0 => b0 -> Const a b -> Const a b #
Monoid a => Monoid (Const a b) |
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b # mappend :: Const a b -> Const a b -> Const a b # mconcat :: [Const a b] -> Const a b #
Storable a => Storable (Const a b) |
Instance details Defined in Data.Functor.Const Methods sizeOf :: Const a b -> Int # alignment :: Const a b -> Int # peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) # pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () # peekByteOff :: Ptr b0 -> Int -> IO (Const a b) # pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () # peek :: Ptr (Const a b) -> IO (Const a b) # poke :: Ptr (Const a b) -> Const a b -> IO () #
Bits a => Bits (Const a b) |
Instance details Defined in Data.Functor.Const Methods (.&.) :: Const a b -> Const a b -> Const a b # (.|.) :: Const a b -> Const a b -> Const a b # xor :: Const a b -> Const a b -> Const a b # complement :: Const a b -> Const a b # shift :: Const a b -> Int -> Const a b # rotate :: Const a b -> Int -> Const a b # zeroBits :: Const a b # bit :: Int -> Const a b # setBit :: Const a b -> Int -> Const a b # clearBit :: Const a b -> Int -> Const a b # complementBit :: Const a b -> Int -> Const a b # testBit :: Const a b -> Int -> Bool # bitSizeMaybe :: Const a b -> Maybe Int # bitSize :: Const a b -> Int # isSigned :: Const a b -> Bool # shiftL :: Const a b -> Int -> Const a b # unsafeShiftL :: Const a b -> Int -> Const a b # shiftR :: Const a b -> Int -> Const a b # unsafeShiftR :: Const a b -> Int -> Const a b # rotateL :: Const a b -> Int -> Const a b # rotateR :: Const a b -> Int -> Const a b # popCount :: Const a b -> Int #
FiniteBits a => FiniteBits (Const a b) |
Instance details Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int # countLeadingZeros :: Const a b -> Int # countTrailingZeros :: Const a b -> Int #
type Rep1 (Const a :: k -> *) |
Instance details Defined in Data.Functor.Const type Rep1 (Const a :: k -> *) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep (Const a b) |
Instance details Defined in Data.Functor.Const type Rep (Const a b) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

find :: Foldable t => (a -> Bool) -> t a -> Maybe a #

The `find` function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or `Nothing` if there is no such element.

notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 #

`notElem` is the negation of `elem`.

minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The least element of a non-empty structure with respect to the given comparison function.

maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a #

The largest element of a non-empty structure with respect to the given comparison function.

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

Determines whether all elements of the structure satisfy the predicate.

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

Determines whether any element of the structure satisfies the predicate.

or :: Foldable t => t Bool -> Bool #

`or` returns the disjunction of a container of Bools. For the result to be `False`, the container must be finite; `True`, however, results from a `True` value finitely far from the left end.

and :: Foldable t => t Bool -> Bool #

`and` returns the conjunction of a container of Bools. For the result to be `True`, the container must be finite; `False`, however, results from a `False` value finitely far from the left end.

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #

Map a function over all the elements of a container and concatenate the resulting lists.

concat :: Foldable t => t [a] -> [a] #

The concatenation of all the elements of a container of lists.

msum :: (Foldable t, MonadPlus m) => t (m a) -> m a #

The sum of a collection of actions, generalizing `concat`. As of base 4.8.0.0, `msum` is just `asum`, specialized to `MonadPlus`.

asum :: (Foldable t, Alternative f) => t (f a) -> f a #

The sum of a collection of actions, generalizing `concat`.

asum [Just Hello, Nothing, Just World] Just Hello

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see `sequence`.

As of base 4.8.0.0, `sequence_` is just `sequenceA_`, specialized to `Monad`.

sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f () #

Evaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see `sequenceA`.

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () #

`forM_` is `mapM_` with its arguments flipped. For a version that doesn't ignore the results see `forM`.

As of base 4.8.0.0, `forM_` is just `for_`, specialized to `Monad`.

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `mapM`.

As of base 4.8.0.0, `mapM_` is just `traverse_`, specialized to `Monad`.

for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () #

`for_` is `traverse_` with its arguments flipped. For a version that doesn't ignore the results see `for`.

    >>> for_ [1..4] print
    1
    2
    3
    4

traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () #

Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `traverse`.

foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

stimesMonoid :: (Integral b, Monoid a) => b -> a -> a #

This is a valid definition of `stimes` for a `Monoid`.

Unlike the default definition of `stimes`, it is defined for 0 and so it should be preferred where possible.

stimesIdempotent :: Integral b => b -> a -> a #

This is a valid definition of `stimes` for an idempotent `Semigroup`.

When `x <> x = x`, this definition should be preferred, because it works in O(1) rather than O(log n).

newtype Dual a #

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

    >>> getDual (mappend (Dual "Hello") (Dual "World"))
    "WorldHello"

Constructors

Dual |
Fields getDual :: a

Instances

Monad Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Dual a -> (a -> Dual b) -> Dual b # (>>) :: Dual a -> Dual b -> Dual b # return :: a -> Dual a # fail :: String -> Dual a #
Functor Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b # (<$) :: a -> Dual b -> Dual a #
MonadFix Dual | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Dual a) -> Dual a #
Applicative Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a # (<*>) :: Dual (a -> b) -> Dual a -> Dual b # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c # (*>) :: Dual a -> Dual b -> Dual b # (<*) :: Dual a -> Dual b -> Dual a #
Foldable Dual | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # toList :: Dual a -> [a] # null :: Dual a -> Bool # length :: Dual a -> Int # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # minimum :: Ord a => Dual a -> a # sum :: Num a => Dual a -> a # product :: Num a => Dual a -> a #
Traversable Dual | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) # sequenceA :: Applicative f => Dual (f a) -> f (Dual a) # mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) # sequence :: Monad m => Dual (m a) -> m (Dual a) #
Bounded a => Bounded (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Dual a # maxBound :: Dual a #
Eq a => Eq (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Dual a -> Dual a -> Bool # (/=) :: Dual a -> Dual a -> Bool #
Data a => Data (Dual a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dual a -> c (Dual a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dual a) # toConstr :: Dual a -> Constr # dataTypeOf :: Dual a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dual a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dual a)) # gmapT :: (forall b. Data b => b -> b) -> Dual a -> Dual a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dual a -> r # gmapQ :: (forall d. Data d => d -> u) -> Dual a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dual a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dual a -> m (Dual a) #
Ord a => Ord (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Dual a -> Dual a -> Ordering # (<) :: Dual a -> Dual a -> Bool # (<=) :: Dual a -> Dual a -> Bool # (>) :: Dual a -> Dual a -> Bool # (>=) :: Dual a -> Dual a -> Bool # max :: Dual a -> Dual a -> Dual a # min :: Dual a -> Dual a -> Dual a #
Read a => Read (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Dual a) # readList :: ReadS [Dual a] # readPrec :: ReadPrec (Dual a) # readListPrec :: ReadPrec [Dual a] #
Show a => Show (Dual a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Dual a -> ShowS # show :: Dual a -> String # showList :: [Dual a] -> ShowS #
Generic (Dual a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Dual a) :: * -> * # Methods from :: Dual a -> Rep (Dual a) x # to :: Rep (Dual a) x -> Dual a #
Semigroup a => Semigroup (Dual a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Dual a -> Dual a -> Dual a # sconcat :: NonEmpty (Dual a) -> Dual a # stimes :: Integral b => b -> Dual a -> Dual a #
Monoid a => Monoid (Dual a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Dual a # mappend :: Dual a -> Dual a -> Dual a # mconcat :: [Dual a] -> Dual a #
Generic1 Dual |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep1 Dual :: k -> * # Methods from1 :: Dual a -> Rep1 Dual a # to1 :: Rep1 Dual a -> Dual a #
type Rep (Dual a) |
Instance details Defined in Data.Semigroup.Internal type Rep (Dual a) = D1 (MetaData "Dual" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Dual |
Instance details Defined in Data.Semigroup.Internal type Rep1 Dual = D1 (MetaData "Dual" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Endo a #

The monoid of endomorphisms under composition.

    >>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
    >>> appEndo computation "Haskell"
    "Hello, Haskell!"

Constructors

Endo |
Fields appEndo :: a -> a

Instances

Generic (Endo a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Endo a) :: * -> * # Methods from :: Endo a -> Rep (Endo a) x # to :: Rep (Endo a) x -> Endo a #
Semigroup (Endo a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Endo a -> Endo a -> Endo a # sconcat :: NonEmpty (Endo a) -> Endo a # stimes :: Integral b => b -> Endo a -> Endo a #
Monoid (Endo a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Endo a # mappend :: Endo a -> Endo a -> Endo a # mconcat :: [Endo a] -> Endo a #
type Rep (Endo a) |
Instance details Defined in Data.Semigroup.Internal type Rep (Endo a) = D1 (MetaData "Endo" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Endo" PrefixI True) (S1 (MetaSel (Just "appEndo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a -> a))))

newtype All #

Boolean monoid under conjunction (`&&`).

    >>> getAll (All True <> mempty <> All False)
    False

    >>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
    False

Constructors

All |
Fields getAll :: Bool

Instances

Bounded All |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: All # maxBound :: All #
Eq All |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: All -> All -> Bool # (/=) :: All -> All -> Bool #
Data All | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All # toConstr :: All -> Constr # dataTypeOf :: All -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c All) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) # gmapT :: (forall b. Data b => b -> b) -> All -> All # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQ :: (forall d. Data d => d -> u) -> All -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All #
Ord All |
Instance details Defined in Data.Semigroup.Internal Methods compare :: All -> All -> Ordering # (<) :: All -> All -> Bool # (<=) :: All -> All -> Bool # (>) :: All -> All -> Bool # (>=) :: All -> All -> Bool # max :: All -> All -> All # min :: All -> All -> All #
Read All |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS All # readList :: ReadS [All] # readPrec :: ReadPrec All # readListPrec :: ReadPrec [All] #
Show All |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> All -> ShowS # show :: All -> String # showList :: [All] -> ShowS #
Generic All |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep All :: * -> * # Methods from :: All -> Rep All x # to :: Rep All x -> All #
Semigroup All | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: All -> All -> All # sconcat :: NonEmpty All -> All # stimes :: Integral b => b -> All -> All #
Monoid All | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: All # mappend :: All -> All -> All # mconcat :: [All] -> All #
type Rep All |
Instance details Defined in Data.Semigroup.Internal type Rep All = D1 (MetaData "All" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "All" PrefixI True) (S1 (MetaSel (Just "getAll") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))

newtype Any #

Boolean monoid under disjunction (`||`).

    >>> getAny (Any True <> mempty <> Any False)
    True

    >>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
    True

Constructors

Any |
Fields getAny :: Bool

Instances

Bounded Any |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Any # maxBound :: Any #
Eq Any |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Any -> Any -> Bool # (/=) :: Any -> Any -> Bool #
Data Any | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any # toConstr :: Any -> Constr # dataTypeOf :: Any -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Any) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) # gmapT :: (forall b. Data b => b -> b) -> Any -> Any # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any #
Ord Any |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Any -> Any -> Ordering # (<) :: Any -> Any -> Bool # (<=) :: Any -> Any -> Bool # (>) :: Any -> Any -> Bool # (>=) :: Any -> Any -> Bool # max :: Any -> Any -> Any # min :: Any -> Any -> Any #
Read Any |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS Any # readList :: ReadS [Any] # readPrec :: ReadPrec Any # readListPrec :: ReadPrec [Any] #
Show Any |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Any -> ShowS # show :: Any -> String # showList :: [Any] -> ShowS #
Generic Any |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep Any :: * -> * # Methods from :: Any -> Rep Any x # to :: Rep Any x -> Any #
Semigroup Any | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Any -> Any -> Any # sconcat :: NonEmpty Any -> Any # stimes :: Integral b => b -> Any -> Any #
Monoid Any | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Any # mappend :: Any -> Any -> Any # mconcat :: [Any] -> Any #
type Rep Any |
Instance details Defined in Data.Semigroup.Internal type Rep Any = D1 (MetaData "Any" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Any" PrefixI True) (S1 (MetaSel (Just "getAny") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))

newtype Sum a #

Monoid under addition.

    >>> getSum (Sum 1 <> Sum 2 <> mempty)
    3

Constructors

Sum |
Fields getSum :: a

Instances

Monad Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Sum a -> (a -> Sum b) -> Sum b # (>>) :: Sum a -> Sum b -> Sum b # return :: a -> Sum a # fail :: String -> Sum a #
Functor Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b # (<$) :: a -> Sum b -> Sum a #
MonadFix Sum | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Sum a) -> Sum a #
Applicative Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a # (<*>) :: Sum (a -> b) -> Sum a -> Sum b # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c # (*>) :: Sum a -> Sum b -> Sum b # (<*) :: Sum a -> Sum b -> Sum a #
Foldable Sum | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # toList :: Sum a -> [a] # null :: Sum a -> Bool # length :: Sum a -> Int # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # minimum :: Ord a => Sum a -> a # sum :: Num a => Sum a -> a # product :: Num a => Sum a -> a #
Traversable Sum | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) # sequenceA :: Applicative f => Sum (f a) -> f (Sum a) # mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) # sequence :: Monad m => Sum (m a) -> m (Sum a) #
Bounded a => Bounded (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Sum a # maxBound :: Sum a #
Eq a => Eq (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Sum a -> Sum a -> Bool # (/=) :: Sum a -> Sum a -> Bool #
Data a => Data (Sum a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum a -> c (Sum a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum a) # toConstr :: Sum a -> Constr # dataTypeOf :: Sum a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sum a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum a)) # gmapT :: (forall b. Data b => b -> b) -> Sum a -> Sum a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum a -> r # gmapQ :: (forall d. Data d => d -> u) -> Sum a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum a -> m (Sum a) #
Num a => Num (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Sum a -> Sum a -> Sum a # (-) :: Sum a -> Sum a -> Sum a # (*) :: Sum a -> Sum a -> Sum a # negate :: Sum a -> Sum a # abs :: Sum a -> Sum a # signum :: Sum a -> Sum a # fromInteger :: Integer -> Sum a #
Ord a => Ord (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Sum a -> Sum a -> Ordering # (<) :: Sum a -> Sum a -> Bool # (<=) :: Sum a -> Sum a -> Bool # (>) :: Sum a -> Sum a -> Bool # (>=) :: Sum a -> Sum a -> Bool # max :: Sum a -> Sum a -> Sum a # min :: Sum a -> Sum a -> Sum a #
Read a => Read (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Sum a) # readList :: ReadS [Sum a] # readPrec :: ReadPrec (Sum a) # readListPrec :: ReadPrec [Sum a] #
Show a => Show (Sum a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Sum a -> ShowS # show :: Sum a -> String # showList :: [Sum a] -> ShowS #
Generic (Sum a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Sum a) :: * -> * # Methods from :: Sum a -> Rep (Sum a) x # to :: Rep (Sum a) x -> Sum a #
Num a => Semigroup (Sum a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Sum a -> Sum a -> Sum a # sconcat :: NonEmpty (Sum a) -> Sum a # stimes :: Integral b => b -> Sum a -> Sum a #
Num a => Monoid (Sum a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Sum a # mappend :: Sum a -> Sum a -> Sum a # mconcat :: [Sum a] -> Sum a #
Generic1 Sum |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep1 Sum :: k -> * # Methods from1 :: Sum a -> Rep1 Sum a # to1 :: Rep1 Sum a -> Sum a #
type Rep (Sum a) |
Instance details Defined in Data.Semigroup.Internal type Rep (Sum a) = D1 (MetaData "Sum" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Sum |
Instance details Defined in Data.Semigroup.Internal type Rep1 Sum = D1 (MetaData "Sum" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Product a #

Monoid under multiplication.

    >>> getProduct (Product 3 <> Product 4 <> mempty)
    12

Constructors

Product |
Fields getProduct :: a

Instances

Monad Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Product a -> (a -> Product b) -> Product b # (>>) :: Product a -> Product b -> Product b # return :: a -> Product a # fail :: String -> Product a #
Functor Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b # (<$) :: a -> Product b -> Product a #
MonadFix Product | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Product a) -> Product a #
Applicative Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a # (<*>) :: Product (a -> b) -> Product a -> Product b # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c # (*>) :: Product a -> Product b -> Product b # (<*) :: Product a -> Product b -> Product a #
Foldable Product | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # toList :: Product a -> [a] # null :: Product a -> Bool # length :: Product a -> Int # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # sum :: Num a => Product a -> a # product :: Num a => Product a -> a #
Traversable Product | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) # sequenceA :: Applicative f => Product (f a) -> f (Product a) # mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) # sequence :: Monad m => Product (m a) -> m (Product a) #
Bounded a => Bounded (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Product a # maxBound :: Product a #
Eq a => Eq (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Product a -> Product a -> Bool # (/=) :: Product a -> Product a -> Bool #
Data a => Data (Product a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Product a -> c (Product a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product a) # toConstr :: Product a -> Constr # dataTypeOf :: Product a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product a)) # gmapT :: (forall b. Data b => b -> b) -> Product a -> Product a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product a -> r # gmapQ :: (forall d. Data d => d -> u) -> Product a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Product a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product a -> m (Product a) #
Num a => Num (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Product a -> Product a -> Product a # (-) :: Product a -> Product a -> Product a # (*) :: Product a -> Product a -> Product a # negate :: Product a -> Product a # abs :: Product a -> Product a # signum :: Product a -> Product a # fromInteger :: Integer -> Product a #
Ord a => Ord (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Product a -> Product a -> Ordering # (<) :: Product a -> Product a -> Bool # (<=) :: Product a -> Product a -> Bool # (>) :: Product a -> Product a -> Bool # (>=) :: Product a -> Product a -> Bool # max :: Product a -> Product a -> Product a # min :: Product a -> Product a -> Product a #
Read a => Read (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Product a) # readList :: ReadS [Product a] # readPrec :: ReadPrec (Product a) # readListPrec :: ReadPrec [Product a] #
Show a => Show (Product a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Product a -> ShowS # show :: Product a -> String # showList :: [Product a] -> ShowS #
Generic (Product a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Product a) :: * -> * # Methods from :: Product a -> Rep (Product a) x # to :: Rep (Product a) x -> Product a #
Num a => Semigroup (Product a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Product a -> Product a -> Product a # sconcat :: NonEmpty (Product a) -> Product a # stimes :: Integral b => b -> Product a -> Product a #
Num a => Monoid (Product a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Product a # mappend :: Product a -> Product a -> Product a # mconcat :: [Product a] -> Product a #
Generic1 Product |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep1 Product :: k -> * # Methods from1 :: Product a -> Rep1 Product a # to1 :: Rep1 Product a -> Product a #
type Rep (Product a) |
Instance details Defined in Data.Semigroup.Internal type Rep (Product a) = D1 (MetaData "Product" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Product |
Instance details Defined in Data.Semigroup.Internal type Rep1 Product = D1 (MetaData "Product" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

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

Monoid under `<|>`.

Since: base-4.8.0.0

Constructors

Alt |
Fields getAlt :: f a

Instances

Generic1 (Alt f :: k -> *) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep1 (Alt f) :: k -> * # Methods from1 :: Alt f a -> Rep1 (Alt f) a # to1 :: Rep1 (Alt f) a -> Alt f a #
Monad f => Monad (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b # (>>) :: Alt f a -> Alt f b -> Alt f b # return :: a -> Alt f a # fail :: String -> Alt f a #
Functor f => Functor (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b # (<$) :: a -> Alt f b -> Alt f a #
MonadFix f => MonadFix (Alt f) | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Alt f a) -> Alt f a #
Applicative f => Applicative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c # (*>) :: Alt f a -> Alt f b -> Alt f b # (<*) :: Alt f a -> Alt f b -> Alt f a #
Alternative f => Alternative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods empty :: Alt f a # (<|>) :: Alt f a -> Alt f a -> Alt f a # some :: Alt f a -> Alt f [a] # many :: Alt f a -> Alt f [a] #
MonadPlus f => MonadPlus (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods mzero :: Alt f a # mplus :: Alt f a -> Alt f a -> Alt f a #
Enum (f a) => Enum (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods succ :: Alt f a -> Alt f a # pred :: Alt f a -> Alt f a # toEnum :: Int -> Alt f a # fromEnum :: Alt f a -> Int # enumFrom :: Alt f a -> [Alt f a] # enumFromThen :: Alt f a -> Alt f a -> [Alt f a] # enumFromTo :: Alt f a -> Alt f a -> [Alt f a] # enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] #
Eq (f a) => Eq (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Alt f a -> Alt f a -> Bool # (/=) :: Alt f a -> Alt f a -> Bool #
(Data (f a), Data a, Typeable f) => Data (Alt f a) | Since: base-4.8.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alt f a -> c (Alt f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alt f a) # toConstr :: Alt f a -> Constr # dataTypeOf :: Alt f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Alt f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alt f a)) # gmapT :: (forall b. Data b => b -> b) -> Alt f a -> Alt f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r # gmapQ :: (forall d. Data d => d -> u) -> Alt f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Alt f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) #
Num (f a) => Num (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Alt f a -> Alt f a -> Alt f a # (-) :: Alt f a -> Alt f a -> Alt f a # (*) :: Alt f a -> Alt f a -> Alt f a # negate :: Alt f a -> Alt f a # abs :: Alt f a -> Alt f a # signum :: Alt f a -> Alt f a # fromInteger :: Integer -> Alt f a #
Ord (f a) => Ord (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Alt f a -> Alt f a -> Ordering # (<) :: Alt f a -> Alt f a -> Bool # (<=) :: Alt f a -> Alt f a -> Bool # (>) :: Alt f a -> Alt f a -> Bool # (>=) :: Alt f a -> Alt f a -> Bool # max :: Alt f a -> Alt f a -> Alt f a # min :: Alt f a -> Alt f a -> Alt f a #
Read (f a) => Read (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Alt f a) # readList :: ReadS [Alt f a] # readPrec :: ReadPrec (Alt f a) # readListPrec :: ReadPrec [Alt f a] #
Show (f a) => Show (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Alt f a -> ShowS # show :: Alt f a -> String # showList :: [Alt f a] -> ShowS #
Generic (Alt f a) |
Instance details Defined in Data.Semigroup.Internal Associated Types type Rep (Alt f a) :: * -> * # Methods from :: Alt f a -> Rep (Alt f a) x # to :: Rep (Alt f a) x -> Alt f a #
Alternative f => Semigroup (Alt f a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Alt f a -> Alt f a -> Alt f a # sconcat :: NonEmpty (Alt f a) -> Alt f a # stimes :: Integral b => b -> Alt f a -> Alt f a #
Alternative f => Monoid (Alt f a) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Alt f a # mappend :: Alt f a -> Alt f a -> Alt f a # mconcat :: [Alt f a] -> Alt f a #
type Rep1 (Alt f :: k -> *) |
Instance details Defined in Data.Semigroup.Internal type Rep1 (Alt f :: k -> *) = D1 (MetaData "Alt" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 f)))
type Rep (Alt f a) |
Instance details Defined in Data.Semigroup.Internal type Rep (Alt f a) = D1 (MetaData "Alt" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))))

unsafeCoerce :: a -> b #

unwords :: [String] -> String #

`unwords` is an inverse operation to `words`. It joins words with separating spaces.

    >>> unwords ["Lorem", "ipsum", "dolor"]
    "Lorem ipsum dolor"

words :: String -> [String] #

`words` breaks a string up into a list of words, which were delimited by white space.

    >>> words "Lorem ipsum\ndolor"
    ["Lorem","ipsum","dolor"]

unlines :: [String] -> String #

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

    >>> unlines ["Hello", "World", "!"]
    "Hello\nWorld\n!\n"

lines :: String -> [String] #

`lines` breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.

Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,

    >>> lines ""
    []

    >>> lines "\n"
    [""]

    >>> lines "one"
    ["one"]

    >>> lines "one\n"
    ["one"]

    >>> lines "one\n\n"
    ["one",""]

    >>> lines "one\ntwo"
    ["one","two"]

    >>> lines "one\ntwo\n"
    ["one","two"]

Thus ``lines` s` contains at least as many elements as newlines in `s`.

unfoldr :: (b -> Maybe (a, b)) -> b -> [a] #

The `unfoldr` function is a `dual' to `foldr`: while `foldr` reduces a list to a summary value, `unfoldr` builds a list from a seed value. The function takes the element and returns `Nothing` if it is done producing the list or returns `Just` `(a,b)`, in which case, `a` is a prepended to the list and `b` is used as the next element in a recursive call. For example,

    iterate f == unfoldr (\x -> Just (x, f x))

In some cases, `unfoldr` can undo a `foldr` operation:

    unfoldr f' (foldr f z xs) == xs

if the following holds:

    f' (f x y) = Just (x,y)
    f' z       = Nothing

A simple use of unfoldr:

    >>> unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10
    [10,9,8,7,6,5,4,3,2,1]

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

Sort a list by comparing the results of a key function applied to each element. `sortOn f` is equivalent to `sortBy (comparing f)`, but has the performance advantage of only evaluating `f` once for each element in the input list. This is called the decorate-sort-undecorate paradigm, or Schwartzian transform.

Elements are arranged from from lowest to highest, keeping duplicates in the order they appeared in the input.

    >>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]
    [(1,"Hello"),(2,"world"),(4,"!")]

Since: base-4.8.0.0

sortBy :: (a -> a -> Ordering) -> [a] -> [a] #

The `sortBy` function is the non-overloaded version of `sort`.

    >>> sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")]
    [(1,"Hello"),(2,"world"),(4,"!")]

sort :: Ord a => [a] -> [a] #

The `sort` function implements a stable sorting algorithm. It is a special case of `sortBy`, which allows the programmer to supply their own comparison function.

Elements are arranged from from lowest to highest, keeping duplicates in the order they appeared in the input.

    >>> sort [1,6,4,3,2,5]
    [1,2,3,4,5,6]

permutations :: [a] -> [[a]] #

The `permutations` function returns the list of all permutations of the argument.

    >>> permutations "abc"
    ["abc","bac","cba","bca","cab","acb"]

subsequences :: [a] -> [[a]] #

The `subsequences` function returns the list of all subsequences of the argument.

    >>> subsequences "abc"
    ["","a","b","ab","c","ac","bc","abc"]

tails :: [a] -> [[a]] #

The `tails` function returns all final segments of the argument, longest first. For example,

    >>> tails "abc"
    ["abc","bc","c",""]

Note that `tails` has the following strictness property: `tails _|_ = _|_ : _|_`

inits :: [a] -> [[a]] #

The `inits` function returns all initial segments of the argument, shortest first. For example,

    >>> inits "abc"
    ["","a","ab","abc"]

Note that `inits` has the following strictness property: `inits (xs ++ _|_) = inits xs ++ _|_`

In particular, `inits _|_ = [] : _|_`

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

The `groupBy` function is the non-overloaded version of `group`.

group :: Eq a => [a] -> [[a]] #

The `group` function takes a list and returns a list of lists such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,

    >>> group "Mississippi"
    ["M","i","ss","i","ss","i","pp","i"]

It is a special case of `groupBy`, which allows the programmer to supply their own equality test.

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

The `deleteFirstsBy` function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed.

unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g]) #

The `unzip7` function takes a list of seven-tuples and returns seven lists, analogous to `unzip`.

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

The `unzip6` function takes a list of six-tuples and returns six lists, analogous to `unzip`.

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

The `unzip5` function takes a list of five-tuples and returns five lists, analogous to `unzip`.

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

The `unzip4` function takes a list of quadruples and returns four lists, analogous to `unzip`.

zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h] #

The `zipWith7` function takes a function which combines seven elements, as well as seven lists and returns a list of their point-wise combination, analogous to `zipWith`.

zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] #

The `zipWith6` function takes a function which combines six elements, as well as six lists and returns a list of their point-wise combination, analogous to `zipWith`.

zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] #

The `zipWith5` function takes a function which combines five elements, as well as five lists and returns a list of their point-wise combination, analogous to `zipWith`.

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

The `zipWith4` function takes a function which combines four elements, as well as four lists and returns a list of their point-wise combination, analogous to `zipWith`.

zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)] #

The `zip7` function takes seven lists and returns a list of seven-tuples, analogous to `zip`.

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

The `zip6` function takes six lists and returns a list of six-tuples, analogous to `zip`.

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

The `zip5` function takes five lists and returns a list of five-tuples, analogous to `zip`.

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

The `zip4` function takes four lists and returns a list of quadruples, analogous to `zip`.

genericReplicate :: Integral i => i -> a -> [a] #

The `genericReplicate` function is an overloaded version of `replicate`, which accepts any `Integral` value as the number of repetitions to make.

genericIndex :: Integral i => [a] -> i -> a #

The `genericIndex` function is an overloaded version of `!!`, which accepts any `Integral` value as the index.

genericSplitAt :: Integral i => i -> [a] -> ([a], [a]) #

The `genericSplitAt` function is an overloaded version of `splitAt`, which accepts any `Integral` value as the position at which to split.

genericDrop :: Integral i => i -> [a] -> [a] #

The `genericDrop` function is an overloaded version of `drop`, which accepts any `Integral` value as the number of elements to drop.

genericTake :: Integral i => i -> [a] -> [a] #

The `genericTake` function is an overloaded version of `take`, which accepts any `Integral` value as the number of elements to take.

genericLength :: Num i => [a] -> i #

The `genericLength` function is an overloaded version of `length`. In particular, instead of returning an `Int`, it returns any type which is an instance of `Num`. It is, however, less efficient than `length`.

insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a] #

The non-overloaded version of `insert`.

insert :: Ord a => a -> [a] -> [a] #

The `insert` function takes an element and a list and inserts the element into the list at the first position where it is less than or equal to the next element. In particular, if the list is sorted before the call, the result will also be sorted. It is a special case of `insertBy`, which allows the programmer to supply their own comparison function.

    >>> insert 4 [1,2,3,5,6,7]
    [1,2,3,4,5,6,7]

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

The `partition` function takes a predicate a list and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e.,

    partition p xs == (filter p xs, filter (not . p) xs)

    >>> partition (`elem` "aeiou") "Hello World!"
    ("eoo","Hll Wrld!")

transpose :: [[a]] -> [[a]] #

The `transpose` function transposes the rows and columns of its argument. For example,

    >>> transpose [[1,2,3],[4,5,6]]
    [[1,4],[2,5],[3,6]]

If some of the rows are shorter than the following rows, their elements are skipped:

    >>> transpose [[10,11],[20],[],[30,31,32]]
    [[10,20,30],[11,31],[32]]

intercalate :: [a] -> [[a]] -> [a] #

`intercalate` `xs xss` is equivalent to `(`concat` (`intersperse` xs xss))`. It inserts the list `xs` in between the lists in `xss` and concatenates the result.

    >>> intercalate ", " ["Lorem", "ipsum", "dolor"]
    "Lorem, ipsum, dolor"

intersperse :: a -> [a] -> [a] #

The `intersperse` function takes an element and a list and `intersperses' that element between the elements of the list. For example,

    >>> intersperse ',' "abcde"
    "a,b,c,d,e"

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

The `intersectBy` function is the non-overloaded version of `intersect`.

intersect :: Eq a => [a] -> [a] -> [a] #

The `intersect` function takes the list intersection of two lists. For example,

    >>> [1,2,3,4] `intersect` [2,4,6,8]
    [2,4]

If the first list contains duplicates, so will the result.

    >>> [1,2,2,3,4] `intersect` [6,4,4,2]
    [2,2,4]

It is a special case of `intersectBy`, which allows the programmer to supply their own equality test. If the element is found in both the first and the second list, the element from the first list will be used.

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

The `unionBy` function is the non-overloaded version of `union`.

union :: Eq a => [a] -> [a] -> [a] #

The `union` function returns the list union of the two lists. For example,

    >>> "dog" `union` "cow"
    "dogcw"

Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of `unionBy`, which allows the programmer to supply their own equality test.

(\\) :: Eq a => [a] -> [a] -> [a] infix 5 #

The `\\` function is list difference (non-associative). In the result of `xs` `\\` `ys`, the first occurrence of each element of `ys` in turn (if any) has been removed from `xs`. Thus

    (xs ++ ys) \\ xs == ys.

    >>> "Hello World!" \\ "ell W"
    "Hoorld!"

It is a special case of `deleteFirstsBy`, which allows the programmer to supply their own equality test.

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

The `deleteBy` function behaves like `delete`, but takes a user-supplied equality predicate.

    >>> deleteBy (<=) 4 [1..10]
    [1,2,3,5,6,7,8,9,10]

delete :: Eq a => a -> [a] -> [a] #

`delete` `x` removes the first occurrence of `x` from its list argument. For example,

    >>> delete 'a' "banana"
    "bnana"

It is a special case of `deleteBy`, which allows the programmer to supply their own equality test.

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

The `nubBy` function behaves just like `nub`, except it uses a user-supplied equality predicate instead of the overloaded `==` function.

    >>> nubBy (\x y -> mod x 3 == mod y 3) [1,2,4,5,6]
    [1,2,6]

nub :: Eq a => [a] -> [a] #

O(n^2). The `nub` function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. (The name `nub` means `essence'.) It is a special case of `nubBy`, which allows the programmer to supply their own equality test.

    >>> nub [1,2,3,4,3,2,1,2,4,3,5]
    [1,2,3,4,5]

isInfixOf :: Eq a => [a] -> [a] -> Bool #

The `isInfixOf` function takes two lists and returns `True` iff the first list is contained, wholly and intact, anywhere within the second.

    >>> isInfixOf "Haskell" "I really like Haskell."
    True

    >>> isInfixOf "Ial" "I really like Haskell."
    False

isSuffixOf :: Eq a => [a] -> [a] -> Bool #

The `isSuffixOf` function takes two lists and returns `True` iff the first list is a suffix of the second. The second list must be finite.

    >>> "ld!" `isSuffixOf` "Hello World!"
    True

    >>> "World" `isSuffixOf` "Hello World!"
    False

isPrefixOf :: Eq a => [a] -> [a] -> Bool #

The `isPrefixOf` function takes two lists and returns `True` iff the first list is a prefix of the second.

    >>> "Hello" `isPrefixOf` "Hello World!"
    True

    >>> "Hello" `isPrefixOf` "Wello Horld!"
    False

findIndices :: (a -> Bool) -> [a] -> [Int] #

The `findIndices` function extends `findIndex`, by returning the indices of all elements satisfying the predicate, in ascending order.

    >>> findIndices (`elem` "aeiou") "Hello World!"
    [1,4,7]

findIndex :: (a -> Bool) -> [a] -> Maybe Int #

The `findIndex` function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or `Nothing` if there is no such element.

    >>> findIndex isSpace "Hello World!"
    Just 5

elemIndices :: Eq a => a -> [a] -> [Int] #

The `elemIndices` function extends `elemIndex`, by returning the indices of all elements equal to the query element, in ascending order.

    >>> elemIndices 'o' "Hello World"
    [4,7]

elemIndex :: Eq a => a -> [a] -> Maybe Int #

The `elemIndex` function returns the index of the first element in the given list which is equal (by `==`) to the query element, or `Nothing` if there is no such element.

    >>> elemIndex 4 [0..]
    Just 4

stripPrefix :: Eq a => [a] -> [a] -> Maybe [a] #

The `stripPrefix` function drops the given prefix from a list. It returns `Nothing` if the list did not start with the prefix given, or `Just` the list after the prefix, if it does.

    >>> stripPrefix "foo" "foobar"
    Just "bar"

    >>> stripPrefix "foo" "foo"
    Just ""

    >>> stripPrefix "foo" "barfoo"
    Nothing

    >>> stripPrefix "foo" "barfoobaz"
    Nothing

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

The `dropWhileEnd` function drops the largest suffix of a list in which the given predicate holds for all elements. For example:

    >>> dropWhileEnd isSpace "foo\n"
    "foo"

    >>> dropWhileEnd isSpace "foo bar"
    "foo bar"

    dropWhileEnd isSpace ("foo\n" ++ undefined) == "foo" ++ undefined

Since: base-4.5.0.0

isSeparator :: Char -> Bool #

Selects Unicode space and separator characters.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `Space`
- `LineSeparator`
- `ParagraphSeparator`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Separator".

#### Examples

Expand

Basic usage:

    >>> isSeparator 'a'
    False
    >>> isSeparator '6'
    False
    >>> isSeparator ' '
    True

Warning: newlines and tab characters are not considered separators.

    >>> isSeparator '\n'
    False
    >>> isSeparator '\t'
    False

But some more exotic characters are (like HTML's `&nbsp;`):

    >>> isSeparator '\160'
    True

isNumber :: Char -> Bool #

Selects Unicode numeric characters, including digits from various scripts, Roman numerals, et cetera.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `DecimalNumber`
- `LetterNumber`
- `OtherNumber`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Number".

#### Examples

Expand

Basic usage:

    >>> isNumber 'a'
    False
    >>> isNumber '%'
    False
    >>> isNumber '3'
    True

ASCII `'0'` through `'9'` are all numbers:

    >>> and $ map isNumber ['0'..'9']
    True

Unicode Roman numerals are "numbers" as well:

    >>> isNumber 'Ⅸ'
    True

isMark :: Char -> Bool #

Selects Unicode mark characters, for example accents and the like, which combine with preceding characters.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `NonSpacingMark`
- `SpacingCombiningMark`
- `EnclosingMark`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Mark".

#### Examples

Expand

Basic usage:

    >>> isMark 'a'
    False
    >>> isMark '0'
    False

Combining marks such as accent characters usually need to follow another character before they become printable:

    >>> map isMark "ò"
    [False,True]

Puns are not necessarily supported:

    >>> isMark '✓'
    False

isLetter :: Char -> Bool #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to `isAlpha`.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `UppercaseLetter`
- `LowercaseLetter`
- `TitlecaseLetter`
- `ModifierLetter`
- `OtherLetter`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Letter".

#### Examples

Expand

Basic usage:

    >>> isLetter 'a'
    True
    >>> isLetter 'A'
    True
    >>> isLetter 'λ'
    True
    >>> isLetter '0'
    False
    >>> isLetter '%'
    False
    >>> isLetter '♥'
    False
    >>> isLetter '\31'
    False

Ensure that `isLetter` and `isAlpha` are equivalent.

    >>> let chars = [(chr 0)..]
    >>> let letters = map isLetter chars
    >>> let alphas = map isAlpha chars
    >>> letters == alphas
    True

digitToInt :: Char -> Int #

Convert a single digit `Char` to the corresponding `Int`. This function fails unless its argument satisfies `isHexDigit`, but recognises both upper- and lower-case hexadecimal digits (that is, `'0'`..`'9'`, `'a'`..`'f'`, `'A'`..`'F'`).

#### Examples

Expand

Characters `'0'` through `'9'` are converted properly to `0..9`:

    >>> map digitToInt ['0'..'9']
    [0,1,2,3,4,5,6,7,8,9]

Both upper- and lower-case `'A'` through `'F'` are converted as well, to `10..15`.

    >>> map digitToInt ['a'..'f']
    [10,11,12,13,14,15]
    >>> map digitToInt ['A'..'F']
    [10,11,12,13,14,15]

Anything else throws an exception:

    >>> digitToInt 'G'
    *** Exception: Char.digitToInt: not a digit 'G'
    >>> digitToInt '♥'
    *** Exception: Char.digitToInt: not a digit '\9829'

read :: Read a => String -> a #

The `read` function reads input from a string, which must be completely consumed by the input process. `read` fails with an `error` if the parse is unsuccessful, and it is therefore discouraged from being used in real applications. Use `readMaybe` or `readEither` for safe alternatives.

    >>> read "123" :: Int
    123

    >>> read "hello" :: Int
    *** Exception: Prelude.read: no parse

readMaybe :: Read a => String -> Maybe a #

Parse a string using the `Read` instance. Succeeds if there is exactly one valid result.

    >>> readMaybe "123" :: Maybe Int
    Just 123

    >>> readMaybe "hello" :: Maybe Int
    Nothing

Since: base-4.6.0.0

readEither :: Read a => String -> Either String a #

Parse a string using the `Read` instance. Succeeds if there is exactly one valid result. A `Left` value indicates a parse error.

    >>> readEither "123" :: Either String Int
    Right 123

    >>> readEither "hello" :: Either String Int
    Left "Prelude.read: no parse"

Since: base-4.6.0.0

reads :: Read a => ReadS a #

equivalent to `readsPrec` with a precedence of 0.

fromRight :: b -> Either a b -> b #

Return the contents of a `Right`-value or a default value otherwise.

#### Examples

Expand

Basic usage:

    >>> fromRight 1 (Right 3)
    3
    >>> fromRight 1 (Left "foo")
    1

Since: base-4.10.0.0

fromLeft :: a -> Either a b -> a #

Return the contents of a `Left`-value or a default value otherwise.

#### Examples

Expand

Basic usage:

    >>> fromLeft 1 (Left 3)
    3
    >>> fromLeft 1 (Right "foo")
    1

Since: base-4.10.0.0

isRight :: Either a b -> Bool #

Return `True` if the given value is a `Right`-value, `False` otherwise.

#### Examples

Expand

Basic usage:

    >>> isRight (Left "foo")
    False
    >>> isRight (Right 3)
    True

Assuming a `Left` value signifies some sort of error, we can use `isRight` to write a very simple reporting function that only outputs "SUCCESS" when a computation has succeeded.

This example shows how `isRight` might be used to avoid pattern matching when one does not care about the value contained in the constructor:

    >>> import Control.Monad ( when )
    >>> let report e = when (isRight e) $ putStrLn "SUCCESS"
    >>> report (Left "parse error")
    >>> report (Right 1)
    SUCCESS

Since: base-4.7.0.0

isLeft :: Either a b -> Bool #

Return `True` if the given value is a `Left`-value, `False` otherwise.

#### Examples

Expand

Basic usage:

    >>> isLeft (Left "foo")
    True
    >>> isLeft (Right 3)
    False

Assuming a `Left` value signifies some sort of error, we can use `isLeft` to write a very simple error-reporting function that does absolutely nothing in the case of success, and outputs "ERROR" if any error occurred.

This example shows how `isLeft` might be used to avoid pattern matching when one does not care about the value contained in the constructor:

    >>> import Control.Monad ( when )
    >>> let report e = when (isLeft e) $ putStrLn "ERROR"
    >>> report (Right 1)
    >>> report (Left "parse error")
    ERROR

Since: base-4.7.0.0

partitionEithers :: [Either a b] -> ([a], [b]) #

Partitions a list of `Either` into two lists. All the `Left` elements are extracted, in order, to the first component of the output. Similarly the `Right` elements are extracted to the second component of the output.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> partitionEithers list
    (["foo","bar","baz"],[3,7])

The pair returned by ``partitionEithers` x` should be the same pair as `(`lefts` x, `rights` x)`:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> partitionEithers list == (lefts list, rights list)
    True

rights :: [Either a b] -> [b] #

Extracts from a list of `Either` all the `Right` elements. All the `Right` elements are extracted in order.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> rights list
    [3,7]

lefts :: [Either a b] -> [a] #

Extracts from a list of `Either` all the `Left` elements. All the `Left` elements are extracted in order.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> lefts list
    ["foo","bar","baz"]

either :: (a -> c) -> (b -> c) -> Either a b -> c #

Case analysis for the `Either` type. If the value is ``Left` a`, apply the first function to `a`; if it is ``Right` b`, apply the second function to `b`.

#### Examples

Expand

We create two values of type ``Either` `String` `Int``, one using the `Left` constructor and another using the `Right` constructor. Then we apply "either" the `length` function (if we have a `String`) or the "times-two" function (if we have an `Int`):

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

comparing :: Ord a => (b -> a) -> b -> b -> Ordering #

    comparing p x y = compare (p x) (p y)

Useful combinator for use in conjunction with the `xxxBy` family of functions from Data.List, for example:

      ... sortBy (comparing fst) ...

newtype Down a #

The `Down` type allows you to reverse sort order conveniently. A value of type ``Down` a` contains a value of type `a` (represented as ``Down` a`). If `a` has an ``Ord`` instance associated with it then comparing two values thus wrapped will give you the opposite of their normal sort order. This is particularly useful when sorting in generalised list comprehensions, as in: `then sortWith by `Down` x`

Since: base-4.6.0.0

Constructors

Down a |

Instances

Monad Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (>>=) :: Down a -> (a -> Down b) -> Down b # (>>) :: Down a -> Down b -> Down b # return :: a -> Down a # fail :: String -> Down a #
Functor Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods fmap :: (a -> b) -> Down a -> Down b # (<$) :: a -> Down b -> Down a #
Applicative Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a # (<*>) :: Down (a -> b) -> Down a -> Down b # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c # (*>) :: Down a -> Down b -> Down b # (<*) :: Down a -> Down b -> Down a #
Eq a => Eq (Down a) |
Instance details Defined in Data.Ord Methods (==) :: Down a -> Down a -> Bool # (/=) :: Down a -> Down a -> Bool #
Num a => Num (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (+) :: Down a -> Down a -> Down a # (-) :: Down a -> Down a -> Down a # (*) :: Down a -> Down a -> Down a # negate :: Down a -> Down a # abs :: Down a -> Down a # signum :: Down a -> Down a # fromInteger :: Integer -> Down a #
Ord a => Ord (Down a) | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods compare :: Down a -> Down a -> Ordering # (<) :: Down a -> Down a -> Bool # (<=) :: Down a -> Down a -> Bool # (>) :: Down a -> Down a -> Bool # (>=) :: Down a -> Down a -> Bool # max :: Down a -> Down a -> Down a # min :: Down a -> Down a -> Down a #
Read a => Read (Down a) | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods readsPrec :: Int -> ReadS (Down a) # readList :: ReadS [Down a] # readPrec :: ReadPrec (Down a) # readListPrec :: ReadPrec [Down a] #
Show a => Show (Down a) | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods showsPrec :: Int -> Down a -> ShowS # show :: Down a -> String # showList :: [Down a] -> ShowS #
Semigroup a => Semigroup (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (<>) :: Down a -> Down a -> Down a # sconcat :: NonEmpty (Down a) -> Down a # stimes :: Integral b => b -> Down a -> Down a #
Monoid a => Monoid (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods mempty :: Down a # mappend :: Down a -> Down a -> Down a # mconcat :: [Down a] -> Down a #

asProxyTypeOf :: a -> proxy a -> a #

`asProxyTypeOf` is a type-restricted version of `const`. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the tag of the second.

    >>> import Data.Word
    >>> :type asProxyTypeOf 123 (Proxy :: Proxy Word8)
    asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8

Note the lower-case `proxy` in the definition. This allows any type constructor with just one argument to be passed to the function, for example we could also write

    >>> import Data.Word
    >>> :type asProxyTypeOf 123 (Just (undefined :: Word8))
    asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8

data Proxy (t :: k) :: forall k. k -> * #

`Proxy` is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, ``Proxy` :: `Proxy` a` is a safer alternative to the `'undefined :: a'` idiom.

    >>> Proxy :: Proxy (Void, Int -> Int)
    Proxy

Proxy can even hold types of higher kinds,

    >>> Proxy :: Proxy Either
    Proxy

    >>> Proxy :: Proxy Functor
    Proxy

    >>> Proxy :: Proxy complicatedStructure
    Proxy

Constructors

Proxy |

Instances

Generic1 (Proxy :: k -> *) |
Instance details Defined in GHC.Generics Associated Types type Rep1 Proxy :: k -> * # Methods from1 :: Proxy a -> Rep1 Proxy a # to1 :: Rep1 Proxy a -> Proxy a #
Monad (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b # (>>) :: Proxy a -> Proxy b -> Proxy b # return :: a -> Proxy a # fail :: String -> Proxy a #
Functor (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods fmap :: (a -> b) -> Proxy a -> Proxy b # (<$) :: a -> Proxy b -> Proxy a #
Applicative (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods pure :: a -> Proxy a # (<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b # liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c # (*>) :: Proxy a -> Proxy b -> Proxy b # (<*) :: Proxy a -> Proxy b -> Proxy a #
Foldable (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # toList :: Proxy a -> [a] # null :: Proxy a -> Bool # length :: Proxy a -> Int # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # sum :: Num a => Proxy a -> a # product :: Num a => Proxy a -> a #
Traversable (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) # sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) # mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) # sequence :: Monad m => Proxy (m a) -> m (Proxy a) #
Eq1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #
Ord1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #
Read1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #
Show1 (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #
Alternative (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods empty :: Proxy a # (<|>) :: Proxy a -> Proxy a -> Proxy a # some :: Proxy a -> Proxy [a] # many :: Proxy a -> Proxy [a] #
MonadPlus (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods mzero :: Proxy a # mplus :: Proxy a -> Proxy a -> Proxy a #
Bounded (Proxy t) |
Instance details Defined in Data.Proxy Methods minBound :: Proxy t # maxBound :: Proxy t #
Enum (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods succ :: Proxy s -> Proxy s # pred :: Proxy s -> Proxy s # toEnum :: Int -> Proxy s # fromEnum :: Proxy s -> Int # enumFrom :: Proxy s -> [Proxy s] # enumFromThen :: Proxy s -> Proxy s -> [Proxy s] # enumFromTo :: Proxy s -> Proxy s -> [Proxy s] # enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #
Eq (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (==) :: Proxy s -> Proxy s -> Bool # (/=) :: Proxy s -> Proxy s -> Bool #
Data t => Data (Proxy t) | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) #
Ord (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods compare :: Proxy s -> Proxy s -> Ordering # (<) :: Proxy s -> Proxy s -> Bool # (<=) :: Proxy s -> Proxy s -> Bool # (>) :: Proxy s -> Proxy s -> Bool # (>=) :: Proxy s -> Proxy s -> Bool # max :: Proxy s -> Proxy s -> Proxy s # min :: Proxy s -> Proxy s -> Proxy s #
Read (Proxy t) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods readsPrec :: Int -> ReadS (Proxy t) # readList :: ReadS [Proxy t] # readPrec :: ReadPrec (Proxy t) # readListPrec :: ReadPrec [Proxy t] #
Show (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods showsPrec :: Int -> Proxy s -> ShowS # show :: Proxy s -> String # showList :: [Proxy s] -> ShowS #
Ix (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods range :: (Proxy s, Proxy s) -> [Proxy s] # index :: (Proxy s, Proxy s) -> Proxy s -> Int # unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool # rangeSize :: (Proxy s, Proxy s) -> Int # unsafeRangeSize :: (Proxy s, Proxy s) -> Int
Generic (Proxy t) |
Instance details Defined in GHC.Generics Associated Types type Rep (Proxy t) :: * -> * # Methods from :: Proxy t -> Rep (Proxy t) x # to :: Rep (Proxy t) x -> Proxy t #
Semigroup (Proxy s) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods (<>) :: Proxy s -> Proxy s -> Proxy s # sconcat :: NonEmpty (Proxy s) -> Proxy s # stimes :: Integral b => b -> Proxy s -> Proxy s #
Monoid (Proxy s) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods mempty :: Proxy s # mappend :: Proxy s -> Proxy s -> Proxy s # mconcat :: [Proxy s] -> Proxy s #
type Rep1 (Proxy :: k -> *) |
Instance details Defined in GHC.Generics type Rep1 (Proxy :: k -> *) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: k -> *))
type Rep (Proxy t) |
Instance details Defined in GHC.Generics type Rep (Proxy t) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: * -> *))

data KProxy t #

A concrete, promotable proxy type, for use at the kind level There are no instances for this because it is intended at the kind level only

Constructors

KProxy |

(>>>) :: Category cat => cat a b -> cat b c -> cat a c infixr 1 #

Left-to-right composition

(<<<) :: Category cat => cat b c -> cat a b -> cat a c infixr 1 #

Right-to-left composition

class Category (cat :: k -> k -> *) where #

A class for categories. Instances should satisfy the laws

    f . id  =  f  -- (right identity)
    id . f  =  f  -- (left identity)
    f . (g . h)  =  (f . g) . h  -- (associativity)

Minimal complete definition

id, (.)

Methods

id :: cat a a #

the identity morphism

(.) :: cat b c -> cat a b -> cat a c infixr 9 #

morphism composition

Instances

Category (Coercion :: k -> k -> *) | Since: base-4.7.0.0
Instance details Defined in Control.Category Methods id :: Coercion a a # (.) :: Coercion b c -> Coercion a b -> Coercion a c #
Category ((:~:) :: k -> k -> *) | Since: base-4.7.0.0
Instance details Defined in Control.Category Methods id :: a :~: a # (.) :: (b :~: c) -> (a :~: b) -> a :~: c #
Category ((:~~:) :: k -> k -> *) | Since: base-4.10.0.0
Instance details Defined in Control.Category Methods id :: a :~~: a # (.) :: (b :~~: c) -> (a :~~: b) -> a :~~: c #
Monad m => Category (Kleisli m :: * -> * -> *) | Since: base-3.0
Instance details Defined in Control.Arrow Methods id :: Kleisli m a a # (.) :: Kleisli m b c -> Kleisli m a b -> Kleisli m a c #
Category ((->) :: * -> * -> *) | Since: base-3.0
Instance details Defined in Control.Category Methods id :: a -> a # (.) :: (b -> c) -> (a -> b) -> a -> c #

data (a :: k) :~: (b :: k) :: forall k. k -> k -> * where infix 4 #

Propositional equality. If `a :~: b` is inhabited by some terminating value, then the type `a` is the same as the type `b`. To use this equality in practice, pattern-match on the `a :~: b` to get out the `Refl` constructor; in the body of the pattern-match, the compiler knows that `a ~ b`.

Since: base-4.7.0.0

Constructors

Refl :: a :~: a |

Instances

Category ((:~:) :: k -> k -> *) | Since: base-4.7.0.0
Instance details Defined in Control.Category Methods id :: a :~: a # (.) :: (b :~: c) -> (a :~: b) -> a :~: c #
TestEquality ((:~:) a :: k -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods testEquality :: (a :~: a0) -> (a :~: b) -> Maybe (a0 :~: b) #
a ~ b => Bounded (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~: b # maxBound :: a :~: b #
a ~ b => Enum (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods succ :: (a :~: b) -> a :~: b # pred :: (a :~: b) -> a :~: b # toEnum :: Int -> 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] #
Eq (a :~: b) |
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~: b) -> (a :~: b) -> Bool # (/=) :: (a :~: b) -> (a :~: b) -> Bool #
(a ~ b, Data a) => Data (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~: b) -> c (a :~: b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~: b) # toConstr :: (a :~: b) -> Constr # dataTypeOf :: (a :~: b) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~: b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~: b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~: b) -> a :~: b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a :~: b) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~: b) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) #
Ord (a :~: b) |
Instance details Defined in Data.Type.Equality Methods compare :: (a :~: b) -> (a :~: b) -> Ordering # (<) :: (a :~: b) -> (a :~: b) -> Bool # (<=) :: (a :~: b) -> (a :~: b) -> Bool # (>) :: (a :~: b) -> (a :~: b) -> Bool # (>=) :: (a :~: b) -> (a :~: b) -> Bool # max :: (a :~: b) -> (a :~: b) -> a :~: b # min :: (a :~: b) -> (a :~: b) -> a :~: b #
a ~ b => Read (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~: b) # readList :: ReadS [a :~: b] # readPrec :: ReadPrec (a :~: b) # readListPrec :: ReadPrec [a :~: b] #
Show (a :~: b) |
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~: b) -> ShowS # show :: (a :~: b) -> String # showList :: [a :~: b] -> ShowS #

data (a :: k1) :~~: (b :: k2) :: forall k1 k2. k1 -> k2 -> * where infix 4 #

Kind heterogeneous propositional equality. Like `:~:`, `a :~~: b` is inhabited by a terminating value if and only if `a` is the same type as `b`.

Since: base-4.10.0.0

Constructors

HRefl :: a :~~: a |

Instances

Category ((:~~:) :: k -> k -> *) | Since: base-4.10.0.0
Instance details Defined in Control.Category Methods id :: a :~~: a # (.) :: (b :~~: c) -> (a :~~: b) -> a :~~: c #
TestEquality ((:~~:) a :: k -> *) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods testEquality :: (a :~~: a0) -> (a :~~: b) -> Maybe (a0 :~: b) #
a ~~ b => Bounded (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~~: b # maxBound :: a :~~: b #
a ~~ b => Enum (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods succ :: (a :~~: b) -> a :~~: b # pred :: (a :~~: b) -> a :~~: b # toEnum :: Int -> 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] #
Eq (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~~: b) -> (a :~~: b) -> Bool # (/=) :: (a :~~: b) -> (a :~~: b) -> Bool #
(Typeable i, Typeable j, Typeable a, Typeable b, a ~~ b) => Data (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~~: b) -> c (a :~~: b) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~~: b) # toConstr :: (a :~~: b) -> Constr # dataTypeOf :: (a :~~: b) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~~: b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~~: b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~~: b) -> a :~~: b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~~: b) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~~: b) -> r # gmapQ :: (forall d. Data d => d -> u) -> (a :~~: b) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~~: b) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~~: b) -> m (a :~~: b) #
Ord (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods compare :: (a :~~: b) -> (a :~~: b) -> Ordering # (<) :: (a :~~: b) -> (a :~~: b) -> Bool # (<=) :: (a :~~: b) -> (a :~~: b) -> Bool # (>) :: (a :~~: b) -> (a :~~: b) -> Bool # (>=) :: (a :~~: b) -> (a :~~: b) -> Bool # max :: (a :~~: b) -> (a :~~: b) -> a :~~: b # min :: (a :~~: b) -> (a :~~: b) -> a :~~: b #
a ~~ b => Read (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~~: b) # readList :: ReadS [a :~~: b] # readPrec :: ReadPrec (a :~~: b) # readListPrec :: ReadPrec [a :~~: b] #
Show (a :~~: b) | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~~: b) -> ShowS # show :: (a :~~: b) -> String # showList :: [a :~~: b] -> ShowS #

intPtrToPtr :: IntPtr -> Ptr a #

casts an `IntPtr` to a `Ptr`

ptrToIntPtr :: Ptr a -> IntPtr #

casts a `Ptr` to an `IntPtr`

wordPtrToPtr :: WordPtr -> Ptr a #

casts a `WordPtr` to a `Ptr`

ptrToWordPtr :: Ptr a -> WordPtr #

casts a `Ptr` to a `WordPtr`

freeHaskellFunPtr :: FunPtr a -> IO () #

Release the storage associated with the given `FunPtr`, which must have been obtained from a wrapper stub. This should be called whenever the return value from a foreign import wrapper function is no longer required; otherwise, the storage it uses will leak.

newtype WordPtr #

An unsigned integral type that can be losslessly converted to and from `Ptr`. This type is also compatible with the C99 type `uintptr_t`, and can be marshalled to and from that type safely.

Constructors

WordPtr Word |

Instances

Bounded WordPtr |
Instance details Defined in Foreign.Ptr Methods minBound :: WordPtr # maxBound :: WordPtr #
Enum WordPtr |
Instance details Defined in Foreign.Ptr Methods succ :: WordPtr -> WordPtr # pred :: WordPtr -> WordPtr # toEnum :: Int -> WordPtr # fromEnum :: WordPtr -> Int # enumFrom :: WordPtr -> [WordPtr] # enumFromThen :: WordPtr -> WordPtr -> [WordPtr] # enumFromTo :: WordPtr -> WordPtr -> [WordPtr] # enumFromThenTo :: WordPtr -> WordPtr -> WordPtr -> [WordPtr] #
Eq WordPtr |
Instance details Defined in Foreign.Ptr Methods (==) :: WordPtr -> WordPtr -> Bool # (/=) :: WordPtr -> WordPtr -> Bool #
Integral WordPtr |
Instance details Defined in Foreign.Ptr Methods quot :: WordPtr -> WordPtr -> WordPtr # rem :: WordPtr -> WordPtr -> WordPtr # div :: WordPtr -> WordPtr -> WordPtr # mod :: WordPtr -> WordPtr -> WordPtr # quotRem :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # divMod :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # toInteger :: WordPtr -> Integer #
Data WordPtr | Since: base-4.11.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WordPtr -> c WordPtr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WordPtr # toConstr :: WordPtr -> Constr # dataTypeOf :: WordPtr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WordPtr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WordPtr) # gmapT :: (forall b. Data b => b -> b) -> WordPtr -> WordPtr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WordPtr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WordPtr -> r # gmapQ :: (forall d. Data d => d -> u) -> WordPtr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WordPtr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WordPtr -> m WordPtr #
Num WordPtr |
Instance details Defined in Foreign.Ptr Methods (+) :: WordPtr -> WordPtr -> WordPtr # (-) :: WordPtr -> WordPtr -> WordPtr # (*) :: WordPtr -> WordPtr -> WordPtr # negate :: WordPtr -> WordPtr # abs :: WordPtr -> WordPtr # signum :: WordPtr -> WordPtr # fromInteger :: Integer -> WordPtr #
Ord WordPtr |
Instance details Defined in Foreign.Ptr Methods compare :: WordPtr -> WordPtr -> Ordering # (<) :: WordPtr -> WordPtr -> Bool # (<=) :: WordPtr -> WordPtr -> Bool # (>) :: WordPtr -> WordPtr -> Bool # (>=) :: WordPtr -> WordPtr -> Bool # max :: WordPtr -> WordPtr -> WordPtr # min :: WordPtr -> WordPtr -> WordPtr #
Read WordPtr |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS WordPtr # readList :: ReadS [WordPtr] # readPrec :: ReadPrec WordPtr # readListPrec :: ReadPrec [WordPtr] #
Real WordPtr |
Instance details Defined in Foreign.Ptr Methods toRational :: WordPtr -> Rational #
Show WordPtr |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> WordPtr -> ShowS # show :: WordPtr -> String # showList :: [WordPtr] -> ShowS #
Storable WordPtr |
Instance details Defined in Foreign.Ptr Methods sizeOf :: WordPtr -> Int # alignment :: WordPtr -> Int # peekElemOff :: Ptr WordPtr -> Int -> IO WordPtr # pokeElemOff :: Ptr WordPtr -> Int -> WordPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO WordPtr # pokeByteOff :: Ptr b -> Int -> WordPtr -> IO () # peek :: Ptr WordPtr -> IO WordPtr # poke :: Ptr WordPtr -> WordPtr -> IO () #
Bits WordPtr |
Instance details Defined in Foreign.Ptr Methods (.&.) :: WordPtr -> WordPtr -> WordPtr # (.|.) :: WordPtr -> WordPtr -> WordPtr # xor :: WordPtr -> WordPtr -> WordPtr # complement :: WordPtr -> WordPtr # shift :: WordPtr -> Int -> WordPtr # rotate :: WordPtr -> Int -> WordPtr # zeroBits :: WordPtr # bit :: Int -> WordPtr # setBit :: WordPtr -> Int -> WordPtr # clearBit :: WordPtr -> Int -> WordPtr # complementBit :: WordPtr -> Int -> WordPtr # testBit :: WordPtr -> Int -> Bool # bitSizeMaybe :: WordPtr -> Maybe Int # bitSize :: WordPtr -> Int # isSigned :: WordPtr -> Bool # shiftL :: WordPtr -> Int -> WordPtr # unsafeShiftL :: WordPtr -> Int -> WordPtr # shiftR :: WordPtr -> Int -> WordPtr # unsafeShiftR :: WordPtr -> Int -> WordPtr # rotateL :: WordPtr -> Int -> WordPtr # rotateR :: WordPtr -> Int -> WordPtr # popCount :: WordPtr -> Int #
FiniteBits WordPtr |
Instance details Defined in Foreign.Ptr Methods finiteBitSize :: WordPtr -> Int # countLeadingZeros :: WordPtr -> Int # countTrailingZeros :: WordPtr -> Int #

newtype IntPtr #

A signed integral type that can be losslessly converted to and from `Ptr`. This type is also compatible with the C99 type `intptr_t`, and can be marshalled to and from that type safely.

Constructors

IntPtr Int |

Instances

Bounded IntPtr |
Instance details Defined in Foreign.Ptr Methods minBound :: IntPtr # maxBound :: IntPtr #
Enum IntPtr |
Instance details Defined in Foreign.Ptr Methods succ :: IntPtr -> IntPtr # pred :: IntPtr -> IntPtr # toEnum :: Int -> IntPtr # fromEnum :: IntPtr -> Int # enumFrom :: IntPtr -> [IntPtr] # enumFromThen :: IntPtr -> IntPtr -> [IntPtr] # enumFromTo :: IntPtr -> IntPtr -> [IntPtr] # enumFromThenTo :: IntPtr -> IntPtr -> IntPtr -> [IntPtr] #
Eq IntPtr |
Instance details Defined in Foreign.Ptr Methods (==) :: IntPtr -> IntPtr -> Bool # (/=) :: IntPtr -> IntPtr -> Bool #
Integral IntPtr |
Instance details Defined in Foreign.Ptr Methods quot :: IntPtr -> IntPtr -> IntPtr # rem :: IntPtr -> IntPtr -> IntPtr # div :: IntPtr -> IntPtr -> IntPtr # mod :: IntPtr -> IntPtr -> IntPtr # quotRem :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # divMod :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # toInteger :: IntPtr -> Integer #
Data IntPtr | Since: base-4.11.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntPtr -> c IntPtr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IntPtr # toConstr :: IntPtr -> Constr # dataTypeOf :: IntPtr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IntPtr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IntPtr) # gmapT :: (forall b. Data b => b -> b) -> IntPtr -> IntPtr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntPtr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntPtr -> r # gmapQ :: (forall d. Data d => d -> u) -> IntPtr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IntPtr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntPtr -> m IntPtr #
Num IntPtr |
Instance details Defined in Foreign.Ptr Methods (+) :: IntPtr -> IntPtr -> IntPtr # (-) :: IntPtr -> IntPtr -> IntPtr # (*) :: IntPtr -> IntPtr -> IntPtr # negate :: IntPtr -> IntPtr # abs :: IntPtr -> IntPtr # signum :: IntPtr -> IntPtr # fromInteger :: Integer -> IntPtr #
Ord IntPtr |
Instance details Defined in Foreign.Ptr Methods compare :: IntPtr -> IntPtr -> Ordering # (<) :: IntPtr -> IntPtr -> Bool # (<=) :: IntPtr -> IntPtr -> Bool # (>) :: IntPtr -> IntPtr -> Bool # (>=) :: IntPtr -> IntPtr -> Bool # max :: IntPtr -> IntPtr -> IntPtr # min :: IntPtr -> IntPtr -> IntPtr #
Read IntPtr |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS IntPtr # readList :: ReadS [IntPtr] # readPrec :: ReadPrec IntPtr # readListPrec :: ReadPrec [IntPtr] #
Real IntPtr |
Instance details Defined in Foreign.Ptr Methods toRational :: IntPtr -> Rational #
Show IntPtr |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> IntPtr -> ShowS # show :: IntPtr -> String # showList :: [IntPtr] -> ShowS #
Storable IntPtr |
Instance details Defined in Foreign.Ptr Methods sizeOf :: IntPtr -> Int # alignment :: IntPtr -> Int # peekElemOff :: Ptr IntPtr -> Int -> IO IntPtr # pokeElemOff :: Ptr IntPtr -> Int -> IntPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO IntPtr # pokeByteOff :: Ptr b -> Int -> IntPtr -> IO () # peek :: Ptr IntPtr -> IO IntPtr # poke :: Ptr IntPtr -> IntPtr -> IO () #
Bits IntPtr |
Instance details Defined in Foreign.Ptr Methods (.&.) :: IntPtr -> IntPtr -> IntPtr # (.|.) :: IntPtr -> IntPtr -> IntPtr # xor :: IntPtr -> IntPtr -> IntPtr # complement :: IntPtr -> IntPtr # shift :: IntPtr -> Int -> IntPtr # rotate :: IntPtr -> Int -> IntPtr # zeroBits :: IntPtr # bit :: Int -> IntPtr # setBit :: IntPtr -> Int -> IntPtr # clearBit :: IntPtr -> Int -> IntPtr # complementBit :: IntPtr -> Int -> IntPtr # testBit :: IntPtr -> Int -> Bool # bitSizeMaybe :: IntPtr -> Maybe Int # bitSize :: IntPtr -> Int # isSigned :: IntPtr -> Bool # shiftL :: IntPtr -> Int -> IntPtr # unsafeShiftL :: IntPtr -> Int -> IntPtr # shiftR :: IntPtr -> Int -> IntPtr # unsafeShiftR :: IntPtr -> Int -> IntPtr # rotateL :: IntPtr -> Int -> IntPtr # rotateR :: IntPtr -> Int -> IntPtr # popCount :: IntPtr -> Int #
FiniteBits IntPtr |
Instance details Defined in Foreign.Ptr Methods finiteBitSize :: IntPtr -> Int # countLeadingZeros :: IntPtr -> Int # countTrailingZeros :: IntPtr -> Int #

class Storable a where #

The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.

Memory addresses are represented as values of type ``Ptr` a`, for some `a` which is an instance of class `Storable`. The type argument to `Ptr` helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.

All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class `Storable` facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size `Int` types (`Int8`, `Int16`, `Int32`, `Int64`), the fixed size `Word` types (`Word8`, `Word16`, `Word32`, `Word64`), `StablePtr`, all types from Foreign.C.Types, as well as `Ptr`.

Minimal complete definition

sizeOf, alignment, (peek | peekElemOff | peekByteOff), (poke | pokeElemOff | pokeByteOff)

Methods

sizeOf :: a -> Int #

Computes the storage requirements (in bytes) of the argument. The value of the argument is not used.

alignment :: a -> Int #

Computes the alignment constraint of the argument. An alignment constraint `x` is fulfilled by any address divisible by `x`. The value of the argument is not used.

peekElemOff :: Ptr a -> Int -> IO a #

Read a value from a memory area regarded as an array of values of the same kind. The first argument specifies the start address of the array and the second the index into the array (the first element of the array has index `0`). The following equality holds,

    peekElemOff addr idx = IOExts.fixIO $ \result ->
      peek (addr `plusPtr` (idx * sizeOf result))

Note that this is only a specification, not necessarily the concrete implementation of the function.

pokeElemOff :: Ptr a -> Int -> a -> IO () #

Write a value to a memory area regarded as an array of values of the same kind. The following equality holds:

    pokeElemOff addr idx x =
      poke (addr `plusPtr` (idx * sizeOf x)) x

peekByteOff :: Ptr b -> Int -> IO a #

Read a value from a memory location given by a base address and offset. The following equality holds:

    peekByteOff addr off = peek (addr `plusPtr` off)

pokeByteOff :: Ptr b -> Int -> a -> IO () #

Write a value to a memory location given by a base address and offset. The following equality holds:

    pokeByteOff addr off x = poke (addr `plusPtr` off) x

peek :: Ptr a -> IO a #

Read a value from the given memory location.

Note that the peek and poke functions might require properly aligned addresses to function correctly. This is architecture dependent; thus, portable code should ensure that when peeking or poking values of some type `a`, the alignment constraint for `a`, as given by the function `alignment` is fulfilled.

poke :: Ptr a -> a -> IO () #

Write the given value to the given memory location. Alignment restrictions might apply; see `peek`.

Instances

Storable Bool | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Bool -> Int # alignment :: Bool -> Int # peekElemOff :: Ptr Bool -> Int -> IO Bool # pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () # peekByteOff :: Ptr b -> Int -> IO Bool # pokeByteOff :: Ptr b -> Int -> Bool -> IO () # peek :: Ptr Bool -> IO Bool # poke :: Ptr Bool -> Bool -> IO () #
Storable Char | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Char -> Int # alignment :: Char -> Int # peekElemOff :: Ptr Char -> Int -> IO Char # pokeElemOff :: Ptr Char -> Int -> Char -> IO () # peekByteOff :: Ptr b -> Int -> IO Char # pokeByteOff :: Ptr b -> Int -> Char -> IO () # peek :: Ptr Char -> IO Char # poke :: Ptr Char -> Char -> IO () #
Storable Double | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Double -> Int # alignment :: Double -> Int # peekElemOff :: Ptr Double -> Int -> IO Double # pokeElemOff :: Ptr Double -> Int -> Double -> IO () # peekByteOff :: Ptr b -> Int -> IO Double # pokeByteOff :: Ptr b -> Int -> Double -> IO () # peek :: Ptr Double -> IO Double # poke :: Ptr Double -> Double -> IO () #
Storable Float | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Float -> Int # alignment :: Float -> Int # peekElemOff :: Ptr Float -> Int -> IO Float # pokeElemOff :: Ptr Float -> Int -> Float -> IO () # peekByteOff :: Ptr b -> Int -> IO Float # pokeByteOff :: Ptr b -> Int -> Float -> IO () # peek :: Ptr Float -> IO Float # poke :: Ptr Float -> Float -> IO () #
Storable Int | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int -> Int # alignment :: Int -> Int # peekElemOff :: Ptr Int -> Int -> IO Int # pokeElemOff :: Ptr Int -> Int -> Int -> IO () # peekByteOff :: Ptr b -> Int -> IO Int # pokeByteOff :: Ptr b -> Int -> Int -> IO () # peek :: Ptr Int -> IO Int # poke :: Ptr Int -> Int -> IO () #
Storable Int8 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int8 -> Int # alignment :: Int8 -> Int # peekElemOff :: Ptr Int8 -> Int -> IO Int8 # pokeElemOff :: Ptr Int8 -> Int -> Int8 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int8 # pokeByteOff :: Ptr b -> Int -> Int8 -> IO () # peek :: Ptr Int8 -> IO Int8 # poke :: Ptr Int8 -> Int8 -> IO () #
Storable Int16 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int16 -> Int # alignment :: Int16 -> Int # peekElemOff :: Ptr Int16 -> Int -> IO Int16 # pokeElemOff :: Ptr Int16 -> Int -> Int16 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int16 # pokeByteOff :: Ptr b -> Int -> Int16 -> IO () # peek :: Ptr Int16 -> IO Int16 # poke :: Ptr Int16 -> Int16 -> IO () #
Storable Int32 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int32 -> Int # alignment :: Int32 -> Int # peekElemOff :: Ptr Int32 -> Int -> IO Int32 # pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int32 # pokeByteOff :: Ptr b -> Int -> Int32 -> IO () # peek :: Ptr Int32 -> IO Int32 # poke :: Ptr Int32 -> Int32 -> IO () #
Storable Int64 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int64 -> Int # alignment :: Int64 -> Int # peekElemOff :: Ptr Int64 -> Int -> IO Int64 # pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () # peekByteOff :: Ptr b -> Int -> IO Int64 # pokeByteOff :: Ptr b -> Int -> Int64 -> IO () # peek :: Ptr Int64 -> IO Int64 # poke :: Ptr Int64 -> Int64 -> IO () #
Storable Word | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word -> Int # alignment :: Word -> Int # peekElemOff :: Ptr Word -> Int -> IO Word # pokeElemOff :: Ptr Word -> Int -> Word -> IO () # peekByteOff :: Ptr b -> Int -> IO Word # pokeByteOff :: Ptr b -> Int -> Word -> IO () # peek :: Ptr Word -> IO Word # poke :: Ptr Word -> Word -> IO () #
Storable Word8 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word8 -> Int # alignment :: Word8 -> Int # peekElemOff :: Ptr Word8 -> Int -> IO Word8 # pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word8 # pokeByteOff :: Ptr b -> Int -> Word8 -> IO () # peek :: Ptr Word8 -> IO Word8 # poke :: Ptr Word8 -> Word8 -> IO () #
Storable Word16 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word16 -> Int # alignment :: Word16 -> Int # peekElemOff :: Ptr Word16 -> Int -> IO Word16 # pokeElemOff :: Ptr Word16 -> Int -> Word16 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word16 # pokeByteOff :: Ptr b -> Int -> Word16 -> IO () # peek :: Ptr Word16 -> IO Word16 # poke :: Ptr Word16 -> Word16 -> IO () #
Storable Word32 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word32 -> Int # alignment :: Word32 -> Int # peekElemOff :: Ptr Word32 -> Int -> IO Word32 # pokeElemOff :: Ptr Word32 -> Int -> Word32 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word32 # pokeByteOff :: Ptr b -> Int -> Word32 -> IO () # peek :: Ptr Word32 -> IO Word32 # poke :: Ptr Word32 -> Word32 -> IO () #
Storable Word64 | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word64 -> Int # alignment :: Word64 -> Int # peekElemOff :: Ptr Word64 -> Int -> IO Word64 # pokeElemOff :: Ptr Word64 -> Int -> Word64 -> IO () # peekByteOff :: Ptr b -> Int -> IO Word64 # pokeByteOff :: Ptr b -> Int -> Word64 -> IO () # peek :: Ptr Word64 -> IO Word64 # poke :: Ptr Word64 -> Word64 -> IO () #
Storable () | Since: base-4.9.0.0
Instance details Defined in Foreign.Storable Methods sizeOf :: () -> Int # alignment :: () -> Int # peekElemOff :: Ptr () -> Int -> IO () # pokeElemOff :: Ptr () -> Int -> () -> IO () # peekByteOff :: Ptr b -> Int -> IO () # pokeByteOff :: Ptr b -> Int -> () -> IO () # peek :: Ptr () -> IO () # poke :: Ptr () -> () -> IO () #
Storable CDev |
Instance details Defined in System.Posix.Types Methods sizeOf :: CDev -> Int # alignment :: CDev -> Int # peekElemOff :: Ptr CDev -> Int -> IO CDev # pokeElemOff :: Ptr CDev -> Int -> CDev -> IO () # peekByteOff :: Ptr b -> Int -> IO CDev # pokeByteOff :: Ptr b -> Int -> CDev -> IO () # peek :: Ptr CDev -> IO CDev # poke :: Ptr CDev -> CDev -> IO () #
Storable CIno |
Instance details Defined in System.Posix.Types Methods sizeOf :: CIno -> Int # alignment :: CIno -> Int # peekElemOff :: Ptr CIno -> Int -> IO CIno # pokeElemOff :: Ptr CIno -> Int -> CIno -> IO () # peekByteOff :: Ptr b -> Int -> IO CIno # pokeByteOff :: Ptr b -> Int -> CIno -> IO () # peek :: Ptr CIno -> IO CIno # poke :: Ptr CIno -> CIno -> IO () #
Storable CMode |
Instance details Defined in System.Posix.Types Methods sizeOf :: CMode -> Int # alignment :: CMode -> Int # peekElemOff :: Ptr CMode -> Int -> IO CMode # pokeElemOff :: Ptr CMode -> Int -> CMode -> IO () # peekByteOff :: Ptr b -> Int -> IO CMode # pokeByteOff :: Ptr b -> Int -> CMode -> IO () # peek :: Ptr CMode -> IO CMode # poke :: Ptr CMode -> CMode -> IO () #
Storable COff |
Instance details Defined in System.Posix.Types Methods sizeOf :: COff -> Int # alignment :: COff -> Int # peekElemOff :: Ptr COff -> Int -> IO COff # pokeElemOff :: Ptr COff -> Int -> COff -> IO () # peekByteOff :: Ptr b -> Int -> IO COff # pokeByteOff :: Ptr b -> Int -> COff -> IO () # peek :: Ptr COff -> IO COff # poke :: Ptr COff -> COff -> IO () #
Storable CPid |
Instance details Defined in System.Posix.Types Methods sizeOf :: CPid -> Int # alignment :: CPid -> Int # peekElemOff :: Ptr CPid -> Int -> IO CPid # pokeElemOff :: Ptr CPid -> Int -> CPid -> IO () # peekByteOff :: Ptr b -> Int -> IO CPid # pokeByteOff :: Ptr b -> Int -> CPid -> IO () # peek :: Ptr CPid -> IO CPid # poke :: Ptr CPid -> CPid -> IO () #
Storable CSsize |
Instance details Defined in System.Posix.Types Methods sizeOf :: CSsize -> Int # alignment :: CSsize -> Int # peekElemOff :: Ptr CSsize -> Int -> IO CSsize # pokeElemOff :: Ptr CSsize -> Int -> CSsize -> IO () # peekByteOff :: Ptr b -> Int -> IO CSsize # pokeByteOff :: Ptr b -> Int -> CSsize -> IO () # peek :: Ptr CSsize -> IO CSsize # poke :: Ptr CSsize -> CSsize -> IO () #
Storable CGid |
Instance details Defined in System.Posix.Types Methods sizeOf :: CGid -> Int # alignment :: CGid -> Int # peekElemOff :: Ptr CGid -> Int -> IO CGid # pokeElemOff :: Ptr CGid -> Int -> CGid -> IO () # peekByteOff :: Ptr b -> Int -> IO CGid # pokeByteOff :: Ptr b -> Int -> CGid -> IO () # peek :: Ptr CGid -> IO CGid # poke :: Ptr CGid -> CGid -> IO () #
Storable CNlink |
Instance details Defined in System.Posix.Types Methods sizeOf :: CNlink -> Int # alignment :: CNlink -> Int # peekElemOff :: Ptr CNlink -> Int -> IO CNlink # pokeElemOff :: Ptr CNlink -> Int -> CNlink -> IO () # peekByteOff :: Ptr b -> Int -> IO CNlink # pokeByteOff :: Ptr b -> Int -> CNlink -> IO () # peek :: Ptr CNlink -> IO CNlink # poke :: Ptr CNlink -> CNlink -> IO () #
Storable CUid |
Instance details Defined in System.Posix.Types Methods sizeOf :: CUid -> Int # alignment :: CUid -> Int # peekElemOff :: Ptr CUid -> Int -> IO CUid # pokeElemOff :: Ptr CUid -> Int -> CUid -> IO () # peekByteOff :: Ptr b -> Int -> IO CUid # pokeByteOff :: Ptr b -> Int -> CUid -> IO () # peek :: Ptr CUid -> IO CUid # poke :: Ptr CUid -> CUid -> IO () #
Storable CCc |
Instance details Defined in System.Posix.Types Methods sizeOf :: CCc -> Int # alignment :: CCc -> Int # peekElemOff :: Ptr CCc -> Int -> IO CCc # pokeElemOff :: Ptr CCc -> Int -> CCc -> IO () # peekByteOff :: Ptr b -> Int -> IO CCc # pokeByteOff :: Ptr b -> Int -> CCc -> IO () # peek :: Ptr CCc -> IO CCc # poke :: Ptr CCc -> CCc -> IO () #
Storable CSpeed |
Instance details Defined in System.Posix.Types Methods sizeOf :: CSpeed -> Int # alignment :: CSpeed -> Int # peekElemOff :: Ptr CSpeed -> Int -> IO CSpeed # pokeElemOff :: Ptr CSpeed -> Int -> CSpeed -> IO () # peekByteOff :: Ptr b -> Int -> IO CSpeed # pokeByteOff :: Ptr b -> Int -> CSpeed -> IO () # peek :: Ptr CSpeed -> IO CSpeed # poke :: Ptr CSpeed -> CSpeed -> IO () #
Storable CTcflag |
Instance details Defined in System.Posix.Types Methods sizeOf :: CTcflag -> Int # alignment :: CTcflag -> Int # peekElemOff :: Ptr CTcflag -> Int -> IO CTcflag # pokeElemOff :: Ptr CTcflag -> Int -> CTcflag -> IO () # peekByteOff :: Ptr b -> Int -> IO CTcflag # pokeByteOff :: Ptr b -> Int -> CTcflag -> IO () # peek :: Ptr CTcflag -> IO CTcflag # poke :: Ptr CTcflag -> CTcflag -> IO () #
Storable CRLim |
Instance details Defined in System.Posix.Types Methods sizeOf :: CRLim -> Int # alignment :: CRLim -> Int # peekElemOff :: Ptr CRLim -> Int -> IO CRLim # pokeElemOff :: Ptr CRLim -> Int -> CRLim -> IO () # peekByteOff :: Ptr b -> Int -> IO CRLim # pokeByteOff :: Ptr b -> Int -> CRLim -> IO () # peek :: Ptr CRLim -> IO CRLim # poke :: Ptr CRLim -> CRLim -> IO () #
Storable CBlkSize |
Instance details Defined in System.Posix.Types Methods sizeOf :: CBlkSize -> Int # alignment :: CBlkSize -> Int # peekElemOff :: Ptr CBlkSize -> Int -> IO CBlkSize # pokeElemOff :: Ptr CBlkSize -> Int -> CBlkSize -> IO () # peekByteOff :: Ptr b -> Int -> IO CBlkSize # pokeByteOff :: Ptr b -> Int -> CBlkSize -> IO () # peek :: Ptr CBlkSize -> IO CBlkSize # poke :: Ptr CBlkSize -> CBlkSize -> IO () #
Storable CBlkCnt |
Instance details Defined in System.Posix.Types Methods sizeOf :: CBlkCnt -> Int # alignment :: CBlkCnt -> Int # peekElemOff :: Ptr CBlkCnt -> Int -> IO CBlkCnt # pokeElemOff :: Ptr CBlkCnt -> Int -> CBlkCnt -> IO () # peekByteOff :: Ptr b -> Int -> IO CBlkCnt # pokeByteOff :: Ptr b -> Int -> CBlkCnt -> IO () # peek :: Ptr CBlkCnt -> IO CBlkCnt # poke :: Ptr CBlkCnt -> CBlkCnt -> IO () #
Storable CClockId |
Instance details Defined in System.Posix.Types Methods sizeOf :: CClockId -> Int # alignment :: CClockId -> Int # peekElemOff :: Ptr CClockId -> Int -> IO CClockId # pokeElemOff :: Ptr CClockId -> Int -> CClockId -> IO () # peekByteOff :: Ptr b -> Int -> IO CClockId # pokeByteOff :: Ptr b -> Int -> CClockId -> IO () # peek :: Ptr CClockId -> IO CClockId # poke :: Ptr CClockId -> CClockId -> IO () #
Storable CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods sizeOf :: CFsBlkCnt -> Int # alignment :: CFsBlkCnt -> Int # peekElemOff :: Ptr CFsBlkCnt -> Int -> IO CFsBlkCnt # pokeElemOff :: Ptr CFsBlkCnt -> Int -> CFsBlkCnt -> IO () # peekByteOff :: Ptr b -> Int -> IO CFsBlkCnt # pokeByteOff :: Ptr b -> Int -> CFsBlkCnt -> IO () # peek :: Ptr CFsBlkCnt -> IO CFsBlkCnt # poke :: Ptr CFsBlkCnt -> CFsBlkCnt -> IO () #
Storable CFsFilCnt |
Instance details Defined in System.Posix.Types Methods sizeOf :: CFsFilCnt -> Int # alignment :: CFsFilCnt -> Int # peekElemOff :: Ptr CFsFilCnt -> Int -> IO CFsFilCnt # pokeElemOff :: Ptr CFsFilCnt -> Int -> CFsFilCnt -> IO () # peekByteOff :: Ptr b -> Int -> IO CFsFilCnt # pokeByteOff :: Ptr b -> Int -> CFsFilCnt -> IO () # peek :: Ptr CFsFilCnt -> IO CFsFilCnt # poke :: Ptr CFsFilCnt -> CFsFilCnt -> IO () #
Storable CId |
Instance details Defined in System.Posix.Types Methods sizeOf :: CId -> Int # alignment :: CId -> Int # peekElemOff :: Ptr CId -> Int -> IO CId # pokeElemOff :: Ptr CId -> Int -> CId -> IO () # peekByteOff :: Ptr b -> Int -> IO CId # pokeByteOff :: Ptr b -> Int -> CId -> IO () # peek :: Ptr CId -> IO CId # poke :: Ptr CId -> CId -> IO () #
Storable CKey |
Instance details Defined in System.Posix.Types Methods sizeOf :: CKey -> Int # alignment :: CKey -> Int # peekElemOff :: Ptr CKey -> Int -> IO CKey # pokeElemOff :: Ptr CKey -> Int -> CKey -> IO () # peekByteOff :: Ptr b -> Int -> IO CKey # pokeByteOff :: Ptr b -> Int -> CKey -> IO () # peek :: Ptr CKey -> IO CKey # poke :: Ptr CKey -> CKey -> IO () #
Storable CTimer |
Instance details Defined in System.Posix.Types Methods sizeOf :: CTimer -> Int # alignment :: CTimer -> Int # peekElemOff :: Ptr CTimer -> Int -> IO CTimer # pokeElemOff :: Ptr CTimer -> Int -> CTimer -> IO () # peekByteOff :: Ptr b -> Int -> IO CTimer # pokeByteOff :: Ptr b -> Int -> CTimer -> IO () # peek :: Ptr CTimer -> IO CTimer # poke :: Ptr CTimer -> CTimer -> IO () #
Storable Fd |
Instance details Defined in System.Posix.Types Methods sizeOf :: Fd -> Int # alignment :: Fd -> Int # peekElemOff :: Ptr Fd -> Int -> IO Fd # pokeElemOff :: Ptr Fd -> Int -> Fd -> IO () # peekByteOff :: Ptr b -> Int -> IO Fd # pokeByteOff :: Ptr b -> Int -> Fd -> IO () # peek :: Ptr Fd -> IO Fd # poke :: Ptr Fd -> Fd -> IO () #
Storable CChar |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CChar -> Int # alignment :: CChar -> Int # peekElemOff :: Ptr CChar -> Int -> IO CChar # pokeElemOff :: Ptr CChar -> Int -> CChar -> IO () # peekByteOff :: Ptr b -> Int -> IO CChar # pokeByteOff :: Ptr b -> Int -> CChar -> IO () # peek :: Ptr CChar -> IO CChar # poke :: Ptr CChar -> CChar -> IO () #
Storable CSChar |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CSChar -> Int # alignment :: CSChar -> Int # peekElemOff :: Ptr CSChar -> Int -> IO CSChar # pokeElemOff :: Ptr CSChar -> Int -> CSChar -> IO () # peekByteOff :: Ptr b -> Int -> IO CSChar # pokeByteOff :: Ptr b -> Int -> CSChar -> IO () # peek :: Ptr CSChar -> IO CSChar # poke :: Ptr CSChar -> CSChar -> IO () #
Storable CUChar |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUChar -> Int # alignment :: CUChar -> Int # peekElemOff :: Ptr CUChar -> Int -> IO CUChar # pokeElemOff :: Ptr CUChar -> Int -> CUChar -> IO () # peekByteOff :: Ptr b -> Int -> IO CUChar # pokeByteOff :: Ptr b -> Int -> CUChar -> IO () # peek :: Ptr CUChar -> IO CUChar # poke :: Ptr CUChar -> CUChar -> IO () #
Storable CShort |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CShort -> Int # alignment :: CShort -> Int # peekElemOff :: Ptr CShort -> Int -> IO CShort # pokeElemOff :: Ptr CShort -> Int -> CShort -> IO () # peekByteOff :: Ptr b -> Int -> IO CShort # pokeByteOff :: Ptr b -> Int -> CShort -> IO () # peek :: Ptr CShort -> IO CShort # poke :: Ptr CShort -> CShort -> IO () #
Storable CUShort |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUShort -> Int # alignment :: CUShort -> Int # peekElemOff :: Ptr CUShort -> Int -> IO CUShort # pokeElemOff :: Ptr CUShort -> Int -> CUShort -> IO () # peekByteOff :: Ptr b -> Int -> IO CUShort # pokeByteOff :: Ptr b -> Int -> CUShort -> IO () # peek :: Ptr CUShort -> IO CUShort # poke :: Ptr CUShort -> CUShort -> IO () #
Storable CInt |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CInt -> Int # alignment :: CInt -> Int # peekElemOff :: Ptr CInt -> Int -> IO CInt # pokeElemOff :: Ptr CInt -> Int -> CInt -> IO () # peekByteOff :: Ptr b -> Int -> IO CInt # pokeByteOff :: Ptr b -> Int -> CInt -> IO () # peek :: Ptr CInt -> IO CInt # poke :: Ptr CInt -> CInt -> IO () #
Storable CUInt |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUInt -> Int # alignment :: CUInt -> Int # peekElemOff :: Ptr CUInt -> Int -> IO CUInt # pokeElemOff :: Ptr CUInt -> Int -> CUInt -> IO () # peekByteOff :: Ptr b -> Int -> IO CUInt # pokeByteOff :: Ptr b -> Int -> CUInt -> IO () # peek :: Ptr CUInt -> IO CUInt # poke :: Ptr CUInt -> CUInt -> IO () #
Storable CLong |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CLong -> Int # alignment :: CLong -> Int # peekElemOff :: Ptr CLong -> Int -> IO CLong # pokeElemOff :: Ptr CLong -> Int -> CLong -> IO () # peekByteOff :: Ptr b -> Int -> IO CLong # pokeByteOff :: Ptr b -> Int -> CLong -> IO () # peek :: Ptr CLong -> IO CLong # poke :: Ptr CLong -> CLong -> IO () #
Storable CULong |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CULong -> Int # alignment :: CULong -> Int # peekElemOff :: Ptr CULong -> Int -> IO CULong # pokeElemOff :: Ptr CULong -> Int -> CULong -> IO () # peekByteOff :: Ptr b -> Int -> IO CULong # pokeByteOff :: Ptr b -> Int -> CULong -> IO () # peek :: Ptr CULong -> IO CULong # poke :: Ptr CULong -> CULong -> IO () #
Storable CLLong |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CLLong -> Int # alignment :: CLLong -> Int # peekElemOff :: Ptr CLLong -> Int -> IO CLLong # pokeElemOff :: Ptr CLLong -> Int -> CLLong -> IO () # peekByteOff :: Ptr b -> Int -> IO CLLong # pokeByteOff :: Ptr b -> Int -> CLLong -> IO () # peek :: Ptr CLLong -> IO CLLong # poke :: Ptr CLLong -> CLLong -> IO () #
Storable CULLong |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CULLong -> Int # alignment :: CULLong -> Int # peekElemOff :: Ptr CULLong -> Int -> IO CULLong # pokeElemOff :: Ptr CULLong -> Int -> CULLong -> IO () # peekByteOff :: Ptr b -> Int -> IO CULLong # pokeByteOff :: Ptr b -> Int -> CULLong -> IO () # peek :: Ptr CULLong -> IO CULLong # poke :: Ptr CULLong -> CULLong -> IO () #
Storable CBool |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CBool -> Int # alignment :: CBool -> Int # peekElemOff :: Ptr CBool -> Int -> IO CBool # pokeElemOff :: Ptr CBool -> Int -> CBool -> IO () # peekByteOff :: Ptr b -> Int -> IO CBool # pokeByteOff :: Ptr b -> Int -> CBool -> IO () # peek :: Ptr CBool -> IO CBool # poke :: Ptr CBool -> CBool -> IO () #
Storable CFloat |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CFloat -> Int # alignment :: CFloat -> Int # peekElemOff :: Ptr CFloat -> Int -> IO CFloat # pokeElemOff :: Ptr CFloat -> Int -> CFloat -> IO () # peekByteOff :: Ptr b -> Int -> IO CFloat # pokeByteOff :: Ptr b -> Int -> CFloat -> IO () # peek :: Ptr CFloat -> IO CFloat # poke :: Ptr CFloat -> CFloat -> IO () #
Storable CDouble |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CDouble -> Int # alignment :: CDouble -> Int # peekElemOff :: Ptr CDouble -> Int -> IO CDouble # pokeElemOff :: Ptr CDouble -> Int -> CDouble -> IO () # peekByteOff :: Ptr b -> Int -> IO CDouble # pokeByteOff :: Ptr b -> Int -> CDouble -> IO () # peek :: Ptr CDouble -> IO CDouble # poke :: Ptr CDouble -> CDouble -> IO () #
Storable CPtrdiff |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CPtrdiff -> Int # alignment :: CPtrdiff -> Int # peekElemOff :: Ptr CPtrdiff -> Int -> IO CPtrdiff # pokeElemOff :: Ptr CPtrdiff -> Int -> CPtrdiff -> IO () # peekByteOff :: Ptr b -> Int -> IO CPtrdiff # pokeByteOff :: Ptr b -> Int -> CPtrdiff -> IO () # peek :: Ptr CPtrdiff -> IO CPtrdiff # poke :: Ptr CPtrdiff -> CPtrdiff -> IO () #
Storable CSize |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CSize -> Int # alignment :: CSize -> Int # peekElemOff :: Ptr CSize -> Int -> IO CSize # pokeElemOff :: Ptr CSize -> Int -> CSize -> IO () # peekByteOff :: Ptr b -> Int -> IO CSize # pokeByteOff :: Ptr b -> Int -> CSize -> IO () # peek :: Ptr CSize -> IO CSize # poke :: Ptr CSize -> CSize -> IO () #
Storable CWchar |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CWchar -> Int # alignment :: CWchar -> Int # peekElemOff :: Ptr CWchar -> Int -> IO CWchar # pokeElemOff :: Ptr CWchar -> Int -> CWchar -> IO () # peekByteOff :: Ptr b -> Int -> IO CWchar # pokeByteOff :: Ptr b -> Int -> CWchar -> IO () # peek :: Ptr CWchar -> IO CWchar # poke :: Ptr CWchar -> CWchar -> IO () #
Storable CSigAtomic |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CSigAtomic -> Int # alignment :: CSigAtomic -> Int # peekElemOff :: Ptr CSigAtomic -> Int -> IO CSigAtomic # pokeElemOff :: Ptr CSigAtomic -> Int -> CSigAtomic -> IO () # peekByteOff :: Ptr b -> Int -> IO CSigAtomic # pokeByteOff :: Ptr b -> Int -> CSigAtomic -> IO () # peek :: Ptr CSigAtomic -> IO CSigAtomic # poke :: Ptr CSigAtomic -> CSigAtomic -> IO () #
Storable CClock |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CClock -> Int # alignment :: CClock -> Int # peekElemOff :: Ptr CClock -> Int -> IO CClock # pokeElemOff :: Ptr CClock -> Int -> CClock -> IO () # peekByteOff :: Ptr b -> Int -> IO CClock # pokeByteOff :: Ptr b -> Int -> CClock -> IO () # peek :: Ptr CClock -> IO CClock # poke :: Ptr CClock -> CClock -> IO () #
Storable CTime |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CTime -> Int # alignment :: CTime -> Int # peekElemOff :: Ptr CTime -> Int -> IO CTime # pokeElemOff :: Ptr CTime -> Int -> CTime -> IO () # peekByteOff :: Ptr b -> Int -> IO CTime # pokeByteOff :: Ptr b -> Int -> CTime -> IO () # peek :: Ptr CTime -> IO CTime # poke :: Ptr CTime -> CTime -> IO () #
Storable CUSeconds |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUSeconds -> Int # alignment :: CUSeconds -> Int # peekElemOff :: Ptr CUSeconds -> Int -> IO CUSeconds # pokeElemOff :: Ptr CUSeconds -> Int -> CUSeconds -> IO () # peekByteOff :: Ptr b -> Int -> IO CUSeconds # pokeByteOff :: Ptr b -> Int -> CUSeconds -> IO () # peek :: Ptr CUSeconds -> IO CUSeconds # poke :: Ptr CUSeconds -> CUSeconds -> IO () #
Storable CSUSeconds |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CSUSeconds -> Int # alignment :: CSUSeconds -> Int # peekElemOff :: Ptr CSUSeconds -> Int -> IO CSUSeconds # pokeElemOff :: Ptr CSUSeconds -> Int -> CSUSeconds -> IO () # peekByteOff :: Ptr b -> Int -> IO CSUSeconds # pokeByteOff :: Ptr b -> Int -> CSUSeconds -> IO () # peek :: Ptr CSUSeconds -> IO CSUSeconds # poke :: Ptr CSUSeconds -> CSUSeconds -> IO () #
Storable CIntPtr |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CIntPtr -> Int # alignment :: CIntPtr -> Int # peekElemOff :: Ptr CIntPtr -> Int -> IO CIntPtr # pokeElemOff :: Ptr CIntPtr -> Int -> CIntPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO CIntPtr # pokeByteOff :: Ptr b -> Int -> CIntPtr -> IO () # peek :: Ptr CIntPtr -> IO CIntPtr # poke :: Ptr CIntPtr -> CIntPtr -> IO () #
Storable CUIntPtr |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUIntPtr -> Int # alignment :: CUIntPtr -> Int # peekElemOff :: Ptr CUIntPtr -> Int -> IO CUIntPtr # pokeElemOff :: Ptr CUIntPtr -> Int -> CUIntPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO CUIntPtr # pokeByteOff :: Ptr b -> Int -> CUIntPtr -> IO () # peek :: Ptr CUIntPtr -> IO CUIntPtr # poke :: Ptr CUIntPtr -> CUIntPtr -> IO () #
Storable CIntMax |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CIntMax -> Int # alignment :: CIntMax -> Int # peekElemOff :: Ptr CIntMax -> Int -> IO CIntMax # pokeElemOff :: Ptr CIntMax -> Int -> CIntMax -> IO () # peekByteOff :: Ptr b -> Int -> IO CIntMax # pokeByteOff :: Ptr b -> Int -> CIntMax -> IO () # peek :: Ptr CIntMax -> IO CIntMax # poke :: Ptr CIntMax -> CIntMax -> IO () #
Storable CUIntMax |
Instance details Defined in Foreign.C.Types Methods sizeOf :: CUIntMax -> Int # alignment :: CUIntMax -> Int # peekElemOff :: Ptr CUIntMax -> Int -> IO CUIntMax # pokeElemOff :: Ptr CUIntMax -> Int -> CUIntMax -> IO () # peekByteOff :: Ptr b -> Int -> IO CUIntMax # pokeByteOff :: Ptr b -> Int -> CUIntMax -> IO () # peek :: Ptr CUIntMax -> IO CUIntMax # poke :: Ptr CUIntMax -> CUIntMax -> IO () #
Storable WordPtr |
Instance details Defined in Foreign.Ptr Methods sizeOf :: WordPtr -> Int # alignment :: WordPtr -> Int # peekElemOff :: Ptr WordPtr -> Int -> IO WordPtr # pokeElemOff :: Ptr WordPtr -> Int -> WordPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO WordPtr # pokeByteOff :: Ptr b -> Int -> WordPtr -> IO () # peek :: Ptr WordPtr -> IO WordPtr # poke :: Ptr WordPtr -> WordPtr -> IO () #
Storable IntPtr |
Instance details Defined in Foreign.Ptr Methods sizeOf :: IntPtr -> Int # alignment :: IntPtr -> Int # peekElemOff :: Ptr IntPtr -> Int -> IO IntPtr # pokeElemOff :: Ptr IntPtr -> Int -> IntPtr -> IO () # peekByteOff :: Ptr b -> Int -> IO IntPtr # pokeByteOff :: Ptr b -> Int -> IntPtr -> IO () # peek :: Ptr IntPtr -> IO IntPtr # poke :: Ptr IntPtr -> IntPtr -> IO () #
Storable Fingerprint | Since: base-4.4.0.0
Instance details Defined in Foreign.Storable Methods sizeOf :: Fingerprint -> Int # alignment :: Fingerprint -> Int # peekElemOff :: Ptr Fingerprint -> Int -> IO Fingerprint # pokeElemOff :: Ptr Fingerprint -> Int -> Fingerprint -> IO () # peekByteOff :: Ptr b -> Int -> IO Fingerprint # pokeByteOff :: Ptr b -> Int -> Fingerprint -> IO () # peek :: Ptr Fingerprint -> IO Fingerprint # poke :: Ptr Fingerprint -> Fingerprint -> IO () #
(Storable a, Integral a) => Storable (Ratio a) | Since: base-4.8.0.0
Instance details Defined in Foreign.Storable Methods sizeOf :: Ratio a -> Int # alignment :: Ratio a -> Int # peekElemOff :: Ptr (Ratio a) -> Int -> IO (Ratio a) # pokeElemOff :: Ptr (Ratio a) -> Int -> Ratio a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Ratio a) # pokeByteOff :: Ptr b -> Int -> Ratio a -> IO () # peek :: Ptr (Ratio a) -> IO (Ratio a) # poke :: Ptr (Ratio a) -> Ratio a -> IO () #
Storable (StablePtr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: StablePtr a -> Int # alignment :: StablePtr a -> Int # peekElemOff :: Ptr (StablePtr a) -> Int -> IO (StablePtr a) # pokeElemOff :: Ptr (StablePtr a) -> Int -> StablePtr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (StablePtr a) # pokeByteOff :: Ptr b -> Int -> StablePtr a -> IO () # peek :: Ptr (StablePtr a) -> IO (StablePtr a) # poke :: Ptr (StablePtr a) -> StablePtr a -> IO () #
Storable (Ptr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Ptr a -> Int # alignment :: Ptr a -> Int # peekElemOff :: Ptr (Ptr a) -> Int -> IO (Ptr a) # pokeElemOff :: Ptr (Ptr a) -> Int -> Ptr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Ptr a) # pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () # peek :: Ptr (Ptr a) -> IO (Ptr a) # poke :: Ptr (Ptr a) -> Ptr a -> IO () #
Storable (FunPtr a) | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: FunPtr a -> Int # alignment :: FunPtr a -> Int # peekElemOff :: Ptr (FunPtr a) -> Int -> IO (FunPtr a) # pokeElemOff :: Ptr (FunPtr a) -> Int -> FunPtr a -> IO () # peekByteOff :: Ptr b -> Int -> IO (FunPtr a) # pokeByteOff :: Ptr b -> Int -> FunPtr a -> IO () # peek :: Ptr (FunPtr a) -> IO (FunPtr a) # poke :: Ptr (FunPtr a) -> FunPtr a -> IO () #
Storable a => Storable (Complex a) | Since: base-4.8.0.0
Instance details Defined in Data.Complex Methods sizeOf :: Complex a -> Int # alignment :: Complex a -> Int # peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a) # pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Complex a) # pokeByteOff :: Ptr b -> Int -> Complex a -> IO () # peek :: Ptr (Complex a) -> IO (Complex a) # poke :: Ptr (Complex a) -> Complex a -> IO () #
Storable a => Storable (Identity a) |
Instance details Defined in Data.Functor.Identity Methods sizeOf :: Identity a -> Int # alignment :: Identity a -> Int # peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) # pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Identity a) # pokeByteOff :: Ptr b -> Int -> Identity a -> IO () # peek :: Ptr (Identity a) -> IO (Identity a) # poke :: Ptr (Identity a) -> Identity a -> IO () #
Storable a => Storable (Const a b) |
Instance details Defined in Data.Functor.Const Methods sizeOf :: Const a b -> Int # alignment :: Const a b -> Int # peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) # pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () # peekByteOff :: Ptr b0 -> Int -> IO (Const a b) # pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () # peek :: Ptr (Const a b) -> IO (Const a b) # poke :: Ptr (Const a b) -> Const a b -> IO () #

castPtrToStablePtr :: Ptr () -> StablePtr a #

The inverse of `castStablePtrToPtr`, i.e., we have the identity

    sp == castPtrToStablePtr (castStablePtrToPtr sp)

for any stable pointer `sp` on which `freeStablePtr` has not been executed yet. Moreover, `castPtrToStablePtr` may only be applied to pointers that have been produced by `castStablePtrToPtr`.

castStablePtrToPtr :: StablePtr a -> Ptr () #

Coerce a stable pointer to an address. No guarantees are made about the resulting value, except that the original stable pointer can be recovered by `castPtrToStablePtr`. In particular, the address may not refer to an accessible memory location and any attempt to pass it to the member functions of the class `Storable` leads to undefined behaviour.

deRefStablePtr :: StablePtr a -> IO a #

Obtain the Haskell value referenced by a stable pointer, i.e., the same value that was passed to the corresponding call to `makeStablePtr`. If the argument to `deRefStablePtr` has already been freed using `freeStablePtr`, the behaviour of `deRefStablePtr` is undefined.

freeStablePtr :: StablePtr a -> IO () #

Dissolve the association between the stable pointer and the Haskell value. Afterwards, if the stable pointer is passed to `deRefStablePtr` or `freeStablePtr`, the behaviour is undefined. However, the stable pointer may still be passed to `castStablePtrToPtr`, but the ``Ptr` ()` value returned by `castStablePtrToPtr`, in this case, is undefined (in particular, it may be `nullPtr`). Nevertheless, the call to `castStablePtrToPtr` is guaranteed not to diverge.

castPtrToFunPtr :: Ptr a -> FunPtr b #

Casts a `Ptr` to a `FunPtr`.

Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption.

castFunPtrToPtr :: FunPtr a -> Ptr b #

Casts a `FunPtr` to a `Ptr`.

Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption.

castFunPtr :: FunPtr a -> FunPtr b #

Casts a `FunPtr` to a `FunPtr` of a different type.

nullFunPtr :: FunPtr a #

The constant `nullFunPtr` contains a distinguished value of `FunPtr` that is not associated with a valid memory location.

minusPtr :: Ptr a -> Ptr b -> Int #

Computes the offset required to get from the second to the first argument. We have

    p2 == p1 `plusPtr` (p2 `minusPtr` p1)

alignPtr :: Ptr a -> Int -> Ptr a #

Given an arbitrary address and an alignment constraint, `alignPtr` yields the next higher address that fulfills the alignment constraint. An alignment constraint `x` is fulfilled by any address divisible by `x`. This operation is idempotent.

plusPtr :: Ptr a -> Int -> Ptr b #

Advances the given address by the given offset in bytes.

castPtr :: Ptr a -> Ptr b #

The `castPtr` function casts a pointer from one type to another.

nullPtr :: Ptr a #

The constant `nullPtr` contains a distinguished value of `Ptr` that is not associated with a valid memory location.

showOct :: (Integral a, Show a) => a -> ShowS #

Show non-negative `Integral` numbers in base 8.

showHex :: (Integral a, Show a) => a -> ShowS #

Show non-negative `Integral` numbers in base 16.

showIntAtBase :: (Integral a, Show a) => a -> (Int -> Char) -> a -> ShowS #

Shows a non-negative `Integral` number using the base specified by the first argument, and the character representation specified by the second.

showHFloat :: RealFloat a => a -> ShowS #

Show a floating-point value in the hexadecimal format, similar to the `%a` specifier in C's printf.

    >>> showHFloat (212.21 :: Double) ""
    "0x1.a86b851eb851fp7"
    >>> showHFloat (-12.76 :: Float) ""
    "-0x1.9851ecp3"
    >>> showHFloat (-0 :: Double) ""
    "-0x0p+0"

showGFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed `RealFloat` value using standard decimal notation for arguments whose absolute value lies between `0.1` and `9,999,999`, and scientific notation otherwise.

This behaves as `showFFloat`, except that a decimal point is always guaranteed, even if not needed.

Since: base-4.7.0.0

showFFloatAlt :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed `RealFloat` value using standard decimal notation (e.g. `245000`, `0.0015`).

This behaves as `showFFloat`, except that a decimal point is always guaranteed, even if not needed.

Since: base-4.7.0.0

showGFloat :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed `RealFloat` value using standard decimal notation for arguments whose absolute value lies between `0.1` and `9,999,999`, and scientific notation otherwise.

In the call ``showGFloat` digs val`, if `digs` is `Nothing`, the value is shown to full precision; if `digs` is ``Just` d`, then at most `d` digits after the decimal point are shown.

showFFloat :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed `RealFloat` value using standard decimal notation (e.g. `245000`, `0.0015`).

In the call ``showFFloat` digs val`, if `digs` is `Nothing`, the value is shown to full precision; if `digs` is ``Just` d`, then at most `d` digits after the decimal point are shown.

showEFloat :: RealFloat a => Maybe Int -> a -> ShowS #

Show a signed `RealFloat` value using scientific (exponential) notation (e.g. `2.45e2`, `1.5e-3`).

In the call ``showEFloat` digs val`, if `digs` is `Nothing`, the value is shown to full precision; if `digs` is ``Just` d`, then at most `d` digits after the decimal point are shown.

showInt :: Integral a => a -> ShowS #

Show non-negative `Integral` numbers in base 10.

readSigned :: Real a => ReadS a -> ReadS a #

Reads a signed `Real` value, given a reader for an unsigned value.

readFloat :: RealFrac a => ReadS a #

Reads an unsigned `RealFrac` value, expressed in decimal scientific notation.

readHex :: (Eq a, Num a) => ReadS a #

Read an unsigned number in hexadecimal notation. Both upper or lower case letters are allowed.

    >>> readHex "deadbeef"
    [(3735928559,"")]

readDec :: (Eq a, Num a) => ReadS a #

Read an unsigned number in decimal notation.

    >>> readDec "0644"
    [(644,"")]

readOct :: (Eq a, Num a) => ReadS a #

Read an unsigned number in octal notation.

    >>> readOct "0644"
    [(420,"")]

readInt #

Arguments

:: Num a |
=> a | the base
-> (Char -> Bool) | a predicate distinguishing valid digits in this base
-> (Char -> Int) | a function converting a valid digit character to an `Int`
-> ReadS a |

Reads an unsigned `Integral` value in an arbitrary base.

lexDigits :: ReadS String #

Reads a non-empty string of decimal digits.

readLitChar :: ReadS Char #

Read a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example:

    readLitChar "\\nHello"  =  [('\n', "Hello")]

lexLitChar :: ReadS String #

Read a string representation of a character, using Haskell source-language escape conventions. For example:

    lexLitChar  "\\nHello"  =  [("\\n", "Hello")]

lex :: ReadS String #

The `lex` function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, `lex` returns a single successful `lexeme' consisting of the empty string. (Thus ``lex` "" = [("","")]`.) If there is no legal lexeme at the beginning of the input string, `lex` fails (i.e. returns `[]`).

This lexer is not completely faithful to the Haskell lexical syntax in the following respects:

- Qualified names are not handled properly
- Octal and hexadecimal numerics are not recognized as a single token
- Comments are not treated properly

readParen :: Bool -> ReadS a -> ReadS a #

``readParen` `True` p` parses what `p` parses, but surrounded with parentheses.

``readParen` `False` p` parses what `p` parses, but optionally surrounded with parentheses.

readS_to_Prec :: (Int -> ReadS a) -> ReadPrec a #

readPrec_to_S :: ReadPrec a -> Int -> ReadS a #

readP_to_Prec :: (Int -> ReadP a) -> ReadPrec a #

readPrec_to_P :: ReadPrec a -> Int -> ReadP a #

data ReadPrec a #

Instances

Monad ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods (>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b # (>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # return :: a -> ReadPrec a # fail :: String -> ReadPrec a #
Functor ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b # (<$) :: a -> ReadPrec b -> ReadPrec a #
MonadFail ReadPrec | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fail :: String -> ReadPrec a #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a #
Alternative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods empty :: ReadPrec a # (<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a # some :: ReadPrec a -> ReadPrec [a] # many :: ReadPrec a -> ReadPrec [a] #
MonadPlus ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods mzero :: ReadPrec a # mplus :: ReadPrec a -> ReadPrec a -> ReadPrec a #

readS_to_P :: ReadS a -> ReadP a #

Converts a Haskell ReadS-style function into a parser. Warning: This introduces local backtracking in the resulting parser, and therefore a possible inefficiency.

readP_to_S :: ReadP a -> ReadS a #

Converts a parser into a Haskell ReadS-style function. This is the main way in which you can "run" a `ReadP` parser: the expanded type is `readP_to_S :: ReadP a -> String -> [(a,String)]`

type ReadS a = String -> [(a, String)] #

A parser for a type `a`, represented as a function that takes a `String` and returns a list of possible parses as `(a,`String`)` pairs.

Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf `ReadP`).

data ReadP a #

Instances

Monad ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b # (>>) :: ReadP a -> ReadP b -> ReadP b # return :: a -> ReadP a # fail :: String -> ReadP a #
Functor ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b # (<$) :: a -> ReadP b -> ReadP a #
MonadFail ReadP | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> ReadP a #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c # (*>) :: ReadP a -> ReadP b -> ReadP b # (<*) :: ReadP a -> ReadP b -> ReadP a #
Alternative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: ReadP a # (<|>) :: ReadP a -> ReadP a -> ReadP a # some :: ReadP a -> ReadP [a] # many :: ReadP a -> ReadP [a] #
MonadPlus ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: ReadP a # mplus :: ReadP a -> ReadP a -> ReadP a #

fromRat :: RealFloat a => Rational -> a #

Converts a `Rational` value into any type in class `RealFloat`.

floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int) #

`floatToDigits` takes a base and a non-negative `RealFloat` number, and returns a list of digits and an exponent. In particular, if `x>=0`, and

    floatToDigits base x = ([d1,d2,...,dn], e)

then

1.     n >= 1

2.     x = 0.d1d2...dn * (base**e)

3.     0 <= di <= base-1

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.

byteSwap64 :: Word64 -> Word64 #

Reverse order of bytes in `Word64`.

Since: base-4.7.0.0

byteSwap32 :: Word32 -> Word32 #

Reverse order of bytes in `Word32`.

Since: base-4.7.0.0

byteSwap16 :: Word16 -> Word16 #

Swap bytes in `Word16`.

Since: base-4.7.0.0

toTitle :: Char -> Char #

Convert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged.

toUpper :: Char -> Char #

Convert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.

toLower :: Char -> Char #

Convert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.

isLower :: Char -> Bool #

Selects lower-case alphabetic Unicode characters (letters).

isUpper :: Char -> Bool #

Selects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj.

isPrint :: Char -> Bool #

Selects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces).

isControl :: Char -> Bool #

Selects control characters, which are the non-printing characters of the Latin-1 subset of Unicode.

isAlphaNum :: Char -> Bool #

Selects alphabetic or numeric digit Unicode characters.

Note that numeric digits outside the ASCII range are selected by this function but not by `isDigit`. Such digits may be part of identifiers but are not used by the printer and reader to represent numbers.

isAlpha :: Char -> Bool #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to `isLetter`.

isSymbol :: Char -> Bool #

Selects Unicode symbol characters, including mathematical and currency symbols.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `MathSymbol`
- `CurrencySymbol`
- `ModifierSymbol`
- `OtherSymbol`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Symbol".

#### Examples

Expand

Basic usage:

    >>> isSymbol 'a'
    False
    >>> isSymbol '6'
    False
    >>> isSymbol '='
    True

The definition of "math symbol" may be a little counter-intuitive depending on one's background:

    >>> isSymbol '+'
    True
    >>> isSymbol '-'
    False

isPunctuation :: Char -> Bool #

Selects Unicode punctuation characters, including various kinds of connectors, brackets and quotes.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `ConnectorPunctuation`
- `DashPunctuation`
- `OpenPunctuation`
- `ClosePunctuation`
- `InitialQuote`
- `FinalQuote`
- `OtherPunctuation`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Punctuation".

#### Examples

Expand

Basic usage:

    >>> isPunctuation 'a'
    False
    >>> isPunctuation '7'
    False
    >>> isPunctuation '♥'
    False
    >>> isPunctuation '"'
    True
    >>> isPunctuation '?'
    True
    >>> isPunctuation '—'
    True

isHexDigit :: Char -> Bool #

Selects ASCII hexadecimal digits, i.e. `'0'`..`'9'`, `'a'`..`'f'`, `'A'`..`'F'`.

isOctDigit :: Char -> Bool #

Selects ASCII octal digits, i.e. `'0'`..`'7'`.

isDigit :: Char -> Bool #

Selects ASCII digits, i.e. `'0'`..`'9'`.

isSpace :: Char -> Bool #

Returns `True` for any Unicode space character, and the control characters `\t`, `\n`, `\r`, `\f`, `\v`.

isAsciiUpper :: Char -> Bool #

Selects ASCII upper-case letters, i.e. characters satisfying both `isAscii` and `isUpper`.

isAsciiLower :: Char -> Bool #

Selects ASCII lower-case letters, i.e. characters satisfying both `isAscii` and `isLower`.

isLatin1 :: Char -> Bool #

Selects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.

isAscii :: Char -> Bool #

Selects the first 128 characters of the Unicode character set, corresponding to the ASCII character set.

generalCategory :: Char -> GeneralCategory #

The Unicode general category of the character. This relies on the `Enum` instance of `GeneralCategory`, which must remain in the same order as the categories are presented in the Unicode standard.

#### Examples

Expand

Basic usage:

    >>> generalCategory 'a'
    LowercaseLetter
    >>> generalCategory 'A'
    UppercaseLetter
    >>> generalCategory '0'
    DecimalNumber
    >>> generalCategory '%'
    OtherPunctuation
    >>> generalCategory '♥'
    OtherSymbol
    >>> generalCategory '\31'
    Control
    >>> generalCategory ' '
    Space

data GeneralCategory #

Unicode General Categories (column 2 of the UnicodeData table) in the order they are listed in the Unicode standard (the Unicode Character Database, in particular).

#### Examples

Expand

Basic usage:

    >>> :t OtherLetter
    OtherLetter :: GeneralCategory

`Eq` instance:

    >>> UppercaseLetter == UppercaseLetter
    True
    >>> UppercaseLetter == LowercaseLetter
    False

`Ord` instance:

    >>> NonSpacingMark <= MathSymbol
    True

`Enum` instance:

    >>> enumFromTo ModifierLetter SpacingCombiningMark
    [ModifierLetter,OtherLetter,NonSpacingMark,SpacingCombiningMark]

`Read` instance:

    >>> read "DashPunctuation" :: GeneralCategory
    DashPunctuation
    >>> read "17" :: GeneralCategory
    *** Exception: Prelude.read: no parse

`Show` instance:

    >>> show EnclosingMark
    "EnclosingMark"

`Bounded` instance:

    >>> minBound :: GeneralCategory
    UppercaseLetter
    >>> maxBound :: GeneralCategory
    NotAssigned

`Ix` instance:

    >>> import Data.Ix ( index )
    >>> index (OtherLetter,Control) FinalQuote
    12
    >>> index (OtherLetter,Control) Format
    *** Exception: Error in array index

Constructors

UppercaseLetter | Lu: Letter, Uppercase
LowercaseLetter | Ll: Letter, Lowercase
TitlecaseLetter | Lt: Letter, Titlecase
ModifierLetter | Lm: Letter, Modifier
OtherLetter | Lo: Letter, Other
NonSpacingMark | Mn: Mark, Non-Spacing
SpacingCombiningMark | Mc: Mark, Spacing Combining
EnclosingMark | Me: Mark, Enclosing
DecimalNumber | Nd: Number, Decimal
LetterNumber | Nl: Number, Letter
OtherNumber | No: Number, Other
ConnectorPunctuation | Pc: Punctuation, Connector
DashPunctuation | Pd: Punctuation, Dash
OpenPunctuation | Ps: Punctuation, Open
ClosePunctuation | Pe: Punctuation, Close
InitialQuote | Pi: Punctuation, Initial quote
FinalQuote | Pf: Punctuation, Final quote
OtherPunctuation | Po: Punctuation, Other
MathSymbol | Sm: Symbol, Math
CurrencySymbol | Sc: Symbol, Currency
ModifierSymbol | Sk: Symbol, Modifier
OtherSymbol | So: Symbol, Other
Space | Zs: Separator, Space
LineSeparator | Zl: Separator, Line
ParagraphSeparator | Zp: Separator, Paragraph
Control | Cc: Other, Control
Format | Cf: Other, Format
Surrogate | Cs: Other, Surrogate
PrivateUse | Co: Other, Private Use
NotAssigned | Cn: Other, Not Assigned

Instances

Bounded GeneralCategory |
Instance details Defined in GHC.Unicode Methods minBound :: GeneralCategory # maxBound :: GeneralCategory #
Enum GeneralCategory |
Instance details Defined in GHC.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] #
Eq GeneralCategory |
Instance details Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool #
Ord GeneralCategory |
Instance details Defined in GHC.Unicode Methods compare :: GeneralCategory -> GeneralCategory -> Ordering # (<) :: GeneralCategory -> GeneralCategory -> Bool # (<=) :: GeneralCategory -> GeneralCategory -> Bool # (>) :: GeneralCategory -> GeneralCategory -> Bool # (>=) :: GeneralCategory -> GeneralCategory -> Bool # max :: GeneralCategory -> GeneralCategory -> GeneralCategory # min :: GeneralCategory -> GeneralCategory -> GeneralCategory #
Read GeneralCategory |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS GeneralCategory # readList :: ReadS [GeneralCategory] # readPrec :: ReadPrec GeneralCategory # readListPrec :: ReadPrec [GeneralCategory] #
Show GeneralCategory |
Instance details Defined in GHC.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS # show :: GeneralCategory -> String # showList :: [GeneralCategory] -> ShowS #
Ix GeneralCategory |
Instance details Defined in GHC.Unicode Methods range :: (GeneralCategory, GeneralCategory) -> [GeneralCategory] # index :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int # unsafeIndex :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int inRange :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Bool # rangeSize :: (GeneralCategory, GeneralCategory) -> Int # unsafeRangeSize :: (GeneralCategory, GeneralCategory) -> Int

writeSTRef :: STRef s a -> a -> ST s () #

Write a new value into an `STRef`

readSTRef :: STRef s a -> ST s a #

Read the value of an `STRef`

newSTRef :: a -> ST s (STRef s a) #

Build a new `STRef` in the current state thread

data STRef s a #

a value of type `STRef s a` is a mutable variable in state thread `s`, containing a value of type `a`

    >>> :{
    runST (do
        ref <- newSTRef "hello"
        x <- readSTRef ref
        writeSTRef ref (x ++ "world")
        readSTRef ref )
    :}
    "helloworld"

Instances

Eq (STRef s a) | Pointer equality. Since: base-2.1
Instance details Defined in GHC.STRef Methods (==) :: STRef s a -> STRef s a -> Bool # (/=) :: STRef s a -> STRef s a -> Bool #

runST :: (forall s. ST s a) -> a #

Return the value computed by a state transformer computation. The `forall` ensures that the internal state used by the `ST` computation is inaccessible to the rest of the program.

fixST :: (a -> ST s a) -> ST s a #

Allow the result of a state transformer computation to be used (lazily) inside the computation. Note that if `f` is strict, ``fixST` f = _|_`.

data ST s a #

The strict state-transformer monad. A computation of type ``ST` s a` transforms an internal state indexed by `s`, and returns a value of type `a`. The `s` parameter is either

- an uninstantiated type variable (inside invocations of `runST`), or
- `RealWorld` (inside invocations of `stToIO`).

It serves to keep the internal states of different invocations of `runST` separate from each other and from invocations of `stToIO`.

The `>>=` and `>>` operations are strict in the state (though not in values stored in the state). For example,

    runST (writeSTRef _|_ v >>= f) = _|_

Instances

Monad (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods (>>=) :: ST s a -> (a -> ST s b) -> ST s b # (>>) :: ST s a -> ST s b -> ST s b # return :: a -> ST s a # fail :: String -> ST s a #
Functor (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
MonadFix (ST s) | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> ST s a) -> ST s a #
MonadFail (ST s) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods fail :: String -> ST s a #
Applicative (ST s) | Since: base-4.4.0.0
Instance details Defined in GHC.ST Methods pure :: a -> ST s a # (<*>) :: ST s (a -> b) -> ST s a -> ST s b # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c # (*>) :: ST s a -> ST s b -> ST s b # (<*) :: ST s a -> ST s b -> ST s a #
Show (ST s a) | Since: base-2.1
Instance details Defined in GHC.ST Methods showsPrec :: Int -> ST s a -> ShowS # show :: ST s a -> String # showList :: [ST s a] -> ShowS #
Semigroup a => Semigroup (ST s a) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods (<>) :: ST s a -> ST s a -> ST s a # sconcat :: NonEmpty (ST s a) -> ST s a # stimes :: Integral b => b -> ST s a -> ST s a #
Monoid a => Monoid (ST s a) | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods mempty :: ST s a # mappend :: ST s a -> ST s a -> ST s a # mconcat :: [ST s a] -> ST s a #

toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b #

Attempt to convert an `Integral` type `a` to an `Integral` type `b` using the size of the types as measured by `Bits` methods.

A simpler version of this function is:

    toIntegral :: (Integral a, Integral b) => a -> Maybe b
    toIntegral x
      | toInteger x == y = Just (fromInteger y)
      | otherwise        = Nothing
      where
        y = toInteger x

This version requires going through `Integer`, which can be inefficient. However, `toIntegralSized` is optimized to allow GHC to statically determine the relative type sizes (as measured by `bitSizeMaybe` and `isSigned`) and avoid going through `Integer` for many types. (The implementation uses `fromIntegral`, which is itself optimized with rules for `base` types but may go through `Integer` for some type pairs.)

Since: base-4.8.0.0

popCountDefault :: (Bits a, Num a) => a -> Int #

Default implementation for `popCount`.

This implementation is intentionally naive. Instances are expected to provide an optimized implementation for their size.

Since: base-4.6.0.0

testBitDefault :: (Bits a, Num a) => a -> Int -> Bool #

Default implementation for `testBit`.

Note that: `testBitDefault x i = (x .&. bit i) /= 0`

Since: base-4.6.0.0

bitDefault :: (Bits a, Num a) => Int -> a #

Default implementation for `bit`.

Note that: `bitDefault i = 1 `shiftL` i`

Since: base-4.6.0.0

class Eq a => Bits a where #

The `Bits` class defines bitwise operations over integral types.

- Bits are numbered from 0 with bit 0 being the least significant bit.

Minimal complete definition

(.&.), (.|.), xor, complement, (shift | shiftL, shiftR), (rotate | rotateL, rotateR), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount

Methods

(.&.) :: a -> a -> a infixl 7 #

Bitwise "and"

(.|.) :: a -> a -> a infixl 5 #

Bitwise "or"

xor :: a -> a -> a infixl 6 #

Bitwise "xor"

complement :: a -> a #

Reverse all the bits in the argument

shift :: a -> Int -> a infixl 8 #

``shift` x i` shifts `x` left by `i` bits if `i` is positive, or right by `-i` bits otherwise. Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if the `x` is negative and with 0 otherwise.

An instance can define either this unified `shift` or `shiftL` and `shiftR`, depending on which is more convenient for the type in question.

rotate :: a -> Int -> a infixl 8 #

``rotate` x i` rotates `x` left by `i` bits if `i` is positive, or right by `-i` bits otherwise.

For unbounded types like `Integer`, `rotate` is equivalent to `shift`.

An instance can define either this unified `rotate` or `rotateL` and `rotateR`, depending on which is more convenient for the type in question.

zeroBits :: a #

`zeroBits` is the value with all bits unset.

The following laws ought to hold (for all valid bit indices `n`):

-     clearBit zeroBits n == zeroBits

-     setBit   zeroBits n == bit n

-     testBit  zeroBits n == False

-     popCount zeroBits   == 0

This method uses ``clearBit` (`bit` 0) 0` as its default implementation (which ought to be equivalent to `zeroBits` for types which possess a 0th bit).

Since: base-4.7.0.0

bit :: Int -> a #

`bit i` is a value with the `i`th bit set and all other bits clear.

Can be implemented using `bitDefault` if `a` is also an instance of `Num`.

See also `zeroBits`.

setBit :: a -> Int -> a #

`x `setBit` i` is the same as `x .|. bit i`

clearBit :: a -> Int -> a #

`x `clearBit` i` is the same as `x .&. complement (bit i)`

complementBit :: a -> Int -> a #

`x `complementBit` i` is the same as `x `xor` bit i`

testBit :: a -> Int -> Bool #

Return `True` if the `n`th bit of the argument is 1

Can be implemented using `testBitDefault` if `a` is also an instance of `Num`.

bitSizeMaybe :: a -> Maybe Int #

Return the number of bits in the type of the argument. The actual value of the argument is ignored. Returns Nothing for types that do not have a fixed bitsize, like `Integer`.

Since: base-4.7.0.0

bitSize :: a -> Int #

Return the number of bits in the type of the argument. The actual value of the argument is ignored. The function `bitSize` is undefined for types that do not have a fixed bitsize, like `Integer`.

isSigned :: a -> Bool #

Return `True` if the argument is a signed type. The actual value of the argument is ignored

shiftL :: a -> Int -> a infixl 8 #

Shift the argument left by the specified number of bits (which must be non-negative).

An instance can define either this and `shiftR` or the unified `shift`, depending on which is more convenient for the type in question.

unsafeShiftL :: a -> Int -> a #

Shift the argument left by the specified number of bits. The result is undefined for negative shift amounts and shift amounts greater or equal to the `bitSize`.

Defaults to `shiftL` unless defined explicitly by an instance.

Since: base-4.5.0.0

shiftR :: a -> Int -> a infixl 8 #

Shift the first argument right by the specified number of bits. The result is undefined for negative shift amounts and shift amounts greater or equal to the `bitSize`.

Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if the `x` is negative and with 0 otherwise.

An instance can define either this and `shiftL` or the unified `shift`, depending on which is more convenient for the type in question.

unsafeShiftR :: a -> Int -> a #

Shift the first argument right by the specified number of bits, which must be non-negative and smaller than the number of bits in the type.

Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if the `x` is negative and with 0 otherwise.

Defaults to `shiftR` unless defined explicitly by an instance.

Since: base-4.5.0.0

rotateL :: a -> Int -> a infixl 8 #

Rotate the argument left by the specified number of bits (which must be non-negative).

An instance can define either this and `rotateR` or the unified `rotate`, depending on which is more convenient for the type in question.

rotateR :: a -> Int -> a infixl 8 #

Rotate the argument right by the specified number of bits (which must be non-negative).

An instance can define either this and `rotateL` or the unified `rotate`, depending on which is more convenient for the type in question.

popCount :: a -> Int #

Return the number of set bits in the argument. This number is known as the population count or the Hamming weight.

Can be implemented using `popCountDefault` if `a` is also an instance of `Num`.

Since: base-4.5.0.0

Instances

Bits Bool | Interpret `Bool` as 1-bit bit-field Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods (.&.) :: Bool -> Bool -> Bool # (.|.) :: Bool -> Bool -> Bool # xor :: Bool -> Bool -> Bool # complement :: Bool -> Bool # shift :: Bool -> Int -> Bool # rotate :: Bool -> Int -> Bool # zeroBits :: Bool # bit :: Int -> Bool # setBit :: Bool -> Int -> Bool # clearBit :: Bool -> Int -> Bool # complementBit :: Bool -> Int -> Bool # testBit :: Bool -> Int -> Bool # bitSizeMaybe :: Bool -> Maybe Int # bitSize :: Bool -> Int # isSigned :: Bool -> Bool # shiftL :: Bool -> Int -> Bool # unsafeShiftL :: Bool -> Int -> Bool # shiftR :: Bool -> Int -> Bool # unsafeShiftR :: Bool -> Int -> Bool # rotateL :: Bool -> Int -> Bool # rotateR :: Bool -> Int -> Bool # popCount :: Bool -> Int #
Bits Int | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Int -> Int -> Int # (.|.) :: Int -> Int -> Int # xor :: Int -> Int -> Int # complement :: Int -> Int # shift :: Int -> Int -> Int # rotate :: Int -> Int -> Int # zeroBits :: Int # bit :: Int -> Int # setBit :: Int -> Int -> Int # clearBit :: Int -> Int -> Int # complementBit :: Int -> Int -> Int # testBit :: Int -> Int -> Bool # bitSizeMaybe :: Int -> Maybe Int # bitSize :: Int -> Int # isSigned :: Int -> Bool # shiftL :: Int -> Int -> Int # unsafeShiftL :: Int -> Int -> Int # shiftR :: Int -> Int -> Int # unsafeShiftR :: Int -> Int -> Int # rotateL :: Int -> Int -> Int # rotateR :: Int -> Int -> Int # popCount :: Int -> Int #
Bits Int8 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int8 -> Int8 -> Int8 # (.|.) :: Int8 -> Int8 -> Int8 # xor :: Int8 -> Int8 -> Int8 # complement :: Int8 -> Int8 # shift :: Int8 -> Int -> Int8 # rotate :: Int8 -> Int -> Int8 # zeroBits :: Int8 # bit :: Int -> Int8 # setBit :: Int8 -> Int -> Int8 # clearBit :: Int8 -> Int -> Int8 # complementBit :: Int8 -> Int -> Int8 # testBit :: Int8 -> Int -> Bool # bitSizeMaybe :: Int8 -> Maybe Int # bitSize :: Int8 -> Int # isSigned :: Int8 -> Bool # shiftL :: Int8 -> Int -> Int8 # unsafeShiftL :: Int8 -> Int -> Int8 # shiftR :: Int8 -> Int -> Int8 # unsafeShiftR :: Int8 -> Int -> Int8 # rotateL :: Int8 -> Int -> Int8 # rotateR :: Int8 -> Int -> Int8 # popCount :: Int8 -> Int #
Bits Int16 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int16 -> Int16 -> Int16 # (.|.) :: Int16 -> Int16 -> Int16 # xor :: Int16 -> Int16 -> Int16 # complement :: Int16 -> Int16 # shift :: Int16 -> Int -> Int16 # rotate :: Int16 -> Int -> Int16 # zeroBits :: Int16 # bit :: Int -> Int16 # setBit :: Int16 -> Int -> Int16 # clearBit :: Int16 -> Int -> Int16 # complementBit :: Int16 -> Int -> Int16 # testBit :: Int16 -> Int -> Bool # bitSizeMaybe :: Int16 -> Maybe Int # bitSize :: Int16 -> Int # isSigned :: Int16 -> Bool # shiftL :: Int16 -> Int -> Int16 # unsafeShiftL :: Int16 -> Int -> Int16 # shiftR :: Int16 -> Int -> Int16 # unsafeShiftR :: Int16 -> Int -> Int16 # rotateL :: Int16 -> Int -> Int16 # rotateR :: Int16 -> Int -> Int16 # popCount :: Int16 -> Int #
Bits Int32 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int32 -> Int32 -> Int32 # (.|.) :: Int32 -> Int32 -> Int32 # xor :: Int32 -> Int32 -> Int32 # complement :: Int32 -> Int32 # shift :: Int32 -> Int -> Int32 # rotate :: Int32 -> Int -> Int32 # zeroBits :: Int32 # bit :: Int -> Int32 # setBit :: Int32 -> Int -> Int32 # clearBit :: Int32 -> Int -> Int32 # complementBit :: Int32 -> Int -> Int32 # testBit :: Int32 -> Int -> Bool # bitSizeMaybe :: Int32 -> Maybe Int # bitSize :: Int32 -> Int # isSigned :: Int32 -> Bool # shiftL :: Int32 -> Int -> Int32 # unsafeShiftL :: Int32 -> Int -> Int32 # shiftR :: Int32 -> Int -> Int32 # unsafeShiftR :: Int32 -> Int -> Int32 # rotateL :: Int32 -> Int -> Int32 # rotateR :: Int32 -> Int -> Int32 # popCount :: Int32 -> Int #
Bits Int64 | Since: base-2.1
Instance details Defined in GHC.Int Methods (.&.) :: Int64 -> Int64 -> Int64 # (.|.) :: Int64 -> Int64 -> Int64 # xor :: Int64 -> Int64 -> Int64 # complement :: Int64 -> Int64 # shift :: Int64 -> Int -> Int64 # rotate :: Int64 -> Int -> Int64 # zeroBits :: Int64 # bit :: Int -> Int64 # setBit :: Int64 -> Int -> Int64 # clearBit :: Int64 -> Int -> Int64 # complementBit :: Int64 -> Int -> Int64 # testBit :: Int64 -> Int -> Bool # bitSizeMaybe :: Int64 -> Maybe Int # bitSize :: Int64 -> Int # isSigned :: Int64 -> Bool # shiftL :: Int64 -> Int -> Int64 # unsafeShiftL :: Int64 -> Int -> Int64 # shiftR :: Int64 -> Int -> Int64 # unsafeShiftR :: Int64 -> Int -> Int64 # rotateL :: Int64 -> Int -> Int64 # rotateR :: Int64 -> Int -> Int64 # popCount :: Int64 -> Int #
Bits Integer | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # zeroBits :: Integer # bit :: Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # bitSize :: Integer -> Int # isSigned :: Integer -> Bool # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # rotateR :: Integer -> Int -> Integer # popCount :: Integer -> Int #
Bits Natural | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods (.&.) :: Natural -> Natural -> Natural # (.|.) :: Natural -> Natural -> Natural # xor :: Natural -> Natural -> Natural # complement :: Natural -> Natural # shift :: Natural -> Int -> Natural # rotate :: Natural -> Int -> Natural # zeroBits :: Natural # bit :: Int -> Natural # setBit :: Natural -> Int -> Natural # clearBit :: Natural -> Int -> Natural # complementBit :: Natural -> Int -> Natural # testBit :: Natural -> Int -> Bool # bitSizeMaybe :: Natural -> Maybe Int # bitSize :: Natural -> Int # isSigned :: Natural -> Bool # shiftL :: Natural -> Int -> Natural # unsafeShiftL :: Natural -> Int -> Natural # shiftR :: Natural -> Int -> Natural # unsafeShiftR :: Natural -> Int -> Natural # rotateL :: Natural -> Int -> Natural # rotateR :: Natural -> Int -> Natural # popCount :: Natural -> Int #
Bits Word | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # xor :: Word -> Word -> Word # complement :: Word -> Word # shift :: Word -> Int -> Word # rotate :: Word -> Int -> Word # zeroBits :: Word # bit :: Int -> Word # setBit :: Word -> Int -> Word # clearBit :: Word -> Int -> Word # complementBit :: Word -> Int -> Word # testBit :: Word -> Int -> Bool # bitSizeMaybe :: Word -> Maybe Int # bitSize :: Word -> Int # isSigned :: Word -> Bool # shiftL :: Word -> Int -> Word # unsafeShiftL :: Word -> Int -> Word # shiftR :: Word -> Int -> Word # unsafeShiftR :: Word -> Int -> Word # rotateL :: Word -> Int -> Word # rotateR :: Word -> Int -> Word # popCount :: Word -> Int #
Bits Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word8 -> Word8 -> Word8 # (.|.) :: Word8 -> Word8 -> Word8 # xor :: Word8 -> Word8 -> Word8 # complement :: Word8 -> Word8 # shift :: Word8 -> Int -> Word8 # rotate :: Word8 -> Int -> Word8 # zeroBits :: Word8 # bit :: Int -> Word8 # setBit :: Word8 -> Int -> Word8 # clearBit :: Word8 -> Int -> Word8 # complementBit :: Word8 -> Int -> Word8 # testBit :: Word8 -> Int -> Bool # bitSizeMaybe :: Word8 -> Maybe Int # bitSize :: Word8 -> Int # isSigned :: Word8 -> Bool # shiftL :: Word8 -> Int -> Word8 # unsafeShiftL :: Word8 -> Int -> Word8 # shiftR :: Word8 -> Int -> Word8 # unsafeShiftR :: Word8 -> Int -> Word8 # rotateL :: Word8 -> Int -> Word8 # rotateR :: Word8 -> Int -> Word8 # popCount :: Word8 -> Int #
Bits Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word16 -> Word16 -> Word16 # (.|.) :: Word16 -> Word16 -> Word16 # xor :: Word16 -> Word16 -> Word16 # complement :: Word16 -> Word16 # shift :: Word16 -> Int -> Word16 # rotate :: Word16 -> Int -> Word16 # zeroBits :: Word16 # bit :: Int -> Word16 # setBit :: Word16 -> Int -> Word16 # clearBit :: Word16 -> Int -> Word16 # complementBit :: Word16 -> Int -> Word16 # testBit :: Word16 -> Int -> Bool # bitSizeMaybe :: Word16 -> Maybe Int # bitSize :: Word16 -> Int # isSigned :: Word16 -> Bool # shiftL :: Word16 -> Int -> Word16 # unsafeShiftL :: Word16 -> Int -> Word16 # shiftR :: Word16 -> Int -> Word16 # unsafeShiftR :: Word16 -> Int -> Word16 # rotateL :: Word16 -> Int -> Word16 # rotateR :: Word16 -> Int -> Word16 # popCount :: Word16 -> Int #
Bits Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word32 -> Word32 -> Word32 # (.|.) :: Word32 -> Word32 -> Word32 # xor :: Word32 -> Word32 -> Word32 # complement :: Word32 -> Word32 # shift :: Word32 -> Int -> Word32 # rotate :: Word32 -> Int -> Word32 # zeroBits :: Word32 # bit :: Int -> Word32 # setBit :: Word32 -> Int -> Word32 # clearBit :: Word32 -> Int -> Word32 # complementBit :: Word32 -> Int -> Word32 # testBit :: Word32 -> Int -> Bool # bitSizeMaybe :: Word32 -> Maybe Int # bitSize :: Word32 -> Int # isSigned :: Word32 -> Bool # shiftL :: Word32 -> Int -> Word32 # unsafeShiftL :: Word32 -> Int -> Word32 # shiftR :: Word32 -> Int -> Word32 # unsafeShiftR :: Word32 -> Int -> Word32 # rotateL :: Word32 -> Int -> Word32 # rotateR :: Word32 -> Int -> Word32 # popCount :: Word32 -> Int #
Bits Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods (.&.) :: Word64 -> Word64 -> Word64 # (.|.) :: Word64 -> Word64 -> Word64 # xor :: Word64 -> Word64 -> Word64 # complement :: Word64 -> Word64 # shift :: Word64 -> Int -> Word64 # rotate :: Word64 -> Int -> Word64 # zeroBits :: Word64 # bit :: Int -> Word64 # setBit :: Word64 -> Int -> Word64 # clearBit :: Word64 -> Int -> Word64 # complementBit :: Word64 -> Int -> Word64 # testBit :: Word64 -> Int -> Bool # bitSizeMaybe :: Word64 -> Maybe Int # bitSize :: Word64 -> Int # isSigned :: Word64 -> Bool # shiftL :: Word64 -> Int -> Word64 # unsafeShiftL :: Word64 -> Int -> Word64 # shiftR :: Word64 -> Int -> Word64 # unsafeShiftR :: Word64 -> Int -> Word64 # rotateL :: Word64 -> Int -> Word64 # rotateR :: Word64 -> Int -> Word64 # popCount :: Word64 -> Int #
Bits CDev |
Instance details Defined in System.Posix.Types Methods (.&.) :: CDev -> CDev -> CDev # (.|.) :: CDev -> CDev -> CDev # xor :: CDev -> CDev -> CDev # complement :: CDev -> CDev # shift :: CDev -> Int -> CDev # rotate :: CDev -> Int -> CDev # zeroBits :: CDev # bit :: Int -> CDev # setBit :: CDev -> Int -> CDev # clearBit :: CDev -> Int -> CDev # complementBit :: CDev -> Int -> CDev # testBit :: CDev -> Int -> Bool # bitSizeMaybe :: CDev -> Maybe Int # bitSize :: CDev -> Int # isSigned :: CDev -> Bool # shiftL :: CDev -> Int -> CDev # unsafeShiftL :: CDev -> Int -> CDev # shiftR :: CDev -> Int -> CDev # unsafeShiftR :: CDev -> Int -> CDev # rotateL :: CDev -> Int -> CDev # rotateR :: CDev -> Int -> CDev # popCount :: CDev -> Int #
Bits CIno |
Instance details Defined in System.Posix.Types Methods (.&.) :: CIno -> CIno -> CIno # (.|.) :: CIno -> CIno -> CIno # xor :: CIno -> CIno -> CIno # complement :: CIno -> CIno # shift :: CIno -> Int -> CIno # rotate :: CIno -> Int -> CIno # zeroBits :: CIno # bit :: Int -> CIno # setBit :: CIno -> Int -> CIno # clearBit :: CIno -> Int -> CIno # complementBit :: CIno -> Int -> CIno # testBit :: CIno -> Int -> Bool # bitSizeMaybe :: CIno -> Maybe Int # bitSize :: CIno -> Int # isSigned :: CIno -> Bool # shiftL :: CIno -> Int -> CIno # unsafeShiftL :: CIno -> Int -> CIno # shiftR :: CIno -> Int -> CIno # unsafeShiftR :: CIno -> Int -> CIno # rotateL :: CIno -> Int -> CIno # rotateR :: CIno -> Int -> CIno # popCount :: CIno -> Int #
Bits CMode |
Instance details Defined in System.Posix.Types Methods (.&.) :: CMode -> CMode -> CMode # (.|.) :: CMode -> CMode -> CMode # xor :: CMode -> CMode -> CMode # complement :: CMode -> CMode # shift :: CMode -> Int -> CMode # rotate :: CMode -> Int -> CMode # zeroBits :: CMode # bit :: Int -> CMode # setBit :: CMode -> Int -> CMode # clearBit :: CMode -> Int -> CMode # complementBit :: CMode -> Int -> CMode # testBit :: CMode -> Int -> Bool # bitSizeMaybe :: CMode -> Maybe Int # bitSize :: CMode -> Int # isSigned :: CMode -> Bool # shiftL :: CMode -> Int -> CMode # unsafeShiftL :: CMode -> Int -> CMode # shiftR :: CMode -> Int -> CMode # unsafeShiftR :: CMode -> Int -> CMode # rotateL :: CMode -> Int -> CMode # rotateR :: CMode -> Int -> CMode # popCount :: CMode -> Int #
Bits COff |
Instance details Defined in System.Posix.Types Methods (.&.) :: COff -> COff -> COff # (.|.) :: COff -> COff -> COff # xor :: COff -> COff -> COff # complement :: COff -> COff # shift :: COff -> Int -> COff # rotate :: COff -> Int -> COff # zeroBits :: COff # bit :: Int -> COff # setBit :: COff -> Int -> COff # clearBit :: COff -> Int -> COff # complementBit :: COff -> Int -> COff # testBit :: COff -> Int -> Bool # bitSizeMaybe :: COff -> Maybe Int # bitSize :: COff -> Int # isSigned :: COff -> Bool # shiftL :: COff -> Int -> COff # unsafeShiftL :: COff -> Int -> COff # shiftR :: COff -> Int -> COff # unsafeShiftR :: COff -> Int -> COff # rotateL :: COff -> Int -> COff # rotateR :: COff -> Int -> COff # popCount :: COff -> Int #
Bits CPid |
Instance details Defined in System.Posix.Types Methods (.&.) :: CPid -> CPid -> CPid # (.|.) :: CPid -> CPid -> CPid # xor :: CPid -> CPid -> CPid # complement :: CPid -> CPid # shift :: CPid -> Int -> CPid # rotate :: CPid -> Int -> CPid # zeroBits :: CPid # bit :: Int -> CPid # setBit :: CPid -> Int -> CPid # clearBit :: CPid -> Int -> CPid # complementBit :: CPid -> Int -> CPid # testBit :: CPid -> Int -> Bool # bitSizeMaybe :: CPid -> Maybe Int # bitSize :: CPid -> Int # isSigned :: CPid -> Bool # shiftL :: CPid -> Int -> CPid # unsafeShiftL :: CPid -> Int -> CPid # shiftR :: CPid -> Int -> CPid # unsafeShiftR :: CPid -> Int -> CPid # rotateL :: CPid -> Int -> CPid # rotateR :: CPid -> Int -> CPid # popCount :: CPid -> Int #
Bits CSsize |
Instance details Defined in System.Posix.Types Methods (.&.) :: CSsize -> CSsize -> CSsize # (.|.) :: CSsize -> CSsize -> CSsize # xor :: CSsize -> CSsize -> CSsize # complement :: CSsize -> CSsize # shift :: CSsize -> Int -> CSsize # rotate :: CSsize -> Int -> CSsize # zeroBits :: CSsize # bit :: Int -> CSsize # setBit :: CSsize -> Int -> CSsize # clearBit :: CSsize -> Int -> CSsize # complementBit :: CSsize -> Int -> CSsize # testBit :: CSsize -> Int -> Bool # bitSizeMaybe :: CSsize -> Maybe Int # bitSize :: CSsize -> Int # isSigned :: CSsize -> Bool # shiftL :: CSsize -> Int -> CSsize # unsafeShiftL :: CSsize -> Int -> CSsize # shiftR :: CSsize -> Int -> CSsize # unsafeShiftR :: CSsize -> Int -> CSsize # rotateL :: CSsize -> Int -> CSsize # rotateR :: CSsize -> Int -> CSsize # popCount :: CSsize -> Int #
Bits CGid |
Instance details Defined in System.Posix.Types Methods (.&.) :: CGid -> CGid -> CGid # (.|.) :: CGid -> CGid -> CGid # xor :: CGid -> CGid -> CGid # complement :: CGid -> CGid # shift :: CGid -> Int -> CGid # rotate :: CGid -> Int -> CGid # zeroBits :: CGid # bit :: Int -> CGid # setBit :: CGid -> Int -> CGid # clearBit :: CGid -> Int -> CGid # complementBit :: CGid -> Int -> CGid # testBit :: CGid -> Int -> Bool # bitSizeMaybe :: CGid -> Maybe Int # bitSize :: CGid -> Int # isSigned :: CGid -> Bool # shiftL :: CGid -> Int -> CGid # unsafeShiftL :: CGid -> Int -> CGid # shiftR :: CGid -> Int -> CGid # unsafeShiftR :: CGid -> Int -> CGid # rotateL :: CGid -> Int -> CGid # rotateR :: CGid -> Int -> CGid # popCount :: CGid -> Int #
Bits CNlink |
Instance details Defined in System.Posix.Types Methods (.&.) :: CNlink -> CNlink -> CNlink # (.|.) :: CNlink -> CNlink -> CNlink # xor :: CNlink -> CNlink -> CNlink # complement :: CNlink -> CNlink # shift :: CNlink -> Int -> CNlink # rotate :: CNlink -> Int -> CNlink # zeroBits :: CNlink # bit :: Int -> CNlink # setBit :: CNlink -> Int -> CNlink # clearBit :: CNlink -> Int -> CNlink # complementBit :: CNlink -> Int -> CNlink # testBit :: CNlink -> Int -> Bool # bitSizeMaybe :: CNlink -> Maybe Int # bitSize :: CNlink -> Int # isSigned :: CNlink -> Bool # shiftL :: CNlink -> Int -> CNlink # unsafeShiftL :: CNlink -> Int -> CNlink # shiftR :: CNlink -> Int -> CNlink # unsafeShiftR :: CNlink -> Int -> CNlink # rotateL :: CNlink -> Int -> CNlink # rotateR :: CNlink -> Int -> CNlink # popCount :: CNlink -> Int #
Bits CUid |
Instance details Defined in System.Posix.Types Methods (.&.) :: CUid -> CUid -> CUid # (.|.) :: CUid -> CUid -> CUid # xor :: CUid -> CUid -> CUid # complement :: CUid -> CUid # shift :: CUid -> Int -> CUid # rotate :: CUid -> Int -> CUid # zeroBits :: CUid # bit :: Int -> CUid # setBit :: CUid -> Int -> CUid # clearBit :: CUid -> Int -> CUid # complementBit :: CUid -> Int -> CUid # testBit :: CUid -> Int -> Bool # bitSizeMaybe :: CUid -> Maybe Int # bitSize :: CUid -> Int # isSigned :: CUid -> Bool # shiftL :: CUid -> Int -> CUid # unsafeShiftL :: CUid -> Int -> CUid # shiftR :: CUid -> Int -> CUid # unsafeShiftR :: CUid -> Int -> CUid # rotateL :: CUid -> Int -> CUid # rotateR :: CUid -> Int -> CUid # popCount :: CUid -> Int #
Bits CTcflag |
Instance details Defined in System.Posix.Types Methods (.&.) :: CTcflag -> CTcflag -> CTcflag # (.|.) :: CTcflag -> CTcflag -> CTcflag # xor :: CTcflag -> CTcflag -> CTcflag # complement :: CTcflag -> CTcflag # shift :: CTcflag -> Int -> CTcflag # rotate :: CTcflag -> Int -> CTcflag # zeroBits :: CTcflag # bit :: Int -> CTcflag # setBit :: CTcflag -> Int -> CTcflag # clearBit :: CTcflag -> Int -> CTcflag # complementBit :: CTcflag -> Int -> CTcflag # testBit :: CTcflag -> Int -> Bool # bitSizeMaybe :: CTcflag -> Maybe Int # bitSize :: CTcflag -> Int # isSigned :: CTcflag -> Bool # shiftL :: CTcflag -> Int -> CTcflag # unsafeShiftL :: CTcflag -> Int -> CTcflag # shiftR :: CTcflag -> Int -> CTcflag # unsafeShiftR :: CTcflag -> Int -> CTcflag # rotateL :: CTcflag -> Int -> CTcflag # rotateR :: CTcflag -> Int -> CTcflag # popCount :: CTcflag -> Int #
Bits CRLim |
Instance details Defined in System.Posix.Types Methods (.&.) :: CRLim -> CRLim -> CRLim # (.|.) :: CRLim -> CRLim -> CRLim # xor :: CRLim -> CRLim -> CRLim # complement :: CRLim -> CRLim # shift :: CRLim -> Int -> CRLim # rotate :: CRLim -> Int -> CRLim # zeroBits :: CRLim # bit :: Int -> CRLim # setBit :: CRLim -> Int -> CRLim # clearBit :: CRLim -> Int -> CRLim # complementBit :: CRLim -> Int -> CRLim # testBit :: CRLim -> Int -> Bool # bitSizeMaybe :: CRLim -> Maybe Int # bitSize :: CRLim -> Int # isSigned :: CRLim -> Bool # shiftL :: CRLim -> Int -> CRLim # unsafeShiftL :: CRLim -> Int -> CRLim # shiftR :: CRLim -> Int -> CRLim # unsafeShiftR :: CRLim -> Int -> CRLim # rotateL :: CRLim -> Int -> CRLim # rotateR :: CRLim -> Int -> CRLim # popCount :: CRLim -> Int #
Bits CBlkSize |
Instance details Defined in System.Posix.Types Methods (.&.) :: CBlkSize -> CBlkSize -> CBlkSize # (.|.) :: CBlkSize -> CBlkSize -> CBlkSize # xor :: CBlkSize -> CBlkSize -> CBlkSize # complement :: CBlkSize -> CBlkSize # shift :: CBlkSize -> Int -> CBlkSize # rotate :: CBlkSize -> Int -> CBlkSize # zeroBits :: CBlkSize # bit :: Int -> CBlkSize # setBit :: CBlkSize -> Int -> CBlkSize # clearBit :: CBlkSize -> Int -> CBlkSize # complementBit :: CBlkSize -> Int -> CBlkSize # testBit :: CBlkSize -> Int -> Bool # bitSizeMaybe :: CBlkSize -> Maybe Int # bitSize :: CBlkSize -> Int # isSigned :: CBlkSize -> Bool # shiftL :: CBlkSize -> Int -> CBlkSize # unsafeShiftL :: CBlkSize -> Int -> CBlkSize # shiftR :: CBlkSize -> Int -> CBlkSize # unsafeShiftR :: CBlkSize -> Int -> CBlkSize # rotateL :: CBlkSize -> Int -> CBlkSize # rotateR :: CBlkSize -> Int -> CBlkSize # popCount :: CBlkSize -> Int #
Bits CBlkCnt |
Instance details Defined in System.Posix.Types Methods (.&.) :: CBlkCnt -> CBlkCnt -> CBlkCnt # (.|.) :: CBlkCnt -> CBlkCnt -> CBlkCnt # xor :: CBlkCnt -> CBlkCnt -> CBlkCnt # complement :: CBlkCnt -> CBlkCnt # shift :: CBlkCnt -> Int -> CBlkCnt # rotate :: CBlkCnt -> Int -> CBlkCnt # zeroBits :: CBlkCnt # bit :: Int -> CBlkCnt # setBit :: CBlkCnt -> Int -> CBlkCnt # clearBit :: CBlkCnt -> Int -> CBlkCnt # complementBit :: CBlkCnt -> Int -> CBlkCnt # testBit :: CBlkCnt -> Int -> Bool # bitSizeMaybe :: CBlkCnt -> Maybe Int # bitSize :: CBlkCnt -> Int # isSigned :: CBlkCnt -> Bool # shiftL :: CBlkCnt -> Int -> CBlkCnt # unsafeShiftL :: CBlkCnt -> Int -> CBlkCnt # shiftR :: CBlkCnt -> Int -> CBlkCnt # unsafeShiftR :: CBlkCnt -> Int -> CBlkCnt # rotateL :: CBlkCnt -> Int -> CBlkCnt # rotateR :: CBlkCnt -> Int -> CBlkCnt # popCount :: CBlkCnt -> Int #
Bits CClockId |
Instance details Defined in System.Posix.Types Methods (.&.) :: CClockId -> CClockId -> CClockId # (.|.) :: CClockId -> CClockId -> CClockId # xor :: CClockId -> CClockId -> CClockId # complement :: CClockId -> CClockId # shift :: CClockId -> Int -> CClockId # rotate :: CClockId -> Int -> CClockId # zeroBits :: CClockId # bit :: Int -> CClockId # setBit :: CClockId -> Int -> CClockId # clearBit :: CClockId -> Int -> CClockId # complementBit :: CClockId -> Int -> CClockId # testBit :: CClockId -> Int -> Bool # bitSizeMaybe :: CClockId -> Maybe Int # bitSize :: CClockId -> Int # isSigned :: CClockId -> Bool # shiftL :: CClockId -> Int -> CClockId # unsafeShiftL :: CClockId -> Int -> CClockId # shiftR :: CClockId -> Int -> CClockId # unsafeShiftR :: CClockId -> Int -> CClockId # rotateL :: CClockId -> Int -> CClockId # rotateR :: CClockId -> Int -> CClockId # popCount :: CClockId -> Int #
Bits CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods (.&.) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # (.|.) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # xor :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # complement :: CFsBlkCnt -> CFsBlkCnt # shift :: CFsBlkCnt -> Int -> CFsBlkCnt # rotate :: CFsBlkCnt -> Int -> CFsBlkCnt # zeroBits :: CFsBlkCnt # bit :: Int -> CFsBlkCnt # setBit :: CFsBlkCnt -> Int -> CFsBlkCnt # clearBit :: CFsBlkCnt -> Int -> CFsBlkCnt # complementBit :: CFsBlkCnt -> Int -> CFsBlkCnt # testBit :: CFsBlkCnt -> Int -> Bool # bitSizeMaybe :: CFsBlkCnt -> Maybe Int # bitSize :: CFsBlkCnt -> Int # isSigned :: CFsBlkCnt -> Bool # shiftL :: CFsBlkCnt -> Int -> CFsBlkCnt # unsafeShiftL :: CFsBlkCnt -> Int -> CFsBlkCnt # shiftR :: CFsBlkCnt -> Int -> CFsBlkCnt # unsafeShiftR :: CFsBlkCnt -> Int -> CFsBlkCnt # rotateL :: CFsBlkCnt -> Int -> CFsBlkCnt # rotateR :: CFsBlkCnt -> Int -> CFsBlkCnt # popCount :: CFsBlkCnt -> Int #
Bits CFsFilCnt |
Instance details Defined in System.Posix.Types Methods (.&.) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # (.|.) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # xor :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # complement :: CFsFilCnt -> CFsFilCnt # shift :: CFsFilCnt -> Int -> CFsFilCnt # rotate :: CFsFilCnt -> Int -> CFsFilCnt # zeroBits :: CFsFilCnt # bit :: Int -> CFsFilCnt # setBit :: CFsFilCnt -> Int -> CFsFilCnt # clearBit :: CFsFilCnt -> Int -> CFsFilCnt # complementBit :: CFsFilCnt -> Int -> CFsFilCnt # testBit :: CFsFilCnt -> Int -> Bool # bitSizeMaybe :: CFsFilCnt -> Maybe Int # bitSize :: CFsFilCnt -> Int # isSigned :: CFsFilCnt -> Bool # shiftL :: CFsFilCnt -> Int -> CFsFilCnt # unsafeShiftL :: CFsFilCnt -> Int -> CFsFilCnt # shiftR :: CFsFilCnt -> Int -> CFsFilCnt # unsafeShiftR :: CFsFilCnt -> Int -> CFsFilCnt # rotateL :: CFsFilCnt -> Int -> CFsFilCnt # rotateR :: CFsFilCnt -> Int -> CFsFilCnt # popCount :: CFsFilCnt -> Int #
Bits CId |
Instance details Defined in System.Posix.Types Methods (.&.) :: CId -> CId -> CId # (.|.) :: CId -> CId -> CId # xor :: CId -> CId -> CId # complement :: CId -> CId # shift :: CId -> Int -> CId # rotate :: CId -> Int -> CId # zeroBits :: CId # bit :: Int -> CId # setBit :: CId -> Int -> CId # clearBit :: CId -> Int -> CId # complementBit :: CId -> Int -> CId # testBit :: CId -> Int -> Bool # bitSizeMaybe :: CId -> Maybe Int # bitSize :: CId -> Int # isSigned :: CId -> Bool # shiftL :: CId -> Int -> CId # unsafeShiftL :: CId -> Int -> CId # shiftR :: CId -> Int -> CId # unsafeShiftR :: CId -> Int -> CId # rotateL :: CId -> Int -> CId # rotateR :: CId -> Int -> CId # popCount :: CId -> Int #
Bits CKey |
Instance details Defined in System.Posix.Types Methods (.&.) :: CKey -> CKey -> CKey # (.|.) :: CKey -> CKey -> CKey # xor :: CKey -> CKey -> CKey # complement :: CKey -> CKey # shift :: CKey -> Int -> CKey # rotate :: CKey -> Int -> CKey # zeroBits :: CKey # bit :: Int -> CKey # setBit :: CKey -> Int -> CKey # clearBit :: CKey -> Int -> CKey # complementBit :: CKey -> Int -> CKey # testBit :: CKey -> Int -> Bool # bitSizeMaybe :: CKey -> Maybe Int # bitSize :: CKey -> Int # isSigned :: CKey -> Bool # shiftL :: CKey -> Int -> CKey # unsafeShiftL :: CKey -> Int -> CKey # shiftR :: CKey -> Int -> CKey # unsafeShiftR :: CKey -> Int -> CKey # rotateL :: CKey -> Int -> CKey # rotateR :: CKey -> Int -> CKey # popCount :: CKey -> Int #
Bits Fd |
Instance details Defined in System.Posix.Types Methods (.&.) :: Fd -> Fd -> Fd # (.|.) :: Fd -> Fd -> Fd # xor :: Fd -> Fd -> Fd # complement :: Fd -> Fd # shift :: Fd -> Int -> Fd # rotate :: Fd -> Int -> Fd # zeroBits :: Fd # bit :: Int -> Fd # setBit :: Fd -> Int -> Fd # clearBit :: Fd -> Int -> Fd # complementBit :: Fd -> Int -> Fd # testBit :: Fd -> Int -> Bool # bitSizeMaybe :: Fd -> Maybe Int # bitSize :: Fd -> Int # isSigned :: Fd -> Bool # shiftL :: Fd -> Int -> Fd # unsafeShiftL :: Fd -> Int -> Fd # shiftR :: Fd -> Int -> Fd # unsafeShiftR :: Fd -> Int -> Fd # rotateL :: Fd -> Int -> Fd # rotateR :: Fd -> Int -> Fd # popCount :: Fd -> Int #
Bits CChar |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CChar -> CChar -> CChar # (.|.) :: CChar -> CChar -> CChar # xor :: CChar -> CChar -> CChar # complement :: CChar -> CChar # shift :: CChar -> Int -> CChar # rotate :: CChar -> Int -> CChar # zeroBits :: CChar # bit :: Int -> CChar # setBit :: CChar -> Int -> CChar # clearBit :: CChar -> Int -> CChar # complementBit :: CChar -> Int -> CChar # testBit :: CChar -> Int -> Bool # bitSizeMaybe :: CChar -> Maybe Int # bitSize :: CChar -> Int # isSigned :: CChar -> Bool # shiftL :: CChar -> Int -> CChar # unsafeShiftL :: CChar -> Int -> CChar # shiftR :: CChar -> Int -> CChar # unsafeShiftR :: CChar -> Int -> CChar # rotateL :: CChar -> Int -> CChar # rotateR :: CChar -> Int -> CChar # popCount :: CChar -> Int #
Bits CSChar |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CSChar -> CSChar -> CSChar # (.|.) :: CSChar -> CSChar -> CSChar # xor :: CSChar -> CSChar -> CSChar # complement :: CSChar -> CSChar # shift :: CSChar -> Int -> CSChar # rotate :: CSChar -> Int -> CSChar # zeroBits :: CSChar # bit :: Int -> CSChar # setBit :: CSChar -> Int -> CSChar # clearBit :: CSChar -> Int -> CSChar # complementBit :: CSChar -> Int -> CSChar # testBit :: CSChar -> Int -> Bool # bitSizeMaybe :: CSChar -> Maybe Int # bitSize :: CSChar -> Int # isSigned :: CSChar -> Bool # shiftL :: CSChar -> Int -> CSChar # unsafeShiftL :: CSChar -> Int -> CSChar # shiftR :: CSChar -> Int -> CSChar # unsafeShiftR :: CSChar -> Int -> CSChar # rotateL :: CSChar -> Int -> CSChar # rotateR :: CSChar -> Int -> CSChar # popCount :: CSChar -> Int #
Bits CUChar |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CUChar -> CUChar -> CUChar # (.|.) :: CUChar -> CUChar -> CUChar # xor :: CUChar -> CUChar -> CUChar # complement :: CUChar -> CUChar # shift :: CUChar -> Int -> CUChar # rotate :: CUChar -> Int -> CUChar # zeroBits :: CUChar # bit :: Int -> CUChar # setBit :: CUChar -> Int -> CUChar # clearBit :: CUChar -> Int -> CUChar # complementBit :: CUChar -> Int -> CUChar # testBit :: CUChar -> Int -> Bool # bitSizeMaybe :: CUChar -> Maybe Int # bitSize :: CUChar -> Int # isSigned :: CUChar -> Bool # shiftL :: CUChar -> Int -> CUChar # unsafeShiftL :: CUChar -> Int -> CUChar # shiftR :: CUChar -> Int -> CUChar # unsafeShiftR :: CUChar -> Int -> CUChar # rotateL :: CUChar -> Int -> CUChar # rotateR :: CUChar -> Int -> CUChar # popCount :: CUChar -> Int #
Bits CShort |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CShort -> CShort -> CShort # (.|.) :: CShort -> CShort -> CShort # xor :: CShort -> CShort -> CShort # complement :: CShort -> CShort # shift :: CShort -> Int -> CShort # rotate :: CShort -> Int -> CShort # zeroBits :: CShort # bit :: Int -> CShort # setBit :: CShort -> Int -> CShort # clearBit :: CShort -> Int -> CShort # complementBit :: CShort -> Int -> CShort # testBit :: CShort -> Int -> Bool # bitSizeMaybe :: CShort -> Maybe Int # bitSize :: CShort -> Int # isSigned :: CShort -> Bool # shiftL :: CShort -> Int -> CShort # unsafeShiftL :: CShort -> Int -> CShort # shiftR :: CShort -> Int -> CShort # unsafeShiftR :: CShort -> Int -> CShort # rotateL :: CShort -> Int -> CShort # rotateR :: CShort -> Int -> CShort # popCount :: CShort -> Int #
Bits CUShort |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CUShort -> CUShort -> CUShort # (.|.) :: CUShort -> CUShort -> CUShort # xor :: CUShort -> CUShort -> CUShort # complement :: CUShort -> CUShort # shift :: CUShort -> Int -> CUShort # rotate :: CUShort -> Int -> CUShort # zeroBits :: CUShort # bit :: Int -> CUShort # setBit :: CUShort -> Int -> CUShort # clearBit :: CUShort -> Int -> CUShort # complementBit :: CUShort -> Int -> CUShort # testBit :: CUShort -> Int -> Bool # bitSizeMaybe :: CUShort -> Maybe Int # bitSize :: CUShort -> Int # isSigned :: CUShort -> Bool # shiftL :: CUShort -> Int -> CUShort # unsafeShiftL :: CUShort -> Int -> CUShort # shiftR :: CUShort -> Int -> CUShort # unsafeShiftR :: CUShort -> Int -> CUShort # rotateL :: CUShort -> Int -> CUShort # rotateR :: CUShort -> Int -> CUShort # popCount :: CUShort -> Int #
Bits CInt |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CInt -> CInt -> CInt # (.|.) :: CInt -> CInt -> CInt # xor :: CInt -> CInt -> CInt # complement :: CInt -> CInt # shift :: CInt -> Int -> CInt # rotate :: CInt -> Int -> CInt # zeroBits :: CInt # bit :: Int -> CInt # setBit :: CInt -> Int -> CInt # clearBit :: CInt -> Int -> CInt # complementBit :: CInt -> Int -> CInt # testBit :: CInt -> Int -> Bool # bitSizeMaybe :: CInt -> Maybe Int # bitSize :: CInt -> Int # isSigned :: CInt -> Bool # shiftL :: CInt -> Int -> CInt # unsafeShiftL :: CInt -> Int -> CInt # shiftR :: CInt -> Int -> CInt # unsafeShiftR :: CInt -> Int -> CInt # rotateL :: CInt -> Int -> CInt # rotateR :: CInt -> Int -> CInt # popCount :: CInt -> Int #
Bits CUInt |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CUInt -> CUInt -> CUInt # (.|.) :: CUInt -> CUInt -> CUInt # xor :: CUInt -> CUInt -> CUInt # complement :: CUInt -> CUInt # shift :: CUInt -> Int -> CUInt # rotate :: CUInt -> Int -> CUInt # zeroBits :: CUInt # bit :: Int -> CUInt # setBit :: CUInt -> Int -> CUInt # clearBit :: CUInt -> Int -> CUInt # complementBit :: CUInt -> Int -> CUInt # testBit :: CUInt -> Int -> Bool # bitSizeMaybe :: CUInt -> Maybe Int # bitSize :: CUInt -> Int # isSigned :: CUInt -> Bool # shiftL :: CUInt -> Int -> CUInt # unsafeShiftL :: CUInt -> Int -> CUInt # shiftR :: CUInt -> Int -> CUInt # unsafeShiftR :: CUInt -> Int -> CUInt # rotateL :: CUInt -> Int -> CUInt # rotateR :: CUInt -> Int -> CUInt # popCount :: CUInt -> Int #
Bits CLong |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CLong -> CLong -> CLong # (.|.) :: CLong -> CLong -> CLong # xor :: CLong -> CLong -> CLong # complement :: CLong -> CLong # shift :: CLong -> Int -> CLong # rotate :: CLong -> Int -> CLong # zeroBits :: CLong # bit :: Int -> CLong # setBit :: CLong -> Int -> CLong # clearBit :: CLong -> Int -> CLong # complementBit :: CLong -> Int -> CLong # testBit :: CLong -> Int -> Bool # bitSizeMaybe :: CLong -> Maybe Int # bitSize :: CLong -> Int # isSigned :: CLong -> Bool # shiftL :: CLong -> Int -> CLong # unsafeShiftL :: CLong -> Int -> CLong # shiftR :: CLong -> Int -> CLong # unsafeShiftR :: CLong -> Int -> CLong # rotateL :: CLong -> Int -> CLong # rotateR :: CLong -> Int -> CLong # popCount :: CLong -> Int #
Bits CULong |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CULong -> CULong -> CULong # (.|.) :: CULong -> CULong -> CULong # xor :: CULong -> CULong -> CULong # complement :: CULong -> CULong # shift :: CULong -> Int -> CULong # rotate :: CULong -> Int -> CULong # zeroBits :: CULong # bit :: Int -> CULong # setBit :: CULong -> Int -> CULong # clearBit :: CULong -> Int -> CULong # complementBit :: CULong -> Int -> CULong # testBit :: CULong -> Int -> Bool # bitSizeMaybe :: CULong -> Maybe Int # bitSize :: CULong -> Int # isSigned :: CULong -> Bool # shiftL :: CULong -> Int -> CULong # unsafeShiftL :: CULong -> Int -> CULong # shiftR :: CULong -> Int -> CULong # unsafeShiftR :: CULong -> Int -> CULong # rotateL :: CULong -> Int -> CULong # rotateR :: CULong -> Int -> CULong # popCount :: CULong -> Int #
Bits CLLong |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CLLong -> CLLong -> CLLong # (.|.) :: CLLong -> CLLong -> CLLong # xor :: CLLong -> CLLong -> CLLong # complement :: CLLong -> CLLong # shift :: CLLong -> Int -> CLLong # rotate :: CLLong -> Int -> CLLong # zeroBits :: CLLong # bit :: Int -> CLLong # setBit :: CLLong -> Int -> CLLong # clearBit :: CLLong -> Int -> CLLong # complementBit :: CLLong -> Int -> CLLong # testBit :: CLLong -> Int -> Bool # bitSizeMaybe :: CLLong -> Maybe Int # bitSize :: CLLong -> Int # isSigned :: CLLong -> Bool # shiftL :: CLLong -> Int -> CLLong # unsafeShiftL :: CLLong -> Int -> CLLong # shiftR :: CLLong -> Int -> CLLong # unsafeShiftR :: CLLong -> Int -> CLLong # rotateL :: CLLong -> Int -> CLLong # rotateR :: CLLong -> Int -> CLLong # popCount :: CLLong -> Int #
Bits CULLong |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CULLong -> CULLong -> CULLong # (.|.) :: CULLong -> CULLong -> CULLong # xor :: CULLong -> CULLong -> CULLong # complement :: CULLong -> CULLong # shift :: CULLong -> Int -> CULLong # rotate :: CULLong -> Int -> CULLong # zeroBits :: CULLong # bit :: Int -> CULLong # setBit :: CULLong -> Int -> CULLong # clearBit :: CULLong -> Int -> CULLong # complementBit :: CULLong -> Int -> CULLong # testBit :: CULLong -> Int -> Bool # bitSizeMaybe :: CULLong -> Maybe Int # bitSize :: CULLong -> Int # isSigned :: CULLong -> Bool # shiftL :: CULLong -> Int -> CULLong # unsafeShiftL :: CULLong -> Int -> CULLong # shiftR :: CULLong -> Int -> CULLong # unsafeShiftR :: CULLong -> Int -> CULLong # rotateL :: CULLong -> Int -> CULLong # rotateR :: CULLong -> Int -> CULLong # popCount :: CULLong -> Int #
Bits CBool |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CBool -> CBool -> CBool # (.|.) :: CBool -> CBool -> CBool # xor :: CBool -> CBool -> CBool # complement :: CBool -> CBool # shift :: CBool -> Int -> CBool # rotate :: CBool -> Int -> CBool # zeroBits :: CBool # bit :: Int -> CBool # setBit :: CBool -> Int -> CBool # clearBit :: CBool -> Int -> CBool # complementBit :: CBool -> Int -> CBool # testBit :: CBool -> Int -> Bool # bitSizeMaybe :: CBool -> Maybe Int # bitSize :: CBool -> Int # isSigned :: CBool -> Bool # shiftL :: CBool -> Int -> CBool # unsafeShiftL :: CBool -> Int -> CBool # shiftR :: CBool -> Int -> CBool # unsafeShiftR :: CBool -> Int -> CBool # rotateL :: CBool -> Int -> CBool # rotateR :: CBool -> Int -> CBool # popCount :: CBool -> Int #
Bits CPtrdiff |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CPtrdiff -> CPtrdiff -> CPtrdiff # (.|.) :: CPtrdiff -> CPtrdiff -> CPtrdiff # xor :: CPtrdiff -> CPtrdiff -> CPtrdiff # complement :: CPtrdiff -> CPtrdiff # shift :: CPtrdiff -> Int -> CPtrdiff # rotate :: CPtrdiff -> Int -> CPtrdiff # zeroBits :: CPtrdiff # bit :: Int -> CPtrdiff # setBit :: CPtrdiff -> Int -> CPtrdiff # clearBit :: CPtrdiff -> Int -> CPtrdiff # complementBit :: CPtrdiff -> Int -> CPtrdiff # testBit :: CPtrdiff -> Int -> Bool # bitSizeMaybe :: CPtrdiff -> Maybe Int # bitSize :: CPtrdiff -> Int # isSigned :: CPtrdiff -> Bool # shiftL :: CPtrdiff -> Int -> CPtrdiff # unsafeShiftL :: CPtrdiff -> Int -> CPtrdiff # shiftR :: CPtrdiff -> Int -> CPtrdiff # unsafeShiftR :: CPtrdiff -> Int -> CPtrdiff # rotateL :: CPtrdiff -> Int -> CPtrdiff # rotateR :: CPtrdiff -> Int -> CPtrdiff # popCount :: CPtrdiff -> Int #
Bits CSize |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CSize -> CSize -> CSize # (.|.) :: CSize -> CSize -> CSize # xor :: CSize -> CSize -> CSize # complement :: CSize -> CSize # shift :: CSize -> Int -> CSize # rotate :: CSize -> Int -> CSize # zeroBits :: CSize # bit :: Int -> CSize # setBit :: CSize -> Int -> CSize # clearBit :: CSize -> Int -> CSize # complementBit :: CSize -> Int -> CSize # testBit :: CSize -> Int -> Bool # bitSizeMaybe :: CSize -> Maybe Int # bitSize :: CSize -> Int # isSigned :: CSize -> Bool # shiftL :: CSize -> Int -> CSize # unsafeShiftL :: CSize -> Int -> CSize # shiftR :: CSize -> Int -> CSize # unsafeShiftR :: CSize -> Int -> CSize # rotateL :: CSize -> Int -> CSize # rotateR :: CSize -> Int -> CSize # popCount :: CSize -> Int #
Bits CWchar |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CWchar -> CWchar -> CWchar # (.|.) :: CWchar -> CWchar -> CWchar # xor :: CWchar -> CWchar -> CWchar # complement :: CWchar -> CWchar # shift :: CWchar -> Int -> CWchar # rotate :: CWchar -> Int -> CWchar # zeroBits :: CWchar # bit :: Int -> CWchar # setBit :: CWchar -> Int -> CWchar # clearBit :: CWchar -> Int -> CWchar # complementBit :: CWchar -> Int -> CWchar # testBit :: CWchar -> Int -> Bool # bitSizeMaybe :: CWchar -> Maybe Int # bitSize :: CWchar -> Int # isSigned :: CWchar -> Bool # shiftL :: CWchar -> Int -> CWchar # unsafeShiftL :: CWchar -> Int -> CWchar # shiftR :: CWchar -> Int -> CWchar # unsafeShiftR :: CWchar -> Int -> CWchar # rotateL :: CWchar -> Int -> CWchar # rotateR :: CWchar -> Int -> CWchar # popCount :: CWchar -> Int #
Bits CSigAtomic |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (.|.) :: CSigAtomic -> CSigAtomic -> CSigAtomic # xor :: CSigAtomic -> CSigAtomic -> CSigAtomic # complement :: CSigAtomic -> CSigAtomic # shift :: CSigAtomic -> Int -> CSigAtomic # rotate :: CSigAtomic -> Int -> CSigAtomic # zeroBits :: CSigAtomic # bit :: Int -> CSigAtomic # setBit :: CSigAtomic -> Int -> CSigAtomic # clearBit :: CSigAtomic -> Int -> CSigAtomic # complementBit :: CSigAtomic -> Int -> CSigAtomic # testBit :: CSigAtomic -> Int -> Bool # bitSizeMaybe :: CSigAtomic -> Maybe Int # bitSize :: CSigAtomic -> Int # isSigned :: CSigAtomic -> Bool # shiftL :: CSigAtomic -> Int -> CSigAtomic # unsafeShiftL :: CSigAtomic -> Int -> CSigAtomic # shiftR :: CSigAtomic -> Int -> CSigAtomic # unsafeShiftR :: CSigAtomic -> Int -> CSigAtomic # rotateL :: CSigAtomic -> Int -> CSigAtomic # rotateR :: CSigAtomic -> Int -> CSigAtomic # popCount :: CSigAtomic -> Int #
Bits CIntPtr |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CIntPtr -> CIntPtr -> CIntPtr # (.|.) :: CIntPtr -> CIntPtr -> CIntPtr # xor :: CIntPtr -> CIntPtr -> CIntPtr # complement :: CIntPtr -> CIntPtr # shift :: CIntPtr -> Int -> CIntPtr # rotate :: CIntPtr -> Int -> CIntPtr # zeroBits :: CIntPtr # bit :: Int -> CIntPtr # setBit :: CIntPtr -> Int -> CIntPtr # clearBit :: CIntPtr -> Int -> CIntPtr # complementBit :: CIntPtr -> Int -> CIntPtr # testBit :: CIntPtr -> Int -> Bool # bitSizeMaybe :: CIntPtr -> Maybe Int # bitSize :: CIntPtr -> Int # isSigned :: CIntPtr -> Bool # shiftL :: CIntPtr -> Int -> CIntPtr # unsafeShiftL :: CIntPtr -> Int -> CIntPtr # shiftR :: CIntPtr -> Int -> CIntPtr # unsafeShiftR :: CIntPtr -> Int -> CIntPtr # rotateL :: CIntPtr -> Int -> CIntPtr # rotateR :: CIntPtr -> Int -> CIntPtr # popCount :: CIntPtr -> Int #
Bits CUIntPtr |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CUIntPtr -> CUIntPtr -> CUIntPtr # (.|.) :: CUIntPtr -> CUIntPtr -> CUIntPtr # xor :: CUIntPtr -> CUIntPtr -> CUIntPtr # complement :: CUIntPtr -> CUIntPtr # shift :: CUIntPtr -> Int -> CUIntPtr # rotate :: CUIntPtr -> Int -> CUIntPtr # zeroBits :: CUIntPtr # bit :: Int -> CUIntPtr # setBit :: CUIntPtr -> Int -> CUIntPtr # clearBit :: CUIntPtr -> Int -> CUIntPtr # complementBit :: CUIntPtr -> Int -> CUIntPtr # testBit :: CUIntPtr -> Int -> Bool # bitSizeMaybe :: CUIntPtr -> Maybe Int # bitSize :: CUIntPtr -> Int # isSigned :: CUIntPtr -> Bool # shiftL :: CUIntPtr -> Int -> CUIntPtr # unsafeShiftL :: CUIntPtr -> Int -> CUIntPtr # shiftR :: CUIntPtr -> Int -> CUIntPtr # unsafeShiftR :: CUIntPtr -> Int -> CUIntPtr # rotateL :: CUIntPtr -> Int -> CUIntPtr # rotateR :: CUIntPtr -> Int -> CUIntPtr # popCount :: CUIntPtr -> Int #
Bits CIntMax |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CIntMax -> CIntMax -> CIntMax # (.|.) :: CIntMax -> CIntMax -> CIntMax # xor :: CIntMax -> CIntMax -> CIntMax # complement :: CIntMax -> CIntMax # shift :: CIntMax -> Int -> CIntMax # rotate :: CIntMax -> Int -> CIntMax # zeroBits :: CIntMax # bit :: Int -> CIntMax # setBit :: CIntMax -> Int -> CIntMax # clearBit :: CIntMax -> Int -> CIntMax # complementBit :: CIntMax -> Int -> CIntMax # testBit :: CIntMax -> Int -> Bool # bitSizeMaybe :: CIntMax -> Maybe Int # bitSize :: CIntMax -> Int # isSigned :: CIntMax -> Bool # shiftL :: CIntMax -> Int -> CIntMax # unsafeShiftL :: CIntMax -> Int -> CIntMax # shiftR :: CIntMax -> Int -> CIntMax # unsafeShiftR :: CIntMax -> Int -> CIntMax # rotateL :: CIntMax -> Int -> CIntMax # rotateR :: CIntMax -> Int -> CIntMax # popCount :: CIntMax -> Int #
Bits CUIntMax |
Instance details Defined in Foreign.C.Types Methods (.&.) :: CUIntMax -> CUIntMax -> CUIntMax # (.|.) :: CUIntMax -> CUIntMax -> CUIntMax # xor :: CUIntMax -> CUIntMax -> CUIntMax # complement :: CUIntMax -> CUIntMax # shift :: CUIntMax -> Int -> CUIntMax # rotate :: CUIntMax -> Int -> CUIntMax # zeroBits :: CUIntMax # bit :: Int -> CUIntMax # setBit :: CUIntMax -> Int -> CUIntMax # clearBit :: CUIntMax -> Int -> CUIntMax # complementBit :: CUIntMax -> Int -> CUIntMax # testBit :: CUIntMax -> Int -> Bool # bitSizeMaybe :: CUIntMax -> Maybe Int # bitSize :: CUIntMax -> Int # isSigned :: CUIntMax -> Bool # shiftL :: CUIntMax -> Int -> CUIntMax # unsafeShiftL :: CUIntMax -> Int -> CUIntMax # shiftR :: CUIntMax -> Int -> CUIntMax # unsafeShiftR :: CUIntMax -> Int -> CUIntMax # rotateL :: CUIntMax -> Int -> CUIntMax # rotateR :: CUIntMax -> Int -> CUIntMax # popCount :: CUIntMax -> Int #
Bits WordPtr |
Instance details Defined in Foreign.Ptr Methods (.&.) :: WordPtr -> WordPtr -> WordPtr # (.|.) :: WordPtr -> WordPtr -> WordPtr # xor :: WordPtr -> WordPtr -> WordPtr # complement :: WordPtr -> WordPtr # shift :: WordPtr -> Int -> WordPtr # rotate :: WordPtr -> Int -> WordPtr # zeroBits :: WordPtr # bit :: Int -> WordPtr # setBit :: WordPtr -> Int -> WordPtr # clearBit :: WordPtr -> Int -> WordPtr # complementBit :: WordPtr -> Int -> WordPtr # testBit :: WordPtr -> Int -> Bool # bitSizeMaybe :: WordPtr -> Maybe Int # bitSize :: WordPtr -> Int # isSigned :: WordPtr -> Bool # shiftL :: WordPtr -> Int -> WordPtr # unsafeShiftL :: WordPtr -> Int -> WordPtr # shiftR :: WordPtr -> Int -> WordPtr # unsafeShiftR :: WordPtr -> Int -> WordPtr # rotateL :: WordPtr -> Int -> WordPtr # rotateR :: WordPtr -> Int -> WordPtr # popCount :: WordPtr -> Int #
Bits IntPtr |
Instance details Defined in Foreign.Ptr Methods (.&.) :: IntPtr -> IntPtr -> IntPtr # (.|.) :: IntPtr -> IntPtr -> IntPtr # xor :: IntPtr -> IntPtr -> IntPtr # complement :: IntPtr -> IntPtr # shift :: IntPtr -> Int -> IntPtr # rotate :: IntPtr -> Int -> IntPtr # zeroBits :: IntPtr # bit :: Int -> IntPtr # setBit :: IntPtr -> Int -> IntPtr # clearBit :: IntPtr -> Int -> IntPtr # complementBit :: IntPtr -> Int -> IntPtr # testBit :: IntPtr -> Int -> Bool # bitSizeMaybe :: IntPtr -> Maybe Int # bitSize :: IntPtr -> Int # isSigned :: IntPtr -> Bool # shiftL :: IntPtr -> Int -> IntPtr # unsafeShiftL :: IntPtr -> Int -> IntPtr # shiftR :: IntPtr -> Int -> IntPtr # unsafeShiftR :: IntPtr -> Int -> IntPtr # rotateL :: IntPtr -> Int -> IntPtr # rotateR :: IntPtr -> Int -> IntPtr # popCount :: IntPtr -> Int #
Bits a => Bits (Identity a) |
Instance details Defined in Data.Functor.Identity Methods (.&.) :: Identity a -> Identity a -> Identity a # (.|.) :: Identity a -> Identity a -> Identity a # xor :: Identity a -> Identity a -> Identity a # complement :: Identity a -> Identity a # shift :: Identity a -> Int -> Identity a # rotate :: Identity a -> Int -> Identity a # zeroBits :: Identity a # bit :: Int -> Identity a # setBit :: Identity a -> Int -> Identity a # clearBit :: Identity a -> Int -> Identity a # complementBit :: Identity a -> Int -> Identity a # testBit :: Identity a -> Int -> Bool # bitSizeMaybe :: Identity a -> Maybe Int # bitSize :: Identity a -> Int # isSigned :: Identity a -> Bool # shiftL :: Identity a -> Int -> Identity a # unsafeShiftL :: Identity a -> Int -> Identity a # shiftR :: Identity a -> Int -> Identity a # unsafeShiftR :: Identity a -> Int -> Identity a # rotateL :: Identity a -> Int -> Identity a # rotateR :: Identity a -> Int -> Identity a # popCount :: Identity a -> Int #
Bits a => Bits (Const a b) |
Instance details Defined in Data.Functor.Const Methods (.&.) :: Const a b -> Const a b -> Const a b # (.|.) :: Const a b -> Const a b -> Const a b # xor :: Const a b -> Const a b -> Const a b # complement :: Const a b -> Const a b # shift :: Const a b -> Int -> Const a b # rotate :: Const a b -> Int -> Const a b # zeroBits :: Const a b # bit :: Int -> Const a b # setBit :: Const a b -> Int -> Const a b # clearBit :: Const a b -> Int -> Const a b # complementBit :: Const a b -> Int -> Const a b # testBit :: Const a b -> Int -> Bool # bitSizeMaybe :: Const a b -> Maybe Int # bitSize :: Const a b -> Int # isSigned :: Const a b -> Bool # shiftL :: Const a b -> Int -> Const a b # unsafeShiftL :: Const a b -> Int -> Const a b # shiftR :: Const a b -> Int -> Const a b # unsafeShiftR :: Const a b -> Int -> Const a b # rotateL :: Const a b -> Int -> Const a b # rotateR :: Const a b -> Int -> Const a b # popCount :: Const a b -> Int #

class Bits b => FiniteBits b where #

The `FiniteBits` class denotes types with a finite, fixed number of bits.

Since: base-4.7.0.0

Minimal complete definition

finiteBitSize

Methods

finiteBitSize :: b -> Int #

Return the number of bits in the type of the argument. The actual value of the argument is ignored. Moreover, `finiteBitSize` is total, in contrast to the deprecated `bitSize` function it replaces.

    finiteBitSize = bitSize
    bitSizeMaybe = Just . finiteBitSize

Since: base-4.7.0.0

countLeadingZeros :: b -> Int #

Count number of zero bits preceding the most significant set bit.

    countLeadingZeros (zeroBits :: a) = finiteBitSize (zeroBits :: a)

`countLeadingZeros` can be used to compute log base 2 via

    logBase2 x = finiteBitSize x - 1 - countLeadingZeros x

Note: The default implementation for this method is intentionally naive. However, the instances provided for the primitive integral types are implemented using CPU specific machine instructions.

Since: base-4.8.0.0

countTrailingZeros :: b -> Int #

Count number of zero bits following the least significant set bit.

    countTrailingZeros (zeroBits :: a) = finiteBitSize (zeroBits :: a)
    countTrailingZeros . negate = countTrailingZeros

The related find-first-set operation can be expressed in terms of `countTrailingZeros` as follows

    findFirstSet x = 1 + countTrailingZeros x

Note: The default implementation for this method is intentionally naive. However, the instances provided for the primitive integral types are implemented using CPU specific machine instructions.

Since: base-4.8.0.0

Instances

FiniteBits Bool | Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Bool -> Int # countLeadingZeros :: Bool -> Int # countTrailingZeros :: Bool -> Int #
FiniteBits Int | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Int -> Int # countLeadingZeros :: Int -> Int # countTrailingZeros :: Int -> Int #
FiniteBits Int8 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int8 -> Int # countLeadingZeros :: Int8 -> Int # countTrailingZeros :: Int8 -> Int #
FiniteBits Int16 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int16 -> Int # countLeadingZeros :: Int16 -> Int # countTrailingZeros :: Int16 -> Int #
FiniteBits Int32 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int32 -> Int # countLeadingZeros :: Int32 -> Int # countTrailingZeros :: Int32 -> Int #
FiniteBits Int64 | Since: base-4.6.0.0
Instance details Defined in GHC.Int Methods finiteBitSize :: Int64 -> Int # countLeadingZeros :: Int64 -> Int # countTrailingZeros :: Int64 -> Int #
FiniteBits Word | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int #
FiniteBits Word8 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word8 -> Int # countLeadingZeros :: Word8 -> Int # countTrailingZeros :: Word8 -> Int #
FiniteBits Word16 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word16 -> Int # countLeadingZeros :: Word16 -> Int # countTrailingZeros :: Word16 -> Int #
FiniteBits Word32 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word32 -> Int # countLeadingZeros :: Word32 -> Int # countTrailingZeros :: Word32 -> Int #
FiniteBits Word64 | Since: base-4.6.0.0
Instance details Defined in GHC.Word Methods finiteBitSize :: Word64 -> Int # countLeadingZeros :: Word64 -> Int # countTrailingZeros :: Word64 -> Int #
FiniteBits CDev |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CDev -> Int # countLeadingZeros :: CDev -> Int # countTrailingZeros :: CDev -> Int #
FiniteBits CIno |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CIno -> Int # countLeadingZeros :: CIno -> Int # countTrailingZeros :: CIno -> Int #
FiniteBits CMode |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CMode -> Int # countLeadingZeros :: CMode -> Int # countTrailingZeros :: CMode -> Int #
FiniteBits COff |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: COff -> Int # countLeadingZeros :: COff -> Int # countTrailingZeros :: COff -> Int #
FiniteBits CPid |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CPid -> Int # countLeadingZeros :: CPid -> Int # countTrailingZeros :: CPid -> Int #
FiniteBits CSsize |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CSsize -> Int # countLeadingZeros :: CSsize -> Int # countTrailingZeros :: CSsize -> Int #
FiniteBits CGid |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CGid -> Int # countLeadingZeros :: CGid -> Int # countTrailingZeros :: CGid -> Int #
FiniteBits CNlink |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CNlink -> Int # countLeadingZeros :: CNlink -> Int # countTrailingZeros :: CNlink -> Int #
FiniteBits CUid |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CUid -> Int # countLeadingZeros :: CUid -> Int # countTrailingZeros :: CUid -> Int #
FiniteBits CTcflag |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CTcflag -> Int # countLeadingZeros :: CTcflag -> Int # countTrailingZeros :: CTcflag -> Int #
FiniteBits CRLim |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CRLim -> Int # countLeadingZeros :: CRLim -> Int # countTrailingZeros :: CRLim -> Int #
FiniteBits CBlkSize |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CBlkSize -> Int # countLeadingZeros :: CBlkSize -> Int # countTrailingZeros :: CBlkSize -> Int #
FiniteBits CBlkCnt |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CBlkCnt -> Int # countLeadingZeros :: CBlkCnt -> Int # countTrailingZeros :: CBlkCnt -> Int #
FiniteBits CClockId |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CClockId -> Int # countLeadingZeros :: CClockId -> Int # countTrailingZeros :: CClockId -> Int #
FiniteBits CFsBlkCnt |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CFsBlkCnt -> Int # countLeadingZeros :: CFsBlkCnt -> Int # countTrailingZeros :: CFsBlkCnt -> Int #
FiniteBits CFsFilCnt |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CFsFilCnt -> Int # countLeadingZeros :: CFsFilCnt -> Int # countTrailingZeros :: CFsFilCnt -> Int #
FiniteBits CId |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CId -> Int # countLeadingZeros :: CId -> Int # countTrailingZeros :: CId -> Int #
FiniteBits CKey |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: CKey -> Int # countLeadingZeros :: CKey -> Int # countTrailingZeros :: CKey -> Int #
FiniteBits Fd |
Instance details Defined in System.Posix.Types Methods finiteBitSize :: Fd -> Int # countLeadingZeros :: Fd -> Int # countTrailingZeros :: Fd -> Int #
FiniteBits CChar |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CChar -> Int # countLeadingZeros :: CChar -> Int # countTrailingZeros :: CChar -> Int #
FiniteBits CSChar |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CSChar -> Int # countLeadingZeros :: CSChar -> Int # countTrailingZeros :: CSChar -> Int #
FiniteBits CUChar |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CUChar -> Int # countLeadingZeros :: CUChar -> Int # countTrailingZeros :: CUChar -> Int #
FiniteBits CShort |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CShort -> Int # countLeadingZeros :: CShort -> Int # countTrailingZeros :: CShort -> Int #
FiniteBits CUShort |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CUShort -> Int # countLeadingZeros :: CUShort -> Int # countTrailingZeros :: CUShort -> Int #
FiniteBits CInt |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CInt -> Int # countLeadingZeros :: CInt -> Int # countTrailingZeros :: CInt -> Int #
FiniteBits CUInt |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CUInt -> Int # countLeadingZeros :: CUInt -> Int # countTrailingZeros :: CUInt -> Int #
FiniteBits CLong |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CLong -> Int # countLeadingZeros :: CLong -> Int # countTrailingZeros :: CLong -> Int #
FiniteBits CULong |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CULong -> Int # countLeadingZeros :: CULong -> Int # countTrailingZeros :: CULong -> Int #
FiniteBits CLLong |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CLLong -> Int # countLeadingZeros :: CLLong -> Int # countTrailingZeros :: CLLong -> Int #
FiniteBits CULLong |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CULLong -> Int # countLeadingZeros :: CULLong -> Int # countTrailingZeros :: CULLong -> Int #
FiniteBits CBool |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CBool -> Int # countLeadingZeros :: CBool -> Int # countTrailingZeros :: CBool -> Int #
FiniteBits CPtrdiff |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CPtrdiff -> Int # countLeadingZeros :: CPtrdiff -> Int # countTrailingZeros :: CPtrdiff -> Int #
FiniteBits CSize |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CSize -> Int # countLeadingZeros :: CSize -> Int # countTrailingZeros :: CSize -> Int #
FiniteBits CWchar |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CWchar -> Int # countLeadingZeros :: CWchar -> Int # countTrailingZeros :: CWchar -> Int #
FiniteBits CSigAtomic |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CSigAtomic -> Int # countLeadingZeros :: CSigAtomic -> Int # countTrailingZeros :: CSigAtomic -> Int #
FiniteBits CIntPtr |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CIntPtr -> Int # countLeadingZeros :: CIntPtr -> Int # countTrailingZeros :: CIntPtr -> Int #
FiniteBits CUIntPtr |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CUIntPtr -> Int # countLeadingZeros :: CUIntPtr -> Int # countTrailingZeros :: CUIntPtr -> Int #
FiniteBits CIntMax |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CIntMax -> Int # countLeadingZeros :: CIntMax -> Int # countTrailingZeros :: CIntMax -> Int #
FiniteBits CUIntMax |
Instance details Defined in Foreign.C.Types Methods finiteBitSize :: CUIntMax -> Int # countLeadingZeros :: CUIntMax -> Int # countTrailingZeros :: CUIntMax -> Int #
FiniteBits WordPtr |
Instance details Defined in Foreign.Ptr Methods finiteBitSize :: WordPtr -> Int # countLeadingZeros :: WordPtr -> Int # countTrailingZeros :: WordPtr -> Int #
FiniteBits IntPtr |
Instance details Defined in Foreign.Ptr Methods finiteBitSize :: IntPtr -> Int # countLeadingZeros :: IntPtr -> Int # countTrailingZeros :: IntPtr -> Int #
FiniteBits a => FiniteBits (Identity a) |
Instance details Defined in Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int # countLeadingZeros :: Identity a -> Int # countTrailingZeros :: Identity a -> Int #
FiniteBits a => FiniteBits (Const a b) |
Instance details Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int # countLeadingZeros :: Const a b -> Int # countTrailingZeros :: Const a b -> Int #

bool :: a -> a -> Bool -> a #

Case analysis for the `Bool` type. ``bool` x y p` evaluates to `x` when `p` is `False`, and evaluates to `y` when `p` is `True`.

This is equivalent to `if p then y else x`; that is, one can think of it as an if-then-else construct with its arguments reordered.

#### Examples

Expand

Basic usage:

    >>> bool "foo" "bar" True
    "bar"
    >>> bool "foo" "bar" False
    "foo"

Confirm that ``bool` x y p` and `if p then y else x` are equivalent:

    >>> let p = True; x = "bar"; y = "foo"
    >>> bool x y p == if p then y else x
    True
    >>> let p = False
    >>> bool x y p == if p then y else x
    True

Since: base-4.7.0.0

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

`&` is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator `$`, which allows `&` to be nested in `$`.

    >>> 5 & (+1) & show
    "6"

Since: base-4.8.0.0

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 #

fix :: (a -> a) -> a #

``fix` f` is the least fixed point of the function `f`, i.e. the least defined `x` such that `f x = x`.

For example, we can write the factorial function using direct recursion as

    >>> let fac n = if n <= 1 then 1 else n * fac (n-1) in fac 5
    120

This uses the fact that Haskell’s `let` introduces recursive bindings. We can rewrite this definition using `fix`,

    >>> fix (\rec n -> if n <= 1 then 1 else n * rec (n-1)) 5
    120

Instead of making a recursive call, we introduce a dummy parameter `rec`; when used within `fix`, this parameter then refers to `fix'` argument, hence the recursion is reintroduced.

void :: Functor f => f a -> f () #

``void` value` discards or ignores the result of evaluation, such as the return value of an `IO` action.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with unit:

    >>> void Nothing
    Nothing
    >>> void (Just 3)
    Just ()

Replace the contents of an ``Either` `Int` `Int`` with unit, resulting in an ``Either` `Int` '()'`:

    >>> void (Left 8675309)
    Left 8675309
    >>> void (Right 8675309)
    Right ()

Replace every element of a list with unit:

    >>> void [1,2,3]
    [(),(),()]

Replace the second element of a pair with unit:

    >>> void (1,2)
    (1,())

Discard the result of an `IO` action:

    >>> mapM print [1,2]
    1
    2
    [(),()]
    >>> void $ mapM print [1,2]
    1
    2

($>) :: Functor f => f a -> b -> f b infixl 4 #

Flipped version of `<$`.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with a constant `String`:

    >>> Nothing $> "foo"
    Nothing
    >>> Just 90210 $> "foo"
    Just "foo"

Replace the contents of an ``Either` `Int` `Int`` with a constant `String`, resulting in an ``Either` `Int` `String``:

    >>> Left 8675309 $> "foo"
    Left 8675309
    >>> Right 8675309 $> "foo"
    Right "foo"

Replace each element of a list with a constant `String`:

    >>> [1,2,3] $> "foo"
    ["foo","foo","foo"]

Replace the second element of a pair with a constant `String`:

    >>> (1,2) $> "foo"
    (1,"foo")

Since: base-4.7.0.0

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 #

Flipped version of `<$>`.

    (<&>) = flip fmap

#### Examples

Expand

Apply `(+1)` to a list, a `Just` and a `Right`:

    >>> Just 2 <&> (+1)
    Just 3

    >>> [1,2,3] <&> (+1)
    [2,3,4]

    >>> Right 3 <&> (+1)
    Right 4

Since: base-4.11.0.0

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

An infix synonym for `fmap`.

The name of this operator is an allusion to `$`. Note the similarities between their types:

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

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

#### Examples

Expand

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

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

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

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

Double each element of a list:

    >>> (*2) <$> [1,2,3]
    [2,4,6]

Apply `even` to the second element of a pair:

    >>> even <$> (2,2)
    (2,True)

lcm :: Integral a => a -> a -> a #

``lcm` x y` is the smallest positive integer that both `x` and `y` divide.

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

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

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

(^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 #

raise a number to an integral power

(^) :: (Num a, Integral b) => a -> b -> a infixr 8 #

raise a number to a non-negative integral power

odd :: Integral a => a -> Bool #

even :: Integral a => a -> Bool #

showSigned #

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.

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.

numerator :: Ratio a -> a #

Extract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.

(%) :: Integral a => a -> a -> Ratio a infixl 7 #

Forms the ratio of two integral numbers.

chr :: Int -> Char #

The `toEnum` method restricted to the type `Char`.

intToDigit :: Int -> Char #

Convert an `Int` in the range `0`..`15` to the corresponding single digit `Char`. This function fails on other inputs, and generates lower-case hexadecimal digits.

showLitChar :: Char -> ShowS #

Convert a character to a string using only printable characters, using Haskell source-language escape conventions. For example:

    showLitChar '\n' s  =  "\\n" ++ s

showParen :: Bool -> ShowS -> ShowS #

utility function that surrounds the inner show function with parentheses when the `Bool` parameter is `True`.

showString :: String -> ShowS #

utility function converting a `String` to a show function that simply prepends the string unchanged.

showChar :: Char -> ShowS #

utility function converting a `Char` to a show function that simply prepends the character unchanged.

shows :: Show a => a -> ShowS #

equivalent to `showsPrec` with a precedence of 0.

type ShowS = String -> String #

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

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

The `unzip3` function takes a list of triples and returns three lists, analogous to `unzip`.

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

`unzip` transforms a list of pairs into a list of first components and a list of second components.

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

The `zipWith3` function takes a function which combines three elements, as well as three lists and returns a list of their point-wise combination, analogous to `zipWith`.

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

`zipWith` generalises `zip` by zipping with the function given as the first argument, instead of a tupling function. For example, ``zipWith` (+)` is applied to two lists to produce the list of corresponding sums.

`zipWith` is right-lazy:

    zipWith f [] _|_ = []

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

`zip3` takes three lists and returns a list of triples, analogous to `zip`.

(!!) :: [a] -> Int -> a infixl 9 #

List index (subscript) operator, starting from 0. It is an instance of the more general `genericIndex`, which takes an index of any integral type.

lookup :: Eq a => a -> [(a, b)] -> Maybe b #

`lookup` `key assocs` looks up a key in an association list.

reverse :: [a] -> [a] #

`reverse` `xs` returns the elements of `xs` in reverse order. `xs` must be finite.

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

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

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

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

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

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

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

`span` `p xs` is equivalent to `(`takeWhile` p xs, `dropWhile` p xs)`

splitAt :: Int -> [a] -> ([a], [a]) #

`splitAt` `n xs` returns a tuple where first element is `xs` prefix of length `n` and second element is the remainder of the list:

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

It is equivalent to `(`take` n xs, `drop` n xs)` when `n` is not `_|_` (`splitAt _|_ xs = _|_`). `splitAt` is an instance of the more general `genericSplitAt`, in which `n` may be of any integral type.

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

`drop` `n xs` returns the suffix of `xs` after the first `n` elements, or `[]` if `n > `length` xs`:

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

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

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

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

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

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

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

`dropWhile` `p xs` returns the suffix remaining after `takeWhile` `p xs`:

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

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

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

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

cycle :: [a] -> [a] #

`cycle` ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

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

`replicate` `n x` is a list of length `n` with `x` the value of every element. It is an instance of the more general `genericReplicate`, in which `n` may be of any integral type.

repeat :: a -> [a] #

`repeat` `x` is an infinite list, with `x` the value of every element.

iterate' :: (a -> a) -> a -> [a] #

'iterate\'' is the strict version of `iterate`.

It ensures that the result of each application of force to weak head normal form before proceeding.

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

`iterate` `f x` returns an infinite list of repeated applications of `f` to `x`:

    iterate f x == [x, f x, f (f x), ...]

Note that `iterate` is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See 'iterate\'' for a strict variant of this function.

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

`scanr1` is a variant of `scanr` that has no starting value argument.

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

`scanr` is the right-to-left dual of `scanl`. Note that

    head (scanr f z xs) == foldr f z xs.

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

A strictly accumulating version of `scanl`

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

`scanl1` is a variant of `scanl` that has no starting value argument:

    scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]

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

`scanl` is similar to `foldl`, but returns a list of successive reduced values from the left:

    scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]

Note that

    last (scanl f z xs) == foldl f z xs.

foldl1' :: (a -> a -> a) -> [a] -> a #

A strict version of `foldl1`

init :: [a] -> [a] #

Return all the elements of a list except the last one. The list must be non-empty.

last :: [a] -> a #

Extract the last element of a list, which must be finite and non-empty.

tail :: [a] -> [a] #

Extract the elements after the head of a list, which must be non-empty.

uncons :: [a] -> Maybe (a, [a]) #

Decompose a list into its head and tail. If the list is empty, returns `Nothing`. If the list is non-empty, returns ``Just` (x, xs)`, where `x` is the head of the list and `xs` its tail.

Since: base-4.8.0.0

head :: [a] -> a #

Extract the first element of a list, which must be non-empty.

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

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

#### Examples

Expand

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

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

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

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

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

The `catMaybes` function takes a list of `Maybe`s and returns a list of all the `Just` values.

#### Examples

Expand

Basic usage:

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

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

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

listToMaybe :: [a] -> Maybe a #

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

#### Examples

Expand

Basic usage:

    >>> listToMaybe []
    Nothing

    >>> listToMaybe [9]
    Just 9

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

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

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

But not on lists with more than one element:

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

maybeToList :: Maybe a -> [a] #

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

#### Examples

Expand

Basic usage:

    >>> maybeToList (Just 7)
    [7]

    >>> maybeToList Nothing
    []

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

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

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

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

#### Examples

Expand

Basic usage:

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

    >>> fromMaybe "" Nothing
    ""

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

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

fromJust :: Maybe a -> a #

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

#### Examples

Expand

Basic usage:

    >>> fromJust (Just 1)
    1

    >>> 2 * (fromJust (Just 10))
    20

    >>> 2 * (fromJust Nothing)
    *** Exception: Maybe.fromJust: Nothing

isNothing :: Maybe a -> Bool #

The `isNothing` function returns `True` iff its argument is `Nothing`.

#### Examples

Expand

Basic usage:

    >>> isNothing (Just 3)
    False

    >>> isNothing (Just ())
    False

    >>> isNothing Nothing
    True

Only the outer constructor is taken into consideration:

    >>> isNothing (Just Nothing)
    False

isJust :: Maybe a -> Bool #

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

#### Examples

Expand

Basic usage:

    >>> isJust (Just 3)
    True

    >>> isJust (Just ())
    True

    >>> isJust Nothing
    False

Only the outer constructor is taken into consideration:

    >>> isJust (Just Nothing)
    True

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

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

#### Examples

Expand

Basic usage:

    >>> maybe False odd (Just 3)
    True

    >>> maybe False odd Nothing
    False

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

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

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

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

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

Swap the components of a pair.

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

`uncurry` converts a curried function to a function on pairs.

#### Examples

Expand

    >>> uncurry (+) (1,2)
    3

    >>> uncurry ($) (show, 1)
    "1"

    >>> map (uncurry max) [(1,2), (3,4), (6,8)]
    [2,4,8]

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

`curry` converts an uncurried function to a curried function.

#### Examples

Expand

    >>> curry fst 1 2
    1

unsafeInterleaveIO :: IO a -> IO a #

`unsafeInterleaveIO` allows an `IO` computation to be deferred lazily. When passed a value of type `IO a`, the `IO` will only be performed when the value of the `a` is demanded. This is used to implement lazy file reading, see `hGetContents`.

unsafeDupablePerformIO :: IO a -> a #

This version of `unsafePerformIO` is more efficient because it omits the check that the IO is only being performed by a single thread. Hence, when you use `unsafeDupablePerformIO`, there is a possibility that the IO action may be performed multiple times (on a multiprocessor), and you should therefore ensure that it gives the same results each time. It may even happen that one of the duplicated IO actions is only run partially, and then interrupted in the middle without an exception being raised. Therefore, functions like `bracket` cannot be used safely within `unsafeDupablePerformIO`.

Since: base-4.4.0.0

unsafePerformIO :: IO a -> a #

This is the "back door" into the `IO` monad, allowing `IO` computation to be performed at any time. For this to be safe, the `IO` computation should be free of side effects and independent of its environment.

If the I/O computation wrapped in `unsafePerformIO` performs side effects, then the relative order in which those side effects take place (relative to the main I/O trunk, or other calls to `unsafePerformIO`) is indeterminate. Furthermore, when using `unsafePerformIO` to cause side-effects, you should take the following precautions to ensure the side effects are performed as many times as you expect them to be. Note that these precautions are necessary for GHC, but may not be sufficient, and other compilers may require different precautions:

- Use `{-# NOINLINE foo #-}` as a pragma on any function `foo` that calls `unsafePerformIO`. If the call is inlined, the I/O may be performed more than once.
- Use the compiler flag `-fno-cse` to prevent common sub-expression elimination being performed on the module, which might combine two side effects that were meant to be separate. A good example is using multiple global variables (like `test` in the example below).
- Make sure that the either you switch off let-floating (`-fno-full-laziness`), or that the call to `unsafePerformIO` cannot float outside a lambda. For example, if you say: `f x = unsafePerformIO (newIORef [])` you may get only one reference cell shared between all calls to `f`. Better would be `f x = unsafePerformIO (newIORef [x])` because now it can't float outside the lambda.

It is less well known that `unsafePerformIO` is not type safe. For example:

        test :: IORef [a]
        test = unsafePerformIO $ newIORef []

        main = do
                writeIORef test [42]
                bang <- readIORef test
                print (bang :: [Char])

This program will core dump. This problem with polymorphic references is well known in the ML community, and does not arise with normal monadic use of references. There is no easy way to make it impossible once you use `unsafePerformIO`. Indeed, it is possible to write `coerce :: a -> b` with the help of `unsafePerformIO`. So be careful!

isEmptyMVar :: MVar a -> IO Bool #

Check whether a given `MVar` is empty.

Notice that the boolean value returned is just a snapshot of the state of the MVar. By the time you get to react on its result, the MVar may have been filled (or emptied) - so be extremely careful when using this operation. Use `tryTakeMVar` instead if possible.

tryReadMVar :: MVar a -> IO (Maybe a) #

A non-blocking version of `readMVar`. The `tryReadMVar` function returns immediately, with `Nothing` if the `MVar` was empty, or ``Just` a` if the `MVar` was full with contents `a`.

Since: base-4.7.0.0

tryPutMVar :: MVar a -> a -> IO Bool #

A non-blocking version of `putMVar`. The `tryPutMVar` function attempts to put the value `a` into the `MVar`, returning `True` if it was successful, or `False` otherwise.

tryTakeMVar :: MVar a -> IO (Maybe a) #

A non-blocking version of `takeMVar`. The `tryTakeMVar` function returns immediately, with `Nothing` if the `MVar` was empty, or ``Just` a` if the `MVar` was full with contents `a`. After `tryTakeMVar`, the `MVar` is left empty.

putMVar :: MVar a -> a -> IO () #

Put a value into an `MVar`. If the `MVar` is currently full, `putMVar` will wait until it becomes empty.

There are two further important properties of `putMVar`:

- `putMVar` is single-wakeup. That is, if there are multiple threads blocked in `putMVar`, and the `MVar` becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its `putMVar` operation.
- When multiple threads are blocked on an `MVar`, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using `MVar`s.

readMVar :: MVar a -> IO a #

Atomically read the contents of an `MVar`. If the `MVar` is currently empty, `readMVar` will wait until it is full. `readMVar` is guaranteed to receive the next `putMVar`.

`readMVar` is multiple-wakeup, so when multiple readers are blocked on an `MVar`, all of them are woken up at the same time.

Compatibility note: Prior to base 4.7, `readMVar` was a combination of `takeMVar` and `putMVar`. This mean that in the presence of other threads attempting to `putMVar`, `readMVar` could block. Furthermore, `readMVar` would not receive the next `putMVar` if there was already a pending thread blocked on `takeMVar`. The old behavior can be recovered by implementing 'readMVar as follows:

     readMVar :: MVar a -> IO a
     readMVar m =
       mask_ $ do
         a <- takeMVar m
         putMVar m a
         return a

takeMVar :: MVar a -> IO a #

Return the contents of the `MVar`. If the `MVar` is currently empty, `takeMVar` will wait until it is full. After a `takeMVar`, the `MVar` is left empty.

There are two further important properties of `takeMVar`:

- `takeMVar` is single-wakeup. That is, if there are multiple threads blocked in `takeMVar`, and the `MVar` becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its `takeMVar` operation.
- When multiple threads are blocked on an `MVar`, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using `MVar`s.

newMVar :: a -> IO (MVar a) #

Create an `MVar` which contains the supplied value.

newEmptyMVar :: IO (MVar a) #

Create an `MVar` which is initially empty.

data MVar a #

An `MVar` (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a a box, which may be empty or full.

Instances

Eq (MVar a) | Since: base-4.1.0.0
Instance details Defined in GHC.MVar Methods (==) :: MVar a -> MVar a -> Bool # (/=) :: MVar a -> MVar a -> Bool #

subtract :: Num a => a -> a -> a #

the same as ``flip` (`-`)`.

Because `-` is treated specially in the Haskell grammar, `(-` e`)` is not a section, but an application of prefix negation. However, `(`subtract`` exp`)` is equivalent to the disallowed section.

asTypeOf :: a -> a -> a #

`asTypeOf` is a type-restricted version of `const`. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.

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

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

($!) :: (a -> b) -> a -> b infixr 0 #

Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.

flip :: (a -> b -> c) -> b -> a -> c #

``flip` f` takes its (first) two arguments in the reverse order of `f`.

    >>> flip (++) "hello" "world"
    "worldhello"

const :: a -> b -> a #

`const x` is a unary function which evaluates to `x` for all inputs.

    >>> const 42 "hello"
    42

    >>> map (const 42) [0..3]
    [42,42,42,42]

ord :: Char -> Int #

The `fromEnum` method restricted to the type `Char`.

ap :: Monad m => m (a -> b) -> m a -> m b #

In many situations, the `liftM` operations can be replaced by uses of `ap`, which promotes function application.

    return f `ap` x1 `ap` ... `ap` xn

is equivalent to

    liftMn f x1 x2 ... xn

liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r #

Promote a function to a monad, scanning the monadic arguments from left to right. For example,

    liftM2 (+) [0,1] [0,2] = [0,2,1,3]
    liftM2 (+) (Just 1) Nothing = Nothing

liftM :: Monad m => (a1 -> r) -> m a1 -> m r #

Promote a function to a monad.

when :: Applicative f => Bool -> f () -> f () #

Conditional execution of `Applicative` expressions. For example,

    when debug (putStrLn "Debugging")

will output the string `Debugging` if the Boolean value `debug` is `True`, and otherwise do nothing.

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #

Same as `>>=`, but with the arguments interchanged.

liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d #

Lift a ternary function to actions.

liftA :: Applicative f => (a -> b) -> f a -> f b #

Lift a function to actions. This function may be used as a value for `fmap` in a `Functor` instance.

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

A variant of `<*>` with the arguments reversed.

class Applicative f => Alternative (f :: * -> *) where #

A monoid on applicative functors.

If defined, `some` and `many` should be the least solutions of the equations:

-     some v = (:) <$> v <*> many v

-     many v = some v <|> pure []

Minimal complete definition

empty, (<|>)

Methods

empty :: f a #

The identity of `<|>`

(<|>) :: f a -> f a -> f a infixl 3 #

An associative binary operation

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

One or more.

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

Zero or more.

Instances

Alternative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: [a] # (<|>) :: [a] -> [a] -> [a] # some :: [a] -> [[a]] # many :: [a] -> [[a]] #
Alternative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a # (<|>) :: Maybe a -> Maybe a -> Maybe a # some :: Maybe a -> Maybe [a] # many :: Maybe a -> Maybe [a] #
Alternative IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a # (<|>) :: IO a -> IO a -> IO a # some :: IO a -> IO [a] # many :: IO a -> IO [a] #
Alternative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods empty :: Option a # (<|>) :: Option a -> Option a -> Option a # some :: Option a -> Option [a] # many :: Option a -> Option [a] #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a # (<|>) :: ZipList a -> ZipList a -> ZipList a # some :: ZipList a -> ZipList [a] # many :: ZipList a -> ZipList [a] #
Alternative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods empty :: STM a # (<|>) :: STM a -> STM a -> STM a # some :: STM a -> STM [a] # many :: STM a -> STM [a] #
Alternative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods empty :: ReadPrec a # (<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a # some :: ReadPrec a -> ReadPrec [a] # many :: ReadPrec a -> ReadPrec [a] #
Alternative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: ReadP a # (<|>) :: ReadP a -> ReadP a -> ReadP a # some :: ReadP a -> ReadP [a] # many :: ReadP a -> ReadP [a] #
Alternative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: P a # (<|>) :: P a -> P a -> P a # some :: P a -> P [a] # many :: P a -> P [a] #
Alternative (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: U1 a # (<|>) :: U1 a -> U1 a -> U1 a # some :: U1 a -> U1 [a] # many :: U1 a -> U1 [a] #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a # some :: WrappedMonad m a -> WrappedMonad m [a] # many :: WrappedMonad m a -> WrappedMonad m [a] #
ArrowPlus a => Alternative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods empty :: ArrowMonad a a0 # (<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 # some :: ArrowMonad a a0 -> ArrowMonad a [a0] # many :: ArrowMonad a a0 -> ArrowMonad a [a0] #
Alternative (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods empty :: Proxy a # (<|>) :: Proxy a -> Proxy a -> Proxy a # some :: Proxy a -> Proxy [a] # many :: Proxy a -> Proxy [a] #
Alternative f => Alternative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: Rec1 f a # (<|>) :: Rec1 f a -> Rec1 f a -> Rec1 f a # some :: Rec1 f a -> Rec1 f [a] # many :: Rec1 f a -> Rec1 f [a] #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] #
Alternative f => Alternative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods empty :: Alt f a # (<|>) :: Alt f a -> Alt f a -> Alt f a # some :: Alt f a -> Alt f [a] # many :: Alt f a -> Alt f [a] #
(Alternative f, Alternative g) => Alternative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :*: g) a # (<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a # some :: (f :*: g) a -> (f :*: g) [a] # many :: (f :*: g) a -> (f :*: g) [a] #
Alternative f => Alternative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: M1 i c f a # (<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a # some :: M1 i c f a -> M1 i c f [a] # many :: M1 i c f a -> M1 i c f [a] #
(Alternative f, Applicative g) => Alternative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :.: g) a # (<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a # some :: (f :.: g) a -> (f :.: g) [a] # many :: (f :.: g) a -> (f :.: g) [a] #
(Alternative f, Applicative g) => Alternative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods empty :: Compose f g a # (<|>) :: Compose f g a -> Compose f g a -> Compose f g a # some :: Compose f g a -> Compose f g [a] # many :: Compose f g a -> Compose f g [a] #

class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where #

Monads that also support choice and failure.

Methods

mzero :: m a #

The identity of `mplus`. It should also satisfy the equations

    mzero >>= f  =  mzero
    v >> mzero   =  mzero

The default definition is

    mzero = empty

mplus :: m a -> m a -> m a #

An associative operation. The default definition is

    mplus = (<|>)

Instances

MonadPlus [] | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: [a] # mplus :: [a] -> [a] -> [a] #
MonadPlus Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a # mplus :: Maybe a -> Maybe a -> Maybe a #
MonadPlus IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a # mplus :: IO a -> IO a -> IO a #
MonadPlus Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mzero :: Option a # mplus :: Option a -> Option a -> Option a #
MonadPlus STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods mzero :: STM a # mplus :: STM a -> STM a -> STM a #
MonadPlus ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods mzero :: ReadPrec a # mplus :: ReadPrec a -> ReadPrec a -> ReadPrec a #
MonadPlus ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: ReadP a # mplus :: ReadP a -> ReadP a -> ReadP a #
MonadPlus P | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: P a # mplus :: P a -> P a -> P a #
MonadPlus (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: U1 a # mplus :: U1 a -> U1 a -> U1 a #
(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods mzero :: ArrowMonad a a0 # mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 #
MonadPlus (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods mzero :: Proxy a # mplus :: Proxy a -> Proxy a -> Proxy a #
MonadPlus f => MonadPlus (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: Rec1 f a # mplus :: Rec1 f a -> Rec1 f a -> Rec1 f a #
MonadPlus f => MonadPlus (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods mzero :: Alt f a # mplus :: Alt f a -> Alt f a -> Alt f a #
(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: (f :*: g) a # mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #
MonadPlus f => MonadPlus (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: M1 i c f a # mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a #

data NonEmpty a #

Non-empty (and non-strict) list type.

Since: base-4.9.0.0

Constructors

a :| [a] infixr 5 |

Instances

Monad NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b # (>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # return :: a -> NonEmpty a # fail :: String -> NonEmpty a #
Functor NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b # (<$) :: a -> NonEmpty b -> NonEmpty a #
MonadFix NonEmpty | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> NonEmpty a) -> NonEmpty a #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #
Foldable NonEmpty | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # toList :: NonEmpty a -> [a] # null :: NonEmpty a -> Bool # length :: NonEmpty a -> Int # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # sum :: Num a => NonEmpty a -> a # product :: Num a => NonEmpty a -> a #
Traversable NonEmpty | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) # sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) # mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) # sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #
Eq1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool #
Ord1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering #
Read1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmpty a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmpty a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmpty a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmpty a] #
Show1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS #
IsList (NonEmpty a) | Since: base-4.9.0.0
Instance details Defined in GHC.Exts Associated Types type Item (NonEmpty a) :: * # Methods fromList :: [Item (NonEmpty a)] -> NonEmpty a # fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a # toList :: NonEmpty a -> [Item (NonEmpty a)] #
Eq a => Eq (NonEmpty a) |
Instance details Defined in GHC.Base Methods (==) :: NonEmpty a -> NonEmpty a -> Bool # (/=) :: NonEmpty a -> NonEmpty a -> Bool #
Data a => Data (NonEmpty a) | Since: base-4.9.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) # toConstr :: NonEmpty a -> Constr # dataTypeOf :: NonEmpty a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) # gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #
Ord a => Ord (NonEmpty a) |
Instance details Defined in GHC.Base Methods compare :: NonEmpty a -> NonEmpty a -> Ordering # (<) :: NonEmpty a -> NonEmpty a -> Bool # (<=) :: NonEmpty a -> NonEmpty a -> Bool # (>) :: NonEmpty a -> NonEmpty a -> Bool # (>=) :: NonEmpty a -> NonEmpty a -> Bool # max :: NonEmpty a -> NonEmpty a -> NonEmpty a # min :: NonEmpty a -> NonEmpty a -> NonEmpty a #
Read a => Read (NonEmpty a) |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (NonEmpty a) # readList :: ReadS [NonEmpty a] # readPrec :: ReadPrec (NonEmpty a) # readListPrec :: ReadPrec [NonEmpty a] #
Show a => Show (NonEmpty a) |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> NonEmpty a -> ShowS # show :: NonEmpty a -> String # showList :: [NonEmpty a] -> ShowS #
Generic (NonEmpty a) |
Instance details Defined in GHC.Generics Associated Types type Rep (NonEmpty a) :: * -> * # Methods from :: NonEmpty a -> Rep (NonEmpty a) x # to :: Rep (NonEmpty a) x -> NonEmpty a #
Semigroup (NonEmpty a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a # sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a # stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #
Generic1 NonEmpty |
Instance details Defined in GHC.Generics Associated Types type Rep1 NonEmpty :: k -> * # Methods from1 :: NonEmpty a -> Rep1 NonEmpty a # to1 :: Rep1 NonEmpty a -> NonEmpty a #
type Rep (NonEmpty a) |
Instance details Defined in GHC.Generics type Rep (NonEmpty a) = D1 (MetaData "NonEmpty" "GHC.Base" "base" False) (C1 (MetaCons ":|" (InfixI LeftAssociative 9) False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [a])))
type Item (NonEmpty a) |
Instance details Defined in GHC.Exts type Item (NonEmpty a) = a
type Rep1 NonEmpty |
Instance details Defined in GHC.Generics type Rep1 NonEmpty = D1 (MetaData "NonEmpty" "GHC.Base" "base" False) (C1 (MetaCons ":|" (InfixI LeftAssociative 9) False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1 :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 [])))

type String = [Char] #

A `String` is a list of characters. String constants in Haskell are values of type `String`.

undefined :: HasCallStack => a #

A special case of `error`. It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which `undefined` appears.

errorWithoutStackTrace :: [Char] -> a #

A variant of `error` that does not produce a stack trace.

Since: base-4.9.0.0

error :: HasCallStack => [Char] -> a #

`error` stops execution and displays an error message.

data SomeException where #

The `SomeException` type is the root of the exception type hierarchy. When an exception of type `e` is thrown, behind the scenes it is encapsulated in a `SomeException`.

Constructors

SomeException :: SomeException |

Instances

Show SomeException | Since: base-3.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS #
Exception SomeException | Since: base-3.0
Instance details Defined in GHC.Exception Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String #

stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a #

This is a valid definition of `stimes` for an idempotent `Monoid`.

When `mappend x x = x`, this definition should be preferred, because it works in O(1) rather than O(log n)

(&&) :: Bool -> Bool -> Bool infixr 3 #

Boolean "and"

(||) :: Bool -> Bool -> Bool infixr 2 #

Boolean "or"

not :: Bool -> Bool #

Boolean "not"

# Reimplementations of functions presented in versions of "base" newer than 4.6

## Data.Bool

bool :: a -> a -> Bool -> a #

Case analysis for the `Bool` type. ``bool` x y p` evaluates to `x` when `p` is `False`, and evaluates to `y` when `p` is `True`.

This is equivalent to `if p then y else x`; that is, one can think of it as an if-then-else construct with its arguments reordered.

#### Examples

Expand

Basic usage:

    >>> bool "foo" "bar" True
    "bar"
    >>> bool "foo" "bar" False
    "foo"

Confirm that ``bool` x y p` and `if p then y else x` are equivalent:

    >>> let p = True; x = "bar"; y = "foo"
    >>> bool x y p == if p then y else x
    True
    >>> let p = False
    >>> bool x y p == if p then y else x
    True

Since: base-4.7.0.0

## Data.Function

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

`&` is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator `$`, which allows `&` to be nested in `$`.

    >>> 5 & (+1) & show
    "6"

Since: base-4.8.0.0

## Data.Functor

($>) :: Functor f => f a -> b -> f b infixl 4 #

Flipped version of `<$`.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with a constant `String`:

    >>> Nothing $> "foo"
    Nothing
    >>> Just 90210 $> "foo"
    Just "foo"

Replace the contents of an ``Either` `Int` `Int`` with a constant `String`, resulting in an ``Either` `Int` `String``:

    >>> Left 8675309 $> "foo"
    Left 8675309
    >>> Right 8675309 $> "foo"
    Right "foo"

Replace each element of a list with a constant `String`:

    >>> [1,2,3] $> "foo"
    ["foo","foo","foo"]

Replace the second element of a pair with a constant `String`:

    >>> (1,2) $> "foo"
    (1,"foo")

Since: base-4.7.0.0

## Data.List

isSubsequenceOf :: Eq a => [a] -> [a] -> Bool #

The `isSubsequenceOf` function takes two lists and returns `True` if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively.

``isSubsequenceOf` x y` is equivalent to ``elem` x (`subsequences` y)`.

#### Examples

Expand

    >>> isSubsequenceOf "GHC" "The Glorious Haskell Compiler"
    True
    >>> isSubsequenceOf ['a','d'..'z'] ['a'..'z']
    True
    >>> isSubsequenceOf [1..10] [10,9..0]
    False

Since: base-4.8.0.0

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

Sort a list by comparing the results of a key function applied to each element. `sortOn f` is equivalent to `sortBy (comparing f)`, but has the performance advantage of only evaluating `f` once for each element in the input list. This is called the decorate-sort-undecorate paradigm, or Schwartzian transform.

Elements are arranged from from lowest to highest, keeping duplicates in the order they appeared in the input.

    >>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]
    [(1,"Hello"),(2,"world"),(4,"!")]

Since: base-4.8.0.0

uncons :: [a] -> Maybe (a, [a]) #

Decompose a list into its head and tail. If the list is empty, returns `Nothing`. If the list is non-empty, returns ``Just` (x, xs)`, where `x` is the head of the list and `xs` its tail.

Since: base-4.8.0.0

## Debug.Trace

traceShowId :: Show a => a -> a #

Like `traceShow` but returns the shown value instead of a third value.

    >>> traceShowId (1+2+3, "hello" ++ "world")
    (6,"helloworld")
    (6,"helloworld")

Since: base-4.7.0.0

traceM :: Applicative f => String -> f () #

Like `trace` but returning unit in an arbitrary `Applicative` context. Allows for convenient use in do-notation.

Note that the application of `traceM` is not an action in the `Applicative` context, as `traceIO` is in the `IO` type. While the fresh bindings in the following example will force the `traceM` expressions to be reduced every time the `do`-block is executed, `traceM "not crashed"` would only be reduced once, and the message would only be printed once. If your monad is in `MonadIO`, `liftIO . traceIO` may be a better option.

    >>> :{
    do
        x <- Just 3
        traceM ("x: " ++ show x)
        y <- pure 12
        traceM ("y: " ++ show y)
        pure (x*2 + y)
    :}
    x: 3
    y: 12
    Just 18

Since: base-4.7.0.0

traceShowM :: (Show a, Applicative f) => a -> f () #

Like `traceM`, but uses `show` on the argument to convert it to a `String`.

    >>> :{
    do
        x <- Just 3
        traceShowM x
        y <- pure 12
        traceShowM y
        pure (x*2 + y)
    :}
    3
    12
    Just 18

Since: base-4.7.0.0