Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- stub :: (Applicative f, Monoid a) => f a
- pass :: Applicative f => f ()
- dup :: a -> (a, a)
- both :: (a -> b) -> (a, a) -> (b, b)
- mapPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
- iterateN :: forall a. Int -> (a -> a) -> a -> a
- nestM :: Monad m => Int -> (a -> m a) -> a -> m a
- applyAll :: Foldable t => t (a -> a) -> a -> a
- traverse2 :: (Applicative m, Applicative n, Traversable t) => (a -> m (n b)) -> t a -> m (n (t b))
- lifted :: (MonadTransControl u, Monad (u m), Monad m) => ((a -> m (StT u b)) -> m (StT u b)) -> (a -> u m b) -> u m b
- whenTrue :: Monoid a => a -> Bool -> a
- whenFalse :: Monoid a => a -> Bool -> a
- whenJust :: Monoid b => (a -> b) -> Maybe a -> b
- isPresent :: Foldable t => t a -> Bool
- handlePresence :: Foldable t => b -> (t a -> b) -> t a -> b
- whenText :: a -> (Text -> a) -> Text -> a
- free :: (a -> b) -> (f (Free f a) -> b) -> Free f a -> b
- newtype Path = Path FilePath
- isAbsolute :: Path -> Bool
- (</>) :: Path -> Path -> Path
- joinPath :: [Path] -> Path
- splitDirectories :: Path -> [Path]
- takeDirectory :: Path -> Path
- takeFileName :: Path -> Path
- takeBaseName :: Path -> String
- takeExtension :: Path -> String
- takeExtensions :: Path -> String
- addExtension :: Path -> String -> Path
- dropExtensions :: Path -> Path
- replaceExtension :: Path -> String -> Path
- readFile :: MonadIO m => Path -> m Text
- type Alg f a = f a -> a
- type Transform f a = TransformF (Fix f) a
- type TransformF f a = (f -> a) -> f -> a
- loebM :: (MonadFix m, Traversable t) => t (t a -> m a) -> m (t a)
- adi :: Functor f => Transform f a -> Alg f a -> Fix f -> a
- class Has a b where
- askLocal :: (MonadReader t m, Has t a) => m a
- type KeyMap = HashMap Text
- trace :: String -> a -> a
- traceM :: Monad m => String -> m ()
- over :: Setter s t a b -> (a -> b) -> s -> t
- type Lens' s a = forall (f :: Type -> Type). Functor f => LensLike' f s a
- type LensLike' (f :: Type -> Type) s a = (a -> f a) -> s -> f s
- view :: FoldLike a s t a b -> s -> a
Documentation
stub :: (Applicative f, Monoid a) => f a Source #
pure mempty
: Short-curcuit, stub.
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
:: (Applicative m, Applicative n, Traversable t) | |
=> (a -> m (n b)) | Run function that runs 2 |
-> t a | on every element in |
-> m (n (t b)) | collect the results. |
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 #
handlePresence :: Foldable t => b -> (t a -> b) -> t a -> b Source #
maybe
-like eliminator, for foldable empty/inhabited structures.
free :: (a -> b) -> (f (Free f a) -> b) -> Free f a -> b Source #
Lambda analog of maybe
or either
for Free monad.
Explicit type boundary between FilePath & String.
Instances
FromJSON Path Source # | |
ToJSON Path Source # | |
Data Path Source # | |
Defined in Nix.Utils gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Path -> c Path # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Path # dataTypeOf :: Path -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Path) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Path) # gmapT :: (forall b. Data b => b -> b) -> Path -> Path # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Path -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Path -> r # gmapQ :: (forall d. Data d => d -> u) -> Path -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Path -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Path -> m Path # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Path -> m Path # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Path -> m Path # | |
IsString Path Source # | |
Defined in Nix.Utils fromString :: String -> Path # | |
Monoid Path Source # | |
Semigroup Path Source # | |
Generic Path Source # | |
Read Path Source # | |
Show Path Source # | |
Binary Path Source # | |
NFData Path Source # | |
Eq Path Source # | |
Ord Path Source # | |
Hashable Path Source # | |
ToText Path Source # | |
Serialise Path Source # | |
(Convertible e t f m, MonadValue (NValue t f m) m) => FromValue Path m (NValue' t f m (NValue t f m)) Source # | |
Convertible e t f m => ToValue Path m (NValue' t f m (NValue t f m)) Source # | |
Monad m => MonadState (HashMap Path NExprLoc, HashMap Text Text) (StandardTF r m) Source # | |
type Rep Path Source # | |
isAbsolute :: Path -> Bool Source #
This set of Path
funcs is to control system filepath types & typesafety and to easily migrate from FilePath to anything suitable (like path
or so).
splitDirectories :: Path -> [Path] Source #
takeDirectory :: Path -> Path Source #
takeFileName :: Path -> Path Source #
takeBaseName :: Path -> String Source #
takeExtension :: Path -> String Source #
takeExtensions :: Path -> String Source #
dropExtensions :: Path -> Path Source #
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
type Transform f a = TransformF (Fix f) a Source #
Do according transformation.
It is a transformation of a recursion scheme.
See TransformF
.
type TransformF f a = (f -> a) -> f -> a Source #
Do according transformation.
It is a transformation between functors.
loebM :: (MonadFix m, Traversable t) => t (t a -> m a) -> m (t a) Source #
adi :: Functor f => Transform f a -> Alg f a -> Fix f -> a Source #
adi is Abstracting Definitional Interpreters:
https://arxiv.org/abs/1707.04755
All ADI does is interleaves every layer of evaluation by inserting intermitten layers between them, in that way the evaluation can be extended/embelished in any way wanted. Look at its use to see great examples.
Essentially, it does for evaluation what recursion schemes do for representation: allows threading layers through existing structure, only in this case through behavior.
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.