classy-effects-th-0.1.0.0: Automatic compliance with the classy-effects protocols
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Effect.Class.Machinery.TH

Description

This module provides TemplateHaskell functions to generates automatically various data types and instances that constitute the effect system supplied by the classy-effects framework.

Synopsis

Documentation

makeEffect Source #

Arguments

:: String

A name of order-unified empty effect class generated newly

-> Name

The name of first-order effect class

-> Name

The name of higher-order effect class

-> Q [Dec] 

In addition to makeEffectF and makeEffectH, generate the order-unified empty effect class:

class (FoobarF ... f, FoobarH ... f) => Foobar ... f

, and generate the order-unified effect data type synonym:

type Foobar ... = FoobarS ... :+: LiftIns (FoobarI ...)

makeEffectF :: Name -> Q [Dec] Source #

Generate an instruction data type and type and pattern synonyms for abbreviating LiftIns.

makeEffectH :: Name -> Q [Dec] Source #

Generate a signature data type and a HFunctor instance.

makeEffectWith Source #

Arguments

:: String

A name of order-unified empty effect class generated newly

-> String

A name of type synonym of order-unified effect data type generated newly

-> Name

The name of first-order effect class

-> Name

The name of instruction data type corresponding to the first-order effect class

-> Name

The name of higher-order effect class

-> Name

The name of signature data type corresponding to the higher-order effect class

-> Q [Dec] 

In addition to makeEffectF and makeEffectH, generate the order-unified empty effect class:

class (FoobarF ... f, FoobarH ... f) => Foobar ... f

, and generate the order-unified effect data type synonym:

type Foobar ... = FoobarS ... :+: LiftIns (FoobarI ...)

makeEffectFWith :: String -> Name -> Q [Dec] Source #

Generate an instruction data type and type and pattern synonyms for abbreviating LiftIns.

makeEffectHWith :: String -> Name -> Q [Dec] Source #

Generate a signature data type and a HFunctor instance.

makeEmptyEffect :: Name -> Q [Dec] Source #

Derive an instance of the effect, with no methods, that handles via SendIns/ SendSig instances.

makeOrderUnifiedEffectClass :: Name -> Name -> String -> Q [Dec] Source #

Generate the order-unified empty effect class:

class (FoobarF ... f, FoobarH ... f) => Foobar ... f

, and derive an instance of the effect that handles via SendIns/ SendSig instances.