Safe Haskell | None |
---|---|
Language | Haskell2010 |
The source location annotated nix expression type and supporting types.
Synopsis
- data Ann ann a = Ann {
- annotation :: ann
- annotated :: a
- data SrcSpan = SrcSpan {}
- type NExprLoc = Fix NExprLocF
- type NExprLocF = AnnF SrcSpan NExprF
- type AnnF ann f = Compose (Ann ann) f
- pattern NBinary_ :: SrcSpan -> NBinaryOp -> r -> r -> NExprLocF r
- pattern NUnary_ :: SrcSpan -> NUnaryOp -> r -> NExprLocF r
- pattern NAssert_ :: SrcSpan -> r -> r -> NExprLocF r
- pattern NWith_ :: SrcSpan -> r -> r -> NExprLocF r
- pattern NIf_ :: SrcSpan -> r -> r -> r -> NExprLocF r
- pattern NLet_ :: SrcSpan -> [Binding r] -> r -> NExprLocF r
- pattern NAbs_ :: SrcSpan -> Params r -> r -> NExprLocF r
- pattern NHasAttr_ :: SrcSpan -> r -> NAttrPath r -> NExprLocF r
- pattern NSelect_ :: SrcSpan -> r -> NAttrPath r -> Maybe r -> NExprLocF r
- pattern NEnvPath_ :: SrcSpan -> FilePath -> NExprLocF r
- pattern NLiteralPath_ :: SrcSpan -> FilePath -> NExprLocF r
- pattern NSet_ :: SrcSpan -> NRecordType -> [Binding r] -> NExprLocF r
- pattern NList_ :: SrcSpan -> [r] -> NExprLocF r
- pattern NStr_ :: SrcSpan -> NString r -> NExprLocF r
- pattern NConstant_ :: SrcSpan -> NAtom -> NExprLocF r
- pattern NSynHole_ :: SrcSpan -> Text -> NExprLocF r
- pattern NSym_ :: SrcSpan -> VarName -> NExprLocF r
- pattern AnnE :: forall ann (g :: * -> *). ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
- annToAnnF :: Ann ann (f (Fix (AnnF ann f))) -> Fix (AnnF ann f)
- stripAnnotation :: Functor f => Fix (AnnF ann f) -> Fix f
- stripAnn :: AnnF ann f r -> f r
- nUnary :: Ann SrcSpan NUnaryOp -> NExprLoc -> NExprLoc
- nBinary :: Ann SrcSpan NBinaryOp -> NExprLoc -> NExprLoc -> NExprLoc
- nSelectLoc :: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> Maybe NExprLoc -> NExprLoc
- nHasAttr :: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> NExprLoc
- nApp :: NExprLoc -> NExprLoc -> NExprLoc
- nAbs :: Ann SrcSpan (Params NExprLoc) -> NExprLoc -> NExprLoc
- nStr :: Ann SrcSpan (NString NExprLoc) -> NExprLoc
- deltaInfo :: SourcePos -> (Text, Int, Int)
- nNull :: NExprLoc
- nullSpan :: SrcSpan
- module Data.Functor.Compose
- data SourcePos = SourcePos {
- sourceName :: FilePath
- sourceLine :: !Pos
- sourceColumn :: !Pos
- unPos :: Pos -> Int
- mkPos :: Int -> Pos
Documentation
A type constructor applied to a type along with an annotation
Intended to be used with Fix
:
type MyType = Fix (Compose (Ann Annotation) F)
Ann | |
|
Instances
ToJSON2 Ann Source # | |
Defined in Nix.Expr.Types.Annotated liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Ann a b -> Value # liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Ann a b] -> Value # liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Ann a b -> Encoding # liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Ann a b] -> Encoding # | |
FromJSON2 Ann Source # | |
Defined in Nix.Expr.Types.Annotated | |
Eq2 Ann Source # | |
Ord2 Ann Source # | |
Defined in Nix.Expr.Types.Annotated | |
Read2 Ann Source # | |
Defined in Nix.Expr.Types.Annotated liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Ann a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Ann a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Ann a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Ann a b] # | |
Show2 Ann Source # | |
Binary NExprLoc Source # | |
Serialise NExprLoc Source # | |
ToExpr NExprLoc Source # | |
Functor (Ann ann) Source # | |
Foldable (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated fold :: Monoid m => Ann ann m -> m # foldMap :: Monoid m => (a -> m) -> Ann ann a -> m # foldMap' :: Monoid m => (a -> m) -> Ann ann a -> m # foldr :: (a -> b -> b) -> b -> Ann ann a -> b # foldr' :: (a -> b -> b) -> b -> Ann ann a -> b # foldl :: (b -> a -> b) -> b -> Ann ann a -> b # foldl' :: (b -> a -> b) -> b -> Ann ann a -> b # foldr1 :: (a -> a -> a) -> Ann ann a -> a # foldl1 :: (a -> a -> a) -> Ann ann a -> a # elem :: Eq a => a -> Ann ann a -> Bool # maximum :: Ord a => Ann ann a -> a # minimum :: Ord a => Ann ann a -> a # | |
Traversable (Ann ann) Source # | |
ToJSON ann => ToJSON1 (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated liftToJSON :: (a -> Value) -> ([a] -> Value) -> Ann ann a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Ann ann a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Ann ann a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Ann ann a] -> Encoding # | |
FromJSON ann => FromJSON1 (Ann ann) Source # | |
Eq ann => Eq1 (Ann ann) Source # | |
Ord ann => Ord1 (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated | |
Read ann => Read1 (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated | |
Show ann => Show1 (Ann ann) Source # | |
Binary r => Binary (NExprLocF r) Source # | |
NFData ann => NFData1 (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated | |
Hashable ann => Hashable1 (Ann ann) Source # | |
Defined in Nix.Expr.Types.Annotated | |
Generic1 (Ann ann :: Type -> Type) Source # | |
(Eq ann, Eq a) => Eq (Ann ann a) Source # | |
(Data ann, Data a) => Data (Ann ann a) Source # | |
Defined in Nix.Expr.Types.Annotated gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ann ann a) # toConstr :: Ann ann a -> Constr # dataTypeOf :: Ann ann a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ann ann a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ann ann a)) # gmapT :: (forall b. Data b => b -> b) -> Ann ann a -> Ann ann a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ann ann a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ann ann a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ann ann a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ann ann a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a) # | |
(Ord ann, Ord a) => Ord (Ann ann a) Source # | |
Defined in Nix.Expr.Types.Annotated | |
(Read ann, Read a) => Read (Ann ann a) Source # | |
(Show ann, Show a) => Show (Ann ann a) Source # | |
Generic (Ann ann a) Source # | |
(Hashable ann, Hashable a) => Hashable (Ann ann a) Source # | |
Defined in Nix.Expr.Types.Annotated | |
(Binary ann, Binary a) => Binary (Ann ann a) Source # | |
(NFData ann, NFData a) => NFData (Ann ann a) Source # | |
Defined in Nix.Expr.Types.Annotated | |
(Serialise ann, Serialise a) => Serialise (Ann ann a) Source # | |
Monad m => MonadState (HashMap FilePath NExprLoc) (StandardTF r m) Source # | |
Serialise r => Serialise (Compose (Ann SrcSpan) NExprF r) Source # | |
type Rep1 (Ann ann :: Type -> Type) Source # | |
Defined in Nix.Expr.Types.Annotated type Rep1 (Ann ann :: Type -> Type) = D1 ('MetaData "Ann" "Nix.Expr.Types.Annotated" "hnix-0.10.1-inplace" 'False) (C1 ('MetaCons "Ann" 'PrefixI 'True) (S1 ('MetaSel ('Just "annotation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Just "annotated") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |
type Rep (Ann ann a) Source # | |
Defined in Nix.Expr.Types.Annotated type Rep (Ann ann a) = D1 ('MetaData "Ann" "Nix.Expr.Types.Annotated" "hnix-0.10.1-inplace" 'False) (C1 ('MetaCons "Ann" 'PrefixI 'True) (S1 ('MetaSel ('Just "annotation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Just "annotated") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
A location in a source file
Instances
pattern NSym_ :: SrcSpan -> VarName -> NExprLocF r Source #
Pattern systems for matching on NExprLocF constructions.
pattern AnnE :: forall ann (g :: * -> *). ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g) Source #
module Data.Functor.Compose
The data type SourcePos
represents source positions. It contains the
name of the source file, a line number, and a column number. Source line
and column positions change intensively during parsing, so we need to
make them strict to avoid memory leaks.
SourcePos | |
|