| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Dhall.Marshal.Encode
Description
Please read the Dhall.Tutorial module, which contains a tutorial explaining how to use the language, the compiler, and this library
Synopsis
- data Encoder a = Encoder {}
- class ToDhall a where
- injectWith :: InputNormalizer -> Encoder a
- type Inject = ToDhall
- inject :: ToDhall a => Encoder a
- newtype RecordEncoder a = RecordEncoder (Map Text (Encoder a))
- recordEncoder :: RecordEncoder a -> Encoder a
- encodeField :: ToDhall a => Text -> RecordEncoder a
- encodeFieldWith :: Text -> Encoder a -> RecordEncoder a
- newtype UnionEncoder a = UnionEncoder (Product (Const (Map Text (Expr Src Void))) (Op (Text, Expr Src Void)) a)
- unionEncoder :: UnionEncoder a -> Encoder a
- encodeConstructor :: ToDhall a => Text -> UnionEncoder a
- encodeConstructorWith :: Text -> Encoder a -> UnionEncoder a
- (>|<) :: UnionEncoder a -> UnionEncoder b -> UnionEncoder (Either a b)
- class GenericToDhall f where
- genericToDhallWithNormalizer :: InputNormalizer -> InterpretOptions -> State Int (Encoder (f a))
- genericToDhall :: (Generic a, GenericToDhall (Rep a)) => Encoder a
- genericToDhallWith :: (Generic a, GenericToDhall (Rep a)) => InterpretOptions -> Encoder a
- genericToDhallWithInputNormalizer :: (Generic a, GenericToDhall (Rep a)) => InterpretOptions -> InputNormalizer -> Encoder a
- data InterpretOptions = InterpretOptions {}
- data SingletonConstructors
- defaultInterpretOptions :: InterpretOptions
- newtype InputNormalizer = InputNormalizer {}
- defaultInputNormalizer :: InputNormalizer
- data Result f
- (>$<) :: Contravariant f => (a -> b) -> f b -> f a
- (>*<) :: Divisible f => f a -> f b -> f (a, b)
- data Natural
- data Seq a
- data Text
- data Vector a
- class Generic a
General
An (Encoder a) represents a way to marshal a value of type 'a' from
Haskell into Dhall.
Constructors
| Encoder | |
class ToDhall a where Source #
This class is used by FromDhall instance for functions:
instance (ToDhall a, FromDhall b) => FromDhall (a -> b)
You can convert Dhall functions with "simple" inputs (i.e. instances of this class) into Haskell functions. This works by:
- Marshaling the input to the Haskell function into a Dhall expression (i.e.
x :: Expr Src Void) - Applying the Dhall function (i.e.
f :: Expr Src Void) to the Dhall input (i.e.App f x) - Normalizing the syntax tree (i.e.
normalize (App f x)) - Marshaling the resulting Dhall expression back into a Haskell value
This class auto-generates a default implementation for types that
implement Generic. This does not auto-generate an instance for recursive
types.
The default instance can be tweaked using genericToDhallWith/genericToDhallWithInputNormalizer
and custom InterpretOptions, or using
DerivingVia
and Codec from Dhall.Deriving.
Minimal complete definition
Nothing
Methods
injectWith :: InputNormalizer -> Encoder a Source #
default injectWith :: (Generic a, GenericToDhall (Rep a)) => InputNormalizer -> Encoder a Source #
Instances
inject :: ToDhall a => Encoder a Source #
Use the default input normalizer for injecting a value.
inject = injectWith defaultInputNormalizer
Building encoders
Records
newtype RecordEncoder a Source #
The RecordEncoder divisible (contravariant) functor allows you to build
an Encoder for a Dhall record.
For example, let's take the following Haskell data type:
>>>:{data Project = Project { projectName :: Text , projectDescription :: Text , projectStars :: Natural } :}
And assume that we have the following Dhall record that we would like to
parse as a Project:
{ name =
"dhall-haskell"
, description =
"A configuration language guaranteed to terminate"
, stars =
289
}Our encoder has type Encoder Project, but we can't build that out of any
smaller encoders, as Encoders cannot be combined (they are only Contravariants).
However, we can use an RecordEncoder to build an Encoder for Project:
>>>:{injectProject :: Encoder Project injectProject = recordEncoder ( adapt >$< encodeFieldWith "name" inject >*< encodeFieldWith "description" inject >*< encodeFieldWith "stars" inject ) where adapt (Project{..}) = (projectName, (projectDescription, projectStars)) :}
Or, since we are simply using the ToDhall instance to inject each field, we could write
>>>:{injectProject :: Encoder Project injectProject = recordEncoder ( adapt >$< encodeField "name" >*< encodeField "description" >*< encodeField "stars" ) where adapt (Project{..}) = (projectName, (projectDescription, projectStars)) :}
Constructors
| RecordEncoder (Map Text (Encoder a)) |
Instances
| Contravariant RecordEncoder Source # | |
Defined in Dhall.Marshal.Encode Methods contramap :: (a' -> a) -> RecordEncoder a -> RecordEncoder a' Source # (>$) :: b -> RecordEncoder b -> RecordEncoder a Source # | |
| Divisible RecordEncoder Source # | |
Defined in Dhall.Marshal.Encode Methods divide :: (a -> (b, c)) -> RecordEncoder b -> RecordEncoder c -> RecordEncoder a Source # conquer :: RecordEncoder a Source # | |
recordEncoder :: RecordEncoder a -> Encoder a Source #
Convert a RecordEncoder into the equivalent Encoder.
encodeField :: ToDhall a => Text -> RecordEncoder a Source #
Specify how to encode one field of a record using the default ToDhall
instance for that type.
encodeFieldWith :: Text -> Encoder a -> RecordEncoder a Source #
Specify how to encode one field of a record by supplying an explicit
Encoder for that field.
Unions
newtype UnionEncoder a Source #
UnionEncoder allows you to build an Encoder for a Dhall record.
For example, let's take the following Haskell data type:
>>>:{data Status = Queued Natural | Result Text | Errored Text :}
And assume that we have the following Dhall union that we would like to
parse as a Status:
< Result : Text | Queued : Natural | Errored : Text >.Result "Finish successfully"
Our encoder has type Encoder Status, but we can't build that out of any
smaller encoders, as Encoders cannot be combined.
However, we can use an UnionEncoder to build an Encoder for Status:
>>>:{injectStatus :: Encoder Status injectStatus = adapt >$< unionEncoder ( encodeConstructorWith "Queued" inject >|< encodeConstructorWith "Result" inject >|< encodeConstructorWith "Errored" inject ) where adapt (Queued n) = Left n adapt (Result t) = Right (Left t) adapt (Errored e) = Right (Right e) :}
Or, since we are simply using the ToDhall instance to inject each branch, we could write
>>>:{injectStatus :: Encoder Status injectStatus = adapt >$< unionEncoder ( encodeConstructor "Queued" >|< encodeConstructor "Result" >|< encodeConstructor "Errored" ) where adapt (Queued n) = Left n adapt (Result t) = Right (Left t) adapt (Errored e) = Right (Right e) :}
Instances
| Contravariant UnionEncoder Source # | |
Defined in Dhall.Marshal.Encode Methods contramap :: (a' -> a) -> UnionEncoder a -> UnionEncoder a' Source # (>$) :: b -> UnionEncoder b -> UnionEncoder a Source # | |
unionEncoder :: UnionEncoder a -> Encoder a Source #
Convert a UnionEncoder into the equivalent Encoder.
encodeConstructor :: ToDhall a => Text -> UnionEncoder a Source #
Specify how to encode an alternative by using the default ToDhall instance
for that type.
encodeConstructorWith :: Text -> Encoder a -> UnionEncoder a Source #
Specify how to encode an alternative by providing an explicit Encoder
for that alternative.
(>|<) :: UnionEncoder a -> UnionEncoder b -> UnionEncoder (Either a b) infixr 5 Source #
Combines two UnionEncoder values. See UnionEncoder for usage
notes.
Ideally, this matches chosen;
however, this allows UnionEncoder to not need a Divisible instance
itself (since no instance is possible).
Generic encoding
class GenericToDhall f where Source #
This is the underlying class that powers the FromDhall class's support
for automatically deriving a generic implementation.
Methods
genericToDhallWithNormalizer :: InputNormalizer -> InterpretOptions -> State Int (Encoder (f a)) Source #
Instances
genericToDhall :: (Generic a, GenericToDhall (Rep a)) => Encoder a Source #
Use the default options for injecting a value, whose structure is determined generically.
This can be used when you want to use ToDhall on types that you don't
want to define orphan instances for.
genericToDhallWith :: (Generic a, GenericToDhall (Rep a)) => InterpretOptions -> Encoder a Source #
Use custom options for injecting a value, whose structure is determined generically.
This can be used when you want to use ToDhall on types that you don't
want to define orphan instances for.
genericToDhallWithInputNormalizer :: (Generic a, GenericToDhall (Rep a)) => InterpretOptions -> InputNormalizer -> Encoder a Source #
genericToDhallWithInputNormalizer is like genericToDhallWith, but
instead of using the defaultInputNormalizer it expects an custom
InputNormalizer.
data InterpretOptions Source #
Use these options to tweak how Dhall derives a generic implementation of
FromDhall.
Constructors
| InterpretOptions | |
Fields
| |
data SingletonConstructors Source #
This type specifies how to model a Haskell constructor with 1 field in Dhall
For example, consider the following Haskell datatype definition:
data Example = Foo { x :: Double } | Bar DoubleDepending on which option you pick, the corresponding Dhall type could be:
< Foo : Double | Bar : Double > -- Bare
< Foo : { x : Double } | Bar : { _1 : Double } > -- Wrapped< Foo : { x : Double } | Bar : Double > -- SmartConstructors
| Bare | Never wrap the field in a record |
| Wrapped | Always wrap the field in a record |
| Smart | Only fields in a record if they are named |
Instances
| ToSingletonConstructors a => ModifyOptions (SetSingletonConstructors a :: Type) Source # | |
Defined in Dhall.Deriving Methods modifyOptions :: InterpretOptions -> InterpretOptions Source # | |
defaultInterpretOptions :: InterpretOptions Source #
Default interpret options for generics-based instances, which you can tweak or override, like this:
genericAutoWith
(defaultInterpretOptions { fieldModifier = Data.Text.Lazy.dropWhile (== '_') })Miscellaneous
newtype InputNormalizer Source #
This is only used by the FromDhall instance for
functions in order to normalize the function input before marshaling the
input into a Dhall expression.
Constructors
| InputNormalizer | |
Fields | |
defaultInputNormalizer :: InputNormalizer Source #
Default normalization-related settings (no custom normalization)
This type is exactly the same as Fix except with a different
FromDhall instance. This intermediate type
simplifies the implementation of the inner loop for the
FromDhall instance for Fix.
Instances
| FromDhall (f (Result f)) => FromDhall (Result f) Source # | |
Defined in Dhall.Marshal.Decode | |
| ToDhall (f (Result f)) => ToDhall (Result f) Source # | |
Defined in Dhall.Marshal.Encode Methods injectWith :: InputNormalizer -> Encoder (Result f) Source # | |
(>$<) :: Contravariant f => (a -> b) -> f b -> f a infixl 4 Source #
This is an infix alias for contramap.
Re-exports
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS constructor
Instances
General-purpose finite sequences.
Instances
| FromJSON1 Seq | |
| ToJSON1 Seq | |
Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Value) -> ([a] -> Value) -> Seq a -> Value Source # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Seq a] -> Value Source # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Seq a -> Encoding Source # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Seq a] -> Encoding Source # | |
| MonadFix Seq | Since: containers-0.5.11 |
| MonadZip Seq |
|
| Foldable Seq | |
Defined in Data.Sequence.Internal Methods fold :: Monoid m => Seq m -> m Source # foldMap :: Monoid m => (a -> m) -> Seq a -> m Source # foldMap' :: Monoid m => (a -> m) -> Seq a -> m Source # foldr :: (a -> b -> b) -> b -> Seq a -> b Source # foldr' :: (a -> b -> b) -> b -> Seq a -> b Source # foldl :: (b -> a -> b) -> b -> Seq a -> b Source # foldl' :: (b -> a -> b) -> b -> Seq a -> b Source # foldr1 :: (a -> a -> a) -> Seq a -> a Source # foldl1 :: (a -> a -> a) -> Seq a -> a Source # toList :: Seq a -> [a] Source # null :: Seq a -> Bool Source # length :: Seq a -> Int Source # elem :: Eq a => a -> Seq a -> Bool Source # maximum :: Ord a => Seq a -> a Source # minimum :: Ord a => Seq a -> a Source # | |
| Eq1 Seq | Since: containers-0.5.9 |
| Ord1 Seq | Since: containers-0.5.9 |
Defined in Data.Sequence.Internal | |
| Read1 Seq | Since: containers-0.5.9 |
Defined in Data.Sequence.Internal Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Seq a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Seq a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Seq a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Seq a] Source # | |
| Show1 Seq | Since: containers-0.5.9 |
| Traversable Seq | |
| Alternative Seq | Since: containers-0.5.4 |
| Applicative Seq | Since: containers-0.5.4 |
| Functor Seq | |
| Monad Seq | |
| MonadPlus Seq | |
| UnzipWith Seq | |
Defined in Data.Sequence.Internal Methods unzipWith' :: (x -> (a, b)) -> Seq x -> (Seq a, Seq b) | |
| Hashable1 Seq | |
Defined in Data.Hashable.Class | |
| FoldableWithIndex Int Seq | |
Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> Seq a -> m Source # ifoldMap' :: Monoid m => (Int -> a -> m) -> Seq a -> m Source # ifoldr :: (Int -> a -> b -> b) -> b -> Seq a -> b Source # ifoldl :: (Int -> b -> a -> b) -> b -> Seq a -> b Source # | |
| FunctorWithIndex Int Seq | The position in the |
| TraversableWithIndex Int Seq | |
| Lift a => Lift (Seq a :: Type) | Since: containers-0.6.6 |
| FromJSON a => FromJSON (Seq a) | |
| ToJSON a => ToJSON (Seq a) | |
| Data a => Data (Seq a) | |
Defined in Data.Sequence.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Seq a -> c (Seq a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Seq a) Source # toConstr :: Seq a -> Constr Source # dataTypeOf :: Seq a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Seq a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Seq a)) Source # gmapT :: (forall b. Data b => b -> b) -> Seq a -> Seq a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Seq a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Seq a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Seq a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Seq a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) Source # | |
| a ~ Char => IsString (Seq a) | Since: containers-0.5.7 |
Defined in Data.Sequence.Internal Methods fromString :: String -> Seq a Source # | |
| Monoid (Seq a) | |
| Semigroup (Seq a) | Since: containers-0.5.7 |
| IsList (Seq a) | |
| Read a => Read (Seq a) | |
| Show a => Show (Seq a) | |
| NFData a => NFData (Seq a) | |
Defined in Data.Sequence.Internal | |
| FromDhall a => FromDhall (Seq a) Source # | |
Defined in Dhall.Marshal.Decode | |
| ToDhall a => ToDhall (Seq a) Source # | |
Defined in Dhall.Marshal.Encode Methods injectWith :: InputNormalizer -> Encoder (Seq a) Source # | |
| Eq a => Eq (Seq a) | |
| Ord a => Ord (Seq a) | |
Defined in Data.Sequence.Internal | |
| Hashable v => Hashable (Seq v) | |
Defined in Data.Hashable.Class | |
| Ord a => Stream (Seq a) | |
Defined in Text.Megaparsec.Stream Methods tokenToChunk :: Proxy (Seq a) -> Token (Seq a) -> Tokens (Seq a) tokensToChunk :: Proxy (Seq a) -> [Token (Seq a)] -> Tokens (Seq a) chunkToTokens :: Proxy (Seq a) -> Tokens (Seq a) -> [Token (Seq a)] chunkLength :: Proxy (Seq a) -> Tokens (Seq a) -> Int chunkEmpty :: Proxy (Seq a) -> Tokens (Seq a) -> Bool take1_ :: Seq a -> Maybe (Token (Seq a), Seq a) takeN_ :: Int -> Seq a -> Maybe (Tokens (Seq a), Seq a) takeWhile_ :: (Token (Seq a) -> Bool) -> Seq a -> (Tokens (Seq a), Seq a) | |
| Serialise a => Serialise (Seq a) | |
Defined in Codec.Serialise.Class | |
| type Item (Seq a) | |
Defined in Data.Sequence.Internal | |
| type Token (Seq a) | |
Defined in Text.Megaparsec.Stream type Token (Seq a) = a | |
| type Tokens (Seq a) | |
Defined in Text.Megaparsec.Stream | |
A space efficient, packed, unboxed Unicode text type.
Instances
| FromJSON Text | |
| FromJSONKey Text | |
Defined in Data.Aeson.Types.FromJSON Methods | |
| ToJSON Text | |
| ToJSONKey Text | |
Defined in Data.Aeson.Types.ToJSON Methods | |
| Chunk Text | |
Defined in Data.Attoparsec.Internal.Types Associated Types type ChunkElem Text Methods pappendChunk :: State Text -> Text -> State Text atBufferEnd :: Text -> State Text -> Pos bufferElemAt :: Text -> Pos -> State Text -> Maybe (ChunkElem Text, Int) chunkElemToChar :: Text -> ChunkElem Text -> Char | |
| FoldCase Text | |
Defined in Data.CaseInsensitive.Internal | |
| FromDhall Text Source # | |
Defined in Dhall.Marshal.Decode | |
| ToDhall Text Source # | |
Defined in Dhall.Marshal.Encode Methods injectWith :: InputNormalizer -> Encoder Text Source # | |
| Hashable Text | |
Defined in Data.Hashable.Class | |
| Stream Text | |
Defined in Text.Megaparsec.Stream Methods tokenToChunk :: Proxy Text -> Token Text -> Tokens Text tokensToChunk :: Proxy Text -> [Token Text] -> Tokens Text chunkToTokens :: Proxy Text -> Tokens Text -> [Token Text] chunkLength :: Proxy Text -> Tokens Text -> Int chunkEmpty :: Proxy Text -> Tokens Text -> Bool take1_ :: Text -> Maybe (Token Text, Text) takeN_ :: Int -> Text -> Maybe (Tokens Text, Text) takeWhile_ :: (Token Text -> Bool) -> Text -> (Tokens Text, Text) | |
| TraversableStream Text | |
Defined in Text.Megaparsec.Stream Methods reachOffset :: Int -> PosState Text -> (Maybe String, PosState Text) reachOffsetNoLine :: Int -> PosState Text -> PosState Text | |
| VisualStream Text | |
Defined in Text.Megaparsec.Stream | |
| Pretty Text | Automatically converts all newlines to
Note that
Manually use |
| Serialise Text | |
Defined in Codec.Serialise.Class | |
| MonadParsec Void Text Parser | |
Defined in Dhall.Parser.Combinators Methods parseError :: ParseError Text Void -> Parser a label :: String -> Parser a -> Parser a hidden :: Parser a -> Parser a lookAhead :: Parser a -> Parser a notFollowedBy :: Parser a -> Parser () withRecovery :: (ParseError Text Void -> Parser a) -> Parser a -> Parser a observing :: Parser a -> Parser (Either (ParseError Text Void) a) token :: (Token Text -> Maybe a) -> Set (ErrorItem (Token Text)) -> Parser a tokens :: (Tokens Text -> Tokens Text -> Bool) -> Tokens Text -> Parser (Tokens Text) takeWhileP :: Maybe String -> (Token Text -> Bool) -> Parser (Tokens Text) takeWhile1P :: Maybe String -> (Token Text -> Bool) -> Parser (Tokens Text) takeP :: Maybe String -> Int -> Parser (Tokens Text) getParserState :: Parser (State Text Void) updateParserState :: (State Text Void -> State Text Void) -> Parser () | |
| Stream (NoShareInput Text) | |
Defined in Text.Megaparsec.Stream Methods tokenToChunk :: Proxy (NoShareInput Text) -> Token (NoShareInput Text) -> Tokens (NoShareInput Text) tokensToChunk :: Proxy (NoShareInput Text) -> [Token (NoShareInput Text)] -> Tokens (NoShareInput Text) chunkToTokens :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> [Token (NoShareInput Text)] chunkLength :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> Int chunkEmpty :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> Bool take1_ :: NoShareInput Text -> Maybe (Token (NoShareInput Text), NoShareInput Text) takeN_ :: Int -> NoShareInput Text -> Maybe (Tokens (NoShareInput Text), NoShareInput Text) takeWhile_ :: (Token (NoShareInput Text) -> Bool) -> NoShareInput Text -> (Tokens (NoShareInput Text), NoShareInput Text) | |
| Stream (ShareInput Text) | |
Defined in Text.Megaparsec.Stream Methods tokenToChunk :: Proxy (ShareInput Text) -> Token (ShareInput Text) -> Tokens (ShareInput Text) tokensToChunk :: Proxy (ShareInput Text) -> [Token (ShareInput Text)] -> Tokens (ShareInput Text) chunkToTokens :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> [Token (ShareInput Text)] chunkLength :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> Int chunkEmpty :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> Bool take1_ :: ShareInput Text -> Maybe (Token (ShareInput Text), ShareInput Text) takeN_ :: Int -> ShareInput Text -> Maybe (Tokens (ShareInput Text), ShareInput Text) takeWhile_ :: (Token (ShareInput Text) -> Bool) -> ShareInput Text -> (Tokens (ShareInput Text), ShareInput Text) | |
| type ChunkElem Text | |
Defined in Data.Attoparsec.Internal.Types | |
| type State Text | |
Defined in Data.Attoparsec.Internal.Types type State Text = Buffer | |
| type Item Text | |
| type Token Text | |
Defined in Text.Megaparsec.Stream | |
| type Tokens Text | |
Defined in Text.Megaparsec.Stream | |
| type Token (NoShareInput Text) | |
Defined in Text.Megaparsec.Stream | |
| type Token (ShareInput Text) | |
Defined in Text.Megaparsec.Stream | |
| type Tokens (NoShareInput Text) | |
Defined in Text.Megaparsec.Stream | |
| type Tokens (ShareInput Text) | |
Defined in Text.Megaparsec.Stream | |
Boxed vectors, supporting efficient slicing.
Instances
| FromJSON1 Vector | |
| ToJSON1 Vector | |
Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Value) -> ([a] -> Value) -> Vector a -> Value Source # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Vector a] -> Value Source # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Vector a -> Encoding Source # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Vector a] -> Encoding Source # | |
| MonadFail Vector | Since: vector-0.12.1.0 |
| MonadFix Vector | This instance has the same semantics as the one for lists. Since: vector-0.12.2.0 |
| MonadZip Vector | |
| Foldable Vector | |
Defined in Data.Vector Methods fold :: Monoid m => Vector m -> m Source # foldMap :: Monoid m => (a -> m) -> Vector a -> m Source # foldMap' :: Monoid m => (a -> m) -> Vector a -> m Source # foldr :: (a -> b -> b) -> b -> Vector a -> b Source # foldr' :: (a -> b -> b) -> b -> Vector a -> b Source # foldl :: (b -> a -> b) -> b -> Vector a -> b Source # foldl' :: (b -> a -> b) -> b -> Vector a -> b Source # foldr1 :: (a -> a -> a) -> Vector a -> a Source # foldl1 :: (a -> a -> a) -> Vector a -> a Source # toList :: Vector a -> [a] Source # null :: Vector a -> Bool Source # length :: Vector a -> Int Source # elem :: Eq a => a -> Vector a -> Bool Source # maximum :: Ord a => Vector a -> a Source # minimum :: Ord a => Vector a -> a Source # | |
| Eq1 Vector | |
| Ord1 Vector | |
Defined in Data.Vector | |
| Read1 Vector | |
Defined in Data.Vector Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Vector a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Vector a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Vector a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Vector a] Source # | |
| Show1 Vector | |
| Traversable Vector | |
| Alternative Vector | |
| Applicative Vector | |
| Functor Vector | |
| Monad Vector | |
| MonadPlus Vector | |
| NFData1 Vector | Since: vector-0.12.1.0 |
Defined in Data.Vector | |
| Vector Vector a | |
Defined in Data.Vector Methods basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a) Source # basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a) Source # basicLength :: Vector a -> Int Source # basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a Source # basicUnsafeIndexM :: Vector a -> Int -> Box a Source # basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s () Source # | |
| FromJSON a => FromJSON (Vector a) | |
| ToJSON a => ToJSON (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) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) Source # toConstr :: Vector a -> Constr Source # dataTypeOf :: Vector a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) Source # gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) Source # | |
| Monoid (Vector a) | |
| Semigroup (Vector a) | |
| IsList (Vector a) | |
| Read a => Read (Vector a) | |
| Show a => Show (Vector a) | |
| NFData a => NFData (Vector a) | |
Defined in Data.Vector | |
| FromDhall a => FromDhall (Vector a) Source # | |
Defined in Dhall.Marshal.Decode | |
| ToDhall a => ToDhall (Vector a) Source # | |
Defined in Dhall.Marshal.Encode Methods injectWith :: InputNormalizer -> Encoder (Vector a) Source # | |
| Eq a => Eq (Vector a) | |
| Ord a => Ord (Vector a) | |
Defined in Data.Vector | |
| Serialise a => Serialise (Vector a) | |
Defined in Codec.Serialise.Class Methods encode :: Vector a -> Encoding decode :: Decoder s (Vector a) encodeList :: [Vector a] -> Encoding decodeList :: Decoder s [Vector a] | |
| type Mutable Vector | |
Defined in Data.Vector | |
| type Item (Vector a) | |
Defined in Data.Vector | |
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≡idto.from≡id