configuration-tools-0.6.0: Tools for specifying and parsing configurations

Configuration.Utils.Internal

Contents

Description

Synopsis

# Lenses

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source #

over :: ((a -> Identity b) -> s -> Identity t) -> (a -> b) -> s -> t Source #

set :: ((a -> Identity b) -> s -> Identity t) -> b -> s -> t Source #

view :: MonadReader r m => ((a -> Const a a) -> r -> Const a r) -> m a Source #

type Lens' s a = Lens s s a a Source #

This is the same type as the type from the lens library with the same name.

In case it is already import from the lens package this should be hidden from the import.

type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t Source #

This is the same type as the type from the lens library with the same name.

In case it is already import from the lens package this should be hidden from the import.

type Iso' s a = Iso s s a a Source #

type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t) Source #

This is the same type as the type from the lens library with the same name.

In case it is already import from the lens package this should be hidden from the import.

iso :: (s -> a) -> (b -> t) -> Iso s t a b Source #

# Misc Utils

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in$.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 #

Flipped version of <\$>.

(<&>) = flip fmap

#### Examples

Expand

Apply (+1) to a list, a Just and a Right:

>>> Just 2 <&> (+1)
Just 3
>>> [1,2,3] <&> (+1)
[2,3,4]
>>> Right 3 <&> (+1)
Right 4

Since: base-4.11.0.0

sshow :: (Show a, IsString s) => a -> s Source #

exceptT :: Monad m => (e -> m b) -> (a -> m b) -> ExceptT e m a -> m b Source #

errorT :: Monad m => ExceptT Text m a -> m a Source #