Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module CorePrelude
- undefined :: HasCallStack => a
- (++) :: Monoid m => m -> m -> m
- class Semigroup a where
- data WrappedMonoid m :: * -> *
- module Data.Functor
- module Control.Applicative
- (<&&>) :: Applicative a => a Bool -> a Bool -> a Bool
- (<||>) :: Applicative a => a Bool -> a Bool -> a Bool
- module Control.Monad
- whenM :: Monad m => m Bool -> m () -> m ()
- unlessM :: Monad m => m Bool -> m () -> m ()
- module UnliftIO
- alwaysSTM :: STM Bool -> STM ()
- alwaysSucceedsSTM :: STM a -> STM ()
- orElseSTM :: STM a -> STM a -> STM a
- module Data.Mutable
- module Control.Concurrent.STM.TBChan
- module Control.Concurrent.STM.TBMChan
- module Control.Concurrent.STM.TBMQueue
- module Control.Concurrent.STM.TMChan
- module Control.Concurrent.STM.TMQueue
- primToPrim :: (PrimBase m1, PrimMonad m2, (~) * (PrimState m1) (PrimState m2)) => m1 a -> m2 a
- primToIO :: (PrimBase m, (~) * (PrimState m) RealWorld) => m a -> IO a
- primToST :: PrimBase m => m a -> ST (PrimState m) a
- module Data.Primitive.MutVar
- trace :: String -> a -> a
- traceShow :: Show a => a -> b -> b
- traceId :: String -> String
- traceM :: Monad m => String -> m ()
- traceShowId :: Show a => a -> a
- traceShowM :: (Show a, Monad m) => a -> m ()
- module Data.Time
- class Generic a
- newtype Identity a :: * -> * = Identity {
- runIdentity :: a
- class Monad m => MonadReader r (m :: * -> *) | m -> r where
- ask :: MonadReader r m => m r
- asks :: MonadReader r m => (r -> a) -> m a
- newtype ReaderT k r (m :: k -> *) (a :: k) :: forall k. * -> (k -> *) -> k -> * = ReaderT {
- runReaderT :: r -> m a
- type Reader r = ReaderT * r Identity
- module Data.Foldable
- module Data.Traversable
- module Data.Bifunctor
- module Data.MonoTraversable
- module Data.MonoTraversable.Unprefixed
- module Data.Sequences
- module Data.Containers
- module Data.Builder
- module Data.NonNull
- toByteVector :: ByteString -> SVector Word8
- fromByteVector :: SVector Word8 -> ByteString
- module Say
- yieldThread :: MonadIO m => m ()
- waitAsync :: MonadIO m => Async a -> m a
- pollAsync :: MonadIO m => Async a -> m (Maybe (Either SomeException a))
- waitCatchAsync :: MonadIO m => Async a -> m (Either SomeException a)
- linkAsync :: MonadIO m => Async a -> m ()
- link2Async :: MonadIO m => Async a -> Async b -> m ()
- map :: Functor f => (a -> b) -> f a -> f b
- readMay :: (Element c ~ Char, MonoFoldable c, Read a) => c -> Maybe a
- zip :: Zip f => forall a b. f a -> f b -> f (a, b)
- zip3 :: Zip3 f => forall a b c. f a -> f b -> f c -> f (a, b, c)
- zip4 :: Zip4 f => forall a b c d. f a -> f b -> f c -> f d -> f (a, b, c, d)
- zip5 :: Zip5 f => forall a b c d e. f a -> f b -> f c -> f d -> f e -> f (a, b, c, d, e)
- zip6 :: Zip6 f => forall a b c d e g. f a -> f b -> f c -> f d -> f e -> f g -> f (a, b, c, d, e, g)
- zip7 :: Zip7 f => forall a b c d e g h. f a -> f b -> f c -> f d -> f e -> f g -> f h -> f (a, b, c, d, e, g, h)
- unzip :: Zip f => forall a b. f (a, b) -> (f a, f b)
- unzip3 :: Zip3 f => forall a b c. f (a, b, c) -> (f a, f b, f c)
- unzip4 :: Zip4 f => forall a b c d. f (a, b, c, d) -> (f a, f b, f c, f d)
- unzip5 :: Zip5 f => forall a b c d e. f (a, b, c, d, e) -> (f a, f b, f c, f d, f e)
- unzip6 :: Zip6 f => forall a b c d e g. f (a, b, c, d, e, g) -> (f a, f b, f c, f d, f e, f g)
- unzip7 :: Zip7 f => forall a b c d e g h. f (a, b, c, d, e, g, h) -> (f a, f b, f c, f d, f e, f g, f h)
- zipWith :: Zip f => forall a b c. (a -> b -> c) -> f a -> f b -> f c
- zipWith3 :: Zip3 f => forall a b c d. (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- zipWith4 :: Zip4 f => forall a b c d e. (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e
- zipWith5 :: Zip5 f => forall a b c d e g. (a -> b -> c -> d -> e -> g) -> f a -> f b -> f c -> f d -> f e -> f g
- zipWith6 :: Zip6 f => forall a b c d e g h. (a -> b -> c -> d -> e -> g -> h) -> f a -> f b -> f c -> f d -> f e -> f g -> f h
- zipWith7 :: Zip7 f => forall a b c d e g h i. (a -> b -> c -> d -> e -> g -> h -> i) -> f a -> f b -> f c -> f d -> f e -> f g -> f h -> f i
- hashNub :: (Hashable a, Eq a) => [a] -> [a]
- ordNub :: Ord a => [a] -> [a]
- ordNubBy :: Ord b => (a -> b) -> (a -> a -> Bool) -> [a] -> [a]
- sortWith :: (Ord a, IsSequence c) => (Element c -> a) -> c -> c
- repeat :: a -> [a]
- (\\) :: SetContainer a => a -> a -> a
- intersect :: SetContainer a => a -> a -> a
- class Show a where
- tshow :: Show a => a -> Text
- tlshow :: Show a => a -> LText
- charToLower :: Char -> Char
- charToUpper :: Char -> Char
- readFile :: MonadIO m => FilePath -> m ByteString
- readFileUtf8 :: MonadIO m => FilePath -> m Text
- writeFile :: MonadIO m => FilePath -> ByteString -> m ()
- writeFileUtf8 :: MonadIO m => FilePath -> Text -> m ()
- hGetContents :: MonadIO m => Handle -> m ByteString
- hPut :: MonadIO m => Handle -> ByteString -> m ()
- hGetChunk :: MonadIO m => Handle -> m ByteString
- print :: (Show a, MonadIO m) => a -> m ()
- putChar :: MonadIO m => Char -> m ()
- putStr :: MonadIO m => Text -> m ()
- putStrLn :: MonadIO m => Text -> m ()
- getChar :: MonadIO m => m Char
- getLine :: MonadIO m => m Text
- getContents :: MonadIO m => m LText
- interact :: MonadIO m => (LText -> LText) -> m ()
- data DList a :: * -> *
- asDList :: DList a -> DList a
- applyDList :: DList a -> [a] -> [a]
- module Control.DeepSeq
- asByteString :: ByteString -> ByteString
- asLByteString :: LByteString -> LByteString
- asHashMap :: HashMap k v -> HashMap k v
- asHashSet :: HashSet a -> HashSet a
- asText :: Text -> Text
- asLText :: LText -> LText
- asList :: [a] -> [a]
- asMap :: Map k v -> Map k v
- asIntMap :: IntMap v -> IntMap v
- asMaybe :: Maybe a -> Maybe a
- asSet :: Set a -> Set a
- asIntSet :: IntSet -> IntSet
- asVector :: Vector a -> Vector a
- asUVector :: UVector a -> UVector a
- asSVector :: SVector a -> SVector a
- asString :: [Char] -> [Char]
CorePrelude
module CorePrelude
undefined :: HasCallStack => a Source #
Deprecated: It is highly recommended that you either avoid partial functions or provide meaningful error messages
We define our own undefined
which is marked as deprecated. This makes it
useful to use during development, but lets you more easily get
notifications if you accidentally ship partial code in production.
The classy prelude recommendation for when you need to really have a partial
function in production is to use error
with a very descriptive message so
that, in case an exception is thrown, you get more information than
Prelude.
.undefined
Since 0.5.5
Standard
Monoid
Semigroup
The class of semigroups (types with an associative binary operation).
Since: 4.9.0.0
(<>) :: a -> a -> a infixr 6 #
An associative operation.
(a<>
b)<>
c = a<>
(b<>
c)
If a
is also a Monoid
we further require
(<>
) =mappend
Reduce a non-empty list with <>
The default definition should be sufficient, but this can be overridden for efficiency.
stimes :: Integral b => b -> a -> a #
Repeat a value n
times.
Given that this works on a Semigroup
it is allowed to fail if
you request 0 or fewer repetitions, and the default definition
will do so.
By making this a member of the class, idempotent semigroups and monoids can
upgrade this to execute in O(1) by picking
stimes = stimesIdempotent
or stimes = stimesIdempotentMonoid
respectively.
Semigroup Ordering | Since: 4.9.0.0 |
Semigroup () | Since: 4.9.0.0 |
Semigroup Void | Since: 4.9.0.0 |
Semigroup Event | Since: 4.10.0.0 |
Semigroup Lifetime | Since: 4.10.0.0 |
Semigroup All | Since: 4.9.0.0 |
Semigroup Any | Since: 4.9.0.0 |
Semigroup IntSet | |
Semigroup ByteString | |
Semigroup ShortByteString | |
Semigroup ByteString | |
Semigroup Doc | |
Semigroup [a] | Since: 4.9.0.0 |
Semigroup a => Semigroup (Maybe a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (IO a) | Since: 4.10.0.0 |
Semigroup a => Semigroup (Concurrently a) | Only defined by Since: 2.1.0 |
Ord a => Semigroup (Min a) | Since: 4.9.0.0 |
Ord a => Semigroup (Max a) | Since: 4.9.0.0 |
Semigroup (First a) | Since: 4.9.0.0 |
Semigroup (Last a) | Since: 4.9.0.0 |
Monoid m => Semigroup (WrappedMonoid m) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Option a) | Since: 4.9.0.0 |
Semigroup (NonEmpty a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Identity a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Dual a) | Since: 4.9.0.0 |
Semigroup (Endo a) | Since: 4.9.0.0 |
Num a => Semigroup (Sum a) | Since: 4.9.0.0 |
Num a => Semigroup (Product a) | Since: 4.9.0.0 |
Semigroup (First a) | Since: 4.9.0.0 |
Semigroup (Last a) | Since: 4.9.0.0 |
Semigroup (Vector a) | |
(Hashable a, Eq a) => Semigroup (HashSet a) | |
Ord a => Semigroup (Set a) | |
Semigroup (Seq a) | |
Semigroup (IntMap a) | |
Semigroup (DList a) | |
(Semigroup mono, GrowingAppend mono) => Semigroup (NonNull mono) | |
Semigroup (Doc a) | |
Storable a => Semigroup (Vector a) | |
Prim a => Semigroup (Vector a) | |
Semigroup b => Semigroup (a -> b) | Since: 4.9.0.0 |
Semigroup (Either a b) | Since: 4.9.0.0 |
(Semigroup a, Semigroup b) => Semigroup (a, b) | Since: 4.9.0.0 |
Semigroup (Proxy k s) | Since: 4.9.0.0 |
(Eq k, Hashable k) => Semigroup (HashMap k v) | |
Ord k => Semigroup (Map k v) | |
Apply f => Semigroup (Act f a) | |
(MonadUnliftIO m, Semigroup a) => Semigroup (Concurrently m a) | Only defined by Since: 0.1.0.0 |
(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Const k a b) | Since: 4.9.0.0 |
Alternative f => Semigroup (Alt * f a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Tagged k s a) | |
(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) | Since: 4.9.0.0 |
(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) | Since: 4.9.0.0 |
data WrappedMonoid m :: * -> * #
Provide a Semigroup for an arbitrary Monoid.
NFData1 WrappedMonoid | Since: 1.4.3.0 |
Bounded m => Bounded (WrappedMonoid m) | |
Enum a => Enum (WrappedMonoid a) | Since: 4.9.0.0 |
Eq m => Eq (WrappedMonoid m) | |
Data m => Data (WrappedMonoid m) | |
Ord m => Ord (WrappedMonoid m) | |
Read m => Read (WrappedMonoid m) | |
Show m => Show (WrappedMonoid m) | |
Generic (WrappedMonoid m) | |
Monoid m => Semigroup (WrappedMonoid m) | Since: 4.9.0.0 |
Monoid m => Monoid (WrappedMonoid m) | Since: 4.9.0.0 |
Hashable a => Hashable (WrappedMonoid a) | |
NFData m => NFData (WrappedMonoid m) | Since: 1.4.2.0 |
Generic1 * WrappedMonoid | |
type Rep (WrappedMonoid m) | |
type Rep1 * WrappedMonoid | |
Functor
module Data.Functor
Applicative
module Control.Applicative
(<&&>) :: Applicative a => a Bool -> a Bool -> a Bool infixr 3 Source #
&&
lifted to an Applicative.
Since: 0.12.8
(<||>) :: Applicative a => a Bool -> a Bool -> a Bool infixr 2 Source #
||
lifted to an Applicative.
Since: 0.12.8
Monad
module Control.Monad
whenM :: Monad m => m Bool -> m () -> m () Source #
Only perform the action if the predicate returns True
.
Since 0.9.2
unlessM :: Monad m => m Bool -> m () -> m () Source #
Only perform the action if the predicate returns False
.
Since 0.9.2
UnliftIO reexports
module UnliftIO
Mutable references
alwaysSucceedsSTM :: STM a -> STM () Source #
Synonym for alwaysSucceeds
.
module Data.Mutable
STM Channels
Primitive (exported since 0.9.4)
primToPrim :: (PrimBase m1, PrimMonad m2, (~) * (PrimState m1) (PrimState m2)) => m1 a -> m2 a #
Convert a PrimBase
to another monad with the same state token.
module Data.Primitive.MutVar
Debugging
trace :: String -> a -> a Source #
Warning: Leaving traces in the code
We define our own trace
(and also its variants) which provides a warning
when used. So that tracing is available during development, but the compiler
reminds you to not leave them in the code for production.
traceShowId :: Show a => a -> a Source #
Warning: Leaving traces in the code
Since 0.5.9
traceShowM :: (Show a, Monad m) => a -> m () Source #
Warning: Leaving traces in the code
Since 0.5.9
Time (since 0.6.1)
module Data.Time
Generics (since 0.8.1)
Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.
Transformers (since 0.9.4)
newtype Identity a :: * -> * #
Identity functor and monad. (a non-strict monad)
Since: 4.8.0.0
Identity | |
|
class Monad m => MonadReader r (m :: * -> *) | m -> r where #
See examples in Control.Monad.Reader.
Note, the partially applied function type (->) r
is a simple reader monad.
See the instance
declaration below.
MonadReader r m => MonadReader r (MaybeT m) | |
MonadReader r m => MonadReader r (ListT m) | |
(Representable f, (~) * (Rep f) a) => MonadReader a (Co f) | |
(Monoid w, MonadReader r m) => MonadReader r (WriterT w m) | |
(Monoid w, MonadReader r m) => MonadReader r (WriterT w m) | |
MonadReader r m => MonadReader r (StateT s m) | |
MonadReader r m => MonadReader r (StateT s m) | |
MonadReader r m => MonadReader r (IdentityT * m) | |
MonadReader r m => MonadReader r (ExceptT e m) | |
(Error e, MonadReader r m) => MonadReader r (ErrorT e m) | |
Monad m => MonadReader r (ReaderT * r m) | |
MonadReader r ((->) LiftedRep LiftedRep r) | |
MonadReader r' m => MonadReader r' (ContT * r m) | |
(Monad m, Monoid w) => MonadReader r (RWST r w s m) | |
(Monad m, Monoid w) => MonadReader r (RWST r w s m) | |
ask :: MonadReader r m => m r #
Retrieves the monad environment.
:: MonadReader r m | |
=> (r -> a) | The selector function to apply to the environment. |
-> m a |
Retrieves a function of the current environment.
newtype ReaderT k r (m :: k -> *) (a :: k) :: forall k. * -> (k -> *) -> k -> * #
The reader monad transformer, which adds a read-only environment to the given monad.
The return
function ignores the environment, while >>=
passes
the inherited environment to both subcomputations.
ReaderT | |
|
Monad m => MonadReader r (ReaderT * r m) | |
MonadTrans (ReaderT * r) | |
Monad m => Monad (ReaderT * r m) | |
Functor m => Functor (ReaderT * r m) | |
MonadFix m => MonadFix (ReaderT * r m) | |
MonadFail m => MonadFail (ReaderT * r m) | |
Applicative m => Applicative (ReaderT * r m) | |
Representable m => Representable (ReaderT * e m) | |
MonadZip m => MonadZip (ReaderT * r m) | |
MonadIO m => MonadIO (ReaderT * r m) | |
Alternative m => Alternative (ReaderT * r m) | |
MonadPlus m => MonadPlus (ReaderT * r m) | |
Zip m => Zip (ReaderT * e m) | |
Keyed m => Keyed (ReaderT * e m) | |
Zip m => Zip (ReaderT * e m) | |
ZipWithKey m => ZipWithKey (ReaderT * e m) | |
Indexable m => Indexable (ReaderT * e m) | |
Lookup m => Lookup (ReaderT * e m) | |
PrimMonad m => PrimMonad (ReaderT * r m) | |
Apply m => Apply (ReaderT * e m) | |
Bind m => Bind (ReaderT * e m) | |
Functor m => MonoFunctor (ReaderT * r m a) | |
Applicative m => MonoPointed (ReaderT * r m a) | |
type Rep (ReaderT * e m) | |
type Key (ReaderT * e m) | |
type PrimState (ReaderT * r m) | |
type Element (ReaderT * r m a) | |
type Reader r = ReaderT * r Identity #
The parameterizable reader monad.
Computations are functions of a shared environment.
The return
function ignores the environment, while >>=
passes
the inherited environment to both subcomputations.
Poly hierarchy
module Data.Foldable
module Data.Traversable
Bifunctor (since 0.10.0)
module Data.Bifunctor
Mono hierarchy
module Data.MonoTraversable
module Data.Sequences
module Data.Containers
module Data.Builder
module Data.NonNull
toByteVector :: ByteString -> SVector Word8 Source #
Convert a ByteString
into a storable Vector
.
fromByteVector :: SVector Word8 -> ByteString Source #
Convert a storable Vector
into a ByteString
.
I/O
module Say
Concurrency
yieldThread :: MonadIO m => m () Source #
Originally yield
.
waitCatchAsync :: MonadIO m => Async a -> m (Either SomeException a) Source #
waitCatchSTM
for any MonadIO
Since: 1.0.0
Non-standard
List-like classes
zip6 :: Zip6 f => forall a b c d e g. f a -> f b -> f c -> f d -> f e -> f g -> f (a, b, c, d, e, g) #
zip7 :: Zip7 f => forall a b c d e g h. f a -> f b -> f c -> f d -> f e -> f g -> f h -> f (a, b, c, d, e, g, h) #
unzip7 :: Zip7 f => forall a b c d e g h. f (a, b, c, d, e, g, h) -> (f a, f b, f c, f d, f e, f g, f h) #
zipWith4 :: Zip4 f => forall a b c d e. (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e #
zipWith5 :: Zip5 f => forall a b c d e g. (a -> b -> c -> d -> e -> g) -> f a -> f b -> f c -> f d -> f e -> f g #
zipWith6 :: Zip6 f => forall a b c d e g h. (a -> b -> c -> d -> e -> g -> h) -> f a -> f b -> f c -> f d -> f e -> f g -> f h #
zipWith7 :: Zip7 f => forall a b c d e g h i. (a -> b -> c -> d -> e -> g -> h -> i) -> f a -> f b -> f c -> f d -> f e -> f g -> f h -> f i #
ordNubBy :: Ord b => (a -> b) -> (a -> a -> Bool) -> [a] -> [a] Source #
sortWith :: (Ord a, IsSequence c) => (Element c -> a) -> c -> c Source #
Sort elements using the user supplied function to project something out of each element. Inspired by http://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Exts.html#v:sortWith.
Set-like
(\\) :: SetContainer a => a -> a -> a infixl 9 Source #
An alias for difference
.
intersect :: SetContainer a => a -> a -> a Source #
An alias for intersection
.
Text-like
Conversion of values to readable String
s.
Derived instances of Show
have the following properties, which
are compatible with derived instances of Read
:
- The result of
show
is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used. - If the constructor is defined to be an infix operator, then
showsPrec
will produce infix applications of the constructor. - the representation will be enclosed in parentheses if the
precedence of the top-level constructor in
x
is less thand
(associativity is ignored). Thus, ifd
is0
then the result is never surrounded in parentheses; ifd
is11
it is always surrounded in parentheses, unless it is an atomic expression. - If the constructor is defined using record syntax, then
show
will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a
the derived instance of Show
is equivalent to
instance (Show a) => Show (Tree a) where showsPrec d (Leaf m) = showParen (d > app_prec) $ showString "Leaf " . showsPrec (app_prec+1) m where app_prec = 10 showsPrec d (u :^: v) = showParen (d > up_prec) $ showsPrec (up_prec+1) u . showString " :^: " . showsPrec (up_prec+1) v where up_prec = 5
Note that right-associativity of :^:
is ignored. For example,
produces the stringshow
(Leaf 1 :^: Leaf 2 :^: Leaf 3)"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"
.
:: Int | the operator precedence of the enclosing
context (a number from |
-> a | the value to be converted to a |
-> ShowS |
Convert a value to a readable String
.
showsPrec
should satisfy the law
showsPrec d x r ++ s == showsPrec d x (r ++ s)
Derived instances of Read
and Show
satisfy the following:
That is, readsPrec
parses the string produced by
showsPrec
, and delivers the value that showsPrec
started with.
Show Bool | |
Show Char | Since: 2.1 |
Show Int | Since: 2.1 |
Show Int8 | Since: 2.1 |
Show Int16 | Since: 2.1 |
Show Int32 | Since: 2.1 |
Show Int64 | Since: 2.1 |
Show Integer | Since: 2.1 |
Show Natural | Since: 4.8.0.0 |
Show Ordering | |
Show Word | Since: 2.1 |
Show Word8 | Since: 2.1 |
Show Word16 | Since: 2.1 |
Show Word32 | Since: 2.1 |
Show Word64 | Since: 2.1 |
Show CallStack | Since: 4.9.0.0 |
Show SomeTypeRep | Since: 4.10.0.0 |
Show Exp | |
Show Match | |
Show Clause | |
Show Pat | |
Show Type | |
Show Dec | |
Show Name | |
Show FunDep | |
Show TyVarBndr | |
Show InjectivityAnn | |
Show Overlap | |
Show DerivStrategy | |
Show () | |
Show TyCon | Since: 2.1 |
Show Module | Since: 4.9.0.0 |
Show TrName | Since: 4.9.0.0 |
Show Handle | Since: 4.1.0.0 |
Show ThreadId | Since: 4.2.0.0 |
Show HandleType | Since: 4.1.0.0 |
Show Void | Since: 4.8.0.0 |
Show Version | |
Show BlockReason | |
Show ThreadStatus | |
Show BlockedIndefinitelyOnMVar | Since: 4.1.0.0 |
Show BlockedIndefinitelyOnSTM | Since: 4.1.0.0 |
Show Deadlock | Since: 4.1.0.0 |
Show AllocationLimitExceeded | Since: 4.7.1.0 |
Show CompactionFailed | Since: 4.10.0.0 |
Show AssertionFailed | Since: 4.1.0.0 |
Show SomeAsyncException | Since: 4.7.0.0 |
Show AsyncException | Since: 4.1.0.0 |
Show ArrayException | Since: 4.1.0.0 |
Show ExitCode | |
Show IOErrorType | Since: 4.1.0.0 |
Show BufferMode | |
Show Newline | |
Show NewlineMode | |
Show MaskingState | |
Show IOException | Since: 4.1.0.0 |
Show ErrorCall | Since: 4.0.0.0 |
Show ArithException | Since: 4.0.0.0 |
Show Fixity | |
Show Associativity | |
Show SourceUnpackedness | |
Show SourceStrictness | |
Show DecidedStrictness | |
Show WordPtr | |
Show IntPtr | |
Show GeneralCategory | |
Show SomeException | Since: 3.0 |
Show SrcLoc | |
Show IntSet | |
Show ByteString | |
Show ShortByteString | |
Show ByteString | |
Show Extension | |
Show ForeignSrcLang | |
Show NullError | |
Show Doc | |
Show TextDetails | |
Show Style | |
Show Mode | |
Show ModName | |
Show PkgName | |
Show Module | |
Show OccName | |
Show NameFlavour | |
Show NameSpace | |
Show Loc | |
Show Info | |
Show ModuleInfo | |
Show Fixity | |
Show FixityDirection | |
Show Lit | |
Show Body | |
Show Guard | |
Show Stmt | |
Show Range | |
Show DerivClause | |
Show TypeFamilyHead | |
Show TySynEqn | |
Show FamFlavour | |
Show Foreign | |
Show Callconv | |
Show Safety | |
Show Pragma | |
Show Inline | |
Show RuleMatch | |
Show Phases | |
Show RuleBndr | |
Show AnnTarget | |
Show SourceUnpackedness | |
Show SourceStrictness | |
Show DecidedStrictness | |
Show Con | |
Show Bang | |
Show PatSynDir | |
Show PatSynArgs | |
Show FamilyResultSig | |
Show TyLit | |
Show Role | |
Show AnnLookup | |
Show Padding | |
Show DateFormatSpec | |
Show ZonedTime | |
Show LocalTime | |
Show a => Show [a] | Since: 2.1 |
Show a => Show (Maybe a) | |
Show a => Show (Ratio a) | Since: 2.0.1 |
Show (Ptr a) | Since: 2.1 |
Show (FunPtr a) | Since: 2.1 |
Show p => Show (Par1 p) | |
Show (ForeignPtr a) | Since: 2.1 |
HasResolution a => Show (Fixed a) | Since: 2.1 |
Show a => Show (Min a) | |
Show a => Show (Max a) | |
Show a => Show (First a) | |
Show a => Show (Last a) | |
Show m => Show (WrappedMonoid m) | |
Show a => Show (Option a) | |
Show a => Show (NonEmpty a) | |
Show a => Show (ZipList a) | |
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the
Since: 4.8.0.0 |
Show a => Show (Down a) | |
Show a => Show (Vector a) | |
Show a => Show (HashSet a) | |
Show a => Show (Set a) | |
Show a => Show (Seq a) | |
Show a => Show (IntMap a) | |
Show a => Show (Tree a) | |
Show a => Show (ViewL a) | |
Show a => Show (ViewR a) | |
Show a => Show (DList a) | |
Show a => Show (Hashed a) | |
Show mono => Show (NonNull mono) | |
Show (Doc a) | |
Show a => Show (AnnotDetails a) | |
Show a => Show (Span a) | |
(Show a, Storable a) => Show (Vector a) | |
(Show a, Prim a) => Show (Vector a) | |
(Show b, Show a) => Show (Either a b) | |
Show (V1 k p) | |
Show (U1 k p) | Since: 4.9.0.0 |
Show (TypeRep k a) | |
(Show a, Show b) => Show (a, b) | Since: 2.1 |
Show (ST s a) | Since: 2.1 |
(Show b, Show a) => Show (Arg a b) | |
Show (Proxy k s) | Since: 4.7.0.0 |
(Show k, Show v) => Show (HashMap k v) | |
(Show k, Show a) => Show (Map k a) | |
(Show1 m, Show a) => Show (ListT m a) | |
(Show1 m, Show a) => Show (MaybeT m a) | |
Show (f p) => Show (Rec1 k f p) | |
Show (URec k Char p) | |
Show (URec k Double p) | |
Show (URec k Float p) | |
Show (URec k Int p) | |
Show (URec k Word p) | |
(Show a, Show b, Show c) => Show (a, b, c) | Since: 2.1 |
Show a => Show (Const k a b) | This instance would be equivalent to the derived instances of the
Since: 4.8.0.0 |
Show ((:~:) k a b) | |
Show (p a a) => Show (Join k p a) | |
(Show1 f, Show a) => Show (IdentityT * f a) | |
(Show e, Show1 m, Show a) => Show (ErrorT e m a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
Show b => Show (Tagged k s b) | |
Show c => Show (K1 k i c p) | |
(Show (g p), Show (f p)) => Show ((:+:) k f g p) | |
(Show (g p), Show (f p)) => Show ((:*:) k f g p) | |
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) | Since: 2.1 |
(Show1 f, Show1 g, Show a) => Show (Product * f g a) | Since: 4.9.0.0 |
(Show1 f, Show1 g, Show a) => Show (Sum * f g a) | Since: 4.9.0.0 |
Show ((:~~:) k1 k2 a b) | Since: 4.10.0.0 |
Show (f p) => Show (M1 k i c f p) | |
Show (f (g p)) => Show ((:.:) k2 k1 f g p) | |
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) | Since: 2.1 |
(Show1 f, Show1 g, Show a) => Show (Compose * * f g a) | Since: 4.9.0.0 |
Show (p a b) => Show (WrappedBifunctor k1 k2 p a b) | |
Show (g b) => Show (Joker k2 k1 g a b) | |
Show (p b a) => Show (Flip k1 k2 p a b) | |
Show (f a) => Show (Clown k1 k2 f a b) | |
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | Since: 2.1 |
(Show (q a b), Show (p a b)) => Show (Sum k1 k2 p q a b) | |
(Show (g a b), Show (f a b)) => Show (Product k1 k2 f g a b) | |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) | Since: 2.1 |
Show (f (p a b)) => Show (Tannen k1 k2 k3 f p a b) | |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) | Since: 2.1 |
Show (p (f a) (g b)) => Show (Biff k1 k2 k3 k4 p f g a b) | |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | Since: 2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | Since: 2.1 |
Case conversion
charToLower :: Char -> Char Source #
Convert a character to lower case.
Character-based case conversion is lossy in comparison to string-based toLower
.
For instance, İ will be converted to i, instead of i̇.
charToUpper :: Char -> Char Source #
Convert a character to upper case.
Character-based case conversion is lossy in comparison to string-based toUpper
.
For instance, ß won't be converted to SS.
IO
readFile :: MonadIO m => FilePath -> m ByteString Source #
Strictly read a file into a ByteString
.
Since: 1.2.0
readFileUtf8 :: MonadIO m => FilePath -> m Text Source #
Strictly read a file into a Text
using a UTF-8 character
encoding. In the event of a character encoding error, a Unicode
replacement character will be used (a.k.a., lenientDecode
).
Since: 1.2.0
writeFile :: MonadIO m => FilePath -> ByteString -> m () Source #
Write a ByteString
to a file.
Since: 1.2.0
writeFileUtf8 :: MonadIO m => FilePath -> Text -> m () Source #
Write a Text
to a file using a UTF-8 character encoding.
Since: 1.2.0
hGetContents :: MonadIO m => Handle -> m ByteString Source #
Strictly read the contents of the given Handle
into a
ByteString
.
Since: 1.2.0
hPut :: MonadIO m => Handle -> ByteString -> m () Source #
Write a ByteString
to the given Handle
.
Since: 1.2.0
hGetChunk :: MonadIO m => Handle -> m ByteString Source #
Read a single chunk of data as a ByteString
from the given
Handle
.
Under the surface, this uses hGetSome
with the
default chunk size.
Since: 1.2.0
putChar :: MonadIO m => Char -> m () Source #
Write a character to stdout
Uses system locale settings
Since: 1.3.1
putStr :: MonadIO m => Text -> m () Source #
Write a Text to stdout
Uses system locale settings
Since: 1.3.1
putStrLn :: MonadIO m => Text -> m () Source #
Write a Text followed by a newline to stdout
Uses system locale settings
Since: 1.3.1
getChar :: MonadIO m => m Char Source #
Read a character from stdin
Uses system locale settings
Since: 1.3.1
getLine :: MonadIO m => m Text Source #
Read a line from stdin
Uses system locale settings
Since: 1.3.1
getContents :: MonadIO m => m LText Source #
interact :: MonadIO m => (LText -> LText) -> m () Source #
Takes a function of type 'LText -> LText' and passes all input on stdin to it, then prints result to stdout
Uses lazy IO Uses system locale settings
Since: 1.3.1
Difference lists
A difference list is a function that, given a list, returns the original contents of the difference list prepended to the given list.
This structure supports O(1) append and snoc operations on lists, making it
very useful for append-heavy uses (esp. left-nested uses of ++
), such
as logging and pretty printing.
Here is an example using DList as the state type when printing a tree with the Writer monad:
import Control.Monad.Writer import Data.DList data Tree a = Leaf a | Branch (Tree a) (Tree a) flatten_writer :: Tree x -> DList x flatten_writer = snd . runWriter . flatten where flatten (Leaf x) = tell (singleton x) flatten (Branch x y) = flatten x >> flatten y
Monad DList | |
Functor DList | |
Applicative DList | |
Foldable DList | |
Alternative DList | |
MonadPlus DList | |
IsList (DList a) | |
Eq a => Eq (DList a) | |
Ord a => Ord (DList a) | |
Read a => Read (DList a) | |
Show a => Show (DList a) | |
(~) * a Char => IsString (DList a) | |
Semigroup (DList a) | |
Monoid (DList a) | |
NFData a => NFData (DList a) | |
type Item (DList a) | |
type Index (DList a) | |
type Element (DList a) | |
applyDList :: DList a -> [a] -> [a] Source #
Synonym for apply
Since 0.11.0
Exceptions
module Control.DeepSeq
Force types
Helper functions for situations where type inferer gets confused.
asByteString :: ByteString -> ByteString Source #