cubix
Safe HaskellNone
LanguageHaskell2010

Cubix.Language.Info

Synopsis

SourcePos

data SourcePos Source #

Constructors

SourcePos 

Instances

Instances details
Data SourcePos Source # 
Instance details

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 #

Generic SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Associated Types

type Rep SourcePos 
Instance details

Defined in Cubix.Language.Info

type Rep SourcePos = D1 ('MetaData "SourcePos" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" '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))))
Read SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Show SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

NFData SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Methods

rnf :: SourcePos -> () #

Eq SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Ord SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Hashable SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

FromJSON SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Methods

parseJSON :: Value -> Parser SourcePos

parseJSONList :: Value -> Parser [SourcePos]

omittedField :: Maybe SourcePos

ToJSON SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

Methods

toJSON :: SourcePos -> Value

toEncoding :: SourcePos -> Encoding

toJSONList :: [SourcePos] -> Value

toEncodingList :: [SourcePos] -> Encoding

omitField :: SourcePos -> Bool

type Rep SourcePos Source # 
Instance details

Defined in Cubix.Language.Info

type Rep SourcePos = D1 ('MetaData "SourcePos" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" '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 #

sourceRow :: HasSourcePos c => Lens' c Int Source #

sourceCol :: HasSourcePos c => Lens' c Int Source #

SourceSpan

data SourceSpan Source #

Constructors

SourceSpan 

Instances

Instances details
Data SourceSpan Source # 
Instance details

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

Defined in Cubix.Language.Info

Associated Types

type Rep SourceSpan 
Instance details

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)))
Read SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

Show SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

NFData SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

Methods

rnf :: SourceSpan -> () #

Eq SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

Ord SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

Hashable SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

FromJSON SourceSpan Source # 
Instance details

Defined in Cubix.Language.Info

Methods

parseJSON :: Value -> Parser SourceSpan

parseJSONList :: Value -> Parser [SourceSpan]

omittedField :: Maybe SourceSpan

ToJSON SourceSpan Source # 
Instance details

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

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 #

sourceEnd :: HasSourceSpan c => Lens' c SourcePos Source #

SourceRange

data SourceRange Source #

Constructors

SourceRange 

Fields

Instances

Instances details
Data SourceRange Source # 
Instance details

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

Defined in Cubix.Language.Info

Generic SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Associated Types

type Rep SourceRange 
Instance details

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)))
Read SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Show SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

NFData SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Methods

rnf :: SourceRange -> () #

Eq SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Ord SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Hashable SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

FromJSON SourceRange Source # 
Instance details

Defined in Cubix.Language.Info

Methods

parseJSON :: Value -> Parser SourceRange

parseJSONList :: Value -> Parser [SourceRange]

omittedField :: Maybe SourceRange

ToJSON SourceRange Source # 
Instance details

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

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 #

rangeEnd :: HasSourceRange c => Lens' c Int Source #

rangeLength :: SourceRange -> Int Source #

Return the length of the range.

Attrs

attrLabel :: HasAttrs c => Lens' c Label Source #

attrSpan :: HasAttrs c => Lens' c (Maybe SourceSpan) Source #

Label

data Label Source #

Provides unique labels for AST nodes

Instances

Instances details
Data Label Source # 
Instance details

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 #

toConstr :: Label -> Constr #

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

Defined in Cubix.Language.Info

Associated Types

type Rep Label 
Instance details

Defined in Cubix.Language.Info

type Rep Label = D1 ('MetaData "Label" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" 'True) (C1 ('MetaCons "Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Methods

from :: Label -> Rep Label x #

to :: Rep Label x -> Label #

Read Label Source # 
Instance details

Defined in Cubix.Language.Info

Show Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

showsPrec :: Int -> Label -> ShowS #

show :: Label -> String #

showList :: [Label] -> ShowS #

HasLabel Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

label :: Lens' Label Label Source #

NFData Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

rnf :: Label -> () #

Eq Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

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

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

Ord Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

compare :: Label -> Label -> Ordering #

(<) :: Label -> Label -> Bool #

(<=) :: Label -> Label -> Bool #

(>) :: Label -> Label -> Bool #

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

max :: Label -> Label -> Label #

min :: Label -> Label -> Label #

ToJSON Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

toJSON :: Label -> Value

toEncoding :: Label -> Encoding

toJSONList :: [Label] -> Value

toEncodingList :: [Label] -> Encoding

omitField :: Label -> Bool

(Monad m, HasLabelGen s) => MonadAnnotater Label (StateT s m) Source # 
Instance details

Defined in Cubix.Language.Info

Methods

annM :: forall f (e :: Family) l. f e l -> StateT s m ((f :&: Label) e l) Source #

type Rep Label Source # 
Instance details

Defined in Cubix.Language.Info

type Rep Label = D1 ('MetaData "Label" "Cubix.Language.Info" "cubix-0.7.0.15-inplace" 'True) (C1 ('MetaCons "Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

class HasLabel c where Source #

Methods

label :: Lens' c Label Source #

Instances

Instances details
HasLabel Label Source # 
Instance details

Defined in Cubix.Language.Info

Methods

label :: Lens' Label Label Source #

data LabelGen Source #

Instances

Instances details
HasLabelGen LabelGen Source # 
Instance details

Defined in Cubix.Language.Info

class HasLabelGen s where Source #

Methods

labelGen :: Lens' s LabelGen Source #

Instances

Instances details
HasLabelGen LabelGen Source # 
Instance details

Defined in Cubix.Language.Info

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' :: 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 #

type HFixLab (f :: Node) = AnnHFix Label f Source #

Project

type Project (fs :: Signature) = Map FilePath (E (TermLab fs)) Source #

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 #

putProject :: forall (fs :: Signature). (forall l. TermLab fs l -> String) -> Project fs -> IO () Source #