hnix-0.17.0: Haskell implementation of the Nix language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Nix.Lint

Synopsis

Documentation

data TAtom Source #

Constructors

TInt 
TFloat 
TBool 
TNull 

Instances

Instances details
Show TAtom Source # 
Instance details

Defined in Nix.Lint

Methods

showsPrec :: Int -> TAtom -> ShowS #

show :: TAtom -> String #

showList :: [TAtom] -> ShowS #

Eq TAtom Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

Ord TAtom Source # 
Instance details

Defined in Nix.Lint

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 #

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

Constructors

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

Instances

Instances details
Functor m => Functor (NTypeF m) Source # 
Instance details

Defined in Nix.Lint

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

Instances details
Foldable NSymbolicF Source # 
Instance details

Defined in Nix.Lint

Methods

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

foldMap :: Monoid m => (a -> m) -> NSymbolicF a -> 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 # 
Instance details

Defined in Nix.Lint

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

Functor NSymbolicF Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

Show r => Show (NSymbolicF r) Source # 
Instance details

Defined in Nix.Lint

Eq r => Eq (NSymbolicF r) Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

Ord r => Ord (NSymbolicF r) Source # 
Instance details

Defined in Nix.Lint

type SThunk (m :: Type -> Type) = NThunkF m (Symbolic m) Source #

type SValue (m :: Type -> Type) = Ref m (NSymbolicF (NTypeF m (Symbolic m))) Source #

data Symbolic m Source #

Constructors

SV 

Fields

ST 

Fields

Instances

Instances details
FromValue NixString m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

ToValue Bool m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

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

Show (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

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

show :: Symbolic m -> String #

showList :: [Symbolic m] -> ShowS #

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

Defined in Nix.Lint

Methods

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

synHole :: VarName -> m (Symbolic m) Source #

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

evaledSym :: VarName -> 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 :: Path -> m (Symbolic m) Source #

evalEnvPath :: Path -> 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 #

(MonadThunkId m, MonadAtomicRef m, MonadCatch m) => MonadValue (Symbolic m) m Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

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

(MonadThunkId m, MonadAtomicRef m, MonadCatch m) => MonadValueF (Symbolic m) m Source # 
Instance details

Defined in Nix.Lint

Methods

demandF :: (Symbolic m -> m r) -> Symbolic m -> m r Source #

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

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

Defined in Nix.Lint

Methods

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

Scoped (Symbolic (Lint s)) (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

askScopes :: Lint s (Scopes (Lint s) (Symbolic (Lint s))) Source #

clearScopes :: Lint s r -> Lint s r Source #

pushScopes :: Scopes (Lint s) (Symbolic (Lint s)) -> Lint s r -> Lint s r Source #

lookupVar :: VarName -> Lint s (Maybe (Symbolic (Lint s))) Source #

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

Defined in Nix.Lint

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

Defined in Nix.Lint

Methods

toValue :: (AttrSet (Symbolic m), PositionSet) -> m (Symbolic m) Source #

MonadReader (Context (Lint s) (Symbolic (Lint s))) (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

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

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

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

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

Result == NMany [] -> unify fails.

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

Instances details
MonadFix (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

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

Applicative (Lint s) Source # 
Instance details

Defined in Nix.Lint

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 #

Functor (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

Monad (Lint s) Source # 
Instance details

Defined in Nix.Lint

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 #

MonadCatch (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

catch :: Exception e => Lint s a -> (e -> Lint s a) -> Lint s a #

MonadThrow (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

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

MonadThunkId (Lint s) Source # 
Instance details

Defined in Nix.Lint

Associated Types

type ThunkId (Lint s) Source #

Methods

freshId :: Lint s (ThunkId (Lint s)) Source #

MonadAtomicRef (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

atomicModifyRef :: Ref (Lint s) a -> (a -> (a, b)) -> Lint s b #

atomicModifyRef' :: Ref (Lint s) a -> (a -> (a, b)) -> Lint s b #

MonadRef (Lint s) Source # 
Instance details

Defined in Nix.Lint

Associated Types

type Ref (Lint s) :: Type -> Type #

Methods

newRef :: a -> Lint s (Ref (Lint s) a) #

readRef :: Ref (Lint s) a -> Lint s a #

writeRef :: Ref (Lint s) a -> a -> Lint s () #

modifyRef :: Ref (Lint s) a -> (a -> a) -> Lint s () #

modifyRef' :: Ref (Lint s) a -> (a -> a) -> Lint s () #

Scoped (Symbolic (Lint s)) (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

askScopes :: Lint s (Scopes (Lint s) (Symbolic (Lint s))) Source #

clearScopes :: Lint s r -> Lint s r Source #

pushScopes :: Scopes (Lint s) (Symbolic (Lint s)) -> Lint s r -> Lint s r Source #

lookupVar :: VarName -> Lint s (Maybe (Symbolic (Lint s))) Source #

MonadReader (Context (Lint s) (Symbolic (Lint s))) (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

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

type ThunkId (Lint s) Source # 
Instance details

Defined in Nix.Lint

type ThunkId (Lint s) = ThunkId (ReaderT (Context (Lint s) (Symbolic (Lint s))) (FreshIdT Int (ST s)))
type Ref (Lint s) Source # 
Instance details

Defined in Nix.Lint

type Ref (Lint s) = Ref (ReaderT (Context (Lint s) (Symbolic (Lint s))) (FreshIdT Int (ST s)))

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