symantic-6.3.0.20170807: Library for Typed Tagless-Final Higher-Order Composable DSL

Safe HaskellNone
LanguageHaskell2010

Language.Symantic.Typing.Grammar

Contents

Synopsis

Type AST_Type

type AST_Type src = BinTree (Token_Type src) Source #

Abstract Syntax Tree of Token_Type.

Type Token_Type

data Token_Type src Source #

Instances

Source src => Eq (Token_Type src) Source # 

Methods

(==) :: Token_Type src -> Token_Type src -> Bool #

(/=) :: Token_Type src -> Token_Type src -> Bool #

(Source src, Show (TypeT src ([] Type))) => Show (Token_Type src) Source # 

Methods

showsPrec :: Int -> Token_Type src -> ShowS #

show :: Token_Type src -> String #

showList :: [Token_Type src] -> ShowS #

SourceInj (AST_Type (SrcTe inp ss)) (SrcTe inp ss) # 

Methods

sourceInj :: AST_Type (SrcTe inp ss) -> SrcTe inp ss #

Type ModulesTy

type ModulesTy src = Map (Mod NameTy) (TypeTLen src) Source #

Type TypeTLen

newtype TypeTLen src Source #

Like TypeT, but needing a (Len vs) to be built.

Useful to build a ModulesTy which can be used whatever will be the (Len vs) given to readTyVars.

Constructors

TypeTLen (forall vs. Len vs -> TypeT src vs) 

Instances

Source src => Eq (TypeTLen src) Source # 

Methods

(==) :: TypeTLen src -> TypeTLen src -> Bool #

(/=) :: TypeTLen src -> TypeTLen src -> Bool #

(Source src, Show (TypeT src ([] Type))) => Show (TypeTLen src) Source # 

Methods

showsPrec :: Int -> TypeTLen src -> ShowS #

show :: TypeTLen src -> String #

showList :: [TypeTLen src] -> ShowS #

typeTLen :: forall c src. Source src => Constable c => KindInjP (Ty_of_Type (K c)) => K c ~ Type_of_Ty (Ty_of_Type (K c)) => src -> TypeTLen src Source #

Class ModulesTyInj

class ModulesTyInj ts where Source #

Derive a ModulesTy from the given type-level list of Proxy-fied type constants.

Minimal complete definition

modulesTyInj

Methods

modulesTyInj :: Source src => ModulesTy src Source #

Instances

ModulesTyInj [k] ([] k) Source # 

Methods

modulesTyInj :: Source src => ModulesTy src Source #

(KindInjP (Ty_of_Type (K k c)), (~) * (K k c) (Type_of_Ty (Ty_of_Type (K k c))), Constable k c, ModulesTyInj [*] ts) => ModulesTyInj [*] ((:) * (Proxy k c) ts) Source # 

Methods

modulesTyInj :: Source src => ModulesTy src Source #

Class Gram_Mod

Class Gram_Type_Name

Class Gram_Type

class (Gram_Source src g, Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_CF g, Gram_Comment g, Gram_Op g, Gram_Type_Name g, Gram_Error (Error_Type src) g, Gram_State (Imports NameTy, ModulesTy src) g, Constable (->), Constable [], Constable (,)) => Gram_Type src g where Source #

Read an AST_Type from a textual source.

Instances

(Gram_Source src RuleEBNF, Constable (* -> * -> *) (->), Constable (* -> * -> *) (,), Constable (* -> *) []) => Gram_Type src RuleEBNF Source # 
(Gram_Source src EBNF, Constable (* -> * -> *) (->), Constable (* -> * -> *) (,), Constable (* -> *) []) => Gram_Type src EBNF Source # 
Gram_Type src g => Gram_Type src (CF g) Source # 

readTyName :: Source src => Imports NameTy -> ModulesTy src -> src -> Mod NameTy -> Either (Error_Type src) (TypeTLen src) Source #

Lookup a TyConst or Type synonym associated with given NameTy in given ModulesTy, building it for a vs of given Len.

Type Error_Type

data Error_Type src Source #

Instances

Eq src => Eq (Error_Type src) Source # 

Methods

(==) :: Error_Type src -> Error_Type src -> Bool #

(/=) :: Error_Type src -> Error_Type src -> Bool #

Show src => Show (Error_Type src) Source # 

Methods

showsPrec :: Int -> Error_Type src -> ShowS #

show :: Error_Type src -> String #

showList :: [Error_Type src] -> ShowS #

ErrorInj (Con_Kind src) (Error_Type src) Source # 

Methods

errorInj :: Con_Kind src -> Error_Type src #

ErrorInj (Error_Type src) (Error_Type src) Source # 

Methods

errorInj :: Error_Type src -> Error_Type src #

ErrorInj (Error_Type src) (Error_Term src) # 

Methods

errorInj :: Error_Type src -> Error_Term src #

gram_type :: Gram_Type () g => [CF g (AST_Type ())] Source #

List of the rules of Gram_Type.