parsley-core-2.3.0.0: A fast parser combinator library backed by Typed Template Haskell
LicenseBSD-3-Clause
MaintainerJamie Willis
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Parsley.Internal.Backend.Machine.Defunc

Description

This module contains the infrastructure and definitions of defunctionalised terms used solely within the machine.

Since: 1.0.0.0

Synopsis

Documentation

data Defunc a where Source #

Machine level defunctionalisation, for terms that can only be introduced by the code generator, and that do not require value level representations.

Since: 1.4.0.0

Constructors

LAM :: Lam a -> Defunc a

Wraps Lam terms so that they can be used within the machine.

Since: 1.1.0.0

BOTTOM :: Defunc a

Represents Haskell's undefined, which may be used by high-level optimisers to replace redundant values whilst preserving the types.

Since: 1.0.0.0

INPUT :: Input o -> Defunc o

Allows the static Inputs to be pushed onto the operand stack, which is the easiest way to get them to persist as arguments to handlers, and interact with Seek and Tell.

Since: 1.8.0.0

Instances

Instances details
Show (Defunc a) Source # 
Instance details

Defined in Parsley.Internal.Backend.Machine.Defunc

Methods

showsPrec :: Int -> Defunc a -> ShowS #

show :: Defunc a -> String #

showList :: [Defunc a] -> ShowS #

user :: Defunc a -> Defunc a Source #

Promotes a Defunc value from the Frontend API into a Backend one.

Since: 1.1.0.0

ap :: (?flags :: Flags) => Defunc (a -> b) -> Defunc a -> Defunc b Source #

Applies a function to a value when both are Defunc.

Since: 1.3.0.0

ap2 :: (?flags :: Flags) => Defunc (a -> b -> c) -> Defunc a -> Defunc b -> Defunc c Source #

Applies a function to two values when all are Defunc.

Since: 1.3.0.0

_if :: (?flags :: Flags) => Defunc Bool -> Code a -> Code a -> Code a Source #

Acts as an if-expression lifted to the Defunc level.

Since: 1.3.0.0

genDefunc :: (?flags :: Flags) => Defunc a -> Code a Source #

Generate the Haskell code that represents this defunctionalised value.

Since: 1.0.0.0

pattern NormLam :: (?flags :: Flags) => Lam a -> Defunc a Source #

Pattern that normalises a Lam before returning it.

Since: 1.1.0.0

pattern FREEVAR :: (?flags :: Flags) => Code a -> Defunc a Source #

Pattern that represents simple Lam variables, post-normalisation.

Since: 1.1.0.0