cleff-plugin-0.1.0.0: Automatic disambiguation for extensible effects
Copyright(c) 2022 Xy Ren
LicenseBSD3
Maintainerxy.r@outlook.com
Stabilityunstable
Portabilitynon-portable (GHC only)
Safe HaskellNone
LanguageHaskell2010

Cleff.Plugin.Internal

Description

 
Synopsis

Documentation

data Plugin #

Plugin is the compiler plugin data type. Try to avoid constructing one of these directly, and just modify some fields of defaultPlugin instead: this is to try and preserve source-code compatibility when we add fields to this.

Nonetheless, this API is preliminary and highly likely to change in the future.

type Names = [(String, String, String)] Source #

A list of unique, unambiguous Haskell names in the format of (packageName, moduleName, identifier).

makePlugin :: Names -> Plugin Source #

Make a polysemy-plugin-style effect disambiguation plugin that applies to all the "element-of" typeclasses passed in. Each of the names passed in should have type k -> [k] -> Type where k can be either polymorphic or monomorphic.

Some examples include:

("cleff", "Cleff.Internal.Rec", ":>")
("polysemy", "Polysemy.Internal.Union", "Member")
("effectful", "Effectful.Internal.Effect", ":>")

You can see the source code for notes on the implementation of the plugin.