| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cubix.Language.Info
Synopsis
- data SourcePos = SourcePos {
- _sourceFile :: !String
- _sourceRow :: !Int
- _sourceCol :: !Int
- sourceFile :: HasSourcePos c => Lens' c String
- sourceRow :: HasSourcePos c => Lens' c Int
- sourceCol :: HasSourcePos c => Lens' c Int
- data SourceSpan = SourceSpan {
- _sourceStart :: !SourcePos
- _sourceEnd :: !SourcePos
- sourceStart :: HasSourceSpan c => Lens' c SourcePos
- sourceEnd :: HasSourceSpan c => Lens' c SourcePos
- mkSourceSpan :: String -> (Int, Int) -> (Int, Int) -> SourceSpan
- data SourceRange = SourceRange {
- _rangeStart :: !Int
- _rangeEnd :: !Int
- rangeStart :: HasSourceRange c => Lens' c Int
- rangeEnd :: HasSourceRange c => Lens' c Int
- rangeLength :: SourceRange -> Int
- data Attrs
- attrLabel :: HasAttrs c => Lens' c Label
- attrSpan :: HasAttrs c => Lens' c (Maybe SourceSpan)
- data Label
- class HasLabel c where
- type TermLab (f :: Signature) = AnnTerm Label f
- ppLabel :: Label -> String
- data LabelGen
- class HasLabelGen s where
- mkConcurrentSupplyLabelGen :: MonadIO m => m LabelGen
- runConcurrentSupplyLabeler :: MonadIO m => StateT LabelGen m a -> m a
- unsafeMkConcurrentSupplyLabelGen :: () -> LabelGen
- debugMakeLabel :: Int -> Label
- nextLabel :: (MonadState s m, HasLabelGen s) => m Label
- annotateLabel :: forall (f :: (Type -> Type) -> Type -> Type) (m :: Type -> Type). (HTraversable f, MonadAnnotater Label m) => CxtFunM m f (f :&: Label)
- annotateLabelOuter :: forall (f :: (Type -> Type) -> Type -> Type) m l. (HTraversable f, MonadAnnotater Label m) => Context f (HFixLab f) l -> m (HFixLab f l)
- labelProg :: forall (f :: (Type -> Type) -> Type -> Type) l. HTraversable f => LabelGen -> HFix f l -> HFixLab f l
- annotateTop :: MonadAnnotater Label m => f (HFixLab f) l -> m (HFixLab f l)
- annotateTop' :: forall f (g :: Fragment) m l. (f :<: g, MonadAnnotater Label m) => f (HFixLab g) l -> m (HFixLab g l)
- annotateTopAttrs :: MonadAnnotater Label m => f (HFixAttrs f) l -> m (HFixAttrs f l)
- annotateTopAttrs' :: forall f (g :: Fragment) m l. (f :<: g, MonadAnnotater Label m) => f (HFixAttrs g) l -> m (HFixAttrs g l)
- type HFixLab (f :: Node) = AnnHFix Label f
- type Project (fs :: Signature) = Map FilePath (E (TermLab fs))
- parseProject :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (All HFoldable fs, All HFunctor fs, All HTraversable fs) => LabelGen -> (FilePath -> IO (Maybe (Term fs l))) -> [FilePath] -> IO (Maybe (Project fs))
- rewriteProjectM :: forall m (fs :: Signature). Applicative m => (forall l. TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs)
- rewriteProjectWithFilM :: forall m (fs :: Signature). Applicative m => (forall l. FilePath -> TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs)
- putProject :: forall (fs :: Signature). (forall l. TermLab fs l -> String) -> Project fs -> IO ()
SourcePos
Constructors
| SourcePos | |
Fields
| |
Instances
sourceFile :: HasSourcePos c => Lens' c String Source #
SourceSpan
data SourceSpan Source #
Constructors
| SourceSpan | |
Fields
| |
Instances
| Data SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceSpan -> c SourceSpan # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceSpan # toConstr :: SourceSpan -> Constr # dataTypeOf :: SourceSpan -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceSpan) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceSpan) # gmapT :: (forall b. Data b => b -> b) -> SourceSpan -> SourceSpan # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceSpan -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceSpan -> r # gmapQ :: (forall d. Data d => d -> u) -> SourceSpan -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceSpan -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceSpan -> m SourceSpan # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceSpan -> m SourceSpan # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceSpan -> m SourceSpan # | |||||
| Generic SourceSpan Source # | |||||
Defined in Cubix.Language.Info Associated Types
| |||||
| Read SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods readsPrec :: Int -> ReadS SourceSpan # readList :: ReadS [SourceSpan] # readPrec :: ReadPrec SourceSpan # readListPrec :: ReadPrec [SourceSpan] # | |||||
| Show SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods showsPrec :: Int -> SourceSpan -> ShowS # show :: SourceSpan -> String # showList :: [SourceSpan] -> ShowS # | |||||
| NFData SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods rnf :: SourceSpan -> () # | |||||
| Eq SourceSpan Source # | |||||
Defined in Cubix.Language.Info | |||||
| Ord SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods compare :: SourceSpan -> SourceSpan -> Ordering # (<) :: SourceSpan -> SourceSpan -> Bool # (<=) :: SourceSpan -> SourceSpan -> Bool # (>) :: SourceSpan -> SourceSpan -> Bool # (>=) :: SourceSpan -> SourceSpan -> Bool # max :: SourceSpan -> SourceSpan -> SourceSpan # min :: SourceSpan -> SourceSpan -> SourceSpan # | |||||
| Hashable SourceSpan Source # | |||||
Defined in Cubix.Language.Info | |||||
| FromJSON SourceSpan Source # | |||||
Defined in Cubix.Language.Info | |||||
| ToJSON SourceSpan Source # | |||||
Defined in Cubix.Language.Info Methods toJSON :: SourceSpan -> Value toEncoding :: SourceSpan -> Encoding toJSONList :: [SourceSpan] -> Value toEncodingList :: [SourceSpan] -> Encoding omitField :: SourceSpan -> Bool | |||||
| type Rep SourceSpan Source # | |||||
Defined in Cubix.Language.Info type Rep SourceSpan = D1 ('MetaData "SourceSpan" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" 'False) (C1 ('MetaCons "SourceSpan" 'PrefixI 'True) (S1 ('MetaSel ('Just "_sourceStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SourcePos) :*: S1 ('MetaSel ('Just "_sourceEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SourcePos))) | |||||
sourceStart :: HasSourceSpan c => Lens' c SourcePos Source #
mkSourceSpan :: String -> (Int, Int) -> (Int, Int) -> SourceSpan Source #
SourceRange
data SourceRange Source #
Constructors
| SourceRange | |
Fields
| |
Instances
| Data SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceRange -> c SourceRange # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceRange # toConstr :: SourceRange -> Constr # dataTypeOf :: SourceRange -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceRange) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceRange) # gmapT :: (forall b. Data b => b -> b) -> SourceRange -> SourceRange # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceRange -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceRange -> r # gmapQ :: (forall d. Data d => d -> u) -> SourceRange -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceRange -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceRange -> m SourceRange # | |||||
| Semigroup SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods (<>) :: SourceRange -> SourceRange -> SourceRange # sconcat :: NonEmpty SourceRange -> SourceRange # stimes :: Integral b => b -> SourceRange -> SourceRange # | |||||
| Generic SourceRange Source # | |||||
Defined in Cubix.Language.Info Associated Types
| |||||
| Read SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods readsPrec :: Int -> ReadS SourceRange # readList :: ReadS [SourceRange] # readPrec :: ReadPrec SourceRange # readListPrec :: ReadPrec [SourceRange] # | |||||
| Show SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods showsPrec :: Int -> SourceRange -> ShowS # show :: SourceRange -> String # showList :: [SourceRange] -> ShowS # | |||||
| NFData SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods rnf :: SourceRange -> () # | |||||
| Eq SourceRange Source # | |||||
Defined in Cubix.Language.Info | |||||
| Ord SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods compare :: SourceRange -> SourceRange -> Ordering # (<) :: SourceRange -> SourceRange -> Bool # (<=) :: SourceRange -> SourceRange -> Bool # (>) :: SourceRange -> SourceRange -> Bool # (>=) :: SourceRange -> SourceRange -> Bool # max :: SourceRange -> SourceRange -> SourceRange # min :: SourceRange -> SourceRange -> SourceRange # | |||||
| Hashable SourceRange Source # | |||||
Defined in Cubix.Language.Info | |||||
| FromJSON SourceRange Source # | |||||
Defined in Cubix.Language.Info | |||||
| ToJSON SourceRange Source # | |||||
Defined in Cubix.Language.Info Methods toJSON :: SourceRange -> Value toEncoding :: SourceRange -> Encoding toJSONList :: [SourceRange] -> Value toEncodingList :: [SourceRange] -> Encoding omitField :: SourceRange -> Bool | |||||
| type Rep SourceRange Source # | |||||
Defined in Cubix.Language.Info type Rep SourceRange = D1 ('MetaData "SourceRange" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" 'False) (C1 ('MetaCons "SourceRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rangeStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_rangeEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) | |||||
rangeStart :: HasSourceRange c => Lens' c Int Source #
rangeLength :: SourceRange -> Int Source #
Return the length of the range.
Attrs
attrSpan :: HasAttrs c => Lens' c (Maybe SourceSpan) Source #
Label
Provides unique labels for AST nodes
Instances
| Data Label Source # | |||||
Defined in Cubix.Language.Info Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Label -> c Label # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Label # dataTypeOf :: Label -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Label) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Label) # gmapT :: (forall b. Data b => b -> b) -> Label -> Label # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Label -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Label -> r # gmapQ :: (forall d. Data d => d -> u) -> Label -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Label -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Label -> m Label # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Label -> m Label # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Label -> m Label # | |||||
| Generic Label Source # | |||||
Defined in Cubix.Language.Info Associated Types
| |||||
| Read Label Source # | |||||
| Show Label Source # | |||||
| HasLabel Label Source # | |||||
| NFData Label Source # | |||||
Defined in Cubix.Language.Info | |||||
| Eq Label Source # | |||||
| Ord Label Source # | |||||
| ToJSON Label Source # | |||||
Defined in Cubix.Language.Info Methods toEncoding :: Label -> Encoding toJSONList :: [Label] -> Value toEncodingList :: [Label] -> Encoding | |||||
| (Monad m, HasLabelGen s) => MonadAnnotater Label (StateT s m) Source # | |||||
| type Rep Label Source # | |||||
Defined in Cubix.Language.Info | |||||
Instances
class HasLabelGen s where Source #
Instances
mkConcurrentSupplyLabelGen :: MonadIO m => m LabelGen Source #
unsafeMkConcurrentSupplyLabelGen :: () -> LabelGen Source #
debugMakeLabel :: Int -> Label Source #
nextLabel :: (MonadState s m, HasLabelGen s) => m Label Source #
annotateLabel :: forall (f :: (Type -> Type) -> Type -> Type) (m :: Type -> Type). (HTraversable f, MonadAnnotater Label m) => CxtFunM m f (f :&: Label) Source #
Fully annotates a term with fresh labels
annotateLabelOuter :: forall (f :: (Type -> Type) -> Type -> Type) m l. (HTraversable f, MonadAnnotater Label m) => Context f (HFixLab f) l -> m (HFixLab f l) Source #
labelProg :: forall (f :: (Type -> Type) -> Type -> Type) l. HTraversable f => LabelGen -> HFix f l -> HFixLab f l Source #
annotateTop :: MonadAnnotater Label m => f (HFixLab f) l -> m (HFixLab f l) Source #
annotateTop' :: forall f (g :: Fragment) m l. (f :<: g, MonadAnnotater Label m) => f (HFixLab g) l -> m (HFixLab g l) Source #
annotateTopAttrs :: MonadAnnotater Label m => f (HFixAttrs f) l -> m (HFixAttrs f l) Source #
annotateTopAttrs' :: forall f (g :: Fragment) m l. (f :<: g, MonadAnnotater Label m) => f (HFixAttrs g) l -> m (HFixAttrs g l) Source #
Project
parseProject :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (All HFoldable fs, All HFunctor fs, All HTraversable fs) => LabelGen -> (FilePath -> IO (Maybe (Term fs l))) -> [FilePath] -> IO (Maybe (Project fs)) Source #
rewriteProjectM :: forall m (fs :: Signature). Applicative m => (forall l. TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs) Source #
rewriteProjectWithFilM :: forall m (fs :: Signature). Applicative m => (forall l. FilePath -> TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs) Source #