Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Bool
- data Char
- data Double
- data Float
- data Int
- data Word
- data Ordering
- data Maybe a
- class a ~# b => (a :: k) ~ (b :: k)
- data Integer
- class Generic a
- class Show a where
- 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 (Real a, Fractional a) => RealFrac a where
- class (Real a, Enum a) => Integral a where
- class Read a where
- data IO a
- class Eq a => Ord a where
- type String = [Char]
- type Rational = Ratio Integer
- class Num a => Fractional a where
- (/) :: a -> a -> a
- recip :: a -> a
- fromRational :: Rational -> a
- class (Num a, Ord a) => Real a where
- toRational :: a -> Rational
- class Eq a where
- class Semigroup a => Monoid a where
- class Semigroup a where
- (<>) :: a -> a -> a
- class Functor f => Applicative (f :: Type -> Type) where
- class Functor (f :: Type -> Type) where
- class Applicative m => Monad (m :: Type -> Type) where
- data ByteString
- data Text
- data Either a b
- class Foldable (t :: Type -> Type) where
- foldMap :: Monoid m => (a -> m) -> t a -> m
- foldr :: (a -> b -> b) -> b -> t a -> b
- foldl :: (b -> a -> b) -> b -> t a -> b
- foldr1 :: (a -> a -> a) -> t a -> a
- foldl1 :: (a -> a -> a) -> 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
- sum :: Num a => t a -> a
- product :: Num a => t a -> a
- class Monad m => MonadFail (m :: Type -> Type) where
- 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 (Typeable e, Show e) => Exception e where
- toException :: e -> SomeException
- fromException :: SomeException -> Maybe e
- displayException :: e -> String
- type IOError = IOException
- class Monad m => MonadIO (m :: Type -> Type) where
- class Fractional a => Floating a where
- class Num a where
- class (RealFrac a, Floating a) => RealFloat a where
- floatRadix :: a -> Integer
- floatDigits :: a -> Int
- floatRange :: a -> (Int, Int)
- decodeFloat :: a -> (Integer, Int)
- encodeFloat :: Integer -> Int -> a
- exponent :: a -> Int
- significand :: a -> a
- scaleFloat :: Int -> a -> a
- isNaN :: a -> Bool
- isInfinite :: a -> Bool
- isDenormalized :: a -> Bool
- isNegativeZero :: a -> Bool
- isIEEE :: a -> Bool
- atan2 :: a -> a -> a
- type ShowS = String -> String
- type ReadS a = String -> [(a, String)]
- type FilePath = String
- type Reader r = ReaderT r Identity
- class (forall (m :: Type -> Type). Monad m => Monad (t m)) => MonadTrans (t :: (Type -> Type) -> Type -> Type) where
- class MonadIO m => MonadUnliftIO (m :: Type -> Type)
- newtype ReaderT r (m :: Type -> Type) a = ReaderT {
- runReaderT :: r -> m a
- class ToLogStr msg where
- data LogStr
- type Lens' s a = Lens s s a a
- class Monad m => MonadReader r (m :: Type -> Type) | m -> r where
- data Loc = Loc {}
- newtype LoggingT (m :: Type -> Type) a = LoggingT {}
- newtype WriterLoggingT (m :: Type -> Type) a = WriterLoggingT {
- unWriterLoggingT :: m (a, DList LogLine)
- type LogLine = (Loc, LogSource, LogLevel, LogStr)
- newtype NoLoggingT (m :: Type -> Type) a = NoLoggingT {
- runNoLoggingT :: m a
- class (MonadLogger m, MonadIO m) => MonadLoggerIO (m :: Type -> Type) where
- class Monad m => MonadLogger (m :: Type -> Type) where
- monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> m ()
- type LogSource = Text
- data LogLevel
- realToFrac :: (Real a, Fractional b) => a -> b
- fromIntegral :: (Integral a, Num b) => a -> b
- ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- otherwise :: Bool
- (++) :: [a] -> [a] -> [a]
- map :: (a -> b) -> [a] -> [b]
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- filter :: (a -> Bool) -> [a] -> [a]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- when :: Applicative f => Bool -> f () -> f ()
- fromMaybe :: a -> Maybe a -> a
- catMaybes :: [Maybe a] -> [a]
- void :: Functor f => f a -> f ()
- id :: a -> a
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
- guard :: Alternative f => Bool -> f ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- takeWhile :: (a -> Bool) -> [a] -> [a]
- take :: Int -> [a] -> [a]
- read :: Read a => String -> a
- (.) :: (b -> c) -> (a -> b) -> a -> c
- const :: a -> b -> a
- error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- even :: Integral a => a -> Bool
- fst :: (a, b) -> a
- readMaybe :: Read a => String -> Maybe a
- uncurry :: (a -> b -> c) -> (a, b) -> c
- head :: HasCallStack => [a] -> a
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- throwIO :: (MonadIO m, Exception e) => e -> m a
- catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
- writeFile :: FilePath -> String -> IO ()
- getLine :: IO String
- putStrLn :: String -> IO ()
- (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
- (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- cycle :: HasCallStack => [a] -> [a]
- concat :: Foldable t => t [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- print :: Show a => a -> IO ()
- first :: Bifunctor p => (a -> b) -> p a c -> p b c
- second :: Bifunctor p => (b -> c) -> p a b -> p a c
- (^) :: (Num a, Integral b) => a -> b -> a
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- errorWithoutStackTrace :: forall (r :: RuntimeRep) (a :: TYPE r). [Char] -> a
- undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- flip :: (a -> b -> c) -> b -> a -> c
- ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- until :: (a -> Bool) -> (a -> a) -> a -> a
- asTypeOf :: a -> a -> a
- subtract :: Num a => a -> a -> a
- maybe :: b -> (a -> b) -> Maybe a -> b
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- listToMaybe :: [a] -> Maybe a
- tail :: HasCallStack => [a] -> [a]
- last :: HasCallStack => [a] -> a
- init :: HasCallStack => [a] -> [a]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- iterate :: (a -> a) -> a -> [a]
- repeat :: a -> [a]
- replicate :: Int -> a -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- drop :: Int -> [a] -> [a]
- splitAt :: Int -> [a] -> ([a], [a])
- span :: (a -> Bool) -> [a] -> ([a], [a])
- break :: (a -> Bool) -> [a] -> ([a], [a])
- reverse :: [a] -> [a]
- and :: Foldable t => t Bool -> Bool
- or :: Foldable t => t Bool -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- (!!) :: HasCallStack => [a] -> Int -> a
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- unzip :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- shows :: Show a => a -> ShowS
- showChar :: Char -> ShowS
- showString :: String -> ShowS
- showParen :: Bool -> ShowS -> ShowS
- odd :: Integral a => a -> Bool
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- gcd :: Integral a => a -> a -> a
- lcm :: Integral a => a -> a -> a
- snd :: (a, b) -> b
- curry :: ((a, b) -> c) -> a -> b -> c
- lex :: ReadS String
- readParen :: Bool -> ReadS a -> ReadS a
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- reads :: Read a => ReadS a
- for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- lines :: String -> [String]
- unlines :: [String] -> String
- words :: String -> [String]
- unwords :: [String] -> String
- userError :: String -> IOError
- ioError :: IOError -> IO a
- putChar :: Char -> IO ()
- putStr :: String -> IO ()
- getChar :: IO Char
- getContents :: IO String
- interact :: (String -> String) -> IO ()
- readFile :: FilePath -> IO String
- appendFile :: FilePath -> String -> IO ()
- readLn :: Read a => IO a
- readIO :: Read a => String -> IO a
- pack :: String -> Text
- unpack :: Text -> String
- view :: MonadReader s m => Getting a s a -> m a
- fromLogStr :: LogStr -> ByteString
- lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
- logDebug :: (HasCallStack, MonadLogger m) => Text -> m ()
- logInfo :: (HasCallStack, MonadLogger m) => Text -> m ()
- logWarn :: (HasCallStack, MonadLogger m) => Text -> m ()
- logError :: (HasCallStack, MonadLogger m) => Text -> m ()
- logOther :: (HasCallStack, MonadLogger m) => LogLevel -> Text -> m ()
- logDebugSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()
- logInfoSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()
- logWarnSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()
- logErrorSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()
- logOtherSH :: (HasCallStack, MonadLogger m, Show a) => LogLevel -> a -> m ()
- liftLoc :: Loc -> Q Exp
- logDebugS :: Q Exp
- logInfoS :: Q Exp
- logWarnS :: Q Exp
- logErrorS :: Q Exp
- logOtherS :: Q Exp
- runWriterLoggingT :: Functor m => WriterLoggingT m a -> m (a, [LogLine])
- execWriterLoggingT :: Functor m => WriterLoggingT m a -> m [LogLine]
- defaultOutput :: Handle -> Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- defaultLogStr :: Loc -> LogSource -> LogLevel -> LogStr -> LogStr
- runFileLoggingT :: MonadBaseControl IO m => FilePath -> LoggingT m a -> m a
- runStderrLoggingT :: MonadIO m => LoggingT m a -> m a
- runStdoutLoggingT :: MonadIO m => LoggingT m a -> m a
- runChanLoggingT :: MonadIO m => Chan LogLine -> LoggingT m a -> m a
- unChanLoggingT :: (MonadLogger m, MonadIO m) => Chan LogLine -> m void
- withChannelLogger :: forall (m :: Type -> Type) a. (MonadBaseControl IO m, MonadIO m) => Int -> LoggingT m a -> LoggingT m a
- filterLogger :: forall (m :: Type -> Type) a. (LogSource -> LogLevel -> Bool) -> LoggingT m a -> LoggingT m a
- mapLoggingT :: (m a -> n b) -> LoggingT m a -> LoggingT n b
- mapNoLoggingT :: (m a -> n b) -> NoLoggingT m a -> NoLoggingT n b
- defaultLoc :: Loc
- logWithoutLoc :: (MonadLogger m, ToLogStr msg) => LogSource -> LogLevel -> msg -> m ()
- logDebugN :: MonadLogger m => Text -> m ()
- logInfoN :: MonadLogger m => Text -> m ()
- logWarnN :: MonadLogger m => Text -> m ()
- logErrorN :: MonadLogger m => Text -> m ()
- logOtherN :: MonadLogger m => LogLevel -> Text -> m ()
- logDebugNS :: MonadLogger m => LogSource -> Text -> m ()
- logInfoNS :: MonadLogger m => LogSource -> Text -> m ()
- logWarnNS :: MonadLogger m => LogSource -> Text -> m ()
- logErrorNS :: MonadLogger m => LogSource -> Text -> m ()
- logOtherNS :: MonadLogger m => LogSource -> LogLevel -> Text -> m ()
- logDebugCS :: MonadLogger m => CallStack -> Text -> m ()
- logInfoCS :: MonadLogger m => CallStack -> Text -> m ()
- logWarnCS :: MonadLogger m => CallStack -> Text -> m ()
- logErrorCS :: MonadLogger m => CallStack -> Text -> m ()
- logOtherCS :: MonadLogger m => CallStack -> LogLevel -> Text -> m ()
Documentation
Instances
The character type Char
is an enumeration whose values represent
Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see
http://www.unicode.org/ for details). This set extends the ISO 8859-1
(Latin-1) character set (the first 256 characters), which is itself an extension
of the ASCII character set (the first 128 characters). A character literal in
Haskell has type Char
.
To convert a Char
to or from the corresponding Int
value defined
by Unicode, use toEnum
and fromEnum
from the
Enum
class respectively (or equivalently ord
and
chr
).
Instances
Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
Instances
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Instances
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]
.
The exact range for a given implementation can be determined by using
minBound
and maxBound
from the Bounded
class.
Instances
Instances
Instances
FromJSON Ordering | |
Defined in Data.Aeson.Types.FromJSON | |
ToJSON Ordering | |
Monoid Ordering | Since: base-2.1 |
Semigroup Ordering | Since: base-4.9.0.0 |
Bounded Ordering | Since: base-2.1 |
Enum Ordering | Since: base-2.1 |
Generic Ordering | |
Read Ordering | Since: base-2.1 |
Show Ordering | Since: base-2.1 |
NFData Ordering | |
Defined in Control.DeepSeq | |
Eq Ordering | |
Ord Ordering | |
Defined in GHC.Classes | |
Hashable Ordering | |
Defined in Data.Hashable.Class | |
type Rep Ordering | Since: base-4.6.0.0 |
The Maybe
type encapsulates an optional value. A value of type
either contains a value of type Maybe
aa
(represented as
),
or it is empty (represented as Just
aNothing
). Using Maybe
is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as error
.
The Maybe
type is also a monad. It is a simple kind of error
monad, where all errors are represented by Nothing
. A richer
error monad can be built using the Either
type.
Instances
FromJSON1 Maybe | |
ToJSON1 Maybe | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> Maybe a -> Value # liftToJSONList :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> [Maybe a] -> Value # liftToEncoding :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> Maybe a -> Encoding # liftToEncodingList :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> [Maybe a] -> Encoding # liftOmitField :: (a -> Bool) -> Maybe a -> Bool # | |
MonadFail Maybe | Since: base-4.9.0.0 |
Defined in Control.Monad.Fail | |
Foldable Maybe | Since: base-2.1 |
Defined in Data.Foldable fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # | |
Traversable Maybe | Since: base-2.1 |
Alternative Maybe | Picks the leftmost Since: base-2.1 |
Applicative Maybe | Since: base-2.1 |
Functor Maybe | Since: base-2.1 |
Monad Maybe | Since: base-2.1 |
MonadPlus Maybe | Picks the leftmost Since: base-2.1 |
MonadFailure Maybe | |
NFData1 Maybe | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Hashable1 Maybe | |
Defined in Data.Hashable.Class | |
Generic1 Maybe | |
MonadBaseControl Maybe Maybe | |
Lift a => Lift (Maybe a :: Type) | |
FromJSON a => FromJSON (Maybe a) | |
Defined in Data.Aeson.Types.FromJSON | |
ToJSON a => ToJSON (Maybe a) | |
Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner Since: base-2.1 |
Semigroup a => Semigroup (Maybe a) | Since: base-4.9.0.0 |
Generic (Maybe a) | |
SingKind a => SingKind (Maybe a) | Since: base-4.9.0.0 |
Defined in GHC.Generics type DemoteRep (Maybe a) | |
Read a => Read (Maybe a) | Since: base-2.1 |
Show a => Show (Maybe a) | Since: base-2.1 |
NFData a => NFData (Maybe a) | |
Defined in Control.DeepSeq | |
Eq a => Eq (Maybe a) | Since: base-2.1 |
Ord a => Ord (Maybe a) | Since: base-2.1 |
Hashable a => Hashable (Maybe a) | |
Defined in Data.Hashable.Class | |
SingI ('Nothing :: Maybe a) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Each (Maybe a) (Maybe b) a b | |
SingI a2 => SingI ('Just a2 :: Maybe a1) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
type Failure Maybe | |
Defined in Basement.Monad | |
type Rep1 Maybe | Since: base-4.6.0.0 |
type StM Maybe a | |
Defined in Control.Monad.Trans.Control | |
type DemoteRep (Maybe a) | |
Defined in GHC.Generics | |
type Rep (Maybe a) | Since: base-4.6.0.0 |
Defined in GHC.Generics | |
data Sing (b :: Maybe a) | |
class a ~# b => (a :: k) ~ (b :: k) infix 4 #
Lifted, homogeneous equality. By lifted, we mean that it
can be bogus (deferred type error). By homogeneous, the two
types a
and b
must have the same kinds.
Arbitrary precision integers. In contrast with fixed-size integral types
such as Int
, the Integer
type represents the entire infinite range of
integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (fit into an Int
), IS
constructor is used.
Otherwise Integer
and IN
constructors are used to store a BigNat
representing respectively the positive or the negative value magnitude.
Invariant: Integer
and IN
are used iff value doesn't fit in IS
Instances
Representable types of kind *
.
This class is derivable in GHC with the DeriveGeneric
flag on.
A Generic
instance must satisfy the following laws:
from
.to
≡id
to
.from
≡id