symantic-parser-0.0.0.20210102: Parser combinators statically optimized and staged via typed meta-programming
Safe HaskellNone
LanguageHaskell2010

Symantic.Parser.Grammar

Synopsis

Documentation

type Grammar repr = (Applicable repr, Alternable repr, Letable Name repr, Selectable repr, Matchable repr, Foldable repr, Lookable repr) Source #

grammar :: Grammar repr => ObserveSharing Name (OptimizeComb Name repr) a -> repr a Source #

A usual pipeline to interpret Combinators: observeSharing then optimizeComb then a polymorphic (repr).

class Letable letName repr where Source #

This class is not for manual usage like usual symantic operators, here def and ref are introduced by observeSharing.

Minimal complete definition

Nothing

Methods

def :: letName -> repr a -> repr a Source #

(def letName x) let-binds (letName) to be equal to (x).

ref :: Bool -> letName -> repr a Source #

(ref isRec letName) is a reference to (letName). (isRec) is True iif. this reference is recursive, ie. is reachable within its definition.

def :: Liftable1 repr => Letable letName (Output repr) => letName -> repr a -> repr a Source #

(def letName x) let-binds (letName) to be equal to (x).

ref :: Liftable repr => Letable letName (Output repr) => Bool -> letName -> repr a Source #

(ref isRec letName) is a reference to (letName). (isRec) is True iif. this reference is recursive, ie. is reachable within its definition.

Instances

Instances details
Show letName => Letable letName WriteComb Source # 
Instance details

Defined in Symantic.Parser.Grammar.Write

Methods

def :: letName -> WriteComb a -> WriteComb a Source #

ref :: Bool -> letName -> WriteComb a Source #

Show letName => Letable letName DumpComb Source # 
Instance details

Defined in Symantic.Parser.Grammar.Dump

Methods

def :: letName -> DumpComb a -> DumpComb a Source #

ref :: Bool -> letName -> DumpComb a Source #

Letable Name (Comb repr) Source # 
Instance details

Defined in Symantic.Parser.Grammar.Optimize

Methods

def :: Name -> Comb repr a -> Comb repr a Source #

ref :: Bool -> Name -> Comb repr a Source #

Letable Name (Machine inp) Source # 
Instance details

Defined in Symantic.Parser.Machine.Instructions

Methods

def :: Name -> Machine inp a -> Machine inp a Source #

ref :: Bool -> Name -> Machine inp a Source #

(Letable letName repr, Eq letName, Hashable letName) => Letable letName (CleanDefs letName repr) Source # 
Instance details

Defined in Symantic.Univariant.Letable

Methods

def :: letName -> CleanDefs letName repr a -> CleanDefs letName repr a Source #

ref :: Bool -> letName -> CleanDefs letName repr a Source #

(Letable letName repr, MakeLetName letName, Eq letName, Hashable letName) => Letable letName (ObserveSharing letName repr) Source # 
Instance details

Defined in Symantic.Univariant.Letable

Methods

def :: letName -> ObserveSharing letName repr a -> ObserveSharing letName repr a Source #

ref :: Bool -> letName -> ObserveSharing letName repr a Source #

Letable letName (Comb repr) => Letable letName (OptimizeComb letName repr) Source # 
Instance details

Defined in Symantic.Parser.Grammar.Optimize

Methods

def :: letName -> OptimizeComb letName repr a -> OptimizeComb letName repr a Source #

ref :: Bool -> letName -> OptimizeComb letName repr a Source #