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

Nix.Cited

Documentation

data Provenance m v Source #

Constructors

Provenance 

Fields

  • _lexicalScope :: Scopes m v
     
  • _originExpr :: NExprLocF (Maybe v)

    When calling the function x: x + 2 with argument x = 3, the originExpr for the resulting value will be 3 + 2, while the contextExpr will be (x: x + 2) 3, preserving not only the result of the call, but what was called and with what arguments.

Instances

Instances details
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 v] (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

ask :: NCited m v a -> [Provenance m v] #

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)] #

Show v => Show (Provenance m v) Source # 
Instance details

Defined in Nix.Cited

Methods

showsPrec :: Int -> Provenance m v -> ShowS #

show :: Provenance m v -> String #

showList :: [Provenance m v] -> ShowS #

Generic (Provenance m v) Source # 
Instance details

Defined in Nix.Cited

Associated Types

type Rep (Provenance m v) :: Type -> Type #

Methods

from :: Provenance m v -> Rep (Provenance m v) x #

to :: Rep (Provenance m v) x -> Provenance m v #

type Rep (Provenance m v) Source # 
Instance details

Defined in Nix.Cited

type Rep (Provenance m v) = D1 ('MetaData "Provenance" "Nix.Cited" "hnix-0.10.1-inplace" 'False) (C1 ('MetaCons "Provenance" 'PrefixI 'True) (S1 ('MetaSel ('Just "_lexicalScope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Scopes m v)) :*: S1 ('MetaSel ('Just "_originExpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NExprLocF (Maybe v)))))

data NCited m v a Source #

Constructors

NCited 

Fields

Instances

Instances details
HasCitations m v (NCited m v a) Source # 
Instance details

Defined in Nix.Cited

Methods

citations :: NCited m v a -> [Provenance m v] Source #

addProvenance :: Provenance m v -> NCited m v a -> NCited m v a Source #

ComonadEnv [Provenance m v] (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

ask :: NCited m v a -> [Provenance m v] #

Functor (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

fmap :: (a -> b) -> NCited m v a -> NCited m v b #

(<$) :: a -> NCited m v b -> NCited m v a #

Applicative (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

pure :: a -> NCited m v a #

(<*>) :: NCited m v (a -> b) -> NCited m v a -> NCited m v b #

liftA2 :: (a -> b -> c) -> NCited m v a -> NCited m v b -> NCited m v c #

(*>) :: NCited m v a -> NCited m v b -> NCited m v b #

(<*) :: NCited m v a -> NCited m v b -> NCited m v a #

Foldable (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

fold :: Monoid m0 => NCited m v m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> NCited m v a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> NCited m v a -> m0 #

foldr :: (a -> b -> b) -> b -> NCited m v a -> b #

foldr' :: (a -> b -> b) -> b -> NCited m v a -> b #

foldl :: (b -> a -> b) -> b -> NCited m v a -> b #

foldl' :: (b -> a -> b) -> b -> NCited m v a -> b #

foldr1 :: (a -> a -> a) -> NCited m v a -> a #

foldl1 :: (a -> a -> a) -> NCited m v a -> a #

toList :: NCited m v a -> [a] #

null :: NCited m v a -> Bool #

length :: NCited m v a -> Int #

elem :: Eq a => a -> NCited m v a -> Bool #

maximum :: Ord a => NCited m v a -> a #

minimum :: Ord a => NCited m v a -> a #

sum :: Num a => NCited m v a -> a #

product :: Num a => NCited m v a -> a #

Traversable (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

traverse :: Applicative f => (a -> f b) -> NCited m v a -> f (NCited m v b) #

sequenceA :: Applicative f => NCited m v (f a) -> f (NCited m v a) #

mapM :: Monad m0 => (a -> m0 b) -> NCited m v a -> m0 (NCited m v b) #

sequence :: Monad m0 => NCited m v (m0 a) -> m0 (NCited m v a) #

Comonad (NCited m v) Source # 
Instance details

Defined in Nix.Cited

Methods

extract :: NCited m v a -> a #

duplicate :: NCited m v a -> NCited m v (NCited m v a) #

extend :: (NCited m v a -> b) -> NCited m v a -> NCited m v b #

(Show v, Show a) => Show (NCited m v a) Source # 
Instance details

Defined in Nix.Cited

Methods

showsPrec :: Int -> NCited m v a -> ShowS #

show :: NCited m v a -> String #

showList :: [NCited m v a] -> ShowS #

Generic (NCited m v a) Source # 
Instance details

Defined in Nix.Cited

Associated Types

type Rep (NCited m v a) :: Type -> Type #

Methods

from :: NCited m v a -> Rep (NCited m v a) x #

to :: Rep (NCited m v a) x -> NCited m v a #

type Rep (NCited m v a) Source # 
Instance details

Defined in Nix.Cited

type Rep (NCited m v a) = D1 ('MetaData "NCited" "Nix.Cited" "hnix-0.10.1-inplace" 'False) (C1 ('MetaCons "NCited" 'PrefixI 'True) (S1 ('MetaSel ('Just "_provenance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Provenance m v]) :*: S1 ('MetaSel ('Just "_cited") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

originExpr :: forall f v (m :: Type -> Type). Functor f => (NExprLocF (Maybe v) -> f (NExprLocF (Maybe v))) -> Provenance m v -> f (Provenance m v) Source #

lexicalScope :: forall f (m1 :: Type -> Type) v (m2 :: Type -> Type). Functor f => (Scopes m1 v -> f (Scopes m2 v)) -> Provenance m1 v -> f (Provenance m2 v) Source #

cited :: forall f t a (m :: Type -> Type) v. Functor f => (t -> f a) -> NCited m v t -> f (NCited m v a) Source #

provenance :: forall f (m1 :: Type -> Type) v1 (m2 :: Type -> Type) v2 a. Functor f => ([Provenance m1 v1] -> f [Provenance m2 v2]) -> NCited m1 v1 a -> f (NCited m2 v2 a) Source #

class HasCitations m v a where Source #

Methods

citations :: a -> [Provenance m v] Source #

addProvenance :: Provenance m v -> a -> a Source #

Instances

Instances details
HasCitations m v (NCited m v a) Source # 
Instance details

Defined in Nix.Cited

Methods

citations :: NCited m v a -> [Provenance m v] Source #

addProvenance :: Provenance m v -> NCited m v a -> NCited m v 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 #

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 #

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

Defined in Nix.Standard

class HasCitations1 m v f where Source #

Methods

citations1 :: f a -> [Provenance m v] Source #

addProvenance1 :: Provenance m v -> f a -> f a Source #

Instances

Instances details
HasCitations1 m (StdValue m) (StdCited 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 #