| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Nix.String
Synopsis
- data NixString
- getStringContext :: NixString -> HashSet StringContext
- mkNixString :: HashSet StringContext -> Text -> NixString
- data StringContext = StringContext {}
- data ContextFlavor
- newtype NixLikeContext = NixLikeContext {}
- data NixLikeContextValue = NixLikeContextValue {
- nlcvPath :: !Bool
- nlcvAllOutputs :: !Bool
- nlcvOutputs :: ![Text]
- toNixLikeContext :: HashSet StringContext -> NixLikeContext
- fromNixLikeContext :: NixLikeContext -> HashSet StringContext
- hasContext :: NixString -> Bool
- intercalateNixString :: NixString -> [NixString] -> NixString
- getStringNoContext :: NixString -> Maybe Text
- ignoreContext :: NixString -> Text
- mkNixStringWithoutContext :: Text -> NixString
- mkNixStringWithSingletonContext :: StringContext -> VarName -> NixString
- modifyNixContents :: (Text -> Text) -> NixString -> NixString
- type WithStringContext = WithStringContextT Identity
- newtype WithStringContextT (m :: Type -> Type) a = WithStringContextT (WriterT (HashSet StringContext) m a)
- extractNixString :: forall (m :: Type -> Type). Monad m => NixString -> WithStringContextT m Text
- addStringContext :: forall (m :: Type -> Type). Monad m => HashSet StringContext -> WithStringContextT m ()
- addSingletonStringContext :: forall (m :: Type -> Type). Monad m => StringContext -> WithStringContextT m ()
- runWithStringContextT :: Monad m => WithStringContextT m Text -> m NixString
- runWithStringContextT' :: Monad m => WithStringContextT m a -> m (a, HashSet StringContext)
- runWithStringContext :: WithStringContextT Identity Text -> NixString
- runWithStringContext' :: WithStringContextT Identity a -> (a, HashSet StringContext)
Documentation
Instances
mkNixString :: HashSet StringContext -> Text -> NixString Source #
Create NixString from a Text and context
data StringContext Source #
A Nix StringContext ...
Constructors
| StringContext | |
Fields | |
Instances
| Generic StringContext Source # | |||||
Defined in Nix.String Associated Types
| |||||
| Show StringContext Source # | |||||
Defined in Nix.String Methods showsPrec :: Int -> StringContext -> ShowS # show :: StringContext -> String # showList :: [StringContext] -> ShowS # | |||||
| Eq StringContext Source # | |||||
Defined in Nix.String Methods (==) :: StringContext -> StringContext -> Bool # (/=) :: StringContext -> StringContext -> Bool # | |||||
| Ord StringContext Source # | |||||
Defined in Nix.String Methods compare :: StringContext -> StringContext -> Ordering # (<) :: StringContext -> StringContext -> Bool # (<=) :: StringContext -> StringContext -> Bool # (>) :: StringContext -> StringContext -> Bool # (>=) :: StringContext -> StringContext -> Bool # max :: StringContext -> StringContext -> StringContext # min :: StringContext -> StringContext -> StringContext # | |||||
| Hashable StringContext Source # | |||||
Defined in Nix.String | |||||
| Monad m => MonadWriter (HashSet StringContext) (WithStringContextT m) Source # | |||||
Defined in Nix.String Methods writer :: (a, HashSet StringContext) -> WithStringContextT m a # tell :: HashSet StringContext -> WithStringContextT m () # listen :: WithStringContextT m a -> WithStringContextT m (a, HashSet StringContext) # pass :: WithStringContextT m (a, HashSet StringContext -> HashSet StringContext) -> WithStringContextT m a # | |||||
| type Rep StringContext Source # | |||||
Defined in Nix.String type Rep StringContext = D1 ('MetaData "StringContext" "Nix.String" "hnix-0.17.0-822MukN0dHtG1UXXNqsDIm" 'False) (C1 ('MetaCons "StringContext" 'PrefixI 'True) (S1 ('MetaSel ('Just "getStringContextFlavor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ContextFlavor) :*: S1 ('MetaSel ('Just "getStringContextPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName))) | |||||
data ContextFlavor Source #
A ContextFlavor describes the sum of possible derivations for string contexts
Constructors
| DirectPath | |
| AllOutputs | |
| DerivationOutput !Text |
Instances
| Generic ContextFlavor Source # | |||||
Defined in Nix.String Associated Types
| |||||
| Show ContextFlavor Source # | |||||
Defined in Nix.String Methods showsPrec :: Int -> ContextFlavor -> ShowS # show :: ContextFlavor -> String # showList :: [ContextFlavor] -> ShowS # | |||||
| Eq ContextFlavor Source # | |||||
Defined in Nix.String Methods (==) :: ContextFlavor -> ContextFlavor -> Bool # (/=) :: ContextFlavor -> ContextFlavor -> Bool # | |||||
| Ord ContextFlavor Source # | |||||
Defined in Nix.String Methods compare :: ContextFlavor -> ContextFlavor -> Ordering # (<) :: ContextFlavor -> ContextFlavor -> Bool # (<=) :: ContextFlavor -> ContextFlavor -> Bool # (>) :: ContextFlavor -> ContextFlavor -> Bool # (>=) :: ContextFlavor -> ContextFlavor -> Bool # max :: ContextFlavor -> ContextFlavor -> ContextFlavor # min :: ContextFlavor -> ContextFlavor -> ContextFlavor # | |||||
| Hashable ContextFlavor Source # | |||||
Defined in Nix.String | |||||
| type Rep ContextFlavor Source # | |||||
Defined in Nix.String type Rep ContextFlavor = D1 ('MetaData "ContextFlavor" "Nix.String" "hnix-0.17.0-822MukN0dHtG1UXXNqsDIm" 'False) (C1 ('MetaCons "DirectPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AllOutputs" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DerivationOutput" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) | |||||
newtype NixLikeContext Source #
Constructors
| NixLikeContext | |
Fields | |
Instances
| Generic NixLikeContext Source # | |||||
Defined in Nix.String Associated Types
Methods from :: NixLikeContext -> Rep NixLikeContext x # to :: Rep NixLikeContext x -> NixLikeContext # | |||||
| Show NixLikeContext Source # | |||||
Defined in Nix.String Methods showsPrec :: Int -> NixLikeContext -> ShowS # show :: NixLikeContext -> String # showList :: [NixLikeContext] -> ShowS # | |||||
| Eq NixLikeContext Source # | |||||
Defined in Nix.String Methods (==) :: NixLikeContext -> NixLikeContext -> Bool # (/=) :: NixLikeContext -> NixLikeContext -> Bool # | |||||
| Ord NixLikeContext Source # | |||||
Defined in Nix.String Methods compare :: NixLikeContext -> NixLikeContext -> Ordering # (<) :: NixLikeContext -> NixLikeContext -> Bool # (<=) :: NixLikeContext -> NixLikeContext -> Bool # (>) :: NixLikeContext -> NixLikeContext -> Bool # (>=) :: NixLikeContext -> NixLikeContext -> Bool # max :: NixLikeContext -> NixLikeContext -> NixLikeContext # min :: NixLikeContext -> NixLikeContext -> NixLikeContext # | |||||
| type Rep NixLikeContext Source # | |||||
Defined in Nix.String type Rep NixLikeContext = D1 ('MetaData "NixLikeContext" "Nix.String" "hnix-0.17.0-822MukN0dHtG1UXXNqsDIm" 'True) (C1 ('MetaCons "NixLikeContext" 'PrefixI 'True) (S1 ('MetaSel ('Just "getNixLikeContext") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AttrSet NixLikeContextValue)))) | |||||
data NixLikeContextValue Source #
Constructors
| NixLikeContextValue | |
Fields
| |
Instances
| Monoid NixLikeContextValue Source # | |||||
Defined in Nix.String Methods mempty :: NixLikeContextValue # mappend :: NixLikeContextValue -> NixLikeContextValue -> NixLikeContextValue # | |||||
| Semigroup NixLikeContextValue Source # | |||||
Defined in Nix.String Methods (<>) :: NixLikeContextValue -> NixLikeContextValue -> NixLikeContextValue # sconcat :: NonEmpty NixLikeContextValue -> NixLikeContextValue # stimes :: Integral b => b -> NixLikeContextValue -> NixLikeContextValue # | |||||
| Generic NixLikeContextValue Source # | |||||
Defined in Nix.String Associated Types
Methods from :: NixLikeContextValue -> Rep NixLikeContextValue x # to :: Rep NixLikeContextValue x -> NixLikeContextValue # | |||||
| Show NixLikeContextValue Source # | |||||
Defined in Nix.String Methods showsPrec :: Int -> NixLikeContextValue -> ShowS # show :: NixLikeContextValue -> String # showList :: [NixLikeContextValue] -> ShowS # | |||||
| Eq NixLikeContextValue Source # | |||||
Defined in Nix.String Methods (==) :: NixLikeContextValue -> NixLikeContextValue -> Bool # (/=) :: NixLikeContextValue -> NixLikeContextValue -> Bool # | |||||
| Ord NixLikeContextValue Source # | |||||
Defined in Nix.String Methods compare :: NixLikeContextValue -> NixLikeContextValue -> Ordering # (<) :: NixLikeContextValue -> NixLikeContextValue -> Bool # (<=) :: NixLikeContextValue -> NixLikeContextValue -> Bool # (>) :: NixLikeContextValue -> NixLikeContextValue -> Bool # (>=) :: NixLikeContextValue -> NixLikeContextValue -> Bool # max :: NixLikeContextValue -> NixLikeContextValue -> NixLikeContextValue # min :: NixLikeContextValue -> NixLikeContextValue -> NixLikeContextValue # | |||||
| Convertible e t f m => ToValue NixLikeContextValue m (NValue' t f m (NValue t f m)) Source # | |||||
Defined in Nix.Convert | |||||
| type Rep NixLikeContextValue Source # | |||||
Defined in Nix.String type Rep NixLikeContextValue = D1 ('MetaData "NixLikeContextValue" "Nix.String" "hnix-0.17.0-822MukN0dHtG1UXXNqsDIm" 'False) (C1 ('MetaCons "NixLikeContextValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "nlcvPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "nlcvAllOutputs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "nlcvOutputs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text])))) | |||||
hasContext :: NixString -> Bool Source #
Returns True if the NixString has an associated context
intercalateNixString :: NixString -> [NixString] -> NixString Source #
Combine NixStrings with a separator
getStringNoContext :: NixString -> Maybe Text Source #
Extract the string contents from a NixString that has no context
ignoreContext :: NixString -> Text Source #
Extract the string contents from a NixString even if the NixString has an associated context
mkNixStringWithoutContext :: Text -> NixString Source #
Constructs NixString without a context
mkNixStringWithSingletonContext :: StringContext -> VarName -> NixString Source #
Create NixString using a singleton context
modifyNixContents :: (Text -> Text) -> NixString -> NixString Source #
Modify the string part of the NixString, leaving the context unchanged
newtype WithStringContextT (m :: Type -> Type) a Source #
A monad for accumulating string context while producing a result string.
Constructors
| WithStringContextT (WriterT (HashSet StringContext) m a) |
Instances
| MonadTrans WithStringContextT Source # | |
Defined in Nix.String Methods lift :: Monad m => m a -> WithStringContextT m a # | |
| Applicative m => Applicative (WithStringContextT m) Source # | |
Defined in Nix.String Methods pure :: a -> WithStringContextT m a # (<*>) :: WithStringContextT m (a -> b) -> WithStringContextT m a -> WithStringContextT m b # liftA2 :: (a -> b -> c) -> WithStringContextT m a -> WithStringContextT m b -> WithStringContextT m c # (*>) :: WithStringContextT m a -> WithStringContextT m b -> WithStringContextT m b # (<*) :: WithStringContextT m a -> WithStringContextT m b -> WithStringContextT m a # | |
| Functor m => Functor (WithStringContextT m) Source # | |
Defined in Nix.String Methods fmap :: (a -> b) -> WithStringContextT m a -> WithStringContextT m b # (<$) :: a -> WithStringContextT m b -> WithStringContextT m a # | |
| Monad m => Monad (WithStringContextT m) Source # | |
Defined in Nix.String Methods (>>=) :: WithStringContextT m a -> (a -> WithStringContextT m b) -> WithStringContextT m b # (>>) :: WithStringContextT m a -> WithStringContextT m b -> WithStringContextT m b # return :: a -> WithStringContextT m a # | |
| Monad m => MonadWriter (HashSet StringContext) (WithStringContextT m) Source # | |
Defined in Nix.String Methods writer :: (a, HashSet StringContext) -> WithStringContextT m a # tell :: HashSet StringContext -> WithStringContextT m () # listen :: WithStringContextT m a -> WithStringContextT m (a, HashSet StringContext) # pass :: WithStringContextT m (a, HashSet StringContext -> HashSet StringContext) -> WithStringContextT m a # | |
extractNixString :: forall (m :: Type -> Type). Monad m => NixString -> WithStringContextT m Text Source #
Get the contents of a NixString and write its context into the resulting set.
addStringContext :: forall (m :: Type -> Type). Monad m => HashSet StringContext -> WithStringContextT m () Source #
Add StringContexts into the resulting set.
addSingletonStringContext :: forall (m :: Type -> Type). 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.
runWithStringContextT' :: Monad m => WithStringContextT m a -> m (a, HashSet StringContext) Source #
Run an action that manipulates nix strings, and collect the contexts encountered. Warning: this may be unsafe, depending on how you handle the resulting context list.
runWithStringContext :: WithStringContextT Identity Text -> NixString Source #
Run an action producing a string with a context and put those into a NixString.
runWithStringContext' :: WithStringContextT Identity a -> (a, HashSet StringContext) Source #
Run an action that manipulates nix strings, and collect the contexts encountered. Warning: this may be unsafe, depending on how you handle the resulting context list.