Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cubix.Language.Info
Synopsis
- data SourcePos
- sourceFile :: HasSourcePos c => Lens' c String
- sourceRow :: HasSourcePos c => Lens' c Int
- sourceCol :: HasSourcePos c => Lens' c Int
- data SourceSpan
- sourceStart :: HasSourceSpan c => Lens' c SourcePos
- sourceEnd :: HasSourceSpan c => Lens' c SourcePos
- mkSourceSpan :: String -> (Int, Int) -> (Int, Int) -> SourceSpan
- data Attrs
- attrLabel :: HasAttrs c => Lens' c Label
- attrSpan :: HasAttrs c => Lens' c (Maybe SourceSpan)
- data Label
- class HasLabel c where
- type TermLab f = AnnTerm Label f
- class (MonadState s m, HasLabelGen s) => MonadLabeler s m | m -> s
- ppLabel :: Label -> String
- data LabelGen
- class HasLabelGen s where
- mkCSLabelGen :: MonadIO m => m LabelGen
- unsafeMkCSLabelGen :: () -> LabelGen
- debugMakeLabel :: Int -> Label
- nextLabel :: MonadLabeler s m => m Label
- annotateLabel :: (HTraversable f, MonadAnnotater Label m) => CxtFunM m f (f :&: Label)
- annotateOuter :: (HTraversable f, MonadAnnotater a m) => Context f (AnnHFix a f) l -> m (AnnHFix a f l)
- annotateLabelOuter :: (HTraversable f, MonadAnnotater Label m) => Context f (HFixLab f) l -> m (HFixLab f l)
- labelProg :: HTraversable f => LabelGen -> HFix f l -> HFixLab f l
- annotateTop :: MonadAnnotater Label m => f (HFixLab f) l -> m (HFixLab f l)
- annotateTop' :: (f :<: g, MonadAnnotater Label m) => f (HFixLab g) l -> m (HFixLab g l)
- type Project fs = Map FilePath (E (TermLab fs))
- parseProject :: forall fs l. (All HFoldable fs, All HFunctor fs, All HTraversable fs) => LabelGen -> (FilePath -> IO (Maybe (Term fs l))) -> [FilePath] -> IO (Maybe (Project fs))
- rewriteProjectM :: Applicative m => (forall l. TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs)
- rewriteProjectWithFilM :: Applicative m => (forall l. FilePath -> TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs)
- putProject :: (forall l. TermLab fs l -> String) -> Project fs -> IO ()
- type HFixLab f = AnnHFix Label f
Documentation
Instances
Eq SourcePos Source # | |
Data SourcePos Source # | |
Defined in Cubix.Language.Info Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos # toConstr :: SourcePos -> Constr # dataTypeOf :: SourcePos -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) # gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r # gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos # | |
Ord SourcePos Source # | |
Read SourcePos Source # | |
Show SourcePos Source # | |
Generic SourcePos Source # | |
NFData SourcePos Source # | |
Defined in Cubix.Language.Info | |
type Rep SourcePos Source # | |
Defined in Cubix.Language.Info type Rep SourcePos = D1 ('MetaData "SourcePos" "Cubix.Language.Info" "cubix-0.1.0.0-GE3qzSJT6A0CUj1veI8jGO" 'False) (C1 ('MetaCons "SourcePos" 'PrefixI 'True) (S1 ('MetaSel ('Just "_sourceFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: (S1 ('MetaSel ('Just "_sourceRow") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_sourceCol") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) |
sourceFile :: HasSourcePos c => Lens' c String Source #
data SourceSpan Source #
Instances
sourceStart :: HasSourceSpan c => Lens' c SourcePos Source #
mkSourceSpan :: String -> (Int, Int) -> (Int, Int) -> SourceSpan Source #
attrSpan :: HasAttrs c => Lens' c (Maybe SourceSpan) Source #
Provides unique labels for AST nodes
Instances
Eq Label Source # | |
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 # | |
Ord Label Source # | |
Read Label Source # | |
Show Label Source # | |
Generic Label Source # | |
NFData Label Source # | |
Defined in Cubix.Language.Info | |
HasLabel Label Source # | |
(Monad m, MonadLabeler s m) => MonadAnnotater Label m Source # | |
type Rep Label Source # | |
Defined in Cubix.Language.Info |
class (MonadState s m, HasLabelGen s) => MonadLabeler s m | m -> s Source #
Instances
(MonadState s m, HasLabelGen s) => MonadLabeler s m Source # | |
Defined in Cubix.Language.Info |
Instances
class HasLabelGen s where Source #
Instances
mkCSLabelGen :: MonadIO m => m LabelGen Source #
unsafeMkCSLabelGen :: () -> LabelGen Source #
debugMakeLabel :: Int -> Label Source #
nextLabel :: MonadLabeler s m => m Label Source #
annotateLabel :: (HTraversable f, MonadAnnotater Label m) => CxtFunM m f (f :&: Label) Source #
Fully annotates a term with fresh labels
annotateOuter :: (HTraversable f, MonadAnnotater a m) => Context f (AnnHFix a f) l -> m (AnnHFix a f l) Source #
annotateLabelOuter :: (HTraversable f, MonadAnnotater Label m) => Context f (HFixLab f) l -> m (HFixLab f l) Source #
annotateTop :: MonadAnnotater Label m => f (HFixLab f) l -> m (HFixLab f l) Source #
annotateTop' :: (f :<: g, MonadAnnotater Label m) => f (HFixLab g) l -> m (HFixLab g l) Source #
parseProject :: forall fs l. (All HFoldable fs, All HFunctor fs, All HTraversable fs) => LabelGen -> (FilePath -> IO (Maybe (Term fs l))) -> [FilePath] -> IO (Maybe (Project fs)) Source #
rewriteProjectM :: Applicative m => (forall l. TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs) Source #
rewriteProjectWithFilM :: Applicative m => (forall l. FilePath -> TermLab fs l -> m (TermLab fs l)) -> Project fs -> m (Project fs) Source #