Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype TemplateKey = TemplateKey {}
- newtype TemplateValue = TemplateValue {}
- data Template a = Template {}
- data Uninterpolated a
- data InterpolationFailure
- newtype InterpolationContext = InterpolationContext {}
- class FromTemplateValue a where
- class ToTemplateValue a where
- newtype Interpolator templates identities = Interpolator {
- runInterpolator :: templates -> Reader InterpolationContext (Validation [InterpolationFailure] identities)
- runTemplate :: FromTemplateValue a => Interpolator (Uninterpolated a) a
- mkInterpolationContext :: MonadIO m => m InterpolationContext
- interpolateWithContext :: (Default Interpolator templates identities, MonadIO m) => templates -> m (Either [InterpolationFailure] identities)
- interpolateWithContextExplicit :: MonadIO m => Interpolator templates identities -> templates -> m (Either [InterpolationFailure] identities)
- maybeGen :: Gen a -> Gen (Maybe a)
- noEnv :: Gen Text
- noColons :: Gen Text
Documentation
newtype TemplateKey Source #
Newtype wrapper for an environment variable key.
newtype TemplateValue Source #
Newtype wrapper for an environment variable value.
Type for a value that is described by '_env:ENVIRONMENT_VARIABLE:default' in JSON.
data Uninterpolated a Source #
Type for a value that can be described either with '_env...' or as just a literal value in JSON.
FromTemplateValue a => Default Interpolator (Uninterpolated a) a Source # | When we can parse template values, we can interpolate from the template. |
Eq a => Eq (Uninterpolated a) Source # | |
Ord a => Ord (Uninterpolated a) Source # | |
Show a => Show (Uninterpolated a) Source # | |
Arbitrary a => Arbitrary (Uninterpolated a) Source # | |
Arbitrary (Uninterpolated Text) Source # | |
(ToTemplateValue a, ToJSON a) => ToJSON (Uninterpolated a) Source # | |
(FromTemplateValue a, FromJSON a) => FromJSON (Uninterpolated a) Source # | |
data InterpolationFailure Source #
newtype InterpolationContext Source #
class FromTemplateValue a where Source #
A class for parsing environment variable values, which should only be defined on primitives.
Similar to Read
except that for text-type values it should parse using identity.
parseTemplateValue :: TemplateValue -> Maybe a Source #
class ToTemplateValue a where Source #
A class for showing environment variable values, which should only be defined on primitives.
Similar to Show
except that for text-type values it should use identity.
toTemplateValue :: a -> TemplateValue Source #
newtype Interpolator templates identities Source #
Interpolator | |
|
Profunctor Interpolator Source # | |
ProductProfunctor Interpolator Source # | |
SumProfunctor Interpolator Source # | |
Default Interpolator a a Source # | Pure transformation for the identity interpolation. FIXME this is too clunky for overlapping instances, define an auxiliary class (or type) for IdentityInterpolation. |
FromTemplateValue a => Default Interpolator (Uninterpolated a) a Source # | When we can parse template values, we can interpolate from the template. |
Default Interpolator a b => Default Interpolator [a] [b] Source # | |
Default Interpolator a b => Default Interpolator (Maybe a) (Maybe b) Source # | |
(Default Interpolator a b, Ord a, Ord b) => Default Interpolator (Set a) (Set b) Source # | |
Default Interpolator a b => Default Interpolator (Map k a) (Map k b) Source # | |
Functor (Interpolator templates) Source # | |
Applicative (Interpolator templates) Source # | |
runTemplate :: FromTemplateValue a => Interpolator (Uninterpolated a) a Source #
Run a template using the interpolation context and failing if the value is not found or not readable.
mkInterpolationContext :: MonadIO m => m InterpolationContext Source #
interpolateWithContext :: (Default Interpolator templates identities, MonadIO m) => templates -> m (Either [InterpolationFailure] identities) Source #
interpolateWithContextExplicit :: MonadIO m => Interpolator templates identities -> templates -> m (Either [InterpolationFailure] identities) Source #