extensible-skeleton-0: Operational-based extensible effect library

Copyright(c) Fumiaki Kinoshita 2019
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Extensible.Effect.TH

Description

 
Synopsis

Documentation

decEffects :: DecsQ -> DecsQ Source #

Generate named effects from a GADT declaration.

decEffects [d|
 data Blah a b x where
   Blah :: Int -> a -> Blah a b b
 |]

generates

type Blah a b = "Blah" >: Action '[Int, a] b
blah :: forall xs a b
  . Associate "Blah" (Action '[Int, a] b) xs
  => Int -> a -> Eff xs b
blah a0 a1
  = liftEff
    (Data.Proxy.Proxy :: Data.Proxy.Proxy "Blah")
    (AArgument a0 (AArgument a1 AResult))

decEffectSet :: DecsQ -> DecsQ Source #

Instead of making a type synonym for individual actions, it defines a list of actions.

decEffectSuite :: DecsQ -> DecsQ Source #

Generates type synonyms for the set of actions and also individual actions.

customDecEffects Source #

Arguments

:: Bool

generate a synonym of the set of actions

-> Bool

generate synonyms for individual actions

-> DecsQ 
-> DecsQ 

Generate effect suite with custom settings.