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

Safe HaskellNone
LanguageHaskell2010

Language.Symantic.Typing.Read

Contents

Synopsis

Documentation

readType :: Inj_Source (KindK src) src => Inj_Source (TypeVT src) src => Inj_Source (AST_Type src) src => Name2Type src -> AST_Type src -> Either (Error_Type src) (TypeVT src) Source #

Read a Type from an AST_Type, given its Vars.

readTyVars :: forall vs src. Inj_Source (KindK src) src => Inj_Source (TypeVT src) src => Inj_Source (AST_Type src) src => Name2Type src -> Vars src vs -> AST_Type src -> Either (Error_Type src) (TypeT src vs) Source #

Read a Type from an AST_Type, given its Vars.

readTyName :: Source src => Name2Type src -> src -> Len vs -> NameTy -> Either (Error_Type src) (TypeT src vs) Source #

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

readVars :: Source src => EVars src -> AST_Type src -> EVars src Source #

Return the given EVars augmented by the ones used in given AST_Type.

Type Name2Type

type Name2Type src = Map NameTy (TypeTLen src) Source #

Type TypeTLen

newtype TypeTLen src Source #

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

Useful to build a Name2Type 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 (TypeTLen src) Source # 

Methods

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

show :: TypeTLen src -> String #

showList :: [TypeTLen src] -> ShowS #

Class Inj_Name2Type

class Inj_Name2Type cs where Source #

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

Minimal complete definition

inj_Name2Type

Methods

inj_Name2Type :: Source src => Name2Type src Source #

Instances

Inj_Name2Type [k] ([] k) Source # 

Methods

inj_Name2Type :: Source src => Name2Type src Source #

(Inj_KindP (Ty_of_Type (K k c)), (~) * (K k c) (Type_of_Ty (Ty_of_Type (K k c))), Constable k c, Inj_Name2Type [*] cs) => Inj_Name2Type [*] ((:) * (Proxy k c) cs) Source # 

Methods

inj_Name2Type :: Source src => Name2Type src Source #

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 #

Inj_Error (Con_Kind src) (Error_Type src) Source # 

Methods

inj_Error :: Con_Kind src -> Error_Type src #

Inj_Error (Error_Type src) (Error_Type src) Source # 

Methods

inj_Error :: Error_Type src -> Error_Type src #

Inj_Error (Error_Type src) (Error_Term src) # 

Methods

inj_Error :: Error_Type src -> Error_Term src #