Safe Haskell | None |
---|---|
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 = (MonadTCEnv m, ReadTCState m, MonadStConcreteNames m, HasOptions m, HasBuiltins m, MonadDebug m)
- 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 = (MonadTCEnv m, ReadTCState m, MonadStConcreteNames m, HasOptions m, HasBuiltins m, MonadDebug m) Source #
We need: - Read access to the AbsToCon environment - Read access to the TC environment - Read access to the TC state - Read and write access to the stConcreteNames part of the TC state - Read access to the options - Permission to print debug messages
Instances
noTakenNames :: AbsToCon a -> AbsToCon a Source #
lookupQName :: AllowAmbiguousNames -> QName -> AbsToCon QName Source #