haskell-debugger
Safe HaskellNone
LanguageGHC2021

GHC.Debugger.Runtime.Term.Parser

Description

This module contains the TermParser abstraction, which provides utilities for interpreting and parsing Terms

Synopsis

Documentation

obtainParsedTerm :: String -> Int -> Bool -> Type -> ForeignHValue -> TermParser a -> Debugger (Either [TermParseError] a) Source #

The main entry point for running the TermParser.

Term parser abstraction

newtype TermParser a Source #

Constructors

TermParser 

Instances

Instances details
Alternative TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Applicative TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Methods

pure :: a -> TermParser a #

(<*>) :: TermParser (a -> b) -> TermParser a -> TermParser b #

liftA2 :: (a -> b -> c) -> TermParser a -> TermParser b -> TermParser c #

(*>) :: TermParser a -> TermParser b -> TermParser b #

(<*) :: TermParser a -> TermParser b -> TermParser a #

Functor TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Methods

fmap :: (a -> b) -> TermParser a -> TermParser b #

(<$) :: a -> TermParser b -> TermParser a #

Monad TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Methods

(>>=) :: TermParser a -> (a -> TermParser b) -> TermParser b #

(>>) :: TermParser a -> TermParser b -> TermParser b #

return :: a -> TermParser a #

MonadFail TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Methods

fail :: HasCallStack => String -> TermParser a #

MonadIO TermParser Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Parser

Methods

liftIO :: IO a -> TermParser a #

seqTermP :: HasCallStack => TermParser a -> TermParser a Source #

Evaluate the currently focused term

refreshTerm :: TermParser Term Source #

If a term is a suspension, make sure that it's a thunk and not just that we reached the depth limit.

focus :: TermParser Term -> TermParser a -> TermParser a Source #

Change the focus of the term parser onto the specified term.

focusSeq :: HasCallStack => TermParser Term -> TermParser a -> TermParser a Source #

Focus on a new subtree, after forcing it to WHNF.

subtermTerm :: Int -> TermParser Term Source #

Choose the nth subterm

subtermWith :: Int -> TermParser a -> TermParser a Source #

Choose the nth subterm, force it to WHNF and run the supplied parser on it.

primParser :: TermParser Word Source #

Parse a primitive value as a single word (Prim term)

isSuspension :: TermParser Bool Source #

Is the current focus a suspension?

foreignValueToTerm :: Type -> ForeignHValue -> TermParser Term Source #

Obtain a Term from a ForeignHValue

Logging parsers

Base parsers

parseList :: TermParser a -> TermParser [a] Source #

Parse a list, given a parser for each element. The whole list will be forced.

maybeParser :: TermParser a -> TermParser (Maybe a) Source #

Parse a Maybe something

VarValue

varValueParser :: TermParser (Term, Bool) Source #

Parse a term which is a ValValue

VarFields

varFieldsParser :: TermParser [(String, Term)] Source #

Parse a term which is a 'Program VarFields'

Program Parser

programTermParser :: TermParser Term Source #

Parses and evaluates a Program term.