Safe Haskell | None |
---|---|
Language | Haskell2010 |
A prelude for NumHask
Synopsis
- (++) :: [a] -> [a] -> [a]
- seq :: a -> b -> b
- filter :: (a -> Bool) -> [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- otherwise :: Bool
- ($) :: (a -> 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
- class Applicative m => Monad (m :: Type -> Type) where
- class Functor (f :: Type -> Type) where
- class Num a where
- signum :: a -> a
- class Eq a => Ord a where
- class Read a
- class (Num a, Ord a) => Real a
- class (RealFrac a, Floating a) => RealFloat a where
- floatRadix :: a -> Integer
- floatDigits :: a -> Int
- floatRange :: a -> (Int, Int)
- decodeFloat :: a -> (Integer, Int)
- encodeFloat :: Integer -> Int -> a
- exponent :: a -> Int
- significand :: a -> a
- scaleFloat :: Int -> a -> a
- isNaN :: a -> Bool
- isInfinite :: a -> Bool
- isDenormalized :: a -> Bool
- isNegativeZero :: a -> Bool
- isIEEE :: a -> Bool
- class (Real a, Fractional a) => RealFrac a
- class Show a
- class Typeable (a :: k)
- class IsString a
- class Functor f => Applicative (f :: Type -> Type) where
- class Foldable (t :: Type -> Type) where
- fold :: Monoid m => t m -> m
- foldMap :: Monoid m => (a -> m) -> t a -> m
- foldr :: (a -> b -> b) -> b -> t a -> b
- foldr' :: (a -> b -> b) -> b -> t a -> b
- foldl :: (b -> a -> b) -> b -> t a -> b
- foldl' :: (b -> a -> b) -> b -> t a -> b
- toList :: t a -> [a]
- null :: t a -> Bool
- length :: t a -> Int
- elem :: Eq a => a -> t a -> Bool
- maximum :: Ord a => t a -> a
- minimum :: Ord a => t a -> a
- 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 where
- class Generic1 (f :: k -> Type)
- class Datatype (d :: k) where
- datatypeName :: t d f a -> [Char]
- moduleName :: t d f a -> [Char]
- packageName :: t d f a -> [Char]
- isNewtype :: t d f a -> Bool
- class Constructor (c :: k) where
- class Selector (s :: k) where
- selName :: t s f a -> [Char]
- selSourceUnpackedness :: t s f a -> SourceUnpackedness
- selSourceStrictness :: t s f a -> SourceStrictness
- selDecidedStrictness :: t s f a -> DecidedStrictness
- class KnownNat (n :: Nat)
- class KnownSymbol (n :: Symbol)
- class IsLabel (x :: Symbol) a where
- fromLabel :: a
- class Semigroup a where
- class Semigroup a => Monoid a where
- class HasField (x :: k) r a | x r -> a where
- getField :: r -> a
- data Bool
- data Char
- data Double = D# Double#
- data Float = F# Float#
- data Int
- data Int8
- data Int16
- data Int32
- data Int64
- data Integer
- data Maybe a
- data Ordering
- type Rational = Ratio Integer
- 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
- type Type = Type
- data Constraint
- data V1 (p :: k) :: forall k. k -> Type
- data U1 (p :: k) :: forall k. k -> Type = U1
- newtype K1 i c (p :: k) :: forall k. Type -> Type -> k -> Type = K1 {
- unK1 :: c
- newtype M1 i (c :: Meta) (f :: k -> Type) (p :: k) :: forall k. Type -> Meta -> (k -> Type) -> k -> Type = M1 {
- unM1 :: f p
- data ((f :: k -> Type) :+: (g :: k -> Type)) (p :: k) :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
- data ((f :: k -> Type) :*: (g :: k -> Type)) (p :: k) :: forall k. (k -> Type) -> (k -> Type) -> k -> Type = (f p) :*: (g p)
- newtype ((f :: k2 -> Type) :.: (g :: k1 -> k2)) (p :: k1) :: forall k2 k1. (k2 -> Type) -> (k1 -> k2) -> k1 -> Type = Comp1 {
- unComp1 :: f (g p)
- type Rec0 = (K1 R :: Type -> k -> Type)
- type D1 = (M1 D :: Meta -> (k -> Type) -> k -> Type)
- type C1 = (M1 C :: Meta -> (k -> Type) -> k -> Type)
- type S1 = (M1 S :: Meta -> (k -> Type) -> k -> Type)
- data family URec a (p :: k) :: Type
- data Nat
- data Symbol
- type family CmpNat (a :: Nat) (b :: Nat) :: Ordering where ...
- class a ~R# b => Coercible (a :: k0) (b :: k0)
- data StaticPtr a
- data CallStack
- 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
- concurrently :: IO a -> IO b -> IO (a, b)
- race_ :: IO a -> IO b -> IO ()
- race :: IO a -> IO b -> IO (Either a b)
- link2 :: Async a -> Async b -> IO ()
- link :: Async a -> IO ()
- waitBoth :: Async a -> Async b -> IO (a, b)
- waitEitherCancel :: Async a -> Async b -> IO (Either a b)
- waitEither_ :: Async a -> Async b -> IO ()
- waitEither :: Async a -> Async b -> IO (Either a b)
- waitEitherCatchCancel :: Async a -> Async b -> IO (Either (Either SomeException a) (Either SomeException b))
- waitEitherCatch :: Async a -> Async b -> IO (Either (Either SomeException a) (Either SomeException b))
- waitAnyCancel :: [Async a] -> IO (Async a, a)
- waitAny :: [Async a] -> IO (Async a, a)
- waitAnyCatchCancel :: [Async a] -> IO (Async a, Either SomeException a)
- waitAnyCatch :: [Async a] -> IO (Async a, Either SomeException a)
- cancelWith :: Exception e => Async a -> e -> IO ()
- cancel :: Async a -> IO ()
- poll :: Async a -> IO (Maybe (Either SomeException a))
- waitCatch :: Async a -> IO (Either SomeException a)
- wait :: Async a -> IO a
- withAsyncOn :: Int -> IO a -> (Async a -> IO b) -> IO b
- withAsyncBound :: IO a -> (Async a -> IO b) -> IO b
- withAsync :: IO a -> (Async a -> IO b) -> IO b
- asyncOn :: Int -> IO a -> IO (Async a)
- asyncBound :: IO a -> IO (Async a)
- async :: IO a -> IO (Async a)
- data Async a
- newtype Concurrently a = Concurrently {
- runConcurrently :: IO a
- integralEnumFromThenTo :: Integral a => a -> a -> a -> [a]
- integralEnumFromTo :: Integral a => a -> a -> [a]
- integralEnumFromThen :: (Integral a, Bounded a) => a -> a -> [a]
- integralEnumFrom :: (Integral a, Bounded a) => a -> [a]
- gcdWord' :: Word -> Word -> Word
- gcdInt' :: Int -> Int -> Int
- (^^%^^) :: Integral a => Rational -> a -> Rational
- (^%^) :: Integral a => Rational -> a -> Rational
- numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a]
- numericEnumFromTo :: (Ord a, Fractional a) => a -> a -> [a]
- numericEnumFromThen :: Fractional a => a -> a -> [a]
- numericEnumFrom :: Fractional a => a -> [a]
- notANumber :: Rational
- ratioPrec1 :: Int
- ratioPrec :: Int
- underflowError :: a
- overflowError :: a
- ratioZeroDenominatorError :: a
- divZeroError :: a
- boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]
- boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
- maxInt :: Int
- minInt :: Int
- conjugate :: Num a => Complex a -> Complex a
- vacuous :: Functor f => f Void -> f a
- absurd :: Void -> a
- data Void
- option :: b -> (a -> b) -> Option a -> b
- mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
- diff :: Semigroup m => m -> Endo m
- cycle1 :: Semigroup m => m -> m
- data WrappedMonoid m
- newtype Option a = Option {}
- 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 :: Type -> Type -> Type) where
- nonEmpty :: [a] -> Maybe (NonEmpty a)
- showStackTrace :: IO (Maybe String)
- getStackTrace :: IO (Maybe [Location])
- data SrcLoc = SrcLoc {
- sourceFile :: String
- sourceLine :: Int
- sourceColumn :: Int
- data Location = Location {
- objectName :: String
- functionName :: String
- srcLoc :: Maybe SrcLoc
- class Monad m => MonadIO (m :: Type -> Type) where
- getArgs :: IO [String]
- exitSuccess :: IO a
- exitFailure :: IO a
- exitWith :: ExitCode -> IO a
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- 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 ZipList a = ZipList {
- getZipList :: [a]
- newtype Identity a = Identity {
- runIdentity :: a
- withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- openFile :: FilePath -> IOMode -> IO Handle
- stderr :: Handle
- stdin :: Handle
- threadDelay :: Int -> 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
- withFrozenCallStack :: HasCallStack => (HasCallStack -> a) -> a
- callStack :: HasCallStack -> CallStack
- allowInterrupt :: IO ()
- catches :: IO a -> [Handler a] -> IO a
- fixST :: (a -> ST s a) -> ST s 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
- 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
- mkWeakThreadId :: ThreadId -> IO (Weak ThreadId)
- threadCapability :: ThreadId -> IO (Int, Bool)
- myThreadId :: IO ThreadId
- killThread :: ThreadId -> IO ()
- setNumCapabilities :: Int -> IO ()
- getNumCapabilities :: IO Int
- forkIO :: IO () -> IO ThreadId
- data STM a
- ioError :: IOError -> IO a
- asyncExceptionFromException :: Exception e => SomeException -> Maybe e
- asyncExceptionToException :: Exception e => e -> SomeException
- data BlockedIndefinitelyOnMVar = BlockedIndefinitelyOnMVar
- data BlockedIndefinitelyOnSTM = BlockedIndefinitelyOnSTM
- data Deadlock = Deadlock
- data AllocationLimitExceeded = AllocationLimitExceeded
- newtype CompactionFailed = CompactionFailed String
- newtype AssertionFailed = AssertionFailed String
- data SomeAsyncException where
- SomeAsyncException :: forall e. Exception e => e -> SomeAsyncException
- data AsyncException
- data ArrayException
- data ExitCode
- stdout :: Handle
- 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
- catch :: Exception e => IO a -> (e -> IO a) -> IO a
- type FilePath = String
- data MaskingState
- data IOException
- prettyCallStack :: CallStack -> String
- prettySrcLoc :: SrcLoc -> String
- data ErrorCall where
- class (Typeable e, Show e) => Exception e where
- toException :: e -> SomeException
- fromException :: SomeException -> Maybe e
- displayException :: e -> String
- data ArithException
- eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)
- cast :: (Typeable a, Typeable b) => a -> Maybe b
- typeRep :: Typeable a => proxy a -> TypeRep
- type TypeRep = SomeTypeRep
- newtype Const a (b :: k) :: forall k. Type -> k -> Type = 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 Ap (f :: k -> Type) (a :: k) :: forall k. (k -> Type) -> k -> Type = Ap {
- getAp :: f a
- stimesMonoid :: (Integral b, Monoid a) => b -> a -> a
- stimesIdempotent :: Integral b => b -> a -> a
- newtype Dual a = Dual {
- getDual :: a
- newtype Endo a = Endo {
- appEndo :: a -> a
- newtype All = All {}
- newtype Any = Any {}
- newtype Alt (f :: k -> Type) (a :: k) :: forall k. (k -> Type) -> k -> Type = Alt {
- getAlt :: f a
- data Fixity
- data FixityI
- data Associativity
- data Meta
- someSymbolVal :: String -> SomeSymbol
- someNatVal :: Integer -> Maybe SomeNat
- symbolVal :: KnownSymbol n => proxy n -> String
- natVal :: KnownNat n => proxy n -> Integer
- data SomeSymbol where
- SomeSymbol :: forall (n :: Symbol). KnownSymbol n => Proxy n -> SomeSymbol
- data SomeNat where
- unfoldr :: (b -> Maybe (a, b)) -> b -> [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]]
- genericReplicate :: Integral i => i -> a -> [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
- transpose :: [[a]] -> [[a]]
- intercalate :: [a] -> [[a]] -> [a]
- intersperse :: a -> [a] -> [a]
- isPrefixOf :: Eq a => [a] -> [a] -> Bool
- 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 -> Type = Proxy
- repr :: (a :~: b) -> Coercion a b
- coerceWith :: Coercion a b -> a -> b
- data Coercion (a :: k) (b :: k) :: forall k. k -> k -> Type where
- gcastWith :: (a :~: b) -> ((a ~ b) -> r) -> r
- castWith :: (a :~: b) -> a -> b
- sym :: (a :~: b) -> b :~: a
- data (a :: k) :~: (b :: k) :: forall k. k -> k -> Type where
- type family (a :: k) == (b :: k) :: Bool where ...
- data WordPtr
- data IntPtr
- data IOMode
- class Storable a
- byteSwap64 :: Word64 -> Word64
- byteSwap32 :: Word32 -> Word32
- byteSwap16 :: Word16 -> Word16
- runST :: (forall s. ST s a) -> 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
- (.&.) :: a -> a -> a
- (.|.) :: a -> a -> a
- xor :: a -> a -> a
- complement :: a -> a
- shift :: a -> Int -> a
- rotate :: a -> Int -> a
- zeroBits :: a
- bit :: Int -> a
- setBit :: a -> Int -> a
- clearBit :: a -> Int -> a
- complementBit :: a -> Int -> a
- testBit :: a -> Int -> Bool
- bitSizeMaybe :: a -> Maybe Int
- bitSize :: a -> Int
- isSigned :: a -> Bool
- shiftL :: a -> Int -> a
- shiftR :: a -> Int -> a
- rotateL :: a -> Int -> a
- rotateR :: a -> Int -> a
- popCount :: a -> Int
- class Bits b => FiniteBits b where
- finiteBitSize :: b -> Int
- countLeadingZeros :: b -> Int
- countTrailingZeros :: b -> Int
- (&) :: 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
- denominator :: Ratio a -> a
- numerator :: Ratio a -> a
- (%) :: Integral a => a -> a -> Ratio a
- chr :: Int -> Char
- unzip :: [(a, b)] -> ([a], [b])
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- reverse :: [a] -> [a]
- break :: (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]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- catMaybes :: [Maybe a] -> [a]
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- fromMaybe :: a -> 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
- 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
- currentCallStack :: IO [String]
- asTypeOf :: a -> a -> a
- until :: (a -> Bool) -> (a -> a) -> a -> a
- flip :: (a -> b -> c) -> b -> a -> c
- (.) :: (b -> c) -> (a -> b) -> a -> c
- const :: a -> b -> a
- ord :: Char -> Int
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- liftA :: Applicative f => (a -> b) -> f a -> f b
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- class Applicative f => Alternative (f :: Type -> Type) where
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
- data NonEmpty a = a :| [a]
- getCallStack :: CallStack -> [([Char], SrcLoc)]
- type HasCallStack = ?callStack :: CallStack
- stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
- data SomeException where
- SomeException :: forall e. Exception e => e -> SomeException
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- data ByteString
- data IntMap a
- data IntSet
- data Map k a
- data Seq a
- data Set a
- force :: NFData a => a -> a
- ($!!) :: NFData a => (a -> b) -> a -> b
- deepseq :: NFData a => a -> b -> b
- class NFData a where
- rnf :: a -> ()
- hashUsing :: Hashable b => (a -> b) -> Int -> a -> Int
- class Hashable a where
- hashWithSalt :: Int -> a -> Int
- hash :: a -> Int
- lift :: (MonadTrans t, Monad m) => m a -> t m a
- gets :: MonadState s m => (s -> a) -> m a
- modify :: MonadState s m => (s -> s) -> m ()
- class Monad m => MonadState s (m :: Type -> Type) | m -> s where
- asks :: MonadReader r m => (r -> a) -> m a
- class Monad m => MonadReader r (m :: Type -> Type) | m -> r where
- class Monad m => MonadError e (m :: Type -> Type) | m -> e where
- throwError :: e -> m a
- catchError :: m a -> (e -> m a) -> m a
- newtype ExceptT e (m :: Type -> Type) a = ExceptT (m (Either e a))
- type Except e = ExceptT e Identity
- runExcept :: Except e a -> Either e a
- mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' b
- withExcept :: (e -> e') -> Except e a -> Except e' a
- runExceptT :: ExceptT e m a -> m (Either e a)
- mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b
- withExceptT :: Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a
- newtype ReaderT r (m :: k -> Type) (a :: k) :: forall k. Type -> (k -> Type) -> k -> Type = ReaderT {
- runReaderT :: r -> m a
- type Reader r = ReaderT r Identity
- runReader :: Reader r a -> r -> a
- newtype StateT s (m :: Type -> Type) a = StateT {
- runStateT :: s -> m (a, s)
- type State s = StateT s Identity
- runState :: State s a -> s -> (a, s)
- evalState :: State s a -> s -> a
- execState :: State s a -> s -> s
- withState :: (s -> s) -> State s a -> State s a
- evalStateT :: Monad m => StateT s m a -> s -> m a
- execStateT :: Monad m => StateT s m a -> s -> m s
- die :: Text -> IO a
- show :: (Show a, StringConv String b) => a -> b
- liftIO2 :: MonadIO m => (a -> b -> IO c) -> a -> b -> m c
- liftIO1 :: MonadIO m => (a -> IO b) -> a -> m b
- guardedA :: (Functor f, Alternative t) => (a -> f Bool) -> a -> f (t a)
- guarded :: Alternative f => (a -> Bool) -> a -> f a
- pass :: Applicative f => f ()
- throwTo :: (MonadIO m, Exception e) => ThreadId -> e -> m ()
- throwIO :: (MonadIO m, Exception e) => e -> m a
- print :: (MonadIO m, Show a) => a -> m ()
- applyN :: Int -> (a -> a) -> a -> a
- unsnoc :: [x] -> Maybe ([x], x)
- uncons :: [a] -> Maybe (a, [a])
- map :: Functor f => (a -> b) -> f a -> f b
- identity :: a -> a
- type LText = Text
- type LByteString = ByteString
- witness :: a
- undefined :: a
- notImplemented :: a
- traceId :: Text -> Text
- traceM :: Monad m => Text -> m ()
- traceShowM :: (Show a, Monad m) => a -> m ()
- traceShowId :: Show a => a -> a
- traceShow :: Show a => a -> b -> b
- traceIO :: Print b => b -> a -> IO a
- trace :: Print b => b -> a -> a
- putErrText :: MonadIO m => Text -> m ()
- putLByteString :: MonadIO m => ByteString -> m ()
- putByteString :: MonadIO m => ByteString -> m ()
- putLText :: MonadIO m => Text -> m ()
- putText :: MonadIO m => Text -> m ()
- class Print a where
- atDef :: a -> [a] -> Int -> a
- atMay :: [a] -> Int -> Maybe a
- foldl1May' :: (a -> a -> a) -> [a] -> Maybe a
- foldl1May :: (a -> a -> a) -> [a] -> Maybe a
- foldr1May :: (a -> a -> a) -> [a] -> Maybe a
- maximumDef :: Ord a => a -> [a] -> a
- minimumDef :: Ord a => a -> [a] -> a
- maximumMay :: Ord a => [a] -> Maybe a
- minimumMay :: Ord a => [a] -> Maybe a
- lastDef :: a -> [a] -> a
- lastMay :: [a] -> Maybe a
- tailSafe :: [a] -> [a]
- tailDef :: [a] -> [a] -> [a]
- tailMay :: [a] -> Maybe [a]
- initSafe :: [a] -> [a]
- initDef :: [a] -> [a] -> [a]
- initMay :: [a] -> Maybe [a]
- headDef :: a -> [a] -> a
- headMay :: [a] -> Maybe a
- panic :: HasCallStack => Text -> a
- data FatalError = FatalError {}
- liftM2' :: Monad m => (a -> b -> c) -> m a -> m b -> m c
- liftM' :: Monad m => (a -> b) -> m a -> m b
- concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
- list :: [b] -> (a -> b) -> [a] -> [b]
- ordNub :: Ord a => [a] -> [a]
- sortOn :: Ord o => (a -> o) -> [a] -> [a]
- head :: Foldable f => f a -> Maybe a
- foreach :: Functor f => f a -> (a -> b) -> f b
- (<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
- tryIO :: MonadIO m => IO a -> ExceptT IOException m a
- note :: MonadError e m => e -> Maybe a -> m a
- hush :: Alternative m => Either e a -> m a
- maybeToEither :: e -> Maybe a -> Either e a
- maybeEmpty :: Monoid b => (a -> b) -> Maybe a -> b
- maybeToLeft :: r -> Maybe l -> Either l r
- maybeToRight :: l -> Maybe r -> Either l r
- rightToMaybe :: Either l r -> Maybe r
- leftToMaybe :: Either l r -> Maybe l
- toSL :: StringConv a b => a -> b
- toS :: StringConv a b => a -> b
- data Leniency
- class StringConv a b where
- (<&&>) :: Applicative a => a Bool -> a Bool -> a Bool
- (&&^) :: Monad m => m Bool -> m Bool -> m Bool
- (<||>) :: Applicative a => a Bool -> a Bool -> a Bool
- (||^) :: Monad m => m Bool -> m Bool -> m Bool
- guardM :: MonadPlus m => m Bool -> m ()
- ifM :: Monad m => m Bool -> m a -> m a -> m a
- unlessM :: Monad m => m Bool -> m () -> m ()
- whenM :: Monad m => m Bool -> m () -> m ()
- bool :: a -> a -> Bool -> a
- ($!) :: (a -> b) -> a -> b
- (<<*>>) :: (Applicative f, Applicative g) => f (g (a -> b)) -> f (g a) -> f (g b)
- liftAA2 :: (Applicative f, Applicative g) => (a -> b -> c) -> f (g a) -> f (g b) -> f (g c)
- purer :: (Applicative f, Applicative g) => a -> f (g a)
- eitherA :: Alternative f => f a -> f b -> f (Either a b)
- orEmpty :: Alternative f => Bool -> a -> f a
- orAlt :: (Alternative f, Monoid a) => f a -> f a
- throwE :: Monad m => e -> ExceptT e m a
- catchE :: Monad m => ExceptT e m a -> (e -> ExceptT e' m a) -> ExceptT e' m a
- data UnicodeException
- type OnDecodeError = OnError Word8 Char
- type OnError a b = String -> Maybe a -> Maybe b
- strictDecode :: OnDecodeError
- lenientDecode :: OnDecodeError
- ignore :: OnError a b
- replace :: b -> OnError a b
- data Text
- decodeUtf8With :: OnDecodeError -> ByteString -> Text
- decodeUtf8 :: ByteString -> Text
- decodeUtf8' :: ByteString -> Either UnicodeException Text
- encodeUtf8 :: Text -> ByteString
- words :: Text -> [Text]
- lines :: Text -> [Text]
- unlines :: [Text] -> Text
- unwords :: [Text] -> Text
- toStrict :: Text -> Text
- fromStrict :: Text -> Text
- readFile :: FilePath -> IO Text
- writeFile :: FilePath -> Text -> IO ()
- appendFile :: FilePath -> Text -> IO ()
- interact :: (Text -> Text) -> IO ()
- getContents :: IO Text
- getLine :: IO Text
- check :: Bool -> STM ()
- fromString :: IsString a => String -> a
- fail :: Monad m => String -> m a
- ifThenElse :: Bool -> a -> a -> a
- fromList :: IsList l => [Item l] -> l
- fromListN :: IsList l => Int -> [Item l] -> l
- module NumHask.Algebra.Abstract.Action
- module NumHask.Algebra.Abstract.Additive
- module NumHask.Algebra.Abstract.Field
- module NumHask.Algebra.Abstract.Group
- module NumHask.Algebra.Abstract.Lattice
- module NumHask.Algebra.Abstract.Module
- module NumHask.Algebra.Abstract.Multiplicative
- module NumHask.Algebra.Abstract.Ring
- module NumHask.Algebra.Linear.Hadamard
- module NumHask.Analysis.Metric
- module NumHask.Data.Complex
- module NumHask.Data.Integral
- module NumHask.Data.LogField
- module NumHask.Data.Rational
- module NumHask.Data.Pair
- module NumHask.Data.Positive
- data Natural
- module NumHask.Exception
Backend
NumHask imports Protolude as the prelude and replaces much of the Num
heirarchy in base.
Usage of Semigroup
and Monoid
has been avoided to retain basic compatability.
(++) :: [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]
($) :: (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 $ True where foo :: Bool -> Int#
is well-typed
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.
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
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..]
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] = []
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
.
The Haskell Report defines no laws for Eq
. However, ==
is customarily
expected to implement an equivalence relationship where two values comparing
equal are indistinguishable by "public" functions, with a "public" function
being one not allowing to see implementation details. For example, for a
type representing non-normalised natural numbers modulo 100, a "public"
function doesn't make the difference between 1 and 201. It is expected to
have the following properties:
Instances
Eq Bool | |
Eq Char | |
Eq Double | Note that due to the presence of
Also note that
|
Eq Float | Note that due to the presence of
Also note that
|
Eq Int | |
Eq Int8 | Since: base-2.1 |
Eq Int16 | Since: base-2.1 |
Eq Int32 | Since: base-2.1 |
Eq Int64 | Since: base-2.1 |
Eq Integer | |
Eq Natural | Since: base-4.8.0.0 |
Eq Ordering | |
Eq Word | |
Eq Word8 | Since: base-2.1 |
Eq Word16 | Since: base-2.1 |
Eq Word32 | Since: base-2.1 |
Eq Word64 | Since: base-2.1 |
Eq SomeTypeRep | |
Defined in Data.Typeable.Internal (==) :: SomeTypeRep -> SomeTypeRep -> Bool # (/=) :: SomeTypeRep -> SomeTypeRep -> Bool # | |
Eq () | |
Eq TyCon | |
Eq Module | |
Eq TrName | |
Eq Handle | Since: base-4.1.0.0 |
Eq ThreadId | Since: base-4.2.0.0 |
Eq AsyncCancelled | |
Defined in Control.Concurrent.Async (==) :: AsyncCancelled -> AsyncCancelled -> Bool # (/=) :: AsyncCancelled -> AsyncCancelled -> Bool # | |
Eq BigNat | |
Eq Void | Since: base-4.8.0.0 |
Eq SpecConstrAnnotation | Since: base-4.3.0.0 |
Defined in GHC.Exts (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # | |
Eq Version | Since: base-2.1 |
Eq BlockReason | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync (==) :: BlockReason -> BlockReason -> Bool # (/=) :: BlockReason -> BlockReason -> Bool # | |
Eq ThreadStatus | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync (==) :: ThreadStatus -> ThreadStatus -> Bool # (/=) :: ThreadStatus -> ThreadStatus -> Bool # | |
Eq CDev | |
Eq CIno | |
Eq CMode | |
Eq COff | |
Eq CPid | |
Eq CSsize | |
Eq CGid | |
Eq CNlink | |
Eq CUid | |
Eq CCc | |
Eq CSpeed | |
Eq CTcflag | |
Eq CRLim | |
Eq CBlkSize | |
Eq CBlkCnt | |
Eq CClockId | |
Eq CFsBlkCnt | |
Eq CFsFilCnt | |
Eq CId | |
Eq CKey | |
Eq CTimer | |
Eq Fd | |
Eq AsyncException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool # | |
Eq ArrayException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool # | |
Eq ExitCode | |
Eq IOErrorType | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception (==) :: IOErrorType -> IOErrorType -> Bool # (/=) :: IOErrorType -> IOErrorType -> Bool # | |
Eq BufferMode | Since: base-4.2.0.0 |
Defined in GHC.IO.Handle.Types (==) :: BufferMode -> BufferMode -> Bool # (/=) :: BufferMode -> BufferMode -> Bool # | |
Eq Newline | Since: base-4.2.0.0 |
Eq NewlineMode | Since: base-4.2.0.0 |
Defined in GHC.IO.Handle.Types (==) :: NewlineMode -> NewlineMode -> Bool # (/=) :: NewlineMode -> NewlineMode -> Bool # | |
Eq MaskingState | Since: base-4.3.0.0 |
Defined in GHC.IO (==) :: MaskingState -> MaskingState -> Bool # (/=) :: MaskingState -> MaskingState -> Bool # | |
Eq IOException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception (==) :: IOException -> IOException -> Bool # (/=) :: IOException -> IOException -> Bool # | |
Eq ErrorCall | Since: base-4.7.0.0 |
Eq ArithException | Since: base-3.0 |
Defined in GHC.Exception.Type (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool # | |
Eq All | Since: base-2.1 |
Eq Any | Since: base-2.1 |
Eq Fixity | Since: base-4.6.0.0 |
Eq Associativity | Since: base-4.6.0.0 |
Defined in GHC.Generics (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
Eq SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
Eq SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
Eq DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
Eq SomeSymbol | Since: base-4.7.0.0 |
Defined in GHC.TypeLits (==) :: SomeSymbol -> SomeSymbol -> Bool # (/=) :: SomeSymbol -> SomeSymbol -> Bool # | |
Eq SomeNat | Since: base-4.7.0.0 |
Eq CChar | |
Eq CSChar | |
Eq CUChar | |
Eq CShort | |
Eq CUShort | |
Eq CInt | |
Eq CUInt | |
Eq CLong | |
Eq CULong | |
Eq CLLong | |
Eq CULLong | |
Eq CBool | |
Eq CFloat | |
Eq CDouble | |
Eq CPtrdiff | |
Eq CSize | |
Eq CWchar | |
Eq CSigAtomic | |
Defined in Foreign.C.Types (==) :: CSigAtomic -> CSigAtomic -> Bool # (/=) :: CSigAtomic -> CSigAtomic -> Bool # | |
Eq CClock | |
Eq CTime | |
Eq CUSeconds | |
Eq CSUSeconds | |
Defined in Foreign.C.Types (==) :: CSUSeconds -> CSUSeconds -> Bool # (/=) :: CSUSeconds -> CSUSeconds -> Bool # | |
Eq CIntPtr | |
Eq CUIntPtr | |
Eq CIntMax | |
Eq CUIntMax | |
Eq WordPtr | |
Eq IntPtr | |
Eq IOMode | Since: base-4.2.0.0 |
Eq SrcLoc | Since: base-4.9.0.0 |
Eq ByteString | |
Defined in Data.ByteString.Lazy.Internal (==) :: ByteString -> ByteString -> Bool # (/=) :: ByteString -> ByteString -> Bool # | |
Eq ByteString | |
Defined in Data.ByteString.Internal (==) :: ByteString -> ByteString -> Bool # (/=) :: ByteString -> ByteString -> Bool # | |
Eq IntSet | |
Eq Leniency | |
Eq UnicodeException | |
Defined in Data.Text.Encoding.Error (==) :: UnicodeException -> UnicodeException -> Bool # (/=) :: UnicodeException -> UnicodeException -> Bool # | |
Eq CodePoint | |
Eq DecoderState | |
Eq a => Eq [a] | |
Eq a => Eq (Maybe a) | Since: base-2.1 |
Eq a => Eq (Ratio a) | Since: base-2.1 |
Eq (StablePtr a) | Since: base-2.1 |
Eq (Ptr a) | Since: base-2.1 |
Eq (FunPtr a) | |
Eq p => Eq (Par1 p) | Since: base-4.7.0.0 |
Eq (Async a) | |
Eq a => Eq (Complex a) | Since: base-2.1 |
Eq a => Eq (Min a) | Since: base-4.9.0.0 |
Eq a => Eq (Max a) | Since: base-4.9.0.0 |
Eq a => Eq (First a) | Since: base-4.9.0.0 |
Eq a => Eq (Last a) | Since: base-4.9.0.0 |
Eq m => Eq (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # | |
Eq a => Eq (Option a) | Since: base-4.9.0.0 |
Eq (Chan a) | Since: base-4.4.0.0 |
Eq a => Eq (ZipList a) | Since: base-4.7.0.0 |
Eq a => Eq (Identity a) | Since: base-4.8.0.0 |
Eq (TVar a) | Since: base-4.8.0.0 |
Eq a => Eq (First a) | Since: base-2.1 |
Eq a => Eq (Last a) | Since: base-2.1 |
Eq a => Eq (Dual a) | Since: base-2.1 |
Eq a => Eq (Sum a) | Since: base-2.1 |
Eq a => Eq (Product a) | Since: base-2.1 |
Eq a => Eq (Down a) | Since: base-4.6.0.0 |
Eq (MVar a) | Since: base-4.1.0.0 |
Eq a => Eq (NonEmpty a) | Since: base-4.9.0.0 |
Eq a => Eq (IntMap a) | |
Eq a => Eq (Tree a) | |
Eq a => Eq (Seq a) | |
Eq a => Eq (ViewL a) | |
Eq a => Eq (ViewR a) | |
Eq a => Eq (Set a) | |
Eq a => Eq (Hashed a) | Uses precomputed hash to detect inequality faster |
Eq a => Eq (Positive a) | |
Eq a => Eq (LogField a) | |
Eq a => Eq (Pair a) | |
(Eq a, Additive a) => Eq (Ratio a) | |
Eq a => Eq (Complex a) | |
(Eq a, Eq b) => Eq (Either a b) | Since: base-2.1 |
Eq (V1 p) | Since: base-4.9.0.0 |
Eq (U1 p) | Since: base-4.9.0.0 |
Eq (TypeRep a) | Since: base-2.1 |
(Eq a, Eq b) => Eq (a, b) | |
Eq a => Eq (Arg a b) | Since: base-4.9.0.0 |
Eq (Proxy s) | Since: base-4.7.0.0 |
(Eq k, Eq a) => Eq (Map k a) | |
Eq (f p) => Eq (Rec1 f p) | Since: base-4.7.0.0 |
Eq (URec (Ptr ()) p) | Since: base-4.9.0.0 |
Eq (URec Char p) | Since: base-4.9.0.0 |
Eq (URec Double p) | Since: base-4.9.0.0 |
Eq (URec Float p) | |
Eq (URec Int p) | Since: base-4.9.0.0 |
Eq (URec Word p) | Since: base-4.9.0.0 |
(Eq a, Eq b, Eq c) => Eq (a, b, c) | |
Eq a => Eq (Const a b) | Since: base-4.9.0.0 |
Eq (f a) => Eq (Ap f a) | Since: base-4.12.0.0 |
Eq (f a) => Eq (Alt f a) | Since: base-4.8.0.0 |
Eq (Coercion a b) | Since: base-4.7.0.0 |
Eq (a :~: b) | Since: base-4.7.0.0 |
(Eq e, Eq1 m, Eq a) => Eq (ErrorT e m a) | |
(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a) | |
Eq c => Eq (K1 i c p) | Since: base-4.7.0.0 |
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | Since: base-4.7.0.0 |
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | Since: base-4.7.0.0 |
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) | Since: base-4.9.0.0 |
(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) | Since: base-4.9.0.0 |
Eq (a :~~: b) | Since: base-4.10.0.0 |
Eq (f p) => Eq (M1 i c f p) | Since: base-4.7.0.0 |
Eq (f (g p)) => Eq ((f :.: g) p) | Since: base-4.7.0.0 |
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) | Since: base-4.9.0.0 |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
class Fractional a => Floating a where #
Trigonometric and hyperbolic functions and related functions.
The Haskell Report defines no laws for Floating
. However, '(+)', '(*)'
and exp
are customarily expected to define an exponential field and have
the following properties:
exp (a + b)
= @exp a * exp bexp (fromInteger 0)
=fromInteger 1
computes log1p
x
, but provides more precise
results for small (absolute) values of log
(1 + x)x
if possible.
Since: base-4.9.0.0
computes expm1
x
, but provides more precise
results for small (absolute) values of exp
x - 1x
if possible.
Since: base-4.9.0.0
Instances
class Num a => Fractional a #
Fractional numbers, supporting real division.
The Haskell Report defines no laws for Fractional
. However, '(+)' and
'(*)' are customarily expected to define a division ring and have the
following properties:
recip
gives the multiplicative inversex * recip x
=recip x * x
=fromInteger 1
Note that it isn't customarily expected that a type instance of
Fractional
implement a field. However, all instances in base
do.
fromRational, (recip | (/))
Instances
Fractional CFloat | |
Fractional CDouble | |
Integral a => Fractional (Ratio a) | Since: base-2.0.1 |
RealFloat a => Fractional (Complex a) | Since: base-2.1 |
Fractional a => Fractional (Identity a) | Since: base-4.9.0.0 |
Fractional a => Fractional (Const a b) | Since: base-4.9.0.0 |
class Applicative m => Monad (m :: Type -> Type) where #
The Monad
class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do
expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad
should satisfy the following laws:
Furthermore, the Monad
and Applicative
operations should relate as follows:
The above laws imply:
and that pure
and (<*>
) satisfy the applicative functor laws.
The instances of Monad
for lists, Maybe
and IO
defined in the Prelude satisfy these laws.
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Inject a value into the monadic type.
Instances
Monad [] | Since: base-2.1 |
Monad Maybe | Since: base-2.1 |
Monad IO | Since: base-2.1 |
Monad Par1 | Since: base-4.9.0.0 |
Monad Complex | Since: base-4.9.0.0 |
Monad Min | Since: base-4.9.0.0 |
Monad Max | Since: base-4.9.0.0 |
Monad First | Since: base-4.9.0.0 |
Monad Last | Since: base-4.9.0.0 |
Monad Option | Since: base-4.9.0.0 |
Monad Identity | Since: base-4.8.0.0 |
Monad STM | Since: base-4.3.0.0 |
Monad First | Since: base-4.8.0.0 |
Monad Last | Since: base-4.8.0.0 |
Monad Dual | Since: base-4.8.0.0 |
Monad Sum | Since: base-4.8.0.0 |
Monad Product | Since: base-4.8.0.0 |
Monad Down | Since: base-4.11.0.0 |
Monad ReadP | Since: base-2.1 |
Monad NonEmpty | Since: base-4.9.0.0 |
Monad Tree | |
Monad Seq | |
Monad Pair | |
Monad P | Since: base-2.1 |
Monad (Either e) | Since: base-4.4.0.0 |
Monad (U1 :: Type -> Type) | Since: base-4.9.0.0 |
Monoid a => Monad ((,) a) | Since: base-4.9.0.0 |
Monad (ST s) | Since: base-2.1 |
Monad m => Monad (WrappedMonad m) | Since: base-4.7.0.0 |
Defined in Control.Applicative (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a # | |
Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Monad f => Monad (Rec1 f) | Since: base-4.9.0.0 |
Monad f => Monad (Ap f) | Since: base-4.12.0.0 |
Monad f => Monad (Alt f) | Since: base-4.8.0.0 |
(Applicative f, Monad f) => Monad (WhenMissing f x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal (>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b # (>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b # return :: a -> WhenMissing f x a # fail :: String -> WhenMissing f x a # | |
(Monad m, Error e) => Monad (ErrorT e m) | |
Monad m => Monad (ExceptT e m) | |
Monad m => Monad (StateT s m) | |
Monad ((->) r :: Type -> Type) | Since: base-2.1 |
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0 |
(Monad f, Monad g) => Monad (Product f g) | Since: base-4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal (>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b # (>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b # return :: a -> WhenMatched f x y a # fail :: String -> WhenMatched f x y a # | |
(Applicative f, Monad f) => Monad (WhenMissing f k x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal (>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b # (>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # return :: a -> WhenMissing f k x a # fail :: String -> WhenMissing f k x a # | |
Monad m => Monad (ReaderT r m) | |
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal (>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b # (>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # return :: a -> WhenMatched f k x y a # fail :: String -> WhenMatched f k x y a # |
class Functor (f :: Type -> Type) where #
The Functor
class is used for types that can be mapped over.
Instances of Functor
should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor
for lists, Maybe
and IO
satisfy these laws.