data-effects-th-0.2.0.0: Template Haskell utilities for the data-effects library.
Copyright(c) 2023-2024 Sayo Koyoneda
(c) 2010-2011 Patrick Bahr Tom Hvitved
(c) 2020 Michael Szvetits
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
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 LiftFOE

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

Generate the pattern synonyms for operation constructors:

pattern LBaz ... = LiftFOE (Baz ...)

genLiftFOETypeSynonym :: EffClsInfo -> Dec Source #

Generate the type synonym for an first-order effect datatype:

type (LFoobar ...) = LiftFOE (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.