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

Nix.Convert

Description

Although there are a lot of instances in this file, really it's just a combinatorial explosion of the following combinations:

  • Several Haskell types being converted to/from Nix wrappers
  • Several types of Nix wrappers
  • Whether to be shallow or deep while unwrapping

Documentation

newtype Deeper a Source #

Constructors

Deeper 

Fields

Instances

Instances details
Functor Deeper Source # 
Instance details

Defined in Nix.Convert

Methods

fmap :: (a -> b) -> Deeper a -> Deeper b #

(<$) :: a -> Deeper b -> Deeper a #

Foldable Deeper Source # 
Instance details

Defined in Nix.Convert

Methods

fold :: Monoid m => Deeper m -> m #

foldMap :: Monoid m => (a -> m) -> Deeper a -> m #

foldMap' :: Monoid m => (a -> m) -> Deeper a -> m #

foldr :: (a -> b -> b) -> b -> Deeper a -> b #

foldr' :: (a -> b -> b) -> b -> Deeper a -> b #

foldl :: (b -> a -> b) -> b -> Deeper a -> b #

foldl' :: (b -> a -> b) -> b -> Deeper a -> b #

foldr1 :: (a -> a -> a) -> Deeper a -> a #

foldl1 :: (a -> a -> a) -> Deeper a -> a #

toList :: Deeper a -> [a] #

null :: Deeper a -> Bool #

length :: Deeper a -> Int #

elem :: Eq a => a -> Deeper a -> Bool #

maximum :: Ord a => Deeper a -> a #

minimum :: Ord a => Deeper a -> a #

sum :: Num a => Deeper a -> a #

product :: Num a => Deeper a -> a #

Traversable Deeper Source # 
Instance details

Defined in Nix.Convert

Methods

traverse :: Applicative f => (a -> f b) -> Deeper a -> f (Deeper b) #

sequenceA :: Applicative f => Deeper (f a) -> f (Deeper a) #

mapM :: Monad m => (a -> m b) -> Deeper a -> m (Deeper b) #

sequence :: Monad m => Deeper (m a) -> m (Deeper a) #

(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 #

(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 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 #

class FromValue a m v where Source #

Methods

fromValue :: v -> m a Source #

fromValueMay :: v -> m (Maybe a) Source #

Instances

Instances details
(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 #

FromValue NixString m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

(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 #

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 #

(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 => 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 #

(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 #

FromValue (AttrSet (Symbolic m), AttrSet SourcePos) m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

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 #

type Convertible e t f m = (Framed e m, MonadDataErrorContext t f m, MonadThunk t m (NValue t f m)) Source #

newtype Path Source #

Constructors

Path 

Fields

Instances

Instances details
Show Path Source # 
Instance details

Defined in Nix.Convert

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

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, 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 #

class ToValue a m v where Source #

Methods

toValue :: a -> m v Source #

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 #

ToValue Bool m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

toValue :: Bool -> m (Symbolic 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, 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 => 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, 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 #

ToValue [Symbolic m] m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

toValue :: [Symbolic m] -> m (Symbolic 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 => 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, 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 #

ToValue (AttrSet (Symbolic m), AttrSet SourcePos) m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

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 #