hnix-0.5.1: Haskell implementation of the Nix language

Safe HaskellNone
LanguageHaskell2010

Nix.Lint

Synopsis

Documentation

data TAtom Source #

Constructors

TInt 
TFloat 
TBool 
TNull 

Instances

Eq TAtom Source # 

Methods

(==) :: TAtom -> TAtom -> Bool #

(/=) :: TAtom -> TAtom -> Bool #

Ord TAtom Source # 

Methods

compare :: TAtom -> TAtom -> Ordering #

(<) :: TAtom -> TAtom -> Bool #

(<=) :: TAtom -> TAtom -> Bool #

(>) :: TAtom -> TAtom -> Bool #

(>=) :: TAtom -> TAtom -> Bool #

max :: TAtom -> TAtom -> TAtom #

min :: TAtom -> TAtom -> TAtom #

Show TAtom Source # 

Methods

showsPrec :: Int -> TAtom -> ShowS #

show :: TAtom -> String #

showList :: [TAtom] -> ShowS #

data NTypeF (m :: * -> *) r Source #

Constructors

TConstant [TAtom] 
TStr 
TList r 
TSet (Maybe (HashMap Text r)) 
TClosure (Params ()) 
TPath 
TBuiltin String (SThunk m -> m (Symbolic m)) 

Instances

Functor (NTypeF m) Source # 

Methods

fmap :: (a -> b) -> NTypeF m a -> NTypeF m b #

(<$) :: a -> NTypeF m b -> NTypeF m a #

data NSymbolicF r Source #

Constructors

NAny 
NMany [r] 

Instances

Functor NSymbolicF Source # 

Methods

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

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

Foldable NSymbolicF Source # 

Methods

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

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

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

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

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

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

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

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

toList :: NSymbolicF a -> [a] #

null :: NSymbolicF a -> Bool #

length :: NSymbolicF a -> Int #

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

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

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

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

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

Traversable NSymbolicF Source # 

Methods

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

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

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

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

Eq r => Eq (NSymbolicF r) Source # 

Methods

(==) :: NSymbolicF r -> NSymbolicF r -> Bool #

(/=) :: NSymbolicF r -> NSymbolicF r -> Bool #

Ord r => Ord (NSymbolicF r) Source # 
Show r => Show (NSymbolicF r) Source # 

newtype SThunk m Source #

Constructors

SThunk 

Fields

Instances

ToValue [SThunk m] m (Symbolic m) Source # 

Methods

toValue :: [SThunk m] -> m (Symbolic m) Source #

MonadLint e m => MonadThunk (Symbolic m) (SThunk m) m Source # 

Methods

thunk :: m (Symbolic m) -> m (SThunk m) Source #

force :: SThunk m -> (Symbolic m -> m r) -> m r Source #

value :: Symbolic m -> SThunk m Source #

ToValue (AttrSet (SThunk m), AttrSet SourcePos) m (Symbolic m) Source # 
FromValue (AttrSet (SThunk m), AttrSet SourcePos) m (Symbolic m) Source # 
MonadReader (Context (Lint s) (SThunk (Lint s))) (Lint s) Source # 

Methods

ask :: Lint s (Context (Lint s) (SThunk (Lint s))) #

local :: (Context (Lint s) (SThunk (Lint s)) -> Context (Lint s) (SThunk (Lint s))) -> Lint s a -> Lint s a #

reader :: (Context (Lint s) (SThunk (Lint s)) -> a) -> Lint s a #

newtype Symbolic m Source #

Constructors

Symbolic 

Fields

Instances

ToValue Bool m (Symbolic m) Source # 

Methods

toValue :: Bool -> m (Symbolic m) Source #

Show (Symbolic m) Source # 

Methods

showsPrec :: Int -> Symbolic m -> ShowS #

show :: Symbolic m -> String #

showList :: [Symbolic m] -> ShowS #

MonadLint e m => MonadEval (Symbolic m) m Source # 

Methods

freeVariable :: Text -> m (Symbolic m) Source #

attrMissing :: NonEmpty Text -> Maybe (Symbolic m) -> m (Symbolic m) Source #

evaledSym :: Text -> Symbolic m -> m (Symbolic m) Source #

evalCurPos :: m (Symbolic m) Source #

evalConstant :: NAtom -> m (Symbolic m) Source #

evalString :: NString (m (Symbolic m)) -> m (Symbolic m) Source #

evalLiteralPath :: FilePath -> m (Symbolic m) Source #

evalEnvPath :: FilePath -> m (Symbolic m) Source #

evalUnary :: NUnaryOp -> Symbolic m -> m (Symbolic m) Source #

evalBinary :: NBinaryOp -> Symbolic m -> m (Symbolic m) -> m (Symbolic m) Source #

evalWith :: m (Symbolic m) -> m (Symbolic m) -> m (Symbolic m) Source #

evalIf :: Symbolic m -> m (Symbolic m) -> m (Symbolic m) -> m (Symbolic m) Source #

evalAssert :: Symbolic m -> m (Symbolic m) -> m (Symbolic m) Source #

evalApp :: Symbolic m -> m (Symbolic m) -> m (Symbolic m) Source #

evalAbs :: Params (m (Symbolic m)) -> (forall a. m (Symbolic m) -> (AttrSet (m (Symbolic m)) -> m (Symbolic m) -> m (a, Symbolic m)) -> m (a, Symbolic m)) -> m (Symbolic m) Source #

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

ToValue [SThunk m] m (Symbolic m) Source # 

Methods

toValue :: [SThunk m] -> m (Symbolic m) Source #

MonadLint e m => MonadThunk (Symbolic m) (SThunk m) m Source # 

Methods

thunk :: m (Symbolic m) -> m (SThunk m) Source #

force :: SThunk m -> (Symbolic m -> m r) -> m r Source #

value :: Symbolic m -> SThunk m Source #

ToValue (AttrSet (SThunk m), AttrSet SourcePos) m (Symbolic m) Source # 
FromValue (Text, DList Text) m (Symbolic m) Source # 
FromValue (AttrSet (SThunk m), AttrSet SourcePos) m (Symbolic m) Source # 

mkSymbolic :: MonadVar m => [NTypeF m (SThunk m)] -> m (Symbolic m) Source #

type MonadLint e m = (Scoped e (SThunk m) m, Framed e m, MonadVar m) Source #

symerr :: forall e m a. MonadLint e m => String -> m a Source #

merge :: forall e m. MonadLint e m => NExprF () -> [NTypeF m (SThunk m)] -> [NTypeF m (SThunk m)] -> m [NTypeF m (SThunk m)] Source #

unify :: forall e m. MonadLint e m => NExprF () -> Symbolic m -> Symbolic m -> m (Symbolic m) Source #

unify raises an error if the result is would be 'NMany []'.

lintBinaryOp :: forall e m. (MonadLint e m, MonadEval (Symbolic m) m) => NBinaryOp -> Symbolic m -> m (Symbolic m) -> m (Symbolic m) Source #

lintApp :: forall e m. MonadLint e m => NExprF () -> Symbolic m -> m (Symbolic m) -> m (HashMap VarName (Symbolic m), Symbolic m) infixl 1 Source #

newtype Lint s a Source #

Constructors

Lint 

Fields

Instances

Monad (Lint s) Source # 

Methods

(>>=) :: Lint s a -> (a -> Lint s b) -> Lint s b #

(>>) :: Lint s a -> Lint s b -> Lint s b #

return :: a -> Lint s a #

fail :: String -> Lint s a #

Functor (Lint s) Source # 

Methods

fmap :: (a -> b) -> Lint s a -> Lint s b #

(<$) :: a -> Lint s b -> Lint s a #

MonadFix (Lint s) Source # 

Methods

mfix :: (a -> Lint s a) -> Lint s a #

Applicative (Lint s) Source # 

Methods

pure :: a -> Lint s a #

(<*>) :: Lint s (a -> b) -> Lint s a -> Lint s b #

liftA2 :: (a -> b -> c) -> Lint s a -> Lint s b -> Lint s c #

(*>) :: Lint s a -> Lint s b -> Lint s b #

(<*) :: Lint s a -> Lint s b -> Lint s a #

MonadThrow (Lint s) Source # 

Methods

throwM :: Exception e => e -> Lint s a #

MonadVar (Lint s) Source # 

Associated Types

type Var (Lint s :: * -> *) :: * -> * Source #

Methods

newVar :: a -> Lint s (Var (Lint s) a) Source #

readVar :: Var (Lint s) a -> Lint s a Source #

writeVar :: Var (Lint s) a -> a -> Lint s () Source #

atomicModifyVar :: Var (Lint s) a -> (a -> (a, b)) -> Lint s b Source #

MonadReader (Context (Lint s) (SThunk (Lint s))) (Lint s) Source # 

Methods

ask :: Lint s (Context (Lint s) (SThunk (Lint s))) #

local :: (Context (Lint s) (SThunk (Lint s)) -> Context (Lint s) (SThunk (Lint s))) -> Lint s a -> Lint s a #

reader :: (Context (Lint s) (SThunk (Lint s)) -> a) -> Lint s a #

type Var (Lint s) Source # 
type Var (Lint s) = STRef s

runLintM :: Options -> Lint s a -> ST s a Source #