Copyright | (c) 2018-2022 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Toml.Type.AnyValue
Contents
Description
Existential wrapper over Value
type and matching functions.
Since: 0.0.0
Synopsis
- data AnyValue = AnyValue (Value t)
- reifyAnyValues :: forall (t :: TValue). Value t -> [AnyValue] -> Either TypeMismatchError [Value t]
- toMArray :: [AnyValue] -> Either MatchError (Value 'TArray)
- data MatchError = MatchError {
- valueExpected :: !TValue
- valueActual :: !AnyValue
- mkMatchError :: forall (t :: TValue) a. TValue -> Value t -> Either MatchError a
- matchBool :: forall (t :: TValue). Value t -> Either MatchError Bool
- matchInteger :: forall (t :: TValue). Value t -> Either MatchError Integer
- matchDouble :: forall (t :: TValue). Value t -> Either MatchError Double
- matchText :: forall (t :: TValue). Value t -> Either MatchError Text
- matchZoned :: forall (t :: TValue). Value t -> Either MatchError ZonedTime
- matchLocal :: forall (t :: TValue). Value t -> Either MatchError LocalTime
- matchDay :: forall (t :: TValue). Value t -> Either MatchError Day
- matchHours :: forall (t :: TValue). Value t -> Either MatchError TimeOfDay
- matchArray :: forall a (t :: TValue). (AnyValue -> Either MatchError a) -> Value t -> Either MatchError [a]
- applyAsToAny :: forall r (t :: TValue). (AnyValue -> r) -> Value t -> r
Documentation
Existential wrapper for Value
.
Since: 0.0.0
reifyAnyValues :: forall (t :: TValue). Value t -> [AnyValue] -> Either TypeMismatchError [Value t] #
Matching
data MatchError #
Value type mismatch error.
Constructors
MatchError | |
Fields
|
Instances
mkMatchError :: forall (t :: TValue) a. TValue -> Value t -> Either MatchError a #
Helper function to create MatchError
.
matchInteger :: forall (t :: TValue). Value t -> Either MatchError Integer #
matchDouble :: forall (t :: TValue). Value t -> Either MatchError Double #
matchZoned :: forall (t :: TValue). Value t -> Either MatchError ZonedTime #
matchLocal :: forall (t :: TValue). Value t -> Either MatchError LocalTime #
matchHours :: forall (t :: TValue). Value t -> Either MatchError TimeOfDay #
matchArray :: forall a (t :: TValue). (AnyValue -> Either MatchError a) -> Value t -> Either MatchError [a] #
Extract list of elements of type a
from array.