data-effects-th-0.1.1.0: Template Haskell utilities for the data-effects library.
Copyright(c) 2023-2024 Yamada Ryo
(c) 2010-2011 Patrick Bahr Tom Hvitved
(c) 2020 Michael Szvetits
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Effect.TH.Internal

Description

 
Synopsis

Documentation

data EffClsInfo Source #

Constructors

EffClsInfo 

newtype MakeEffectConf Source #

Instances

Instances details
Default MakeEffectConf Source # 
Instance details

Defined in Data.Effect.TH.Internal

Methods

def :: MakeEffectConf #

data DataInfo Source #

A reified information of a datatype.

Constructors

DataInfo 

Generating Synonyms about LiftIns

genLiftInsPatternSynonyms :: EffClsInfo -> Q [Dec] Source #

Generate the pattern synonyms for instruction constructors:

pattern LBaz ... = LiftIns (Baz ...)

genLiftInsTypeSynonym :: EffClsInfo -> Dec Source #

Generate the type synonym for an instruction class datatype:

type (LFoobar ...) = LiftIns (Foobar ...)

Utility functions

tyVarName :: TyVarBndr a -> Name Source #

Pures the name of a type variable.

tyVarType :: TyVarBndr a -> Type Source #

Converts a type variable to a type.

unkindTypeRec :: Type -> Type Source #

Throws away all kind information from a type.

unkindTyVar :: TyVarBndr a -> TyVarBndr a Source #

Throws away the kind information of a type variable.

occurs :: Name -> Type -> Bool Source #

Checks if a name m appears somewhere in a type.

analyzeData :: Info -> Maybe DataInfo Source #

This function abstracts away newtype declaration, it turns them into data declarations.