Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data NixString
- principledGetContext :: NixString -> HashSet StringContext
- principledMakeNixString :: Text -> HashSet StringContext -> NixString
- principledMempty :: NixString
- data StringContext = StringContext {
- scPath :: !Text
- scFlavor :: !ContextFlavor
- data ContextFlavor
- newtype NixLikeContext = NixLikeContext {}
- data NixLikeContextValue = NixLikeContextValue {
- nlcvPath :: !Bool
- nlcvAllOutputs :: !Bool
- nlcvOutputs :: ![Text]
- toNixLikeContext :: HashSet StringContext -> NixLikeContext
- fromNixLikeContext :: NixLikeContext -> HashSet StringContext
- stringHasContext :: NixString -> Bool
- principledIntercalateNixString :: NixString -> [NixString] -> NixString
- hackyGetStringNoContext :: NixString -> Maybe Text
- principledGetStringNoContext :: NixString -> Maybe Text
- principledStringIgnoreContext :: NixString -> Text
- hackyStringIgnoreContext :: NixString -> Text
- hackyMakeNixStringWithoutContext :: Text -> NixString
- principledMakeNixStringWithoutContext :: Text -> NixString
- principledMakeNixStringWithSingletonContext :: Text -> StringContext -> NixString
- principledModifyNixContents :: (Text -> Text) -> NixString -> NixString
- principledStringMappend :: NixString -> NixString -> NixString
- principledStringMempty :: NixString
- principledStringMConcat :: [NixString] -> NixString
- type WithStringContext = WithStringContextT Identity
- newtype WithStringContextT m a = WithStringContextT (WriterT (HashSet StringContext) m a)
- extractNixString :: Monad m => NixString -> WithStringContextT m Text
- addStringContext :: Monad m => HashSet StringContext -> WithStringContextT m ()
- addSingletonStringContext :: Monad m => StringContext -> WithStringContextT m ()
- runWithStringContextT :: Monad m => WithStringContextT m Text -> m NixString
- runWithStringContext :: WithStringContextT Identity Text -> NixString
Documentation
Instances
Eq NixString Source # | |
Ord NixString Source # | |
Defined in Nix.String | |
Show NixString Source # | |
Generic NixString Source # | |
Hashable NixString Source # | |
Defined in Nix.String | |
FromValue NixString m (Symbolic m) Source # | |
Convertible e t f m => ToValue NixString m (NValue' t f m (NValue t f m)) Source # | |
(Convertible e t f m, MonadValue (NValue t f m) m, MonadEffects t f m) => FromValue NixString m (NValue' t f m (NValue t f m)) Source # | |
type Rep NixString Source # | |
Defined in Nix.String type Rep NixString = D1 ('MetaData "NixString" "Nix.String" "hnix-0.9.0-inplace" 'False) (C1 ('MetaCons "NixString" 'PrefixI 'True) (S1 ('MetaSel ('Just "nsContents") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "nsContext") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet StringContext)))) |
principledMakeNixString :: Text -> HashSet StringContext -> NixString Source #
Create a NixString from a Text and context
principledMempty :: NixString Source #
Combine two NixStrings using mappend
data StringContext Source #
A StringContext
...
StringContext | |
|
Instances
data ContextFlavor Source #
A ContextFlavor
describes the sum of possible derivations for string contexts
Instances
newtype NixLikeContext Source #
Instances
data NixLikeContextValue Source #
NixLikeContextValue | |
|
Instances
stringHasContext :: NixString -> Bool Source #
Returns True if the NixString has an associated context
principledIntercalateNixString :: NixString -> [NixString] -> NixString Source #
Combine NixStrings with a separator
hackyGetStringNoContext :: NixString -> Maybe Text Source #
Extract the string contents from a NixString that has no context
principledGetStringNoContext :: NixString -> Maybe Text Source #
Extract the string contents from a NixString that has no context
principledStringIgnoreContext :: NixString -> Text Source #
Extract the string contents from a NixString even if the NixString has an associated context
hackyStringIgnoreContext :: NixString -> Text Source #
Extract the string contents from a NixString even if the NixString has an associated context
hackyMakeNixStringWithoutContext :: Text -> NixString Source #
Constructs a NixString without a context
principledMakeNixStringWithoutContext :: Text -> NixString Source #
Constructs a NixString without a context
principledMakeNixStringWithSingletonContext :: Text -> StringContext -> NixString Source #
Create a NixString using a singleton context
principledModifyNixContents :: (Text -> Text) -> NixString -> NixString Source #
Modify the string part of the NixString, leaving the context unchanged
principledStringMappend :: NixString -> NixString -> NixString Source #
Combine two NixStrings using mappend
principledStringMempty :: NixString Source #
Empty string with empty context.
principledStringMConcat :: [NixString] -> NixString Source #
Combine NixStrings using mconcat
newtype WithStringContextT m a Source #
A monad for accumulating string context while producing a result string.
Instances
extractNixString :: Monad m => NixString -> WithStringContextT m Text Source #
Get the contents of a NixString
and write its context into the resulting set.
addStringContext :: Monad m => HashSet StringContext -> WithStringContextT m () Source #
Add StringContext
s into the resulting set.
addSingletonStringContext :: Monad m => StringContext -> WithStringContextT m () Source #
Add a StringContext
into the resulting set.
runWithStringContextT :: Monad m => WithStringContextT m Text -> m NixString Source #
Run an action producing a string with a context and put those into a NixString
.
runWithStringContext :: WithStringContextT Identity Text -> NixString Source #
Run an action producing a string with a context and put those into a NixString
.