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

Nix.Lint

Synopsis

Documentation

data TAtom Source #

Constructors

TInt 
TFloat 
TBool 
TNull 

Instances

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

Show TAtom Source # 
Instance details

Defined in Nix.Lint

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 (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
Functor NSymbolicF Source # 
Instance details

Defined in Nix.Lint

Methods

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

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

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

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

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

Defined in Nix.Lint

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

type SValue (m :: * -> *) = Var m (NSymbolicF (NTypeF m (Symbolic m))) Source #

data Symbolic m Source #

Constructors

SV 

Fields

ST 

Fields

Instances

Instances details
ToValue Bool m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

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

FromValue NixString m (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Show (Symbolic m) Source # 
Instance details

Defined in Nix.Lint

Methods

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

show :: Symbolic m -> String #

showList :: [Symbolic m] -> ShowS #

(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 -> (Symbolic m -> m r) -> m r Source #

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

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

Defined in Nix.Lint

Methods

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

synHole :: 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 [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

currentScopes :: 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 :: Text -> Lint s (Maybe (Symbolic (Lint s))) Source #

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

Defined in Nix.Lint

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

Defined in Nix.Lint

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 => String -> 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. 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

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

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 #

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 #

MonadThrow (Lint s) Source # 
Instance details

Defined in Nix.Lint

Methods

throwM :: Exception e => e -> 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 #

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

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 #

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 #

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

Defined in Nix.Lint

Methods

currentScopes :: 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 :: Text -> 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 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)))
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)))

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