hnix-0.9.0: Haskell implementation of the Nix language
Safe HaskellNone
LanguageHaskell2010

Nix.Value

Synopsis

Documentation

data NValueF p m r Source #

An NValue is the most reduced form of an NExpr after evaluation is completed. s is related to the type of errors that might occur during construction or use of a value.

Constructors

NVConstantF NAtom 
NVStrF NixString

A string has a value and a context, which can be used to record what a string has been build from

NVPathF FilePath 
NVListF [r] 
NVSetF (AttrSet r) (AttrSet SourcePos) 
NVClosureF (Params ()) (p -> m r)

A function is a closed set of parameters representing the "call signature", used at application time to check the type of arguments passed to the function. Since it supports default values which may depend on other values within the final argument set, this dependency is represented as a set of pending evaluations. The arguments are finally normalized into a set which is passed to the function.

Note that 'm r' is being used here because effectively a function and its set of default arguments is "never fully evaluated". This enforces in the type that it must be re-evaluated for each call.

NVBuiltinF String (p -> m r)

A builtin function is itself already in normal form. Also, it may or may not choose to evaluate its argument in the production of a result.

Instances

Instances details
Functor m => Functor (NValueF p m) Source # 
Instance details

Defined in Nix.Value

Methods

fmap :: (a -> b) -> NValueF p m a -> NValueF p m b #

(<$) :: a -> NValueF p m b -> NValueF p m a #

Foldable (NValueF p m) Source #

This Foldable instance only folds what the value actually is known to contain at time of fold.

Instance details

Defined in Nix.Value

Methods

fold :: Monoid m0 => NValueF p m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> NValueF p m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> NValueF p m a -> m0 #

foldr :: (a -> b -> b) -> b -> NValueF p m a -> b #

foldr' :: (a -> b -> b) -> b -> NValueF p m a -> b #

foldl :: (b -> a -> b) -> b -> NValueF p m a -> b #

foldl' :: (b -> a -> b) -> b -> NValueF p m a -> b #

foldr1 :: (a -> a -> a) -> NValueF p m a -> a #

foldl1 :: (a -> a -> a) -> NValueF p m a -> a #

toList :: NValueF p m a -> [a] #

null :: NValueF p m a -> Bool #

length :: NValueF p m a -> Int #

elem :: Eq a => a -> NValueF p m a -> Bool #

maximum :: Ord a => NValueF p m a -> a #

minimum :: Ord a => NValueF p m a -> a #

sum :: Num a => NValueF p m a -> a #

product :: Num a => NValueF p m a -> a #

Eq1 (NValueF p m) Source # 
Instance details

Defined in Nix.Value.Equal

Methods

liftEq :: (a -> b -> Bool) -> NValueF p m a -> NValueF p m b -> Bool #

Show r => Show (NValueF p m r) Source # 
Instance details

Defined in Nix.Value

Methods

showsPrec :: Int -> NValueF p m r -> ShowS #

show :: NValueF p m r -> String #

showList :: [NValueF p m r] -> ShowS #

Generic (NValueF p m r) Source # 
Instance details

Defined in Nix.Value

Associated Types

type Rep (NValueF p m r) :: Type -> Type #

Methods

from :: NValueF p m r -> Rep (NValueF p m r) x #

to :: Rep (NValueF p m r) x -> NValueF p m r #

type Rep (NValueF p m r) Source # 
Instance details

Defined in Nix.Value

type Rep (NValueF p m r) = D1 ('MetaData "NValueF" "Nix.Value" "hnix-0.9.0-inplace" 'False) ((C1 ('MetaCons "NVConstantF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NAtom)) :+: (C1 ('MetaCons "NVStrF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NixString)) :+: C1 ('MetaCons "NVPathF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))) :+: ((C1 ('MetaCons "NVListF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [r])) :+: C1 ('MetaCons "NVSetF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AttrSet r)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AttrSet SourcePos)))) :+: (C1 ('MetaCons "NVClosureF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Params ())) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (p -> m r))) :+: C1 ('MetaCons "NVBuiltinF" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (p -> m r))))))

lmapNValueF :: Functor m => (b -> a) -> NValueF a m r -> NValueF b m r Source #

hoistNValueF :: (forall x. m x -> n x) -> NValueF p m a -> NValueF p n a Source #

sequenceNValueF :: (Functor n, Monad m, Applicative n) => (forall x. n x -> m x) -> NValueF p m (n a) -> n (NValueF p m a) Source #

bindNValueF :: (Monad m, Monad n) => (forall x. n x -> m x) -> (a -> n b) -> NValueF p m a -> n (NValueF p m b) Source #

liftNValueF :: (MonadTrans u, Monad m) => NValueF p m a -> NValueF p (u m) a Source #

unliftNValueF :: (MonadTrans u, Monad m) => (forall x. u m x -> m x) -> NValueF p (u m) a -> NValueF p m a Source #

type MonadDataContext f (m :: * -> *) = (Comonad f, Applicative f, Traversable f, Monad m) Source #

newtype NValue' t f m a Source #

At the time of constructor, the expected arguments to closures are values that may contain thunks. The type of such thunks are fixed at that time.

Constructors

NValue 

Fields

Instances

Instances details
Convertible e t f m => ToValue Bool m (NExprF (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Bool -> m (NExprF (NValue t f m)) Source #

Convertible e t f m => ToValue () m (NExprF (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: () -> m (NExprF (NValue t f m)) Source #

(Convertible e t f m, ToValue a m (Deeper (NValue' t f m (NValue t f m)))) => ToValue a m (Deeper (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: a -> m (Deeper (NValue t f m)) Source #

(Convertible e t f m, FromValue a m (NValue' t f m (NValue t f m))) => FromValue a m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: Deeper (NValue' t f m (NValue t f m)) -> m a Source #

fromValueMay :: Deeper (NValue' t f m (NValue t f m)) -> m (Maybe a) Source #

(Convertible e t f m, MonadValue (NValue t f m) m, FromValue a m (Deeper (NValue' t f m (NValue t f m)))) => FromValue a m (Deeper (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: Deeper (NValue t f m) -> m a Source #

fromValueMay :: Deeper (NValue t f m) -> m (Maybe a) Source #

(HasCitations1 m v f, HasCitations m v t) => HasCitations m v (NValue t f m) Source # 
Instance details

Defined in Nix.Pretty

Methods

citations :: NValue t f m -> [Provenance m v] Source #

addProvenance :: Provenance m v -> NValue t f m -> NValue t f m Source #

(Convertible e t f m, ToValue a m (NValue' t f m (NValue t f m))) => ToValue a m (NValue t f m) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: a -> m (NValue t f m) Source #

(Convertible e t f m, MonadValue (NValue t f m) m, FromValue a m (NValue' t f m (NValue t f m))) => FromValue a m (NValue t f m) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue t f m -> m a Source #

fromValueMay :: NValue t f m -> m (Maybe a) Source #

HasCitations1 m v f => HasCitations m v (NValue' t f m a) Source # 
Instance details

Defined in Nix.Pretty

Methods

citations :: NValue' t f m a -> [Provenance m v] Source #

addProvenance :: Provenance m v -> NValue' t f m a -> NValue' t f m a Source #

Convertible e t f m => ToValue Bool m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Bool -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue Float m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Float -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue Int m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Int -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue Integer m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Integer -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue () m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: () -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue ByteString m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: ByteString -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue SourcePos m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: SourcePos -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue NixLikeContextValue m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: NixLikeContextValue -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue NixString m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: NixString -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue StorePath m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: StorePath -> 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 # 
Instance details

Defined in Nix.Convert

Methods

toValue :: Path -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => FromValue Bool m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m Bool Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe Bool) Source #

Convertible e t f m => FromValue Float m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m Float Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe Float) Source #

Convertible e t f m => FromValue Int m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m Int Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe Int) Source #

Convertible e t f m => FromValue Integer m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m Integer Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe Integer) Source #

Convertible e t f m => FromValue () m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m () Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe ()) Source #

Convertible e t f m => FromValue ByteString m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m ByteString Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe ByteString) 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 # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m NixString Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe NixString) Source #

(Convertible e t f m, MonadValue (NValue t f m) m) => FromValue Path m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m Path Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe Path) Source #

HasCitations1 m (StdValue m) (StdCited m) Source # 
Instance details

Defined in Nix.Standard

HasCitations m (StdValue m) (StdThunk m) Source # 
Instance details

Defined in Nix.Standard

HasCitations1 m (NValue t f m) (Cited t f m) Source # 
Instance details

Defined in Nix.Cited.Basic

Methods

citations1 :: Cited t f m a -> [Provenance m (NValue t f m)] Source #

addProvenance1 :: Provenance m (NValue t f m) -> Cited t f m a -> Cited t f m a Source #

MonadReader (Context m (StdValue m)) m => Scoped (StdValue m) m Source # 
Instance details

Defined in Nix.Standard

Methods

currentScopes :: m (Scopes m (StdValue m)) Source #

clearScopes :: m r -> m r Source #

pushScopes :: Scopes m (StdValue m) -> m r -> m r Source #

lookupVar :: Text -> m (Maybe (StdValue m)) Source #

(MonadAtomicRef m, MonadCatch m, Typeable m, MonadReader (Context m (StdValue m)) m, MonadThunkId m) => MonadValue (StdValue m) m Source # 
Instance details

Defined in Nix.Standard

Methods

defer :: m (StdValue m) -> m (StdValue m) Source #

demand :: StdValue m -> (StdValue m -> m r) -> m r Source #

inform :: StdValue m -> (m (StdValue m) -> m (StdValue m)) -> m (StdValue m) Source #

(MonadAtomicRef m, MonadCatch m, Typeable m, MonadReader (Context m (StdValue m)) m, MonadThunkId m) => MonadThunk (StdThunk m) m (StdValue m) Source # 
Instance details

Defined in Nix.Standard

Methods

thunk :: m (StdValue m) -> m (StdThunk m) Source #

thunkId :: StdThunk m -> ThunkId m Source #

queryM :: StdThunk m -> m r -> (StdValue m -> m r) -> m r Source #

force :: StdThunk m -> (StdValue m -> m r) -> m r Source #

forceEff :: StdThunk m -> (StdValue m -> m r) -> m r Source #

further :: StdThunk m -> (m (StdValue m) -> m (StdValue m)) -> m (StdThunk m) Source #

(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue [a] m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: [a] -> m (Deeper (NValue' t f m (NValue t f m))) Source #

(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue (AttrSet a) m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: AttrSet a -> m (Deeper (NValue' t f m (NValue t f m))) Source #

(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue [a] m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: Deeper (NValue' t f m (NValue t f m)) -> m [a] Source #

fromValueMay :: Deeper (NValue' t f m (NValue t f m)) -> m (Maybe [a]) Source #

(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue (AttrSet a) m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: Deeper (NValue' t f m (NValue t f m)) -> m (AttrSet a) Source #

fromValueMay :: Deeper (NValue' t f m (NValue t f m)) -> m (Maybe (AttrSet a)) Source #

Convertible e t f m => ToValue [NValue t f m] m (NValue' t f m (NValue t f m)) Source #

With ToValue, we can always act recursively

Instance details

Defined in Nix.Convert

Methods

toValue :: [NValue t f m] -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => ToValue (AttrSet (NValue t f m)) m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: AttrSet (NValue t f m) -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => FromValue [NValue t f m] m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m [NValue t f m] Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe [NValue t f m]) Source #

Convertible e t f m => FromValue (AttrSet (NValue t f m)) m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m (AttrSet (NValue t f m)) Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe (AttrSet (NValue t f m))) Source #

ComonadEnv [Provenance m (StdValue m)] (StdCited m) Source # 
Instance details

Defined in Nix.Standard

Methods

ask :: StdCited m a -> [Provenance m (StdValue m)] #

ComonadEnv [Provenance m (NValue t f m)] (Cited t f m) Source # 
Instance details

Defined in Nix.Cited.Basic

Methods

ask :: Cited t f m a -> [Provenance m (NValue t f m)] #

(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue (AttrSet a, AttrSet SourcePos) m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: (AttrSet a, AttrSet SourcePos) -> m (Deeper (NValue' t f m (NValue t f m))) Source #

(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue (AttrSet a, AttrSet SourcePos) m (Deeper (NValue' t f m (NValue t f m))) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: Deeper (NValue' t f m (NValue t f m)) -> m (AttrSet a, AttrSet SourcePos) Source #

fromValueMay :: Deeper (NValue' t f m (NValue t f m)) -> m (Maybe (AttrSet a, AttrSet SourcePos)) Source #

Convertible e t f m => ToValue (AttrSet (NValue t f m), AttrSet SourcePos) m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

toValue :: (AttrSet (NValue t f m), AttrSet SourcePos) -> m (NValue' t f m (NValue t f m)) Source #

Convertible e t f m => FromValue (AttrSet (NValue t f m), AttrSet SourcePos) m (NValue' t f m (NValue t f m)) Source # 
Instance details

Defined in Nix.Convert

Methods

fromValue :: NValue' t f m (NValue t f m) -> m (AttrSet (NValue t f m), AttrSet SourcePos) Source #

fromValueMay :: NValue' t f m (NValue t f m) -> m (Maybe (AttrSet (NValue t f m), AttrSet SourcePos)) Source #

Monad m => MonadReader (Context r (StdValue r)) (StandardTF r m) Source # 
Instance details

Defined in Nix.Standard

Methods

ask :: StandardTF r m (Context r (StdValue r)) #

local :: (Context r (StdValue r) -> Context r (StdValue r)) -> StandardTF r m a -> StandardTF r m a #

reader :: (Context r (StdValue r) -> a) -> StandardTF r m a #

(Functor f, Functor m) => Functor (NValue' t f m) Source # 
Instance details

Defined in Nix.Value

Methods

fmap :: (a -> b) -> NValue' t f m a -> NValue' t f m b #

(<$) :: a -> NValue' t f m b -> NValue' t f m a #

Foldable f => Foldable (NValue' t f m) Source # 
Instance details

Defined in Nix.Value

Methods

fold :: Monoid m0 => NValue' t f m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> NValue' t f m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> NValue' t f m a -> m0 #

foldr :: (a -> b -> b) -> b -> NValue' t f m a -> b #

foldr' :: (a -> b -> b) -> b -> NValue' t f m a -> b #

foldl :: (b -> a -> b) -> b -> NValue' t f m a -> b #

foldl' :: (b -> a -> b) -> b -> NValue' t f m a -> b #

foldr1 :: (a -> a -> a) -> NValue' t f m a -> a #

foldl1 :: (a -> a -> a) -> NValue' t f m a -> a #

toList :: NValue' t f m a -> [a] #

null :: NValue' t f m a -> Bool #

length :: NValue' t f m a -> Int #

elem :: Eq a => a -> NValue' t f m a -> Bool #

maximum :: Ord a => NValue' t f m a -> a #

minimum :: Ord a => NValue' t f m a -> a #

sum :: Num a => NValue' t f m a -> a #

product :: Num a => NValue' t f m a -> a #

(Eq t, Eq1 f, Eq1 m) => Eq1 (NValue' t f m) Source # 
Instance details

Defined in Nix.Value.Equal

Methods

liftEq :: (a -> b -> Bool) -> NValue' t f m a -> NValue' t f m b -> Bool #

Comonad f => Show1 (NValue' t f m) Source # 
Instance details

Defined in Nix.Value

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NValue' t f m a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NValue' t f m a] -> ShowS #

MonadNix e t f m => MonadEval (NValue t f m) m Source # 
Instance details

Defined in Nix.Exec

Methods

freeVariable :: Text -> m (NValue t f m) Source #

synHole :: Text -> m (NValue t f m) Source #

attrMissing :: NonEmpty Text -> Maybe (NValue t f m) -> m (NValue t f m) Source #

evaledSym :: Text -> NValue t f m -> m (NValue t f m) Source #

evalCurPos :: m (NValue t f m) Source #

evalConstant :: NAtom -> m (NValue t f m) Source #

evalString :: NString (m (NValue t f m)) -> m (NValue t f m) Source #

evalLiteralPath :: FilePath -> m (NValue t f m) Source #

evalEnvPath :: FilePath -> m (NValue t f m) Source #

evalUnary :: NUnaryOp -> NValue t f m -> m (NValue t f m) Source #

evalBinary :: NBinaryOp -> NValue t f m -> m (NValue t f m) -> m (NValue t f m) Source #

evalWith :: m (NValue t f m) -> m (NValue t f m) -> m (NValue t f m) Source #

evalIf :: NValue t f m -> m (NValue t f m) -> m (NValue t f m) -> m (NValue t f m) Source #

evalAssert :: NValue t f m -> m (NValue t f m) -> m (NValue t f m) Source #

evalApp :: NValue t f m -> m (NValue t f m) -> m (NValue t f m) Source #

evalAbs :: Params (m (NValue t f m)) -> (forall a. m (NValue t f m) -> (AttrSet (m (NValue t f m)) -> m (NValue t f m) -> m (a, NValue t f m)) -> m (a, NValue t f m)) -> m (NValue t f m) Source #

evalError :: Exception s => s -> m a Source #

(Comonad f, Show a) => Show (NValue' t f m a) Source # 
Instance details

Defined in Nix.Value

Methods

showsPrec :: Int -> NValue' t f m a -> ShowS #

show :: NValue' t f m a -> String #

showList :: [NValue' t f m a] -> ShowS #

Generic (NValue' t f m a) Source # 
Instance details

Defined in Nix.Value

Associated Types

type Rep (NValue' t f m a) :: Type -> Type #

Methods

from :: NValue' t f m a -> Rep (NValue' t f m a) x #

to :: Rep (NValue' t f m a) x -> NValue' t f m a #

type Rep (NValue' t f m a) Source # 
Instance details

Defined in Nix.Value

type Rep (NValue' t f m a) = D1 ('MetaData "NValue'" "Nix.Value" "hnix-0.9.0-inplace" 'True) (C1 ('MetaCons "NValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "_nValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (NValueF (NValue t f m) m a)))))

sequenceNValue' :: (Functor n, Traversable f, Monad m, Applicative n) => (forall x. n x -> m x) -> NValue' t f m (n a) -> n (NValue' t f m a) Source #

bindNValue' :: (Traversable f, Monad m, Monad n) => (forall x. n x -> m x) -> (a -> n b) -> NValue' t f m a -> n (NValue' t f m b) Source #

hoistNValue' :: (Functor m, Functor n, Functor f) => (forall x. n x -> m x) -> (forall x. m x -> n x) -> NValue' t f m a -> NValue' t f n a Source #

liftNValue' :: (MonadTrans u, Monad m, Functor (u m), Functor f) => (forall x. u m x -> m x) -> NValue' t f m a -> NValue' t f (u m) a Source #

unliftNValue' :: (MonadTrans u, Monad m, Functor (u m), Functor f) => (forall x. u m x -> m x) -> NValue' t f (u m) a -> NValue' t f m a Source #

iterNValue' :: forall t f m a r. MonadDataContext f m => (a -> (NValue' t f m a -> r) -> r) -> (NValue' t f m r -> r) -> NValue' t f m a -> r Source #

type NValue t f m = Free (NValue' t f m) t Source #

An NValueNF is a fully evaluated value in normal form. An 'NValue f t m' is a value in head normal form, where only the "top layer" has been evaluated. An action of type 'm (NValue f t m)' is a pending evaluation that has yet to be performed. An t is either a pending evaluation, or a value in head normal form. A NThunkSet is a set of mappings from keys to thunks.

The Free structure is used here to represent the possibility that cycles may appear during normalization.

hoistNValue :: (Functor m, Functor n, Functor f) => (forall x. n x -> m x) -> (forall x. m x -> n x) -> NValue t f m -> NValue t f n Source #

liftNValue :: (MonadTrans u, Monad m, Functor (u m), Functor f) => (forall x. u m x -> m x) -> NValue t f m -> NValue t f (u m) Source #

unliftNValue :: (MonadTrans u, Monad m, Functor (u m), Functor f) => (forall x. u m x -> m x) -> NValue t f (u m) -> NValue t f m Source #

iterNValue :: forall t f m r. MonadDataContext f m => (t -> (NValue t f m -> r) -> r) -> (NValue' t f m r -> r) -> NValue t f m -> r Source #

iterNValueM :: (MonadDataContext f m, Monad n) => (forall x. n x -> m x) -> (t -> (NValue t f m -> n r) -> n r) -> (NValue' t f m (n r) -> n r) -> NValue t f m -> n r Source #

pattern NVThunk :: forall f a. a -> Free f a Source #

nvThunk :: Applicative f => t -> NValue t f m Source #

pattern NVConstant' :: Comonad w => NAtom -> NValue' t w m a Source #

pattern NVConstant :: forall (w :: Type -> Type) t (m :: Type -> Type) a. Comonad w => NAtom -> Free (NValue' t w m) a Source #

pattern NVStr' :: Comonad w => NixString -> NValue' t w m a Source #

pattern NVStr :: forall (w :: Type -> Type) t (m :: Type -> Type) a. Comonad w => NixString -> Free (NValue' t w m) a Source #

pattern NVPath' :: Comonad w => FilePath -> NValue' t w m a Source #

pattern NVPath :: forall (w :: Type -> Type) t (m :: Type -> Type) a. Comonad w => FilePath -> Free (NValue' t w m) a Source #

pattern NVList' :: forall w t m a. Comonad w => [a] -> NValue' t w m a Source #

pattern NVList :: forall (w :: Type -> Type) t (m :: Type -> Type) a. Comonad w => [Free (NValue' t w m) a] -> Free (NValue' t w m) a Source #

nvList' :: Applicative f => [r] -> NValue' t f m r Source #

nvList :: Applicative f => [NValue t f m] -> NValue t f m Source #

pattern NVSet' :: forall w t m a. Comonad w => AttrSet a -> AttrSet SourcePos -> NValue' t w m a Source #

pattern NVSet :: forall (w :: Type -> Type) t (m :: Type -> Type) a. Comonad w => AttrSet (Free (NValue' t w m) a) -> AttrSet SourcePos -> Free (NValue' t w m) a Source #

pattern NVClosure' :: Comonad w => Params () -> (NValue t w m -> m a) -> NValue' t w m a Source #

pattern NVClosure :: forall (w :: Type -> Type) t m a. Comonad w => Params () -> (NValue t w m -> m (Free (NValue' t w m) a)) -> Free (NValue' t w m) a Source #

nvClosure' :: (Applicative f, Functor m) => Params () -> (NValue t f m -> m r) -> NValue' t f m r Source #

nvClosure :: (Applicative f, Functor m) => Params () -> (NValue t f m -> m (NValue t f m)) -> NValue t f m Source #

pattern NVBuiltin' :: Comonad w => String -> (NValue t w m -> m a) -> NValue' t w m a Source #

pattern NVBuiltin :: forall (w :: Type -> Type) t m a. Comonad w => String -> (NValue t w m -> m (Free (NValue' t w m) a)) -> Free (NValue' t w m) a Source #

nvBuiltin' :: (Applicative f, Functor m) => String -> (NValue t f m -> m r) -> NValue' t f m r Source #

nvBuiltin :: (Applicative f, Functor m) => String -> (NValue t f m -> m (NValue t f m)) -> NValue t f m Source #

builtin :: forall m f t. (MonadThunk t m (NValue t f m), MonadDataContext f m) => String -> (NValue t f m -> m (NValue t f m)) -> m (NValue t f m) Source #

builtin2 :: (MonadThunk t m (NValue t f m), MonadDataContext f m) => String -> (NValue t f m -> NValue t f m -> m (NValue t f m)) -> m (NValue t f m) Source #

builtin3 :: (MonadThunk t m (NValue t f m), MonadDataContext f m) => String -> (NValue t f m -> NValue t f m -> NValue t f m -> m (NValue t f m)) -> m (NValue t f m) Source #

data TStringContext Source #

Constructors

NoContext 
HasContext 

Instances

Instances details
Show TStringContext Source # 
Instance details

Defined in Nix.Value

data ValueType Source #

Instances

Instances details
Show ValueType Source # 
Instance details

Defined in Nix.Value

showValueType :: (MonadThunk t m (NValue t f m), Comonad f) => NValue t f m -> m String Source #

data ValueFrame t f m Source #

Instances

Instances details
(Comonad f, Show t) => Show (ValueFrame t f m) Source # 
Instance details

Defined in Nix.Value

Methods

showsPrec :: Int -> ValueFrame t f m -> ShowS #

show :: ValueFrame t f m -> String #

showList :: [ValueFrame t f m] -> ShowS #

MonadDataErrorContext t f m => Exception (ValueFrame t f m) Source # 
Instance details

Defined in Nix.Value

_NVBuiltinF :: Applicative f => ((String, p -> m r) -> f (String, p -> m r)) -> NValueF p m r -> f (NValueF p m r) Source #

_NVClosureF :: Applicative f => ((Params (), p -> m r) -> f (Params (), p -> m r)) -> NValueF p m r -> f (NValueF p m r) Source #

_NVSetF :: forall f r p (m :: Type -> Type). Applicative f => ((AttrSet r, AttrSet SourcePos) -> f (AttrSet r, AttrSet SourcePos)) -> NValueF p m r -> f (NValueF p m r) Source #

_NVListF :: forall f r p (m :: Type -> Type). Applicative f => ([r] -> f [r]) -> NValueF p m r -> f (NValueF p m r) Source #

_NVPathF :: forall f p (m :: Type -> Type) r. Applicative f => (FilePath -> f FilePath) -> NValueF p m r -> f (NValueF p m r) Source #

_NVStrF :: forall f p (m :: Type -> Type) r. Applicative f => (NixString -> f NixString) -> NValueF p m r -> f (NValueF p m r) Source #

_NVConstantF :: forall f p (m :: Type -> Type) r. Applicative f => (NAtom -> f NAtom) -> NValueF p m r -> f (NValueF p m r) Source #

nValue :: forall f1 f2 t1 (m1 :: Type -> Type) a1 f3 t2 (m2 :: Type -> Type) a2. Functor f1 => (f2 (NValueF (NValue t1 f2 m1) m1 a1) -> f1 (f3 (NValueF (NValue t2 f3 m2) m2 a2))) -> NValue' t1 f2 m1 a1 -> f1 (NValue' t2 f3 m2 a2) Source #

key :: (Traversable f, Applicative g) => VarName -> LensLike' g (NValue' t f m a) (Maybe a) Source #