Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- module Bio.Base
- (++) :: [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
- 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 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
- class Semigroup a => Monoid a where
- data Bool
- data Char
- data Double
- data Float
- data Int
- data Int8
- data Int16
- data Int32
- data Int64
- data Integer
- data Maybe a
- data Ordering
- 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
- data TyCon
- data ForeignPtr a
- data Handle
- data ST s a
- forkOnWithUnmask :: Int -> ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkIOWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkOn :: Int -> IO () -> IO ThreadId
- forkOS :: IO () -> IO ThreadId
- data ThreadId = ThreadId ThreadId#
- isSpace :: Char -> Bool
- isAlpha :: Char -> Bool
- isDigit :: Char -> Bool
- read :: Read a => String -> a
- type String = [Char]
- class Applicative f => Alternative (f :: * -> *) where
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
- 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
- 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
- data ConstrRep
- type ConIndex = Int
- data Fixity
- 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
- 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
- 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
- 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
- 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
- forkIO :: IO () -> IO ThreadId
- disableAllocationLimit :: IO ()
- enableAllocationLimit :: IO ()
- getAllocationCounter :: IO Int64
- setAllocationCounter :: Int64 -> IO ()
- reportHeapOverflow :: IO ()
- data BlockReason
- data ThreadStatus
- 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
- 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
- data AsyncException
- data ArrayException
- data FixIOException = FixIOException
- data ExitCode
- data IOErrorType
- 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)
- 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
- userError :: String -> IOError
- data IOException = IOError {}
- type IOError = IOException
- throw :: Exception e => e -> a
- class (Typeable e, Show e) => Exception e where
- data ErrorCall where
- data ArithException
- 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
- newtype First a = First {}
- newtype Last a = Last {}
- newtype Dual a = Dual {
- getDual :: a
- newtype Endo a = Endo {
- appEndo :: a -> a
- newtype All = All {}
- newtype Any = Any {}
- 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
- 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
- data Proxy (t :: k) :: forall k. k -> * = Proxy
- (>>>) :: 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
- data (a :: k1) :~~: (b :: k2) :: forall k1 k2. k1 -> k2 -> * where
- 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
- isSymbol :: Char -> Bool
- isPunctuation :: Char -> Bool
- isHexDigit :: Char -> Bool
- isOctDigit :: 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
- 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
- undefined :: HasCallStack => a
- errorWithoutStackTrace :: [Char] -> a
- error :: HasCallStack => [Char] -> a
- data SomeException where
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- data NonEmpty a = a :| [a]
- class Semigroup a where
- hPrint :: Show a => Handle -> a -> IO ()
- stderr :: Handle
- stdin :: Handle
- hPutStrLn :: Handle -> String -> IO ()
- hPutStr :: Handle -> String -> IO ()
- stdout :: Handle
- module System.Posix.Files
- module System.Posix.IO
- module System.Posix.Types
- type Bytes = ByteString
- type LazyBytes = ByteString
- data HashMap k v
- data HashSet a
- data IntMap a
- data IntSet
- data Text
- type LazyText = Text
- data Pair a b = !a :!: !b
- decodeBytes :: Bytes -> Text
- encodeBytes :: Text -> Bytes
- class Hashable a where
- class Unpack s where
- fdGet :: Int -> Fd -> IO Bytes
- fdPut :: Fd -> Bytes -> IO ()
- fdPutLazy :: Fd -> LazyBytes -> IO ()
- withFd :: FilePath -> OpenMode -> Maybe FileMode -> OpenFileFlags -> (Fd -> IO a) -> IO a
Documentation
module Bio.Base
(++) :: [a] -> [a] -> [a] infixr 5 #
Append two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
If the first list is not finite, the result is the first list.
The value of seq a b
is bottom if a
is bottom, and
otherwise equal to b
. In other words, it evaluates the first
argument a
to weak head normal form (WHNF). seq
is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression seq a b
does
not guarantee that a
will be evaluated before b
.
The only guarantee given by seq
is that the both a
and b
will be evaluated before seq
returns a value.
In particular, this means that b
may be evaluated before
a
. If you need to guarantee a specific order of evaluation,
you must use the function pseq
from the "parallel" package.
filter :: (a -> Bool) -> [a] -> [a] #
filter
, applied to a predicate and a list, returns the list of
those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]
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]])
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.
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
.
assertError :: (?callStack :: CallStack) => Bool -> 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.
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
. However, $
x)$
has
low, right-associative binding precedence, so it sometimes allows
parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
,
or map
($
0) xs
.zipWith
($
) fs xs
fromIntegral :: (Integral a, Num b) => a -> b #
general coercion from integral types
realToFrac :: (Real a, Fractional b) => a -> b #
general coercion to fractional types
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)
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.
The Bounded
class is used to name the upper and lower limits of a
type. Ord
is not a superclass of Bounded
since types that are not
totally ordered may also have upper and lower bounds.
The Bounded
class may be derived for any enumeration type;
minBound
is the first constructor listed in the data
declaration
and maxBound
is the last.
Bounded
may also be derived for single-constructor datatypes whose
constituent types are in Bounded
.
Instances
Class Enum
defines operations on sequentially ordered types.
The enumFrom
... methods are used in Haskell's translation of
arithmetic sequences.
Instances of Enum
may be derived for any enumeration type (types
whose constructors have no fields). The nullary constructors are
assumed to be numbered left-to-right by fromEnum
from 0
through n-1
.
See Chapter 10 of the Haskell Report for more details.
For any type that is an instance of class Bounded
as well as Enum
,
the following should hold:
- The calls
andsucc
maxBound
should result in a runtime error.pred
minBound
fromEnum
andtoEnum
should give a runtime error if the result value is not representable in the result type. For example,
is an error.toEnum
7 ::Bool
enumFrom
andenumFromThen
should be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBound
the successor of a value. For numeric types, succ
adds 1.
the predecessor of a value. For numeric types, pred
subtracts 1.
Convert from an Int
.
Convert to an Int
.
It is implementation-dependent what fromEnum
returns when
applied to a value that is too large to fit in an Int
.
Used in Haskell's translation of [n..]
.
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
.
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m]
.
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m]
.
Instances
The Eq
class defines equality (==
) and inequality (/=
).
All the basic datatypes exported by the Prelude are instances of Eq
,
and Eq
may be derived for any datatype whose constituents are also
instances of Eq
.