Copyright | Copyright © 2014-2015 PivotCloud Inc. |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <[email protected]> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Configuration.Utils.Internal
Contents
Description
Synopsis
- lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
- over :: Setter s t a b -> (a -> b) -> s -> t
- set :: Setter s t a b -> b -> s -> t
- view :: MonadReader r m => ((a -> Const a a) -> r -> Const a r) -> m a
- type Lens' s a = Lens s s a a
- type Lens s t a b = forall (f :: Type -> Type). Functor f => (a -> f b) -> s -> f t
- type Setter' s a = Setter s s a a
- type Setter s t a b = (a -> Identity b) -> s -> Identity t
- type Iso' s a = Iso s s a a
- type Iso s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Profunctor p, Functor f) => p a (f b) -> p s (f t)
- iso :: (s -> a) -> (b -> t) -> Iso s t a b
- (&) :: a -> (a -> b) -> b
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- sshow :: (Show a, IsString s) => a -> s
- exceptT :: Monad m => (e -> m b) -> (a -> m b) -> ExceptT e m a -> m b
- errorT :: Monad m => ExceptT Text m a -> m a
Lenses
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 :: Type -> Type). 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 Setter' s a = Setter s s a a Source #
This is almost 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 Setter s t a b = (a -> Identity b) -> s -> Identity t Source #
This is almost 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 t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (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.
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 $
.
This is a version of
, where flip
id
id
is specialized from a -> a
to (a -> b) -> (a -> b)
which by the associativity of (->)
is (a -> b) -> a -> b
.
flipping this yields a -> (a -> b) -> b
which is the type signature of &
Examples
>>>
5 & (+1) & show
"6"
>>>
sqrt $ [1 / n^2 | n <- [1..1000]] & sum & (*6)
3.1406380562059946
Since: base-4.8.0.0