Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The translation of abstract syntax to concrete syntax has two purposes. First it allows us to pretty print abstract syntax values without having to write a dedicated pretty printer, and second it serves as a sanity check for the concrete to abstract translation: translating from concrete to abstract and then back again should be (more or less) the identity.
Synopsis
- class ToConcrete a where
- type ConOfAbs a
- toConcrete :: a -> AbsToCon (ConOfAbs a)
- bindToConcrete :: a -> (ConOfAbs a -> AbsToCon b) -> AbsToCon b
- toConcreteCtx :: ToConcrete a => Precedence -> a -> AbsToCon (ConOfAbs a)
- abstractToConcrete_ :: (ToConcrete a, MonadAbsToCon m) => a -> m (ConOfAbs a)
- abstractToConcreteScope :: (ToConcrete a, MonadAbsToCon m) => ScopeInfo -> a -> m (ConOfAbs a)
- abstractToConcreteHiding :: (LensHiding i, ToConcrete a, MonadAbsToCon m) => i -> a -> m (ConOfAbs a)
- runAbsToCon :: MonadAbsToCon m => AbsToCon c -> m c
- data RangeAndPragma = RangeAndPragma Range Pragma
- abstractToConcreteCtx :: (ToConcrete a, MonadAbsToCon m) => Precedence -> a -> m (ConOfAbs a)
- withScope :: ScopeInfo -> AbsToCon a -> AbsToCon a
- preserveInteractionIds :: AbsToCon a -> AbsToCon a
- type MonadAbsToCon m = (MonadFresh NameId m, MonadInteractionPoints m, MonadStConcreteNames m, HasOptions m, PureTCM m, IsString (m Doc), Null (m Doc), Semigroup (m Doc))
- data AbsToCon a
- data Env
- noTakenNames :: AbsToCon a -> AbsToCon a
- lookupQName :: AllowAmbiguousNames -> QName -> AbsToCon QName
Documentation
class ToConcrete a where Source #
Nothing
toConcrete :: a -> AbsToCon (ConOfAbs a) Source #
bindToConcrete :: a -> (ConOfAbs a -> AbsToCon b) -> AbsToCon b Source #
Instances
toConcreteCtx :: ToConcrete a => Precedence -> a -> AbsToCon (ConOfAbs a) Source #
Translate something in a context of the given precedence.
abstractToConcrete_ :: (ToConcrete a, MonadAbsToCon m) => a -> m (ConOfAbs a) Source #
abstractToConcreteScope :: (ToConcrete a, MonadAbsToCon m) => ScopeInfo -> a -> m (ConOfAbs a) Source #
abstractToConcreteHiding :: (LensHiding i, ToConcrete a, MonadAbsToCon m) => i -> a -> m (ConOfAbs a) Source #
runAbsToCon :: MonadAbsToCon m => AbsToCon c -> m c Source #
data RangeAndPragma Source #
Instances
ToConcrete RangeAndPragma Source # | |
Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs RangeAndPragma Source # toConcrete :: RangeAndPragma -> AbsToCon (ConOfAbs RangeAndPragma) Source # bindToConcrete :: RangeAndPragma -> (ConOfAbs RangeAndPragma -> AbsToCon b) -> AbsToCon b Source # | |
type ConOfAbs RangeAndPragma Source # | |
Defined in Agda.Syntax.Translation.AbstractToConcrete |
abstractToConcreteCtx :: (ToConcrete a, MonadAbsToCon m) => Precedence -> a -> m (ConOfAbs a) Source #
preserveInteractionIds :: AbsToCon a -> AbsToCon a Source #
type MonadAbsToCon m = (MonadFresh NameId m, MonadInteractionPoints m, MonadStConcreteNames m, HasOptions m, PureTCM m, IsString (m Doc), Null (m Doc), Semigroup (m Doc)) Source #
The function runAbsToCon
can target any monad that satisfies
the constraints of MonadAbsToCon
.
Instances
noTakenNames :: AbsToCon a -> AbsToCon a Source #
lookupQName :: AllowAmbiguousNames -> QName -> AbsToCon QName Source #