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

Data.Effect.Class.TH.HFunctor.Internal

Description

 
Synopsis

Documentation

deriveHFunctor :: DataInfo flag -> Q [Dec] Source #

Derive an instance of HFunctor for a type constructor of any higher-order kind taking at least two arguments, from DataInfo.

data DataInfo flag Source #

A reified information of a datatype.

Constructors

DataInfo 

abstractNewtype :: Info -> Maybe (DataInfo ()) Source #

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

infoToDataD :: DataInfo () -> Dec Source #

Convert the reified information of the datatype to a definition.

normalCon :: Con -> (Name, [StrictType], Maybe Type) Source #

This function provides the name and the arity of the given data constructor, and if it is a GADT also its type.

getBinaryFArg :: Type -> Maybe Type -> Type Source #

Auxiliary function to extract the first argument of a binary type application (the second argument of this function). If the second argument is Nothing or not of the right shape, the first argument is returned as a default.

newNames :: Int -> String -> Q [Name] Source #

This function provides a list (of the given length) of new names based on the given string.

iter :: (Eq t, Num t, Quote m) => t -> m Exp -> m Exp -> m Exp Source #

tyVarName :: TyVarBndr a -> Name Source #

pures the name of a type variable.