plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Pretty.Internal.Types

Synopsis

Documentation

data PrettyCursor Source #

Notifies the prettifier what "state" the cursor currently is, so it can decide whether or not to wrap the target expression in parens.

Normal indicates no parens wrapping is necessary, even for complex expressions.

Special indicates complex expressions should be wrapped in parens.

Usually, Special just hints at one of three states:

  1. Applying - The expression is being applied like a function.
  2. Applied - The expression is being applied as a function argument.
  3. Unary arg - The expression is being used as an argument to a high arity unary operator (~ and !).

Constructors

Normal 
Special 

type PrettyMonad s = ReaderT (STGenM StdGen s) (StateT PrettyState (ST s)) Source #

forkState :: MonadState s m => m b -> m b Source #

insertName :: Text -> PrettyState -> PrettyState Source #

Insert a fresh binding onto the name map, i.e a name at index 0 - incrementing all other indices.

builtinFunAtRef :: Map Index Text -> Index -> Maybe DefaultFun Source #

nameOfRef :: Index -> Map Index Text -> Maybe Text Source #