th-reify-compat-0.0.1.5: Compatibility for the result type of TH reify

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

Language.Haskell.TH.Compat.Reify

Contents

- Interfaces to destruct reify result
- Interface to get operator fixity
- Interface of type alias name

Description

This module provides compatibility definitions of destructuring result type of reify for before temaplate-haskell-2.11

Synopsis

- unClassOpI :: Info -> Maybe (Name, Type, ParentName)
- unDataConI :: Info -> Maybe (Name, Type, ParentName)
- unVarI :: Info -> Maybe (Name, Type, Maybe Dec)
- reifyFixity :: Name -> Q (Maybe Fixity)
- type ParentName = Name

# Interfaces to destruct reify result

unClassOpI :: Info -> Maybe (Name, Type, ParentName) Source #

Compatible interface to destruct `ClassOpI`

unDataConI :: Info -> Maybe (Name, Type, ParentName) Source #

Compatible interface to destruct `DataConI`

unVarI :: Info -> Maybe (Name, Type, Maybe Dec) Source #

Compatible interface to destruct `VarI`

# Interface to get operator fixity

reifyFixity :: Name -> Q (Maybe Fixity) Source #

`reifyFixity nm` attempts to find a fixity declaration for `nm`. For example, if the function `foo` has the fixity declaration `infixr 7 foo`, then `reifyFixity 'foo` would return ``Just` (`Fixity` 7 `InfixR`)`. If the function `bar` does not have a fixity declaration, then `reifyFixity 'bar` returns `Nothing`, so you may assume `bar` has `defaultFixity`.

# Interface of type alias name

type ParentName = Name Source #

In `ClassOpI` and `DataConI`, name of the parent class or type