Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Termonad.Prelude
Synopsis
- seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- otherwise :: Bool
- assert :: Bool -> a -> a
- ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- guard :: Alternative f => Bool -> f ()
- join :: Monad m => m (m a) -> m a
- class Bounded a where
- class Enum a where
- succ :: a -> a
- pred :: a -> a
- toEnum :: Int -> a
- fromEnum :: a -> Int
- enumFrom :: a -> [a]
- enumFromThen :: a -> a -> [a]
- enumFromTo :: a -> a -> [a]
- enumFromThenTo :: a -> a -> a -> [a]
- class Eq a where
- class Fractional a => Floating a where
- class Num a => Fractional a where
- (/) :: a -> a -> a
- recip :: a -> a
- fromRational :: Rational -> a
- class (Real a, Enum a) => Integral a where
- class Applicative m => Monad (m :: Type -> Type) where
- class Functor (f :: Type -> Type) where
- class Num a where
- class Eq a => Ord a where
- class Read a
- class (Num a, Ord a) => Real a where
- toRational :: a -> Rational
- class (RealFrac a, Floating a) => RealFloat a where
- floatRadix :: a -> Integer
- floatDigits :: a -> Int
- floatRange :: a -> (Int, Int)
- decodeFloat :: a -> (Integer, Int)
- encodeFloat :: Integer -> Int -> a
- exponent :: a -> Int
- significand :: a -> a
- scaleFloat :: Int -> a -> a
- isNaN :: a -> Bool
- isInfinite :: a -> Bool
- isDenormalized :: a -> Bool
- isNegativeZero :: a -> Bool
- isIEEE :: a -> Bool
- atan2 :: a -> a -> a
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- class Typeable (a :: k)
- class IsString a where
- fromString :: String -> a
- class Functor f => Applicative (f :: Type -> Type) where
- class Foldable (t :: Type -> Type)
- class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where
- traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
- sequenceA :: Applicative f => t (f a) -> f (t a)
- mapM :: Monad m => (a -> m b) -> t a -> m (t b)
- sequence :: Monad m => t (m a) -> m (t a)
- class Generic a
- class Semigroup a where
- class Semigroup a => Monoid a where
- data Bool
- type String = [Char]
- data Char
- data Double
- data Float
- data Int
- data Int32
- data Int64
- data Integer
- data Maybe a
- data Ordering
- type Rational = Ratio Integer
- data RealWorld
- data IO a
- data Word
- data Word8
- data Word32
- data Word64
- data Either a b
- (</>) :: FilePath -> FilePath -> FilePath
- data ByteString
- data MVar a
- deepseq :: NFData a => a -> b -> b
- force :: NFData a => a -> a
- class NFData a where
- rnf :: a -> ()
- data Set a
- data Map k a
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- (&&) :: Bool -> Bool -> Bool
- data SomeException = Exception e => SomeException e
- error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a
- ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- ap :: Monad m => m (a -> b) -> m a -> m b
- asTypeOf :: a -> a -> a
- const :: a -> b -> a
- flip :: (a -> b -> c) -> b -> a -> c
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- until :: (a -> Bool) -> (a -> a) -> a -> a
- when :: Applicative f => Bool -> f () -> f ()
- class Applicative f => Alternative (f :: Type -> Type) where
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
- subtract :: Num a => a -> a -> a
- curry :: ((a, b) -> c) -> a -> b -> c
- uncurry :: (a -> b -> c) -> (a, b) -> c
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- void :: Functor f => f a -> f ()
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- fromMaybe :: a -> Maybe a -> a
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- listToMaybe :: [a] -> Maybe a
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- maybe :: b -> (a -> b) -> Maybe a -> b
- maybeToList :: Maybe a -> [a]
- repeat :: a -> [a]
- (^) :: (Num a, Integral b) => a -> b -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- even :: Integral a => a -> Bool
- odd :: Integral a => a -> Bool
- data Proxy (t :: k) = Proxy
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- partitionEithers :: [Either a b] -> ([a], [b])
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- class (Typeable e, Show e) => Exception e where
- toException :: e -> SomeException
- fromException :: SomeException -> Maybe e
- displayException :: e -> String
- userError :: String -> IOError
- type IOError = IOException
- data IOException
- type FilePath = String
- ioError :: IOError -> IO a
- newtype Identity a = Identity {
- runIdentity :: a
- optional :: Alternative f => f a -> f (Maybe a)
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- unless :: Applicative f => Bool -> f () -> f ()
- class Monad m => MonadReader r (m :: Type -> Type) | m -> r where
- ask :: m r
- class Hashable a where
- hashWithSalt :: Int -> a -> Int
- hash :: a -> Int
- data UTCTime = UTCTime {
- utctDay :: Day
- utctDayTime :: DiffTime
- data Text
- data HashMap k v
- stdout :: Handle
- data Handle
- class Bifunctor (p :: Type -> Type -> Type) where
- waitBothSTM :: Async a -> Async b -> STM (a, b)
- waitEitherSTM_ :: Async a -> Async b -> STM ()
- waitEitherSTM :: Async a -> Async b -> STM (Either a b)
- waitEitherCatchSTM :: Async a -> Async b -> STM (Either (Either SomeException a) (Either SomeException b))
- waitAnySTM :: [Async a] -> STM (Async a, a)
- waitAnyCatchSTM :: [Async a] -> STM (Async a, Either SomeException a)
- pollSTM :: Async a -> STM (Maybe (Either SomeException a))
- waitCatchSTM :: Async a -> STM (Either SomeException a)
- waitSTM :: Async a -> STM a
- data Async a
- data AsyncCancelled = AsyncCancelled
- data WrappedMonoid m
- data Chan a
- data QSem
- data QSemN
- class Monad m => MonadIO (m :: Type -> Type) where
- replicateM_ :: Applicative m => Int -> m a -> m ()
- forever :: Applicative f => f a -> f b
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
- (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- stdin :: Handle
- stderr :: Handle
- userErrorType :: IOErrorType
- tryIOError :: IO a -> IO (Either IOError a)
- resourceVanishedErrorType :: IOErrorType
- permissionErrorType :: IOErrorType
- modifyIOError :: (IOError -> IOError) -> IO a -> IO a
- mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
- isUserErrorType :: IOErrorType -> Bool
- isUserError :: IOError -> Bool
- isResourceVanishedErrorType :: IOErrorType -> Bool
- isResourceVanishedError :: IOError -> Bool
- isPermissionErrorType :: IOErrorType -> Bool
- isPermissionError :: IOError -> Bool
- isIllegalOperationErrorType :: IOErrorType -> Bool
- isIllegalOperation :: IOError -> Bool
- isFullErrorType :: IOErrorType -> Bool
- isFullError :: IOError -> Bool
- isEOFErrorType :: IOErrorType -> Bool
- isEOFError :: IOError -> Bool
- isDoesNotExistErrorType :: IOErrorType -> Bool
- isDoesNotExistError :: IOError -> Bool
- isAlreadyInUseErrorType :: IOErrorType -> Bool
- isAlreadyInUseError :: IOError -> Bool
- isAlreadyExistsErrorType :: IOErrorType -> Bool
- isAlreadyExistsError :: IOError -> Bool
- ioeSetLocation :: IOError -> String -> IOError
- ioeSetHandle :: IOError -> Handle -> IOError
- ioeSetFileName :: IOError -> FilePath -> IOError
- ioeSetErrorType :: IOError -> IOErrorType -> IOError
- ioeSetErrorString :: IOError -> String -> IOError
- ioeGetLocation :: IOError -> String
- ioeGetHandle :: IOError -> Maybe Handle
- ioeGetFileName :: IOError -> Maybe FilePath
- ioeGetErrorType :: IOError -> IOErrorType
- ioeGetErrorString :: IOError -> String
- illegalOperationErrorType :: IOErrorType
- fullErrorType :: IOErrorType
- eofErrorType :: IOErrorType
- doesNotExistErrorType :: IOErrorType
- annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError
- alreadyInUseErrorType :: IOErrorType
- alreadyExistsErrorType :: IOErrorType
- data TVar a
- data STM a
- writeTVar :: TVar a -> a -> STM ()
- readTVar :: TVar a -> STM a
- orElse :: STM a -> STM a -> STM a
- newTVar :: a -> STM (TVar a)
- data SomeAsyncException = Exception e => SomeAsyncException e
- data IOErrorType
- asyncExceptionToException :: Exception e => e -> SomeException
- asyncExceptionFromException :: Exception e => SomeException -> Maybe e
- data BufferMode
- data SeekMode
- data IORef a
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- newtype Down a = Down {
- getDown :: a
- class Storable a
- rights :: [Either a b] -> [b]
- lefts :: [Either a b] -> [a]
- data KProxy t = KProxy
- asProxyTypeOf :: a -> proxy a -> a
- id :: forall (a :: k). Category cat => cat a a
- (.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- data IOMode
- data STRef s a
- bool :: a -> a -> Bool -> a
- (&) :: a -> (a -> b) -> b
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- ($>) :: Functor f => f a -> b -> f b
- swap :: (a, b) -> (b, a)
- 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
- 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
- terror :: HasCallStack => Text -> a
- getArgs :: MonadIO m => m [Text]
- equating :: Eq a => (b -> a) -> b -> b -> Bool
- type LText = Text
- type LByteString = ByteString
- type UVector = Vector
- type SVector = Vector
- data Vector a
- class (Vector Vector a, MVector MVector a) => Unbox a
- data HashSet a
- (<.>) :: FilePath -> String -> FilePath
- data Seq a
- data IntSet
- data IntMap a
- unzip :: Zip f => f (a, b) -> (f a, f b)
- zip :: Zip f => f a -> f b -> f (a, b)
- zipWith :: Zip f => (a -> b -> c) -> f a -> f b -> f c
- unzip3 :: Zip3 f => f (a, b, c) -> (f a, f b, f c)
- zipWith3 :: Zip3 f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- zip3 :: Zip3 f => f a -> f b -> f c -> f (a, b, c)
- zipWith4 :: Zip4 f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e
- unzip4 :: Zip4 f => f (a, b, c, d) -> (f a, f b, f c, f d)
- zip4 :: Zip4 f => f a -> f b -> f c -> f d -> f (a, b, c, d)
- zipWith5 :: Zip5 f => (a -> b -> c -> d -> e -> g) -> f a -> f b -> f c -> f d -> f e -> f g
- unzip5 :: Zip5 f => f (a, b, c, d, e) -> (f a, f b, f c, f d, f e)
- zip5 :: Zip5 f => f a -> f b -> f c -> f d -> f e -> f (a, b, c, d, e)
- zipWith6 :: Zip6 f => (a -> b -> c -> d -> e -> g -> h) -> f a -> f b -> f c -> f d -> f e -> f g -> f h
- unzip6 :: Zip6 f => f (a, b, c, d, e, g) -> (f a, f b, f c, f d, f e, f g)
- zip6 :: Zip6 f => f a -> f b -> f c -> f d -> f e -> f g -> f (a, b, c, d, e, g)
- zipWith7 :: Zip7 f => (a -> b -> c -> d -> e -> g -> h -> i) -> f a -> f b -> f c -> f d -> f e -> f g -> f h -> f i
- unzip7 :: Zip7 f => f (a, b, c, d, e, g, h) -> (f a, f b, f c, f d, f e, f g, f h)
- zip7 :: Zip7 f => f a -> f b -> f c -> f d -> f e -> f g -> f h -> f (a, b, c, d, e, g, h)
- textToBuilder :: ToBuilder Text builder => Text -> builder
- type TextBuilder = Builder
- type BlazeBuilder = Builder
- type ByteStringBuilder = Builder
- class Monoid builder => Builder builder lazy | builder -> lazy, lazy -> builder where
- builderToLazy :: builder -> lazy
- flushBuilder :: builder
- class ToBuilder value builder where
- toBuilder :: value -> builder
- newChan :: MonadIO m => m (Chan a)
- writeChan :: MonadIO m => Chan a -> a -> m ()
- readChan :: MonadIO m => Chan a -> m a
- dupChan :: MonadIO m => Chan a -> m (Chan a)
- getChanContents :: MonadIO m => Chan a -> m [a]
- writeList2Chan :: MonadIO m => Chan a -> [a] -> m ()
- data StringException = StringException String CallStack
- data AsyncExceptionWrapper = Exception e => AsyncExceptionWrapper e
- data SyncExceptionWrapper = Exception e => SyncExceptionWrapper e
- data Handler (m :: Type -> Type) a = Exception e => Handler (e -> m a)
- catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
- catchIO :: MonadUnliftIO m => m a -> (IOException -> m a) -> m a
- catchAny :: MonadUnliftIO m => m a -> (SomeException -> m a) -> m a
- catchDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> (e -> m a) -> m a
- catchAnyDeep :: (NFData a, MonadUnliftIO m) => m a -> (SomeException -> m a) -> m a
- catchJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
- catchSyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
- handle :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a
- handleIO :: MonadUnliftIO m => (IOException -> m a) -> m a -> m a
- handleAny :: MonadUnliftIO m => (SomeException -> m a) -> m a -> m a
- handleDeep :: (MonadUnliftIO m, Exception e, NFData a) => (e -> m a) -> m a -> m a
- handleAnyDeep :: (MonadUnliftIO m, NFData a) => (SomeException -> m a) -> m a -> m a
- handleJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a
- handleSyncOrAsync :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a
- try :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)
- tryIO :: MonadUnliftIO m => m a -> m (Either IOException a)
- tryAny :: MonadUnliftIO m => m a -> m (Either SomeException a)
- tryDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> m (Either e a)
- tryAnyDeep :: (MonadUnliftIO m, NFData a) => m a -> m (Either SomeException a)
- tryJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
- trySyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)
- pureTry :: a -> Either SomeException a
- pureTryDeep :: NFData a => a -> Either SomeException a
- catches :: MonadUnliftIO m => m a -> [Handler m a] -> m a
- catchesDeep :: (MonadUnliftIO m, NFData a) => m a -> [Handler m a] -> m a
- evaluate :: MonadIO m => a -> m a
- evaluateDeep :: (MonadIO m, NFData a) => a -> m a
- bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
- bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
- bracketOnError :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
- bracketOnError_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
- finally :: MonadUnliftIO m => m a -> m b -> m a
- withException :: (MonadUnliftIO m, Exception e) => m a -> (e -> m b) -> m a
- onException :: MonadUnliftIO m => m a -> m b -> m a
- throwIO :: (MonadIO m, Exception e) => e -> m a
- toSyncException :: Exception e => e -> SomeException
- toAsyncException :: Exception e => e -> SomeException
- fromExceptionUnwrap :: Exception e => SomeException -> Maybe e
- isSyncException :: Exception e => e -> Bool
- isAsyncException :: Exception e => e -> Bool
- mask :: MonadUnliftIO m => ((forall a. m a -> m a) -> m b) -> m b
- uninterruptibleMask :: MonadUnliftIO m => ((forall a. m a -> m a) -> m b) -> m b
- mask_ :: MonadUnliftIO m => m a -> m a
- uninterruptibleMask_ :: MonadUnliftIO m => m a -> m a
- throwString :: (MonadIO m, HasCallStack) => String -> m a
- stringException :: HasCallStack => String -> StringException
- throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()
- impureThrow :: Exception e => e -> a
- fromEither :: (Exception e, MonadIO m) => Either e a -> m a
- fromEitherIO :: (Exception e, MonadIO m) => IO (Either e a) -> m a
- fromEitherM :: (Exception e, MonadIO m) => m (Either e a) -> m a
- mapExceptionM :: (Exception e1, Exception e2, MonadUnliftIO m) => (e1 -> e2) -> m a -> m a
- withFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
- withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
- openFile :: MonadIO m => FilePath -> IOMode -> m Handle
- hClose :: MonadIO m => Handle -> m ()
- hFlush :: MonadIO m => Handle -> m ()
- hFileSize :: MonadIO m => Handle -> m Integer
- hSetFileSize :: MonadIO m => Handle -> Integer -> m ()
- hIsEOF :: MonadIO m => Handle -> m Bool
- hSetBuffering :: MonadIO m => Handle -> BufferMode -> m ()
- hGetBuffering :: MonadIO m => Handle -> m BufferMode
- hSeek :: MonadIO m => Handle -> SeekMode -> Integer -> m ()
- hTell :: MonadIO m => Handle -> m Integer
- hIsOpen :: MonadIO m => Handle -> m Bool
- hIsClosed :: MonadIO m => Handle -> m Bool
- hIsReadable :: MonadIO m => Handle -> m Bool
- hIsWritable :: MonadIO m => Handle -> m Bool
- hIsSeekable :: MonadIO m => Handle -> m Bool
- hIsTerminalDevice :: MonadIO m => Handle -> m Bool
- hSetEcho :: MonadIO m => Handle -> Bool -> m ()
- hGetEcho :: MonadIO m => Handle -> m Bool
- hWaitForInput :: MonadIO m => Handle -> Int -> m Bool
- hReady :: MonadIO m => Handle -> m Bool
- getMonotonicTime :: MonadIO m => m Double
- newIORef :: MonadIO m => a -> m (IORef a)
- readIORef :: MonadIO m => IORef a -> m a
- writeIORef :: MonadIO m => IORef a -> a -> m ()
- modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()
- modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()
- atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()
- mkWeakIORef :: MonadUnliftIO m => IORef a -> m () -> m (Weak (IORef a))
- data ConcException = EmptyWithNoAlternative
- data Conc (m :: Type -> Type) a
- newtype Concurrently (m :: Type -> Type) a = Concurrently {
- runConcurrently :: m a
- async :: MonadUnliftIO m => m a -> m (Async a)
- asyncBound :: MonadUnliftIO m => m a -> m (Async a)
- asyncOn :: MonadUnliftIO m => Int -> m a -> m (Async a)
- asyncWithUnmask :: MonadUnliftIO m => ((forall b. m b -> m b) -> m a) -> m (Async a)
- asyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall b. m b -> m b) -> m a) -> m (Async a)
- withAsync :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
- withAsyncBound :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
- withAsyncOn :: MonadUnliftIO m => Int -> m a -> (Async a -> m b) -> m b
- withAsyncWithUnmask :: MonadUnliftIO m => ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
- withAsyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall c. m c -> m c) -> m a) -> (Async a -> m b) -> m b
- wait :: MonadIO m => Async a -> m a
- poll :: MonadIO m => Async a -> m (Maybe (Either SomeException a))
- waitCatch :: MonadIO m => Async a -> m (Either SomeException a)
- cancel :: MonadIO m => Async a -> m ()
- uninterruptibleCancel :: MonadIO m => Async a -> m ()
- cancelWith :: (Exception e, MonadIO m) => Async a -> e -> m ()
- waitAny :: MonadIO m => [Async a] -> m (Async a, a)
- waitAnyCatch :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
- waitAnyCancel :: MonadIO m => [Async a] -> m (Async a, a)
- waitAnyCatchCancel :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
- waitEither :: MonadIO m => Async a -> Async b -> m (Either a b)
- waitEitherCatch :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
- waitEitherCancel :: MonadIO m => Async a -> Async b -> m (Either a b)
- waitEitherCatchCancel :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
- waitEither_ :: MonadIO m => Async a -> Async b -> m ()
- waitBoth :: MonadIO m => Async a -> Async b -> m (a, b)
- link :: MonadIO m => Async a -> m ()
- link2 :: MonadIO m => Async a -> Async b -> m ()
- race :: MonadUnliftIO m => m a -> m b -> m (Either a b)
- race_ :: MonadUnliftIO m => m a -> m b -> m ()
- concurrently :: MonadUnliftIO m => m a -> m b -> m (a, b)
- concurrently_ :: MonadUnliftIO m => m a -> m b -> m ()
- forConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
- forConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
- replicateConcurrently :: MonadUnliftIO m => Int -> m b -> m [b]
- replicateConcurrently_ :: (Applicative m, MonadUnliftIO m) => Int -> m a -> m ()
- mapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
- mapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
- conc :: m a -> Conc m a
- runConc :: MonadUnliftIO m => Conc m a -> m a
- pooledMapConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> (a -> m b) -> t a -> m (t b)
- pooledMapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
- pooledForConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> t a -> (a -> m b) -> m (t b)
- pooledForConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
- pooledMapConcurrentlyN_ :: (MonadUnliftIO m, Foldable f) => Int -> (a -> m b) -> f a -> m ()
- pooledMapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
- pooledForConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
- pooledForConcurrentlyN_ :: (MonadUnliftIO m, Foldable t) => Int -> t a -> (a -> m b) -> m ()
- pooledReplicateConcurrentlyN :: MonadUnliftIO m => Int -> Int -> m a -> m [a]
- pooledReplicateConcurrently :: MonadUnliftIO m => Int -> m a -> m [a]
- pooledReplicateConcurrentlyN_ :: MonadUnliftIO m => Int -> Int -> m a -> m ()
- pooledReplicateConcurrently_ :: MonadUnliftIO m => Int -> m a -> m ()
- newEmptyMVar :: MonadIO m => m (MVar a)
- newMVar :: MonadIO m => a -> m (MVar a)
- takeMVar :: MonadIO m => MVar a -> m a
- putMVar :: MonadIO m => MVar a -> a -> m ()
- readMVar :: MonadIO m => MVar a -> m a
- swapMVar :: MonadIO m => MVar a -> a -> m a
- tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- isEmptyMVar :: MonadIO m => MVar a -> m Bool
- tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))
- data Memoized a
- runMemoized :: MonadIO m => Memoized a -> m a
- memoizeRef :: MonadUnliftIO m => m a -> m (Memoized a)
- memoizeMVar :: MonadUnliftIO m => m a -> m (Memoized a)
- newQSem :: MonadIO m => Int -> m QSem
- waitQSem :: MonadIO m => QSem -> m ()
- signalQSem :: MonadIO m => QSem -> m ()
- withQSem :: MonadUnliftIO m => QSem -> m a -> m a
- newQSemN :: MonadIO m => Int -> m QSemN
- waitQSemN :: MonadIO m => QSemN -> Int -> m ()
- signalQSemN :: MonadIO m => QSemN -> Int -> m ()
- withQSemN :: MonadUnliftIO m => QSemN -> Int -> m a -> m a
- atomically :: MonadIO m => STM a -> m a
- retrySTM :: STM a
- checkSTM :: Bool -> STM ()
- newTVarIO :: MonadIO m => a -> m (TVar a)
- readTVarIO :: MonadIO m => TVar a -> m a
- registerDelay :: MonadIO m => Int -> m (TVar Bool)
- mkWeakTVar :: MonadUnliftIO m => TVar a -> m () -> m (Weak (TVar a))
- newTMVarIO :: MonadIO m => a -> m (TMVar a)
- newEmptyTMVarIO :: MonadIO m => m (TMVar a)
- mkWeakTMVar :: MonadUnliftIO m => TMVar a -> m () -> m (Weak (TMVar a))
- newTChanIO :: MonadIO m => m (TChan a)
- newBroadcastTChanIO :: MonadIO m => m (TChan a)
- newTQueueIO :: MonadIO m => m (TQueue a)
- newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a)
- withSystemTempFile :: MonadUnliftIO m => String -> (FilePath -> Handle -> m a) -> m a
- withSystemTempDirectory :: MonadUnliftIO m => String -> (FilePath -> m a) -> m a
- withTempFile :: MonadUnliftIO m => FilePath -> String -> (FilePath -> Handle -> m a) -> m a
- withTempDirectory :: MonadUnliftIO m => FilePath -> String -> (FilePath -> m a) -> m a
- timeout :: MonadUnliftIO m => Int -> m a -> m (Maybe a)
- wrappedWithRunInIO :: MonadUnliftIO n => (n b -> m b) -> (forall a. m a -> n a) -> ((forall a. m a -> IO a) -> IO b) -> m b
- toIO :: MonadUnliftIO m => m a -> m (IO a)
- withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a
- askRunInIO :: MonadUnliftIO m => m (m a -> IO a)
- askUnliftIO :: MonadUnliftIO m => m (UnliftIO m)
- newtype UnliftIO (m :: Type -> Type) = UnliftIO {}
- class MonadIO m => MonadUnliftIO (m :: Type -> Type) where
- withRunInIO :: ((forall a. m a -> IO a) -> IO b) -> m b
- data TBChan a
- newTBChan :: Int -> STM (TBChan a)
- newTBChanIO :: Int -> IO (TBChan a)
- readTBChan :: TBChan a -> STM a
- tryReadTBChan :: TBChan a -> STM (Maybe a)
- peekTBChan :: TBChan a -> STM a
- tryPeekTBChan :: TBChan a -> STM (Maybe a)
- writeTBChan :: TBChan a -> a -> STM ()
- tryWriteTBChan :: TBChan a -> a -> STM Bool
- unGetTBChan :: TBChan a -> a -> STM ()
- isEmptyTBChan :: TBChan a -> STM Bool
- isFullTBChan :: TBChan a -> STM Bool
- estimateFreeSlotsTBChan :: TBChan a -> STM Int
- freeSlotsTBChan :: TBChan a -> STM Int
- data TBMChan a
- newTBMChan :: Int -> STM (TBMChan a)
- newTBMChanIO :: Int -> IO (TBMChan a)
- readTBMChan :: TBMChan a -> STM (Maybe a)
- tryReadTBMChan :: TBMChan a -> STM (Maybe (Maybe a))
- peekTBMChan :: TBMChan a -> STM (Maybe a)
- tryPeekTBMChan :: TBMChan a -> STM (Maybe (Maybe a))
- writeTBMChan :: TBMChan a -> a -> STM ()
- tryWriteTBMChan :: TBMChan a -> a -> STM (Maybe Bool)
- unGetTBMChan :: TBMChan a -> a -> STM ()
- closeTBMChan :: TBMChan a -> STM ()
- isClosedTBMChan :: TBMChan a -> STM Bool
- isEmptyTBMChan :: TBMChan a -> STM Bool
- isFullTBMChan :: TBMChan a -> STM Bool
- estimateFreeSlotsTBMChan :: TBMChan a -> STM Int
- freeSlotsTBMChan :: TBMChan a -> STM Int
- data TBMQueue a
- newTBMQueue :: Int -> STM (TBMQueue a)
- newTBMQueueIO :: Int -> IO (TBMQueue a)
- readTBMQueue :: TBMQueue a -> STM (Maybe a)
- tryReadTBMQueue :: TBMQueue a -> STM (Maybe (Maybe a))
- peekTBMQueue :: TBMQueue a -> STM (Maybe a)
- tryPeekTBMQueue :: TBMQueue a -> STM (Maybe (Maybe a))
- writeTBMQueue :: TBMQueue a -> a -> STM ()
- tryWriteTBMQueue :: TBMQueue a -> a -> STM (Maybe Bool)
- unGetTBMQueue :: TBMQueue a -> a -> STM ()
- closeTBMQueue :: TBMQueue a -> STM ()
- isClosedTBMQueue :: TBMQueue a -> STM Bool
- isEmptyTBMQueue :: TBMQueue a -> STM Bool
- isFullTBMQueue :: TBMQueue a -> STM Bool
- estimateFreeSlotsTBMQueue :: TBMQueue a -> STM Int
- freeSlotsTBMQueue :: TBMQueue a -> STM Int
- data TMChan a
- newTMChan :: STM (TMChan a)
- newTMChanIO :: IO (TMChan a)
- newBroadcastTMChan :: STM (TMChan a)
- newBroadcastTMChanIO :: IO (TMChan a)
- dupTMChan :: TMChan a -> STM (TMChan a)
- readTMChan :: TMChan a -> STM (Maybe a)
- tryReadTMChan :: TMChan a -> STM (Maybe (Maybe a))
- peekTMChan :: TMChan a -> STM (Maybe a)
- tryPeekTMChan :: TMChan a -> STM (Maybe (Maybe a))
- writeTMChan :: TMChan a -> a -> STM ()
- unGetTMChan :: TMChan a -> a -> STM ()
- closeTMChan :: TMChan a -> STM ()
- isClosedTMChan :: TMChan a -> STM Bool
- isEmptyTMChan :: TMChan a -> STM Bool
- data TMQueue a
- newTMQueue :: STM (TMQueue a)
- newTMQueueIO :: IO (TMQueue a)
- readTMQueue :: TMQueue a -> STM (Maybe a)
- tryReadTMQueue :: TMQueue a -> STM (Maybe (Maybe a))
- peekTMQueue :: TMQueue a -> STM (Maybe a)
- tryPeekTMQueue :: TMQueue a -> STM (Maybe (Maybe a))
- writeTMQueue :: TMQueue a -> a -> STM ()
- unGetTMQueue :: TMQueue a -> a -> STM ()
- closeTMQueue :: TMQueue a -> STM ()
- isClosedTMQueue :: TMQueue a -> STM Bool
- isEmptyTMQueue :: TMQueue a -> STM Bool
- isEmptyTBQueue :: TBQueue a -> STM Bool
- isFullTBQueue :: TBQueue a -> STM Bool
- newTBQueue :: Natural -> STM (TBQueue a)
- peekTBQueue :: TBQueue a -> STM a
- readTBQueue :: TBQueue a -> STM a
- tryPeekTBQueue :: TBQueue a -> STM (Maybe a)
- tryReadTBQueue :: TBQueue a -> STM (Maybe a)
- unGetTBQueue :: TBQueue a -> a -> STM ()
- writeTBQueue :: TBQueue a -> a -> STM ()
- data TBQueue a
- cloneTChan :: TChan a -> STM (TChan a)
- dupTChan :: TChan a -> STM (TChan a)
- isEmptyTChan :: TChan a -> STM Bool
- newBroadcastTChan :: STM (TChan a)
- newTChan :: STM (TChan a)
- peekTChan :: TChan a -> STM a
- readTChan :: TChan a -> STM a
- tryPeekTChan :: TChan a -> STM (Maybe a)
- tryReadTChan :: TChan a -> STM (Maybe a)
- unGetTChan :: TChan a -> a -> STM ()
- writeTChan :: TChan a -> a -> STM ()
- data TChan a
- isEmptyTMVar :: TMVar a -> STM Bool
- newEmptyTMVar :: STM (TMVar a)
- newTMVar :: a -> STM (TMVar a)
- putTMVar :: TMVar a -> a -> STM ()
- readTMVar :: TMVar a -> STM a
- swapTMVar :: TMVar a -> a -> STM a
- takeTMVar :: TMVar a -> STM a
- tryPutTMVar :: TMVar a -> a -> STM Bool
- tryReadTMVar :: TMVar a -> STM (Maybe a)
- tryTakeTMVar :: TMVar a -> STM (Maybe a)
- data TMVar a
- isEmptyTQueue :: TQueue a -> STM Bool
- newTQueue :: STM (TQueue a)
- peekTQueue :: TQueue a -> STM a
- readTQueue :: TQueue a -> STM a
- tryPeekTQueue :: TQueue a -> STM (Maybe a)
- tryReadTQueue :: TQueue a -> STM (Maybe a)
- unGetTQueue :: TQueue a -> a -> STM ()
- writeTQueue :: TQueue a -> a -> STM ()
- data TQueue a
- modifyTVar :: TVar a -> (a -> a) -> STM ()
- modifyTVar' :: TVar a -> (a -> a) -> STM ()
- swapTVar :: TVar a -> a -> STM a
- say :: MonadIO m => Text -> m ()
- sayString :: MonadIO m => String -> m ()
- sayShow :: (MonadIO m, Show a) => a -> m ()
- sayErr :: MonadIO m => Text -> m ()
- sayErrString :: MonadIO m => String -> m ()
- sayErrShow :: (MonadIO m, Show a) => a -> m ()
- hSay :: MonadIO m => Handle -> Text -> m ()
- hSayString :: MonadIO m => Handle -> String -> m ()
- hSayShow :: (MonadIO m, Show a) => Handle -> a -> m ()
- newMutVar :: PrimMonad m => a -> m (MutVar (PrimState m) a)
- readMutVar :: PrimMonad m => MutVar (PrimState m) a -> m a
- writeMutVar :: PrimMonad m => MutVar (PrimState m) a -> a -> m ()
- atomicModifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b
- atomicModifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b
- modifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()
- modifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()
- class Prim a
- data MutVar s a = MutVar (MutVar# s a)
- type family PrimState (m :: Type -> Type)
- class Monad m => PrimMonad (m :: Type -> Type) where
- type MutableDeque c = (MutableQueue c, MutablePushFront c, MutablePopBack c)
- type MutableStack c = (MutablePopFront c, MutablePushFront c)
- type MutableQueue c = (MutablePopFront c, MutablePushBack c)
- class MutableCollection c => MutablePushBack c where
- pushBack :: (PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m ()
- class MutableCollection c => MutablePopBack c where
- class MutableCollection c => MutablePushFront c where
- pushFront :: (PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m ()
- class MutableCollection c => MutablePopFront c where
- class MutableContainer c => MutableCollection c where
- type CollElement c
- newColl :: (PrimMonad m, PrimState m ~ MCState c) => m c
- type family CollElement c
- class MutableRef c => MutableAtomicRef c where
- atomicModifyRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a
- atomicModifyRef' :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a
- class MutableContainer c => MutableRef c where
- type RefElement c
- newRef :: (PrimMonad m, PrimState m ~ MCState c) => RefElement c -> m c
- readRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> m (RefElement c)
- writeRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> RefElement c -> m ()
- modifyRef :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m ()
- modifyRef' :: (PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m ()
- type family RefElement c
- class MutableContainer c where
- type MCState c
- type family MCState c
- asIORef :: IORef a -> IORef a
- asSTRef :: STRef s a -> STRef s a
- asMutVar :: MutVar s a -> MutVar s a
- type IOBRef = BRef (PrimState IO)
- data BRef s a
- asBRef :: BRef s a -> BRef s a
- data DLList s a
- asDLList :: DLList s a -> DLList s a
- type BDeque = Deque MVector
- type SDeque = Deque MVector
- type UDeque = Deque MVector
- data Deque (v :: Type -> Type -> Type) s a
- asUDeque :: UDeque s a -> UDeque s a
- asSDeque :: SDeque s a -> SDeque s a
- asBDeque :: BDeque s a -> BDeque s a
- type IOPRef = PRef (PrimState IO)
- data PRef s a
- asPRef :: PRef s a -> PRef s a
- type IOSRef = SRef (PrimState IO)
- data SRef s a
- asSRef :: SRef s a -> SRef s a
- type IOURef = URef (PrimState IO)
- data URef s a
- asURef :: URef s a -> URef s a
- data WrappedMono mono a where
- WrappedMono :: forall mono a. Element mono ~ a => mono -> WrappedMono mono a
- newtype WrappedPoly (f :: Type -> Type) a = WrappedPoly {
- unwrapPoly :: f a
- class MonoFoldable mono => GrowingAppend mono
- class MonoFunctor mono => MonoComonad mono where
- class MonoPointed mono where
- class (MonoFunctor mono, MonoFoldable mono) => MonoTraversable mono where
- otraverse :: Applicative f => (Element mono -> f (Element mono)) -> mono -> f mono
- omapM :: Applicative m => (Element mono -> m (Element mono)) -> mono -> m mono
- class MonoFoldable mono where
- ofoldMap :: Monoid m => (Element mono -> m) -> mono -> m
- ofoldr :: (Element mono -> b -> b) -> b -> mono -> b
- ofoldl' :: (a -> Element mono -> a) -> a -> mono -> a
- otoList :: mono -> [Element mono]
- oall :: (Element mono -> Bool) -> mono -> Bool
- oany :: (Element mono -> Bool) -> mono -> Bool
- onull :: mono -> Bool
- olength :: mono -> Int
- olength64 :: mono -> Int64
- ocompareLength :: Integral i => mono -> i -> Ordering
- otraverse_ :: Applicative f => (Element mono -> f b) -> mono -> f ()
- ofor_ :: Applicative f => mono -> (Element mono -> f b) -> f ()
- omapM_ :: Applicative m => (Element mono -> m ()) -> mono -> m ()
- oforM_ :: Applicative m => mono -> (Element mono -> m ()) -> m ()
- ofoldlM :: Monad m => (a -> Element mono -> m a) -> a -> mono -> m a
- ofoldMap1Ex :: Semigroup m => (Element mono -> m) -> mono -> m
- ofoldr1Ex :: (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- ofoldl1Ex' :: (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- headEx :: mono -> Element mono
- lastEx :: mono -> Element mono
- unsafeHead :: mono -> Element mono
- unsafeLast :: mono -> Element mono
- maximumByEx :: (Element mono -> Element mono -> Ordering) -> mono -> Element mono
- minimumByEx :: (Element mono -> Element mono -> Ordering) -> mono -> Element mono
- oelem :: Element mono -> mono -> Bool
- onotElem :: Element mono -> mono -> Bool
- class MonoFunctor mono where
- type family Element mono
- replaceElem :: (MonoFunctor mono, Eq (Element mono)) => Element mono -> Element mono -> mono -> mono
- replaceElemStrictText :: Char -> Char -> Text -> Text
- replaceElemLazyText :: Char -> Char -> Text -> Text
- headMay :: MonoFoldable mono => mono -> Maybe (Element mono)
- lastMay :: MonoFoldable mono => mono -> Maybe (Element mono)
- osum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- oproduct :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- oand :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool
- oor :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool
- oconcatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- ofold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- oconcat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- ofoldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- osequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()
- maximumEx :: (MonoFoldable mono, Ord (Element mono)) => mono -> Element mono
- minimumEx :: (MonoFoldable mono, Ord (Element mono)) => mono -> Element mono
- maximumMay :: (MonoFoldable mono, Ord (Element mono)) => mono -> Maybe (Element mono)
- maximumByMay :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Maybe (Element mono)
- minimumMay :: (MonoFoldable mono, Ord (Element mono)) => mono -> Maybe (Element mono)
- minimumByMay :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Maybe (Element mono)
- ofor :: (MonoTraversable mono, Applicative f) => mono -> (Element mono -> f (Element mono)) -> f mono
- oforM :: (MonoTraversable mono, Applicative f) => mono -> (Element mono -> f (Element mono)) -> f mono
- ofoldlUnwrap :: MonoFoldable mono => (x -> Element mono -> x) -> x -> (x -> b) -> mono -> b
- ofoldMUnwrap :: (Monad m, MonoFoldable mono) => (x -> Element mono -> m x) -> m x -> (x -> m b) -> mono -> m b
- ointercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono
- unwrapMono :: WrappedMono mono a -> mono
- class SetContainer set => HasKeysSet set where
- type family KeySet set
- class MonoFunctor mono => MonoZip mono where
- class (SetContainer set, Element set ~ ContainerKey set) => IsSet set where
- class (MonoTraversable map, SetContainer map) => IsMap map where
- type MapValue map
- lookup :: ContainerKey map -> map -> Maybe (MapValue map)
- insertMap :: ContainerKey map -> MapValue map -> map -> map
- deleteMap :: ContainerKey map -> map -> map
- singletonMap :: ContainerKey map -> MapValue map -> map
- mapFromList :: [(ContainerKey map, MapValue map)] -> map
- mapToList :: map -> [(ContainerKey map, MapValue map)]
- findWithDefault :: MapValue map -> ContainerKey map -> map -> MapValue map
- insertWith :: (MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- insertWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- insertLookupWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> (Maybe (MapValue map), map)
- adjustMap :: (MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- adjustWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- updateMap :: (MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- updateWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- updateLookupWithKey :: (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> (Maybe (MapValue map), map)
- alterMap :: (Maybe (MapValue map) -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- unionWith :: (MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- unionWithKey :: (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- unionsWith :: (MapValue map -> MapValue map -> MapValue map) -> [map] -> map
- mapWithKey :: (ContainerKey map -> MapValue map -> MapValue map) -> map -> map
- omapKeysWith :: (MapValue map -> MapValue map -> MapValue map) -> (ContainerKey map -> ContainerKey map) -> map -> map
- filterMap :: (MapValue map -> Bool) -> map -> map
- type family MapValue map
- class BiPolyMap (map :: Type -> Type -> Type) where
- type BPMKeyConstraint (map :: Type -> Type -> Type) key
- mapKeysWith :: (BPMKeyConstraint map k1, BPMKeyConstraint map k2) => (v -> v -> v) -> (k1 -> k2) -> map k1 v -> map k2 v
- type family BPMKeyConstraint (map :: Type -> Type -> Type) key
- class PolyMap (map :: Type -> Type) where
- differenceMap :: map value1 -> map value2 -> map value1
- intersectionMap :: map value1 -> map value2 -> map value1
- intersectionWithMap :: (value1 -> value2 -> value3) -> map value1 -> map value2 -> map value3
- class (Monoid set, Semigroup set, MonoFoldable set, Eq (ContainerKey set), GrowingAppend set) => SetContainer set where
- type ContainerKey set
- member :: ContainerKey set -> set -> Bool
- notMember :: ContainerKey set -> set -> Bool
- union :: set -> set -> set
- unions :: (MonoFoldable mono, Element mono ~ set) => mono -> set
- difference :: set -> set -> set
- intersection :: set -> set -> set
- keys :: set -> [ContainerKey set]
- type family ContainerKey set
- foldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- foldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b
- foldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a
- toList :: MonoFoldable mono => mono -> [Element mono]
- all :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- any :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- null :: MonoFoldable mono => mono -> Bool
- length :: MonoFoldable mono => mono -> Int
- length64 :: MonoFoldable mono => mono -> Int64
- compareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering
- traverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f ()
- for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()
- mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()
- forM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m ()
- foldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- foldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m
- foldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- foldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- sum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- product :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- concatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- elem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- notElem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- point :: MonoPointed mono => Element mono -> mono
- intercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono
- fold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- concat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- foldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- sequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()
- class (Textual textual, IsSequence binary) => Utf8 textual binary | textual -> binary, binary -> textual where
- encodeUtf8 :: textual -> binary
- decodeUtf8 :: binary -> textual
- class (IsSequence lazy, IsSequence strict) => LazySequence lazy strict | lazy -> strict, strict -> lazy where
- toChunks :: lazy -> [strict]
- fromChunks :: [strict] -> lazy
- toStrict :: lazy -> strict
- fromStrict :: strict -> lazy
- class (IsSequence t, IsString t, Element t ~ Char) => Textual t where
- words :: t -> [t]
- unwords :: (Element seq ~ t, MonoFoldable seq) => seq -> t
- lines :: t -> [t]
- unlines :: (Element seq ~ t, MonoFoldable seq) => seq -> t
- toLower :: t -> t
- toUpper :: t -> t
- toCaseFold :: t -> t
- breakWord :: t -> (t, t)
- breakLine :: t -> (t, t)
- class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq where
- fromList :: [Element seq] -> seq
- lengthIndex :: seq -> Index seq
- break :: (Element seq -> Bool) -> seq -> (seq, seq)
- span :: (Element seq -> Bool) -> seq -> (seq, seq)
- dropWhile :: (Element seq -> Bool) -> seq -> seq
- takeWhile :: (Element seq -> Bool) -> seq -> seq
- splitAt :: Index seq -> seq -> (seq, seq)
- unsafeSplitAt :: Index seq -> seq -> (seq, seq)
- take :: Index seq -> seq -> seq
- unsafeTake :: Index seq -> seq -> seq
- drop :: Index seq -> seq -> seq
- unsafeDrop :: Index seq -> seq -> seq
- dropEnd :: Index seq -> seq -> seq
- partition :: (Element seq -> Bool) -> seq -> (seq, seq)
- uncons :: seq -> Maybe (Element seq, seq)
- unsnoc :: seq -> Maybe (seq, Element seq)
- filter :: (Element seq -> Bool) -> seq -> seq
- filterM :: Monad m => (Element seq -> m Bool) -> seq -> m seq
- replicate :: Index seq -> Element seq -> seq
- replicateM :: Monad m => Index seq -> m (Element seq) -> m seq
- groupBy :: (Element seq -> Element seq -> Bool) -> seq -> [seq]
- groupAllOn :: Eq b => (Element seq -> b) -> seq -> [seq]
- subsequences :: seq -> [seq]
- permutations :: seq -> [seq]
- tailEx :: seq -> seq
- tailMay :: seq -> Maybe seq
- initEx :: seq -> seq
- initMay :: seq -> Maybe seq
- unsafeTail :: seq -> seq
- unsafeInit :: seq -> seq
- index :: seq -> Index seq -> Maybe (Element seq)
- indexEx :: seq -> Index seq -> Element seq
- unsafeIndex :: seq -> Index seq -> Element seq
- splitWhen :: (Element seq -> Bool) -> seq -> [seq]
- class (Integral (Index seq), GrowingAppend seq) => SemiSequence seq where
- type family Index seq
- singleton :: MonoPointed seq => Element seq -> seq
- defaultFind :: MonoFoldable seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)
- defaultIntersperse :: IsSequence seq => Element seq -> seq -> seq
- defaultReverse :: IsSequence seq => seq -> seq
- defaultSortBy :: IsSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq
- defaultSplitWhen :: IsSequence seq => (Element seq -> Bool) -> seq -> [seq]
- vectorSortBy :: Vector v e => (e -> e -> Ordering) -> v e -> v e
- vectorSort :: (Vector v e, Ord e) => v e -> v e
- defaultCons :: IsSequence seq => Element seq -> seq -> seq
- defaultSnoc :: IsSequence seq => seq -> Element seq -> seq
- tailDef :: IsSequence seq => seq -> seq
- initDef :: IsSequence seq => seq -> seq
- splitElem :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> [seq]
- splitSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> [seq]
- replaceSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq -> seq
- stripPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq
- stripSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq
- dropPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq
- dropSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq
- ensurePrefix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq
- ensureSuffix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq
- isPrefixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- isSuffixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- isInfixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- group :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]
- groupAll :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]
- delete :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> seq
- deleteBy :: (IsSequence seq, Eq (Element seq)) => (Element seq -> Element seq -> Bool) -> Element seq -> seq -> seq
- splitElemStrictBS :: Word8 -> ByteString -> [ByteString]
- stripPrefixStrictBS :: ByteString -> ByteString -> Maybe ByteString
- stripSuffixStrictBS :: ByteString -> ByteString -> Maybe ByteString
- splitSeqLazyBS :: Word8 -> ByteString -> [ByteString]
- stripPrefixLazyBS :: ByteString -> ByteString -> Maybe ByteString
- stripSuffixLazyBS :: ByteString -> ByteString -> Maybe ByteString
- splitSeqStrictText :: Text -> Text -> [Text]
- replaceSeqStrictText :: Text -> Text -> Text -> Text
- splitSeqLazyText :: Text -> Text -> [Text]
- replaceSeqLazyText :: Text -> Text -> Text -> Text
- sort :: (SemiSequence seq, Ord (Element seq)) => seq -> seq
- catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t
- sortOn :: (Ord o, SemiSequence seq) => (Element seq -> o) -> seq -> seq
- pack :: IsSequence seq => [Element seq] -> seq
- unpack :: MonoFoldable mono => mono -> [Element mono]
- repack :: (MonoFoldable a, IsSequence b, Element a ~ Element b) => a -> b
- data NonNull mono
- fromNullable :: MonoFoldable mono => mono -> Maybe (NonNull mono)
- impureNonNull :: MonoFoldable mono => mono -> NonNull mono
- nonNull :: MonoFoldable mono => mono -> NonNull mono
- fromNonEmpty :: IsSequence seq => NonEmpty (Element seq) -> NonNull seq
- toNonEmpty :: MonoFoldable mono => NonNull mono -> NonEmpty (Element mono)
- toMinList :: NonEmpty a -> NonNull [a]
- ncons :: SemiSequence seq => Element seq -> seq -> NonNull seq
- nuncons :: IsSequence seq => NonNull seq -> (Element seq, Maybe (NonNull seq))
- splitFirst :: IsSequence seq => NonNull seq -> (Element seq, seq)
- nfilter :: IsSequence seq => (Element seq -> Bool) -> NonNull seq -> seq
- nfilterM :: (Monad m, IsSequence seq) => (Element seq -> m Bool) -> NonNull seq -> m seq
- nReplicate :: IsSequence seq => Index seq -> Element seq -> NonNull seq
- tail :: IsSequence seq => NonNull seq -> seq
- init :: IsSequence seq => NonNull seq -> seq
- (<|) :: SemiSequence seq => Element seq -> NonNull seq -> NonNull seq
- head :: MonoFoldable mono => NonNull mono -> Element mono
- last :: MonoFoldable mono => NonNull mono -> Element mono
- ofoldMap1 :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> NonNull mono -> m
- ofold1 :: (MonoFoldable mono, Semigroup (Element mono)) => NonNull mono -> Element mono
- ofoldr1 :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> NonNull mono -> Element mono
- ofoldl1' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> NonNull mono -> Element mono
- maximum :: (MonoFoldable mono, Ord (Element mono)) => NonNull mono -> Element mono
- minimum :: (MonoFoldable mono, Ord (Element mono)) => NonNull mono -> Element mono
- maximumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> NonNull mono -> Element mono
- minimumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> NonNull mono -> Element mono
- mapNonNull :: (Functor f, MonoFoldable (f b)) => (a -> b) -> NonNull (f a) -> NonNull (f b)
- interact :: MonadIO m => (LText -> LText) -> m ()
- getContents :: MonadIO m => m LText
- getLine :: MonadIO m => m Text
- getChar :: MonadIO m => m Char
- putStrLn :: MonadIO m => Text -> m ()
- putStr :: MonadIO m => Text -> m ()
- putChar :: MonadIO m => Char -> m ()
- hGetChunk :: MonadIO m => Handle -> m ByteString
- hPut :: MonadIO m => Handle -> ByteString -> m ()
- hGetContents :: MonadIO m => Handle -> m ByteString
- writeFileUtf8 :: MonadIO m => FilePath -> Text -> m ()
- writeFile :: MonadIO m => FilePath -> ByteString -> m ()
- readFileUtf8 :: MonadIO m => FilePath -> m Text
- readFile :: MonadIO m => FilePath -> m ByteString
- link2Async :: MonadIO m => Async a -> Async b -> m ()
- linkAsync :: MonadIO m => Async a -> m ()
- waitCatchAsync :: MonadIO m => Async a -> m (Either SomeException a)
- pollAsync :: MonadIO m => Async a -> m (Maybe (Either SomeException a))
- waitAsync :: MonadIO m => Async a -> m a
- fromByteVector :: SVector Word8 -> ByteString
- toByteVector :: ByteString -> SVector Word8
- (<||>) :: Applicative a => a Bool -> a Bool -> a Bool
- (<&&>) :: Applicative a => a Bool -> a Bool -> a Bool
- applyDList :: DList a -> [a] -> [a]
- asDList :: DList a -> DList a
- unlessM :: Monad m => m Bool -> m () -> m ()
- whenM :: Monad m => m Bool -> m () -> m ()
- orElseSTM :: STM a -> STM a -> STM a
- ordNubBy :: Ord b => (a -> b) -> (a -> a -> Bool) -> [a] -> [a]
- ordNub :: Ord a => [a] -> [a]
- hashNub :: (Hashable a, Eq a) => [a] -> [a]
- yieldThread :: MonadIO m => m ()
- traceShowM :: (Show a, Monad m) => a -> m ()
- traceShowId :: Show a => a -> a
- traceM :: Monad m => String -> m ()
- traceId :: String -> String
- traceShow :: Show a => a -> b -> b
- trace :: String -> a -> a
- undefined :: HasCallStack => a
- sortWith :: (Ord a, IsSequence c) => (Element c -> a) -> c -> c
- print :: (Show a, MonadIO m) => a -> m ()
- asString :: [Char] -> [Char]
- asSVector :: SVector a -> SVector a
- asUVector :: UVector a -> UVector a
- asVector :: Vector a -> Vector a
- asIntSet :: IntSet -> IntSet
- asSet :: Set a -> Set a
- asMaybe :: Maybe a -> Maybe a
- asIntMap :: IntMap v -> IntMap v
- asMap :: Map k v -> Map k v
- asList :: [a] -> [a]
- asLText :: LText -> LText
- asText :: Text -> Text
- asHashSet :: HashSet a -> HashSet a
- asHashMap :: HashMap k v -> HashMap k v
- asLByteString :: LByteString -> LByteString
- asByteString :: ByteString -> ByteString
- intersect :: SetContainer a => a -> a -> a
- (\\) :: SetContainer a => a -> a -> a
- (++) :: Monoid m => m -> m -> m
- map :: Functor f => (a -> b) -> f a -> f b
- readMay :: (Element c ~ Char, MonoFoldable c, Read a) => c -> Maybe a
- charToUpper :: Char -> Char
- charToLower :: Char -> Char
- tlshow :: Show a => a -> LText
- tshow :: Show a => a -> Text
- newtype Day = ModifiedJulianDay {}
- fromGregorian :: Integer -> Int -> Int -> Day
- toGregorian :: Day -> (Integer, Int, Int)
- getCurrentTime :: IO UTCTime
- defaultTimeLocale :: TimeLocale
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t
- parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- primToPrim :: (PrimBase m1, PrimMonad m2, PrimState m1 ~ PrimState m2) => m1 a -> m2 a
- primToIO :: (PrimBase m, PrimState m ~ RealWorld) => m a -> IO a
- primToST :: PrimBase m => m a -> ST (PrimState m) a
- newtype ReaderT r (m :: Type -> Type) a = ReaderT {
- runReaderT :: r -> m a
- type Reader r = ReaderT r Identity
- asks :: MonadReader r m => (r -> a) -> m a
- data DList a
- ($!!) :: NFData a => (a -> b) -> a -> b
- newtype MaybeT (m :: Type -> Type) a = MaybeT {}
- lift :: (MonadTrans t, Monad m) => m a -> t m a
- hPutStrLn :: MonadIO m => Handle -> Text -> m ()
- whenJust :: Monoid m => Maybe a -> (a -> m) -> m
Documentation
seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b infixr 0 #
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.
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.
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b infixr 0 #
Application operator. This operator is redundant, since ordinary
application (f x)
means the same as (f
. However, $
x)$
has
low, right-associative binding precedence, so it sometimes allows
parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
,
or map
($
0) xs
.zipWith
($
) fs xs
Note that (
is levity-polymorphic in its result type, so that
$
)foo
where $
Truefoo :: Bool -> Int#
is well-typed.
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
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
otherwise. For example:Just
(x `div`
y)
>>> 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)
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.
'
' can be understood as the join
bssdo
expression
do bs <- bss bs
Examples
A common use of join
is to run an IO
computation returned from
an STM
transaction, since STM
transactions
can't perform IO
directly. Recall that
atomically
:: STM a -> IO a
is used to run STM
transactions atomically. So, by
specializing the types of atomically
and join
to
atomically
:: STM (IO b) -> IO (IO b)join
:: IO (IO b) -> IO b
we can compose them as
join
.atomically
:: STM (IO b) -> IO b
The Bounded
class is used to name the upper and lower limits of a
type. Ord
is not a superclass of Bounded
since types that are not
totally ordered may also have upper and lower bounds.
The Bounded
class may be derived for any enumeration type;
minBound
is the first constructor listed in the data
declaration
and maxBound
is the last.
Bounded
may also be derived for single-constructor datatypes whose
constituent types are in Bounded
.
Instances
Bounded All | Since: base-2.1 |
Bounded Any | Since: base-2.1 |
Bounded CBool | |
Bounded CChar | |
Bounded CInt | |
Bounded CIntMax | |
Bounded CIntPtr | |
Bounded CLLong | |
Bounded CLong | |
Bounded CPtrdiff | |
Bounded CSChar | |
Bounded CShort | |
Bounded CSigAtomic | |
Defined in Foreign.C.Types | |
Bounded CSize | |
Bounded CUChar | |
Bounded CUInt | |
Bounded CUIntMax | |
Bounded CUIntPtr | |
Bounded CULLong | |
Bounded CULong | |
Bounded CUShort | |
Bounded CWchar | |
Bounded Associativity | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Bounded DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Bounded SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Bounded SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Bounded Int16 | Since: base-2.1 |
Bounded Int32 | Since: base-2.1 |
Bounded Int64 | Since: base-2.1 |
Bounded Int8 | Since: base-2.1 |
Bounded GeneralCategory | Since: base-2.1 |
Defined in GHC.Unicode | |
Bounded Word16 | Since: base-2.1 |
Bounded Word32 | Since: base-2.1 |
Bounded Word64 | Since: base-2.1 |
Bounded FileType | |
Bounded XdgDirectory | |
Defined in System.Directory.Internal.Common | |
Bounded XdgDirectoryList | |
Defined in System.Directory.Internal.Common | |
Bounded Extension | |
Bounded Ordering | Since: base-2.1 |
Bounded AttrOpTag | |
Bounded Word8 | Since: base-2.1 |
Bounded () | Since: base-2.1 |
Bounded Bool | Since: base-2.1 |
Bounded Char | Since: base-2.1 |
Bounded Int | Since: base-2.1 |
Bounded VecCount | Since: base-4.10.0.0 |
Bounded VecElem | Since: base-4.10.0.0 |
Bounded Word | Since: base-2.1 |
Bounded a => Bounded (Identity a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Down a) | Swaps Since: base-4.14.0.0 |
Bounded a => Bounded (First a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Last a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Max a) | Since: base-4.9.0.0 |
Bounded a => Bounded (Min a) | Since: base-4.9.0.0 |
Bounded m => Bounded (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
Bounded a => Bounded (Dual a) | Since: base-2.1 |
Bounded a => Bounded (Product a) | Since: base-2.1 |
Bounded a => Bounded (Sum a) | Since: base-2.1 |
Bounded (Proxy t) | Since: base-4.7.0.0 |
(Bounded a, Bounded b) => Bounded (Pair a b) | |
(Bounded a, Bounded b) => Bounded (a, b) | Since: base-2.1 |
Bounded a => Bounded (Const a b) | Since: base-4.9.0.0 |
(Applicative f, Bounded a) => Bounded (Ap f a) | Since: base-4.12.0.0 |
Bounded b => Bounded (Tagged s b) | |
(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) | Since: base-2.1 |
(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) | Since: base-2.1 |
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) | Since: base-2.1 |
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) | Since: base-2.1 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
Class Enum
defines operations on sequentially ordered types.
The enumFrom
... methods are used in Haskell's translation of
arithmetic sequences.
Instances of Enum
may be derived for any enumeration type (types
whose constructors have no fields). The nullary constructors are
assumed to be numbered left-to-right by fromEnum
from 0
through n-1
.
See Chapter 10 of the Haskell Report for more details.
For any type that is an instance of class Bounded
as well as Enum
,
the following should hold:
- The calls
andsucc
maxBound
should result in a runtime error.pred
minBound
fromEnum
andtoEnum
should give a runtime error if the result value is not representable in the result type. For example,
is an error.toEnum
7 ::Bool
enumFrom
andenumFromThen
should be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBound
Methods
the successor of a value. For numeric types, succ
adds 1.
the predecessor of a value. For numeric types, pred
subtracts 1.
Convert from an Int
.
Convert to an Int
.
It is implementation-dependent what fromEnum
returns when
applied to a value that is too large to fit in an Int
.
Used in Haskell's translation of [n..]
with [n..] = enumFrom n
,
a possible implementation being enumFrom n = n : enumFrom (succ n)
.
For example:
enumFrom 4 :: [Integer] = [4,5,6,7,...]
enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
with [n,n'..] = enumFromThen n n'
, a possible implementation being
enumFromThen n n' = n : n' : worker (f x) (f x n')
,
worker s v = v : worker s (s v)
, x = fromEnum n' - fromEnum n
and
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
For example:
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m]
with
[n..m] = enumFromTo n m
, a possible implementation being
enumFromTo n m
| n <= m = n : enumFromTo (succ n) m
| otherwise = []
.
For example:
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]
enumFromTo 42 1 :: [Integer] = []
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m]
with
[n,n'..m] = enumFromThenTo n n' m
, a possible implementation
being enumFromThenTo n n' m = worker (f x) (c x) n m
,
x = fromEnum n' - fromEnum n
, c x = bool (>=) ((x 0)
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
and
worker s c v m
| c v m = v : worker s c (s v) m
| otherwise = []
For example:
enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]
enumFromThenTo 6 8 2 :: [Int] = []