Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- trace :: String -> a -> a
- traceM :: Monad m => String -> m ()
- data NixPathEntryType
- class Has a b where
- type TransformF f a = (f -> a) -> f -> a
- type Transform f a = TransformF (Fix f) a
- type AlgM f m a = f a -> m a
- type Alg f a = f a -> a
- type AttrSet = HashMap Text
- _unFix :: Functor f1 => (f2 (Fix f2) -> f1 (f3 (Fix f3))) -> Fix f2 -> f1 (Fix f3)
- loeb :: Functor f => f (f a -> a) -> f a
- loebM :: (MonadFix m, Traversable t) => t (t a -> m a) -> m (t a)
- para :: Functor f => (f (Fix f, a) -> a) -> Fix f -> a
- paraM :: (Traversable f, Monad m) => (f (Fix f, a) -> m a) -> Fix f -> m a
- cataP :: Functor f => (Fix f -> f a -> a) -> Fix f -> a
- cataPM :: (Traversable f, Monad m) => (Fix f -> f a -> m a) -> Fix f -> m a
- lifted :: (MonadTransControl u, Monad (u m), Monad m) => ((a -> m (StT u b)) -> m (StT u b)) -> (a -> u m b) -> u m b
- freeToFix :: Functor f => (a -> Fix f) -> Free f a -> Fix f
- fixToFree :: Functor f => Fix f -> Free f a
- adi :: Functor f => Transform f a -> Alg f a -> Fix f -> a
- adiM :: (Traversable t, Monad m) => Transform t (m a) -> AlgM t m a -> Fix t -> m a
- toEncodingSorted :: Value -> Encoding
- uriAwareSplit :: Text -> [(Text, NixPathEntryType)]
- alterF :: (Eq k, Hashable k, Functor f) => (Maybe v -> f (Maybe v)) -> k -> HashMap k v -> f (HashMap k v)
- list :: Foldable t => b -> (t a -> b) -> t a -> b
- free :: (a -> b) -> (f (Free f a) -> b) -> Free f a -> b
- whenTrue :: Monoid a => a -> Bool -> a
- whenFalse :: Monoid a => a -> Bool -> a
- whenFree :: Monoid b => (f (Free f a) -> b) -> Free f a -> b
- whenPure :: Monoid b => (a -> b) -> Free f a -> b
- both :: (a -> b) -> (a, a) -> (b, b)
- dup :: a -> (a, a)
- mapPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
- stub :: (Applicative f, Monoid a) => f a
- (<>~) :: Monoid a => Setter s t a a -> a -> s -> t
- (||~) :: Setter s t Bool Bool -> Bool -> s -> t
- (&&~) :: Setter s t Bool Bool -> Bool -> s -> t
- (//~) :: Fractional a => Setter s t a a -> a -> s -> t
- (*~) :: Num a => Setter s t a a -> a -> s -> t
- (-~) :: Num a => Setter s t a a -> a -> s -> t
- (+~) :: Num a => Setter s t a a -> a -> s -> t
- set :: Setter s t a b -> b -> s -> t
- (.~) :: Setter s t a b -> b -> s -> t
- (%~) :: Setter s t a b -> (a -> b) -> s -> t
- over :: Setter s t a b -> (a -> b) -> s -> t
- reset :: Resetter s t a b -> b -> s -> t
- under :: Resetter s t a b -> (a -> b) -> s -> t
- degrating :: Grate s t a b -> ((s -> a) -> b) -> t
- zipWithOf :: Grate s t a b -> (a -> a -> b) -> s -> s -> t
- matching :: Traversal s t a b -> s -> Either t a
- (^?) :: s -> Fold s t a b -> Maybe a
- (^..) :: s -> Fold s t a b -> [a]
- nullOf :: Fold s t a b -> s -> Bool
- lengthOf :: Num r => Fold s t a b -> s -> r
- productOf :: Num a => Fold s t a b -> s -> a
- sumOf :: Num a => Fold s t a b -> s -> a
- lastOf :: Fold s t a b -> s -> Maybe a
- firstOf :: Fold s t a b -> s -> Maybe a
- anyOf :: Fold s t a b -> (a -> Bool) -> s -> Bool
- allOf :: Fold s t a b -> (a -> Bool) -> s -> Bool
- toListOf :: Fold s t a b -> s -> [a]
- folding :: Foldable f => (s -> f a) -> Fold s t a b
- to :: (s -> a) -> Getter s t a b
- type Grid s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Functor g) => AdapterLike f g s t a b
- type Grid' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Functor g) => AdapterLike' f g s a
- type Fold s t a b = forall (f :: Type -> Type). (Phantom f, Applicative f) => LensLike f s t a b
- type Fold' s a = forall (f :: Type -> Type). (Phantom f, Applicative f) => LensLike' f s a
- type Getter s t a b = forall (f :: Type -> Type). Phantom f => LensLike f s t a b
- type Getter' s a = forall (f :: Type -> Type). Phantom f => LensLike' f s a
- type Reviewer s t a b = forall (f :: Type -> Type). Phantom f => GrateLike f s t a b
- type Reviewer' s a = forall (f :: Type -> Type). Phantom f => GrateLike' f s a
- type Adapter s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Functor f, Functor g) => AdapterLike f g s t a b
- type Adapter' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Functor f, Functor g) => AdapterLike' f g s a
- type Prism s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Traversable g) => AdapterLike f g s t a b
- type Prism' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Traversable g) => AdapterLike' f g s a
- type Lens s t a b = forall (f :: Type -> Type). Functor f => LensLike f s t a b
- type Lens' s a = forall (f :: Type -> Type). Functor f => LensLike' f s a
- type Traversal s t a b = forall (f :: Type -> Type). Applicative f => LensLike f s t a b
- type Traversal' s a = forall (f :: Type -> Type). Applicative f => LensLike' f s a
- type Setter s t a b = forall (f :: Type -> Type). Identical f => LensLike f s t a b
- type Setter' s a = forall (f :: Type -> Type). Identical f => LensLike' f s a
- type Grate s t a b = forall (g :: Type -> Type). Functor g => GrateLike g s t a b
- type Grate' s a = forall (g :: Type -> Type). Functor g => GrateLike' g s a
- data Constant a (b :: k)
- class (Traversable f, Applicative f) => Identical (f :: Type -> Type)
- class Functor f => Phantom (f :: Type -> Type)
- type GrateLike' (g :: Type -> Type) s a = (g a -> a) -> g s -> s
- type GrateLike (g :: Type -> Type) s t a b = (g a -> b) -> g s -> t
- type LensLike' (f :: Type -> Type) s a = (a -> f a) -> s -> f s
- type LensLike (f :: Type -> Type) s t a b = (a -> f b) -> s -> f t
- type AdapterLike' (f :: Type -> Type) (g :: Type -> Type) s a = (g a -> f a) -> g s -> f s
- type AdapterLike (f :: Type -> Type) (g :: Type -> Type) s t a b = (g a -> f b) -> g s -> f t
- type FoldLike' r s a = LensLike' (Constant r :: Type -> Type) s a
- type FoldLike r s t a b = LensLike (Constant r :: Type -> Type) s t a b
- view :: FoldLike a s t a b -> s -> a
- views :: FoldLike r s t a b -> (a -> r) -> s -> r
- (^.) :: s -> FoldLike a s t a b -> a
- review :: GrateLike (Constant () :: Type -> Type) s t a b -> b -> t
Documentation
data NixPathEntryType Source #
Instances
Eq NixPathEntryType Source # | |
Defined in Nix.Utils (==) :: NixPathEntryType -> NixPathEntryType -> Bool # (/=) :: NixPathEntryType -> NixPathEntryType -> Bool # | |
Show NixPathEntryType Source # | |
Defined in Nix.Utils showsPrec :: Int -> NixPathEntryType -> ShowS # show :: NixPathEntryType -> String # showList :: [NixPathEntryType] -> ShowS # |
type TransformF f a = (f -> a) -> f -> a Source #
Do according transformation.
It is a transformation between functors. ... You got me, it is a natural transformation.
type Transform f a = TransformF (Fix f) a Source #
Do according transformation.
It is a transformation of a recursion scheme.
See TransformF
.
type Alg f a = f a -> a Source #
F-algebra defines how to reduce the fixed-point of a functor to a value. > type Alg f a = f a -> a
loebM :: (MonadFix m, Traversable t) => t (t a -> m a) -> m (t a) Source #
lifted :: (MonadTransControl u, Monad (u m), Monad m) => ((a -> m (StT u b)) -> m (StT u b)) -> (a -> u m b) -> u m b Source #
freeToFix :: Functor f => (a -> Fix f) -> Free f a -> Fix f Source #
Replace:
Pure a -> a
Free -> Fix
adi :: Functor f => Transform f a -> Alg f a -> Fix f -> a Source #
adi is Abstracting Definitional Interpreters:
https://arxiv.org/abs/1707.04755
Essentially, it does for evaluation what recursion schemes do for representation: allows threading layers through existing structure, only in this case through behavior.
toEncodingSorted :: Value -> Encoding Source #
uriAwareSplit :: Text -> [(Text, NixPathEntryType)] Source #
NIX_PATH
is colon-separated, but can also contain URLs, which have a colon
(i.e. https://...
)
alterF :: (Eq k, Hashable k, Functor f) => (Maybe v -> f (Maybe v)) -> k -> HashMap k v -> f (HashMap k v) Source #
list :: Foldable t => b -> (t a -> b) -> t a -> b Source #
Analog for bool
or maybe
, for list-like cons structures.
free :: (a -> b) -> (f (Free f a) -> b) -> Free f a -> b Source #
Lambda analog of maybe
or either
for Free monad.
both :: (a -> b) -> (a, a) -> (b, b) Source #
Apply a single function to both components of a pair.
both succ (1,2) == (2,3)
Taken From package extra
stub :: (Applicative f, Monoid a) => f a Source #
pure mempty
: Short-curcuit, stub.
(<>~) :: Monoid a => Setter s t a a -> a -> s -> t infixr 4 #
Monoidally append a value to all referenced fields.
(//~) :: Fractional a => Setter s t a a -> a -> s -> t infixr 4 #
over :: Setter s t a b -> (a -> b) -> s -> t #
Demote a setter to a semantic editor combinator.
over :: Prism s t a b -> Reviwer s t a b over :: Grid s t a b -> Grate s t a b over :: Adapter s t a b -> Grate s t a b
Covert an AdapterLike
optic into a GrateLike
optic.
under :: Resetter s t a b -> (a -> b) -> s -> t #
Demote a resetter to a semantic editor combinator.
under :: Prism s t a b -> Traversal s t a b under :: Grid s t a b -> Traversal s t a b under :: Adapter s t a b -> Lens s t a b
Covert an AdapterLike
optic into a LensLike
optic.
Note: this function is unrelated to the lens package's under
function.
degrating :: Grate s t a b -> ((s -> a) -> b) -> t #
Demote a grate to its normal, higher-order function, form.
degrating . grate = id grate . degrating = id
zipWithOf :: Grate s t a b -> (a -> a -> b) -> s -> s -> t #
Returns a binary instance of a grate.
zipWithOf l f x y = degrating l (k -> f (k x) (k y))
(^..) :: s -> Fold s t a b -> [a] infixl 8 #
Returns a list of all of the referenced values in order.
lengthOf :: Num r => Fold s t a b -> s -> r #
Counts the number of references in a traversal or fold for the input.
anyOf :: Fold s t a b -> (a -> Bool) -> s -> Bool #
Returns true if any of the referenced values satisfy the given predicate.
allOf :: Fold s t a b -> (a -> Bool) -> s -> Bool #
Returns true if all of the referenced values satisfy the given predicate.
folding :: Foldable f => (s -> f a) -> Fold s t a b #
folding
promotes a "toList" function to a read-only traversal called a fold.
To demote a traversal or fold to a "toList" function use the section (^..l)
or toListOf l
.
to :: (s -> a) -> Getter s t a b #
to
promotes a projection function to a read-only lens called a getter.
To demote a lens to a projection function, use the section (^.l)
or view l
.
>>>
(3 :+ 4, "example")^._1.to(abs)
5.0 :+ 0.0
type Grid s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Functor g) => AdapterLike f g s t a b #
type Grid' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Functor g) => AdapterLike' f g s a #
type Adapter s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Functor f, Functor g) => AdapterLike f g s t a b #
type Adapter' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Functor f, Functor g) => AdapterLike' f g s a #
type Prism s t a b = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Traversable g) => AdapterLike f g s t a b #
type Prism' s a = forall (f :: Type -> Type) (g :: Type -> Type). (Applicative f, Traversable g) => AdapterLike' f g s a #
type Traversal' s a = forall (f :: Type -> Type). Applicative f => LensLike' f s a #
Constant functor.
Instances
class Functor f => Phantom (f :: Type -> Type) #
coerce
Instances
Phantom (Const a :: Type -> Type) | |
Defined in Lens.Family.Phantom | |
Phantom (Constant a :: Type -> Type) | |
Defined in Lens.Family.Phantom | |
Phantom f => Phantom (Backwards f) | |
Defined in Lens.Family.Phantom | |
(Phantom f, Functor g) => Phantom (Compose f g) | |
Defined in Lens.Family.Phantom |
type GrateLike' (g :: Type -> Type) s a = (g a -> a) -> g s -> s #
view :: FoldLike a s t a b -> s -> a #
view :: Getter s t a b -> s -> a
Demote a lens or getter to a projection function.
view :: Monoid a => Fold s t a b -> s -> a
Returns the monoidal summary of a traversal or a fold.
views :: FoldLike r s t a b -> (a -> r) -> s -> r #
views :: Monoid r => Fold s t a b -> (a -> r) -> s -> r
Given a fold or traversal, return the foldMap
of all the values using the given function.
views :: Getter s t a b -> (a -> r) -> s -> r
views
is not particularly useful for getters or lenses, but given a getter or lens, it returns the referenced value passed through the given function.
views l f s = f (view l s)