th-data-compat-0.1.3.1: Compatibility for data definition template of TH

Copyright | 2016-2017 Kei Hibino
License | BSD3
Maintainer | ex8k.hibino@gmail.com
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.Haskell.TH.Compat.Data

Contents

- Interfaces to construct data declarations
- Interfaces to destruct data declarations

Description

This module provides compatibility definitions of data-type declaration templates for before temaplate-haskell-2.11

Synopsis

- dataD' :: CxtQ -> Name -> [TyVarBndr BndrVis] -> [ConQ] -> [Name] -> DecQ
- newtypeD' :: CxtQ -> Name -> [TyVarBndr BndrVis] -> ConQ -> [Name] -> DecQ
- dataInstD' :: CxtQ -> Name -> [TypeQ] -> [ConQ] -> [Name] -> DecQ
- newtypeInstD' :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name] -> DecQ
- plainTVspecified :: Name -> TyVarBndr Specificity
- unDataD :: Dec -> Maybe (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, [Con], [Type])
- unNewtypeD :: Dec -> Maybe (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, Con, [Type])
- unDataInstD :: Dec -> Maybe (Cxt, Maybe [TyVarBndr ()], Type, Maybe Kind, [Con], [Type])
- unNewtypeInstD :: Dec -> Maybe (Cxt, Maybe [TyVarBndr ()], Type, Maybe Kind, Con, [Type])
- unInstanceD :: Dec -> Maybe (Cxt, Type, [Dec])
- unTyVarBndr :: TyVarBndr a -> (Name, Maybe a)

# Interfaces to construct data declarations

dataD' :: CxtQ -> Name -> [TyVarBndr BndrVis] -> [ConQ] -> [Name] -> DecQ Source #

Definition against `dataD`, compatible with before temaplate-haskell-2.11

newtypeD' :: CxtQ -> Name -> [TyVarBndr BndrVis] -> ConQ -> [Name] -> DecQ Source #

Definition against `newtypeD`, compatible with before temaplate-haskell-2.11

dataInstD' :: CxtQ -> Name -> [TypeQ] -> [ConQ] -> [Name] -> DecQ Source #

Definition against `dataInstD`, compatible with before temaplate-haskell-2.11

newtypeInstD' :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name] -> DecQ Source #

Definition against `newtypeInstD`, compatible with before temaplate-haskell-2.11

plainTVspecified :: Name -> TyVarBndr Specificity Source #

# Interfaces to destruct data declarations

unDataD :: Dec -> Maybe (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, [Con], [Type]) Source #

Compatible interface to destruct `DataD`

unNewtypeD :: Dec -> Maybe (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, Con, [Type]) Source #

Compatible interface to destruct `NewtypeD`

unDataInstD :: Dec -> Maybe (Cxt, Maybe [TyVarBndr ()], Type, Maybe Kind, [Con], [Type]) Source #

Compatible interface to destruct `DataInstD`

unNewtypeInstD :: Dec -> Maybe (Cxt, Maybe [TyVarBndr ()], Type, Maybe Kind, Con, [Type]) Source #

Compatible interface to destruct `NewtypeInstD`

unInstanceD :: Dec -> Maybe (Cxt, Type, [Dec]) Source #

Compatible interface to destruct `InstanceD` No Overlap type is defined before template-haskell-2.11.

unTyVarBndr :: TyVarBndr a -> (Name, Maybe a) Source #