| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Preql.Imports
Description
Common imports, so I don't need to repeat them everywhere
Synopsis
- class Functor (f :: Type -> Type) where
- class Typeable (a :: k)
- class Functor f => Applicative (f :: 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)
 
- data TyCon
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- class Applicative f => Alternative (f :: Type -> Type) where
- class Bifunctor (p :: Type -> Type -> Type) where
- class Monad m => MonadIO (m :: Type -> Type) where
- foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m
- fmapDefault :: Traversable t => (a -> b) -> t a -> t b
- mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- optional :: Alternative f => f a -> f (Maybe a)
- newtype WrappedMonad (m :: Type -> Type) a = WrapMonad {- unwrapMonad :: m a
 
- newtype WrappedArrow (a :: Type -> Type -> Type) b c = WrapArrow {- unwrapArrow :: a b c
 
- newtype ZipList a = ZipList {- getZipList :: [a]
 
- class (Typeable e, Show e) => Exception e
- typeOf7 :: Typeable t => t a b c d e f g -> TypeRep
- typeOf6 :: Typeable t => t a b c d e f -> TypeRep
- typeOf5 :: Typeable t => t a b c d e -> TypeRep
- typeOf4 :: Typeable t => t a b c d -> TypeRep
- typeOf3 :: Typeable t => t a b c -> TypeRep
- typeOf2 :: Typeable t => t a b -> TypeRep
- typeOf1 :: Typeable t => t a -> TypeRep
- rnfTypeRep :: TypeRep -> ()
- typeRepFingerprint :: TypeRep -> Fingerprint
- typeRepTyCon :: TypeRep -> TyCon
- typeRepArgs :: TypeRep -> [TypeRep]
- splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
- mkFunTy :: TypeRep -> TypeRep -> TypeRep
- funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep
- gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b))
- gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a))
- gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)
- eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)
- cast :: (Typeable a, Typeable b) => a -> Maybe b
- showsTypeRep :: TypeRep -> ShowS
- typeRep :: Typeable a => proxy a -> TypeRep
- typeOf :: Typeable a => a -> TypeRep
- type TypeRep = SomeTypeRep
- rnfTyCon :: TyCon -> ()
- tyConFingerprint :: TyCon -> Fingerprint
- tyConName :: TyCon -> String
- tyConModule :: TyCon -> String
- tyConPackage :: TyCon -> String
- newtype Const a (b :: k) :: forall k. Type -> k -> Type = Const {- getConst :: a
 
- data Proxy (t :: k) :: forall k. k -> Type = Proxy
- data (a :: k) :~: (b :: k) :: forall k. k -> k -> Type where
- data (a :: k1) :~~: (b :: k2) :: forall k1 k2. k1 -> k2 -> Type where
- void :: Functor f => f a -> f ()
- ($>) :: Functor f => f a -> b -> f b
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- catMaybes :: [Maybe a] -> [a]
- fromMaybe :: a -> Maybe a -> a
- 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
- decodeUtf8With :: OnDecodeError -> ByteString -> Text
- lenientDecode :: OnDecodeError
- data Vector a
- data Text
- data ByteString
Documentation
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.
Minimal complete definition
Instances
The class Typeable allows a concrete representation of a type to
 be calculated.
Minimal complete definition
typeRep#
class Functor f => Applicative (f :: Type -> Type) where #
A functor with application, providing operations to
A minimal complete definition must include implementations of pure
 and of either <*> or liftA2. If it defines both, then they must behave
 the same as their default definitions:
(<*>) =liftA2id
liftA2f x y = f<$>x<*>y
Further, any definition must satisfy the following:
- identity
- pure- id- <*>v = v
- composition
- pure(.)- <*>u- <*>v- <*>w = u- <*>(v- <*>w)
- homomorphism
- puref- <*>- purex =- pure(f x)
- interchange
- u - <*>- purey =- pure(- $y)- <*>u
The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:
As a consequence of these laws, the Functor instance for f will satisfy
It may be useful to note that supposing
forall x y. p (q x y) = f x . g y
it follows from the above that
liftA2p (liftA2q u v) =liftA2f u .liftA2g v
If f is also a Monad, it should satisfy
(which implies that pure and <*> satisfy the applicative functor laws).
Methods
Lift a value.
(<*>) :: f (a -> b) -> f a -> f b infixl 4 #
Sequential application.
A few functors support an implementation of <*> that is more
 efficient than the default one.
liftA2 :: (a -> b -> c) -> f a -> f b -> f c #
Lift a binary function to actions.
Some functors support an implementation of liftA2 that is more
 efficient than the default one. In particular, if fmap is an
 expensive operation, it is likely better to use liftA2 than to
 fmap over the structure and then use <*>.
(*>) :: f a -> f b -> f b infixl 4 #
Sequence actions, discarding the value of the first argument.
(<*) :: f a -> f b -> f a infixl 4 #
Sequence actions, discarding the value of the second argument.
Instances
class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where #
Functors representing data structures that can be traversed from left to right.
A definition of traverse must satisfy the following laws:
- naturality
- t .for every applicative transformation- traversef =- traverse(t . f)- t
- identity
- traverseIdentity = Identity
- composition
- traverse(Compose .- fmapg . f) = Compose .- fmap(- traverseg) .- traversef
A definition of sequenceA must satisfy the following laws:
- naturality
- t .for every applicative transformation- sequenceA=- sequenceA.- fmapt- t
- identity
- sequenceA.- fmapIdentity = Identity
- composition
- sequenceA.- fmapCompose = Compose .- fmap- sequenceA.- sequenceA
where an applicative transformation is a function
t :: (Applicative f, Applicative g) => f a -> g a
preserving the Applicative operations, i.e.
and the identity functor Identity and composition of functors Compose
 are defined as
  newtype Identity a = Identity a
  instance Functor Identity where
    fmap f (Identity x) = Identity (f x)
  instance Applicative Identity where
    pure x = Identity x
    Identity f <*> Identity x = Identity (f x)
  newtype Compose f g a = Compose (f (g a))
  instance (Functor f, Functor g) => Functor (Compose f g) where
    fmap f (Compose x) = Compose (fmap (fmap f) x)
  instance (Applicative f, Applicative g) => Applicative (Compose f g) where
    pure x = Compose (pure (pure x))
    Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)(The naturality law is implied by parametricity.)
Instances are similar to Functor, e.g. given a data type
data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
a suitable instance would be
instance Traversable Tree where traverse f Empty = pure Empty traverse f (Leaf x) = Leaf <$> f x traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r
This is suitable even for abstract types, as the laws for <*>
 imply a form of associativity.
The superclass instances should satisfy the following:
- In the Functorinstance,fmapshould be equivalent to traversal with the identity applicative functor (fmapDefault).
- In the Foldableinstance,foldMapshould be equivalent to traversal with a constant applicative functor (foldMapDefault).
Methods
traverse :: Applicative f => (a -> f b) -> t a -> f (t b) #
Map each element of a structure to an action, evaluate these actions
 from left to right, and collect the results. For a version that ignores
 the results see traverse_.
sequenceA :: Applicative f => t (f a) -> f (t a) #
Evaluate each action in the structure from left to right, and
 collect the results. For a version that ignores the results
 see sequenceA_.
mapM :: Monad m => (a -> m b) -> t a -> m (t b) #
Map each element of a structure to a monadic action, evaluate
 these actions from left to right, and collect the results. For
 a version that ignores the results see mapM_.
sequence :: Monad m => t (m a) -> m (t a) #
Evaluate each monadic action in the structure from left to
 right, and collect the results. For a version that ignores the
 results see sequence_.
Instances
(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #
An infix synonym for fmap.
The name of this operator is an allusion to $.
 Note the similarities between their types:
($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b
Whereas $ is function application, <$> is function
 application lifted over a Functor.
Examples
Convert from a Maybe IntMaybe Stringshow:
>>>show <$> NothingNothing>>>show <$> Just 3Just "3"
Convert from an Either Int IntEither IntString using show:
>>>show <$> Left 17Left 17>>>show <$> Right 17Right "17"
Double each element of a list:
>>>(*2) <$> [1,2,3][2,4,6]
Apply even to the second element of a pair:
>>>even <$> (2,2)(2,True)
class Applicative f => Alternative (f :: Type -> Type) where #
A monoid on applicative functors.
If defined, some and many should be the least solutions
 of the equations:
Methods
The identity of <|>
(<|>) :: f a -> f a -> f a infixl 3 #
An associative binary operation
One or more.
Zero or more.
Instances
class Bifunctor (p :: Type -> Type -> Type) where #
A bifunctor is a type constructor that takes
 two type arguments and is a functor in both arguments. That
 is, unlike with Functor, a type constructor such as Either
 does not need to be partially applied for a Bifunctor
 instance, and the methods in this class permit mapping
 functions over the Left value or the Right value,
 or both at the same time.
Formally, the class Bifunctor represents a bifunctor
 from Hask -> Hask.
Intuitively it is a bifunctor where both the first and second arguments are covariant.
You can define a Bifunctor by either defining bimap or by
 defining both first and second.
If you supply bimap, you should ensure that:
bimapidid≡id
If you supply first and second, ensure:
firstid≡idsecondid≡id
If you supply both, you should also ensure:
bimapf g ≡firstf.secondg
These ensure by parametricity:
bimap(f.g) (h.i) ≡bimapf h.bimapg ifirst(f.g) ≡firstf.firstgsecond(f.g) ≡secondf.secondg
Since: base-4.8.0.0
Methods
bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #
Map over both arguments at the same time.
bimapf g ≡firstf.secondg
Examples
>>>bimap toUpper (+1) ('j', 3)('J',4)
>>>bimap toUpper (+1) (Left 'j')Left 'J'
>>>bimap toUpper (+1) (Right 3)Right 4
Instances
| Bifunctor Either | Since: base-4.8.0.0 | 
| Bifunctor (,) | Since: base-4.8.0.0 | 
| Bifunctor Arg | Since: base-4.9.0.0 | 
| Bifunctor ((,,) x1) | Since: base-4.8.0.0 | 
| Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0 | 
| Bifunctor (Tagged :: Type -> Type -> Type) | |
| Bifunctor (K1 i :: Type -> Type -> Type) | Since: base-4.9.0.0 | 
| Bifunctor ((,,,) x1 x2) | Since: base-4.8.0.0 | 
| Bifunctor ((,,,,) x1 x2 x3) | Since: base-4.8.0.0 | 
| Bifunctor ((,,,,,) x1 x2 x3 x4) | Since: base-4.8.0.0 | 
| Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) | Since: base-4.8.0.0 | 
class Monad m => MonadIO (m :: Type -> Type) where #
Monads in which IO computations may be embedded.
 Any monad built by applying a sequence of monad transformers to the
 IO monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
 is a transformer of monads:
Instances
| MonadIO IO | Since: base-4.9.0.0 | 
| Defined in Control.Monad.IO.Class | |
| MonadIO Q | |
| Defined in Language.Haskell.TH.Syntax | |
| MonadIO m => MonadIO (StateT s m) | |
| Defined in Control.Monad.Trans.State.Strict | |
| MonadIO m => MonadIO (ExceptT e m) | |
| Defined in Control.Monad.Trans.Except | |
| (Error e, MonadIO m) => MonadIO (ErrorT e m) | |
| Defined in Control.Monad.Trans.Error | |
| MonadIO m => MonadIO (StateT s m) | |
| Defined in Control.Monad.Trans.State.Lazy | |
| MonadIO m => MonadIO (ReaderT r m) | |
| Defined in Control.Monad.Trans.Reader | |
foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m #
fmapDefault :: Traversable t => (a -> b) -> t a -> t b #
This function may be used as a value for fmap in a Functor
   instance, provided that traverse is defined. (Using
   fmapDefault with a Traversable instance defined only by
   sequenceA will result in infinite recursion.)
fmapDefaultf ≡runIdentity.traverse(Identity. f)
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) #
One or none.
newtype WrappedMonad (m :: Type -> Type) a #
Constructors
| WrapMonad | |
| Fields 
 | |
Instances
newtype WrappedArrow (a :: Type -> Type -> Type) b c #
Constructors
| WrapArrow | |
| Fields 
 | |
Instances
| Generic1 (WrappedArrow a b :: Type -> Type) | |
| Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> Type # Methods from1 :: WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 # to1 :: Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 # | |
| Arrow a => Functor (WrappedArrow a b) | Since: base-2.1 | 
| Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1 | 
| Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # | |
| (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1 | 
| Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # | |
| Generic (WrappedArrow a b c) | |
| Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: Type -> Type # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c # | |
| type Rep1 (WrappedArrow a b :: Type -> Type) | Since: base-4.7.0.0 | 
| Defined in Control.Applicative type Rep1 (WrappedArrow a b :: Type -> Type) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 (a b)))) | |
| type Rep (WrappedArrow a b c) | Since: base-4.7.0.0 | 
| Defined in Control.Applicative type Rep (WrappedArrow a b c) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a b c)))) | |
Lists, but with an Applicative functor based on zipping.
Constructors
| ZipList | |
| Fields 
 | |
Instances
| Functor ZipList | Since: base-2.1 | 
| Applicative ZipList | f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
    = 'ZipList' (zipWithN f xs1 ... xsN)where  (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
    = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
    = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}Since: base-2.1 | 
| Foldable ZipList | Since: base-4.9.0.0 | 
| Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # | |
| Traversable ZipList | Since: base-4.9.0.0 | 
| Alternative ZipList | Since: base-4.11.0.0 | 
| Eq a => Eq (ZipList a) | Since: base-4.7.0.0 | 
| Ord a => Ord (ZipList a) | Since: base-4.7.0.0 | 
| Read a => Read (ZipList a) | Since: base-4.7.0.0 | 
| Show a => Show (ZipList a) | Since: base-4.7.0.0 | 
| Generic (ZipList a) | |
| Generic1 ZipList | |
| type Rep (ZipList a) | Since: base-4.7.0.0 | 
| Defined in Control.Applicative | |
| type Item (ZipList a) | |
| Defined in Data.Orphans | |
| type Rep1 ZipList | Since: base-4.7.0.0 | 
| Defined in Control.Applicative | |
class (Typeable e, Show e) => Exception e #
Any type that you wish to throw or catch as an exception must be an
instance of the Exception class. The simplest case is a new exception
type directly below the root:
data MyException = ThisException | ThatException
    deriving Show
instance Exception MyExceptionThe default method definitions in the Exception class do what we need
in this case. You can now throw and catch ThisException and
ThatException as exceptions:
*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException
In more complicated examples, you may wish to define a whole hierarchy of exceptions:
---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler
data SomeCompilerException = forall e . Exception e => SomeCompilerException e
instance Show SomeCompilerException where
    show (SomeCompilerException e) = show e
instance Exception SomeCompilerException
compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException
compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
    SomeCompilerException a <- fromException x
    cast a
---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler
data SomeFrontendException = forall e . Exception e => SomeFrontendException e
instance Show SomeFrontendException where
    show (SomeFrontendException e) = show e
instance Exception SomeFrontendException where
    toException = compilerExceptionToException
    fromException = compilerExceptionFromException
frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException
frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
    SomeFrontendException a <- fromException x
    cast a
---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception
data MismatchedParentheses = MismatchedParentheses
    deriving Show
instance Exception MismatchedParentheses where
    toException   = frontendExceptionToException
    fromException = frontendExceptionFromExceptionWe can now catch a MismatchedParentheses exception as
MismatchedParentheses, SomeFrontendException or
SomeCompilerException, but not other types, e.g. IOException:
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses
Instances
rnfTypeRep :: TypeRep -> () #
Force a TypeRep to normal form.
typeRepFingerprint :: TypeRep -> Fingerprint #
Takes a value of type a and returns a concrete representation
 of that type.
Since: base-4.7.0.0
typeRepTyCon :: TypeRep -> TyCon #
Observe the type constructor of a quantified type representation.
typeRepArgs :: TypeRep -> [TypeRep] #
Observe the argument types of a type representation
splitTyConApp :: TypeRep -> (TyCon, [TypeRep]) #
Splits a type constructor application. Note that if the type constructor is polymorphic, this will not return the kinds that were used.
funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep #
Applies a type to a function type. Returns: Just u if the first argument
 represents a function of type t -> u and the second argument represents a
 function of type t. Otherwise, returns Nothing.
gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b) #
A flexible variation parameterised in a type constructor
eqT :: (Typeable a, Typeable b) => Maybe (a :~: b) #
Extract a witness of equality of two types
Since: base-4.7.0.0
showsTypeRep :: TypeRep -> ShowS #
Show a type representation
typeRep :: Typeable a => proxy a -> TypeRep #
Takes a value of type a and returns a concrete representation
 of that type.
Since: base-4.7.0.0
type TypeRep = SomeTypeRep #
A quantified type representation.
tyConFingerprint :: TyCon -> Fingerprint #
tyConModule :: TyCon -> String #
tyConPackage :: TyCon -> String #
newtype Const a (b :: k) :: forall k. Type -> k -> Type #
The Const functor.
Instances
| Generic1 (Const a :: k -> Type) | |
| Unbox a => Vector Vector (Const a b) | |
| Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Const a b) -> m (Vector (Const a b)) # basicUnsafeThaw :: PrimMonad m => Vector (Const a b) -> m (Mutable Vector (PrimState m) (Const a b)) # basicLength :: Vector (Const a b) -> Int # basicUnsafeSlice :: Int -> Int -> Vector (Const a b) -> Vector (Const a b) # basicUnsafeIndexM :: Monad m => Vector (Const a b) -> Int -> m (Const a b) # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Const a b) -> Vector (Const a b) -> m () # | |
| Unbox a => MVector MVector (Const a b) | |
| Defined in Data.Vector.Unboxed.Base Methods basicLength :: MVector s (Const a b) -> Int # basicUnsafeSlice :: Int -> Int -> MVector s (Const a b) -> MVector s (Const a b) # basicOverlaps :: MVector s (Const a b) -> MVector s (Const a b) -> Bool # basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Const a b)) # basicInitialize :: PrimMonad m => MVector (PrimState m) (Const a b) -> m () # basicUnsafeReplicate :: PrimMonad m => Int -> Const a b -> m (MVector (PrimState m) (Const a b)) # basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> m (Const a b) # basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> Const a b -> m () # basicClear :: PrimMonad m => MVector (PrimState m) (Const a b) -> m () # basicSet :: PrimMonad m => MVector (PrimState m) (Const a b) -> Const a b -> m () # basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Const a b) -> MVector (PrimState m) (Const a b) -> m () # basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Const a b) -> MVector (PrimState m) (Const a b) -> m () # basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Const a b) -> Int -> m (MVector (PrimState m) (Const a b)) # | |
| ToJSON2 (Const :: Type -> Type -> Type) | |
| Defined in Data.Aeson.Types.ToJSON Methods liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Const a b -> Value # liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Const a b] -> Value # liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Const a b -> Encoding # liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Const a b] -> Encoding # | |
| FromJSON2 (Const :: Type -> Type -> Type) | |
| Defined in Data.Aeson.Types.FromJSON | |
| Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0 | 
| Eq2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 | 
| Ord2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes | |
| Read2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] # | |
| Show2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0 | 
| Hashable2 (Const :: Type -> Type -> Type) | |
| Defined in Data.Hashable.Class | |
| Functor (Const m :: Type -> Type) | Since: base-2.1 | 
| Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1 | 
| Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0 | 
| Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # | |
| Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0 | 
| ToJSON a => ToJSON1 (Const a :: Type -> Type) | |
| Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a0 -> Value) -> ([a0] -> Value) -> Const a a0 -> Value # liftToJSONList :: (a0 -> Value) -> ([a0] -> Value) -> [Const a a0] -> Value # liftToEncoding :: (a0 -> Encoding) -> ([a0] -> Encoding) -> Const a a0 -> Encoding # liftToEncodingList :: (a0 -> Encoding) -> ([a0] -> Encoding) -> [Const a a0] -> Encoding # | |
| FromJSON a => FromJSON1 (Const a :: Type -> Type) | |
| Contravariant (Const a :: Type -> Type) | |
| Eq a => Eq1 (Const a :: Type -> Type) | Since: base-4.9.0.0 | 
| Ord a => Ord1 (Const a :: Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes | |
| Read a => Read1 (Const a :: Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] # | |
| Show a => Show1 (Const a :: Type -> Type) | Since: base-4.9.0.0 | 
| Hashable a => Hashable1 (Const a :: Type -> Type) | |
| Defined in Data.Hashable.Class | |
| Bounded a => Bounded (Const a b) | Since: base-4.9.0.0 | 
| Enum a => Enum (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # fromEnum :: Const a b -> Int # enumFrom :: Const a b -> [Const a b] # enumFromThen :: Const a b -> Const a b -> [Const a b] # enumFromTo :: Const a b -> Const a b -> [Const a b] # enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] # | |
| Eq a => Eq (Const a b) | Since: base-4.9.0.0 | 
| Floating a => Floating (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # | |
| Fractional a => Fractional (Const a b) | Since: base-4.9.0.0 | 
| Integral a => Integral (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods quot :: Const a b -> Const a b -> Const a b # rem :: Const a b -> Const a b -> Const a b # div :: Const a b -> Const a b -> Const a b # mod :: Const a b -> Const a b -> Const a b # quotRem :: Const a b -> Const a b -> (Const a b, Const a b) # divMod :: Const a b -> Const a b -> (Const a b, Const a b) # | |
| Num a => Num (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const | |
| Ord a => Ord (Const a b) | Since: base-4.9.0.0 | 
| Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the
  Since: base-4.8.0.0 | 
| Real a => Real (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational # | |
| RealFloat a => RealFloat (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods floatRadix :: Const a b -> Integer # floatDigits :: Const a b -> Int # floatRange :: Const a b -> (Int, Int) # decodeFloat :: Const a b -> (Integer, Int) # encodeFloat :: Integer -> Int -> Const a b # exponent :: Const a b -> Int # significand :: Const a b -> Const a b # scaleFloat :: Int -> Const a b -> Const a b # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # | |
| RealFrac a => RealFrac (Const a b) | Since: base-4.9.0.0 | 
| Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the
  Since: base-4.8.0.0 | 
| Ix a => Ix (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods range :: (Const a b, Const a b) -> [Const a b] # index :: (Const a b, Const a b) -> Const a b -> Int # unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int inRange :: (Const a b, Const a b) -> Const a b -> Bool # rangeSize :: (Const a b, Const a b) -> Int # unsafeRangeSize :: (Const a b, Const a b) -> Int | |
| IsString a => IsString (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.String Methods fromString :: String -> Const a b # | |
| Generic (Const a b) | |
| Semigroup a => Semigroup (Const a b) | Since: base-4.9.0.0 | 
| Monoid a => Monoid (Const a b) | Since: base-4.9.0.0 | 
| Hashable a => Hashable (Const a b) | |
| Defined in Data.Hashable.Class | |
| ToJSON a => ToJSON (Const a b) | |
| Defined in Data.Aeson.Types.ToJSON | |
| FromJSON a => FromJSON (Const a b) | |
| Storable a => Storable (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const | |
| Bits a => Bits (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods (.&.) :: Const a b -> Const a b -> Const a b # (.|.) :: Const a b -> Const a b -> Const a b # xor :: Const a b -> Const a b -> Const a b # complement :: Const a b -> Const a b # shift :: Const a b -> Int -> Const a b # rotate :: Const a b -> Int -> Const a b # setBit :: Const a b -> Int -> Const a b # clearBit :: Const a b -> Int -> Const a b # complementBit :: Const a b -> Int -> Const a b # testBit :: Const a b -> Int -> Bool # bitSizeMaybe :: Const a b -> Maybe Int # isSigned :: Const a b -> Bool # shiftL :: Const a b -> Int -> Const a b # unsafeShiftL :: Const a b -> Int -> Const a b # shiftR :: Const a b -> Int -> Const a b # unsafeShiftR :: Const a b -> Int -> Const a b # rotateL :: Const a b -> Int -> Const a b # | |
| FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int # countLeadingZeros :: Const a b -> Int # countTrailingZeros :: Const a b -> Int # | |
| Prim a => Prim (Const a b) | Since: primitive-0.6.5.0 | 
| Defined in Data.Primitive.Types Methods sizeOf# :: Const a b -> Int# # alignment# :: Const a b -> Int# # indexByteArray# :: ByteArray# -> Int# -> Const a b # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Const a b#) # writeByteArray# :: MutableByteArray# s -> Int# -> Const a b -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Const a b -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> Const a b # readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, Const a b#) # writeOffAddr# :: Addr# -> Int# -> Const a b -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> Const a b -> State# s -> State# s # | |
| Unbox a => Unbox (Const a b) | |
| Defined in Data.Vector.Unboxed.Base | |
| type Rep1 (Const a :: k -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const | |
| newtype MVector s (Const a b) | |
| Defined in Data.Vector.Unboxed.Base | |
| type Rep (Const a b) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Const | |
| newtype Vector (Const a b) | |
| Defined in Data.Vector.Unboxed.Base | |
data Proxy (t :: k) :: forall k. k -> Type #
Proxy is a type that holds no data, but has a phantom parameter of
 arbitrary type (or even kind). Its use is to provide type information, even
 though there is no value available of that type (or it may be too costly to
 create one).
Historically, Proxy :: Proxy a'undefined :: a' idiom.
>>>Proxy :: Proxy (Void, Int -> Int)Proxy
Proxy can even hold types of higher kinds,
>>>Proxy :: Proxy EitherProxy
>>>Proxy :: Proxy FunctorProxy
>>>Proxy :: Proxy complicatedStructureProxy
Constructors
| Proxy | 
Instances
| Generic1 (Proxy :: k -> Type) | |
| Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 | 
| Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 | 
| Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 | 
| Foldable (Proxy :: Type -> Type) | Since: base-4.7.0.0 | 
| Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
| Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 | 
| ToJSON1 (Proxy :: Type -> Type) | |
| Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Value) -> ([a] -> Value) -> Proxy a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Proxy a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Proxy a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Proxy a] -> Encoding # | |
| FromJSON1 (Proxy :: Type -> Type) | |
| Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| Contravariant (Proxy :: Type -> Type) | |
| Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes | |
| Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| Defined in Data.Functor.Classes | |
| Show1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 | 
| Hashable1 (Proxy :: Type -> Type) | |
| Defined in Data.Hashable.Class | |
| Bounded (Proxy t) | Since: base-4.7.0.0 | 
| Enum (Proxy s) | Since: base-4.7.0.0 | 
| Eq (Proxy s) | Since: base-4.7.0.0 | 
| Ord (Proxy s) | Since: base-4.7.0.0 | 
| Read (Proxy t) | Since: base-4.7.0.0 | 
| Show (Proxy s) | Since: base-4.7.0.0 | 
| Ix (Proxy s) | Since: base-4.7.0.0 | 
| Defined in Data.Proxy | |
| Generic (Proxy t) | |
| Semigroup (Proxy s) | Since: base-4.9.0.0 | 
| Monoid (Proxy s) | Since: base-4.7.0.0 | 
| Hashable (Proxy a) | |
| Defined in Data.Hashable.Class | |
| ToJSON (Proxy a) | |
| Defined in Data.Aeson.Types.ToJSON | |
| FromJSON (Proxy a) | |
| type Rep1 (Proxy :: k -> Type) | Since: base-4.6.0.0 | 
| type Rep (Proxy t) | Since: base-4.6.0.0 | 
data (a :: k) :~: (b :: k) :: forall k. k -> k -> Type where infix 4 #
Propositional equality. If a :~: b is inhabited by some terminating
 value, then the type a is the same as the type b. To use this equality
 in practice, pattern-match on the a :~: b to get out the Refl constructor;
 in the body of the pattern-match, the compiler knows that a ~ b.
Since: base-4.7.0.0
Instances
| TestEquality ((:~:) a :: k -> Type) | Since: base-4.7.0.0 | 
| Defined in Data.Type.Equality | |
| a ~ b => Bounded (a :~: b) | Since: base-4.7.0.0 | 
| a ~ b => Enum (a :~: b) | Since: base-4.7.0.0 | 
| Defined in Data.Type.Equality Methods succ :: (a :~: b) -> a :~: b # pred :: (a :~: b) -> a :~: b # fromEnum :: (a :~: b) -> Int # enumFrom :: (a :~: b) -> [a :~: b] # enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] # | |
| Eq (a :~: b) | Since: base-4.7.0.0 | 
| Ord (a :~: b) | Since: base-4.7.0.0 | 
| Defined in Data.Type.Equality | |
| a ~ b => Read (a :~: b) | Since: base-4.7.0.0 | 
| Show (a :~: b) | Since: base-4.7.0.0 | 
data (a :: k1) :~~: (b :: k2) :: forall k1 k2. k1 -> k2 -> Type where infix 4 #
Kind heterogeneous propositional equality. Like :~:, a :~~: b is
 inhabited by a terminating value if and only if a is the same type as b.
Since: base-4.10.0.0
Instances
| TestEquality ((:~~:) a :: k -> Type) | Since: base-4.10.0.0 | 
| Defined in Data.Type.Equality | |
| a ~~ b => Bounded (a :~~: b) | Since: base-4.10.0.0 | 
| a ~~ b => Enum (a :~~: b) | Since: base-4.10.0.0 | 
| Defined in Data.Type.Equality Methods succ :: (a :~~: b) -> a :~~: b # pred :: (a :~~: b) -> a :~~: b # fromEnum :: (a :~~: b) -> Int # enumFrom :: (a :~~: b) -> [a :~~: b] # enumFromThen :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromTo :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromThenTo :: (a :~~: b) -> (a :~~: b) -> (a :~~: b) -> [a :~~: b] # | |
| Eq (a :~~: b) | Since: base-4.10.0.0 | 
| Ord (a :~~: b) | Since: base-4.10.0.0 | 
| a ~~ b => Read (a :~~: b) | Since: base-4.10.0.0 | 
| Show (a :~~: b) | Since: base-4.10.0.0 | 
void :: Functor f => f a -> f () #
void valueIO action.
Examples
Replace the contents of a Maybe Int
>>>void NothingNothing>>>void (Just 3)Just ()
Replace the contents of an Either Int IntEither Int '()'
>>>void (Left 8675309)Left 8675309>>>void (Right 8675309)Right ()
Replace every element of a list with unit:
>>>void [1,2,3][(),(),()]
Replace the second element of a pair with unit:
>>>void (1,2)(1,())
Discard the result of an IO action:
>>>mapM print [1,2]1 2 [(),()]>>>void $ mapM print [1,2]1 2
($>) :: Functor f => f a -> b -> f b infixl 4 #
Flipped version of <$.
Examples
Replace the contents of a Maybe IntString:
>>>Nothing $> "foo"Nothing>>>Just 90210 $> "foo"Just "foo"
Replace the contents of an Either Int IntString, resulting in an Either Int String
>>>Left 8675309 $> "foo"Left 8675309>>>Right 8675309 $> "foo"Right "foo"
Replace each element of a list with a constant String:
>>>[1,2,3] $> "foo"["foo","foo","foo"]
Replace the second element of a pair with a constant String:
>>>(1,2) $> "foo"(1,"foo")
Since: base-4.7.0.0
catMaybes :: [Maybe a] -> [a] #
The catMaybes function takes a list of Maybes and returns
 a list of all the Just values.
Examples
Basic usage:
>>>catMaybes [Just 1, Nothing, Just 3][1,3]
When constructing a list of Maybe values, catMaybes can be used
 to return all of the "success" results (if the list is the result
 of a map, then mapMaybe would be more appropriate):
>>>import Text.Read ( readMaybe )>>>[readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][Just 1,Nothing,Just 3]>>>catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][1,3]
fromMaybe :: a -> Maybe a -> a #
The fromMaybe function takes a default value and and Maybe
 value.  If the Maybe is Nothing, it returns the default values;
 otherwise, it returns the value contained in the Maybe.
Examples
Basic usage:
>>>fromMaybe "" (Just "Hello, World!")"Hello, World!"
>>>fromMaybe "" Nothing""
Read an integer from a string using readMaybe. If we fail to
 parse an integer, we want to return 0 by default:
>>>import Text.Read ( readMaybe )>>>fromMaybe 0 (readMaybe "5")5>>>fromMaybe 0 (readMaybe "")0
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d #
Lift a ternary function to actions.
liftA :: Applicative f => (a -> b) -> f a -> f b #
(<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 #
A variant of <*> with the arguments reversed.
decodeUtf8With :: OnDecodeError -> ByteString -> Text #
Decode a ByteString containing UTF-8 encoded text.
NOTE: The replacement character returned by OnDecodeError
 MUST be within the BMP plane; surrogate code points will
 automatically be remapped to the replacement char U+FFFD
 (since 0.11.3.0), whereas code points beyond the BMP will throw an
 error (since 1.2.3.1); For earlier versions of text using
 those unsupported code points would result in undefined behavior.
lenientDecode :: OnDecodeError #
Replace an invalid input byte with the Unicode replacement character U+FFFD.
Boxed vectors, supporting efficient slicing.
Instances
| Monad Vector | |
| Functor Vector | |
| MonadFail Vector | Since: vector-0.12.1.0 | 
| Defined in Data.Vector | |
| Applicative Vector | |
| Foldable Vector | |
| Defined in Data.Vector Methods fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # | |
| Traversable Vector | |
| ToJSON1 Vector | |
| Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Value) -> ([a] -> Value) -> Vector a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Vector a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Vector a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Vector a] -> Encoding # | |
| FromJSON1 Vector | |
| Alternative Vector | |
| MonadPlus Vector | |
| Eq1 Vector | |
| Ord1 Vector | |
| Defined in Data.Vector | |
| Read1 Vector | |
| Defined in Data.Vector | |
| Show1 Vector | |
| MonadZip Vector | |
| NFData1 Vector | Since: vector-0.12.1.0 | 
| Defined in Data.Vector | |
| Vector Vector a | |
| Defined in Data.Vector Methods basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) a -> m (Vector a) # basicUnsafeThaw :: PrimMonad m => Vector a -> m (Mutable Vector (PrimState m) a) # basicLength :: Vector a -> Int # basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a # basicUnsafeIndexM :: Monad m => Vector a -> Int -> m a # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) a -> Vector a -> m () # | |
| IsList (Vector a) | |
| Eq a => Eq (Vector a) | |
| Data a => Data (Vector a) | |
| Defined in Data.Vector Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) # toConstr :: Vector a -> Constr # dataTypeOf :: Vector a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) # gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r # gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # | |
| Ord a => Ord (Vector a) | |
| Defined in Data.Vector | |
| Read a => Read (Vector a) | |
| Show a => Show (Vector a) | |
| Semigroup (Vector a) | |
| Monoid (Vector a) | |
| ToJSON a => ToJSON (Vector a) | |
| Defined in Data.Aeson.Types.ToJSON | |
| FromJSON a => FromJSON (Vector a) | |
| NFData a => NFData (Vector a) | |
| Defined in Data.Vector | |
| type Mutable Vector | |
| Defined in Data.Vector | |
| type Item (Vector a) | |
| Defined in Data.Vector | |
A space efficient, packed, unboxed Unicode text type.
Instances
data ByteString #
A space-efficient representation of a Word8 vector, supporting many
 efficient operations.
A ByteString contains 8-bit bytes, or by using the operations from
 Data.ByteString.Char8 it can be interpreted as containing 8-bit
 characters.