th-bang-compat-0.0.1.0: Compatibility for bang-type template

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

Language.Haskell.TH.Compat.Bang

Contents

- Compat type constructors
- Compat functions

Description

This module provides compatibility definitions of bang-type template for before temaplate-haskell-2.10

Synopsis

- data Bang
- type BangQ = Q Bang
- type BangType = (Bang, Type)
- type BangTypeQ = Q BangType
- type VarBangType = (Name, Bang, Type)
- type VarBangTypeQ = Q VarBangType
- data SourceUnpackedness
  - = NoSourceUnpackedness
  - | SourceNoUnpack
  - | SourceUnpack
- type SourceUnpackednessQ = Q SourceUnpackedness
- data SourceStrictness
  - = NoSourceStrictness
  - | SourceLazy
  - | SourceStrict
- type SourceStrictnessQ = Q SourceStrictness
- bang :: Quote m => m SourceUnpackedness -> m SourceStrictness -> m Bang
- bangType :: Quote m => m Bang -> m Type -> m BangType
- varBangType :: Quote m => Name -> m BangType -> m VarBangType
- noSourceUnpackedness :: Quote m => m SourceUnpackedness
- sourceNoUnpack :: Quote m => m SourceUnpackedness
- sourceUnpack :: Quote m => m SourceUnpackedness
- noSourceStrictness :: Quote m => m SourceStrictness
- sourceLazy :: Quote m => m SourceStrictness
- sourceStrict :: Quote m => m SourceStrictness

# Compat type constructors

data Bang Source #

#### Instances

Instances details

Data Bang |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bang -> c Bang Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bang Source #

toConstr :: Bang -> Constr Source #

dataTypeOf :: Bang -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bang) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang) Source #

gmapT :: (forall b. Data b => b -> b) -> Bang -> Bang Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Bang -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Bang -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bang -> m Bang Source #

Generic Bang |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep Bang :: Type -> Type Source # Methods from :: Bang -> Rep Bang x Source # to :: Rep Bang x -> Bang Source #
Show Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> Bang -> ShowS Source # show :: Bang -> String Source # showList :: [Bang] -> ShowS Source #
Eq Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: Bang -> Bang -> Bool Source # (/=) :: Bang -> Bang -> Bool Source #
Ord Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Bang -> Bang -> Ordering Source # (<) :: Bang -> Bang -> Bool Source # (<=) :: Bang -> Bang -> Bool Source # (>) :: Bang -> Bang -> Bool Source # (>=) :: Bang -> Bang -> Bool Source # max :: Bang -> Bang -> Bang Source # min :: Bang -> Bang -> Bang Source #
type Rep Bang |

Instance details

Defined in Language.Haskell.TH.Syntax

type Rep Bang = D1 ('MetaData "Bang" "Language.Haskell.TH.Syntax" "template-haskell" 'False) (C1 ('MetaCons "Bang" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceUnpackedness) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceStrictness)))

type BangQ = Q Bang Source #

type BangType = (Bang, Type) Source #

type BangTypeQ = Q BangType Source #

type VarBangType = (Name, Bang, Type) Source #

type VarBangTypeQ = Q VarBangType Source #

data SourceUnpackedness Source #

`SourceUnpackedness` corresponds to unpack annotations found in the source code.

This may not agree with the annotations returned by `reifyConStrictness`. See `reifyConStrictness` for more information.

Constructors

NoSourceUnpackedness

    C a

SourceNoUnpack

    C { {-# NOUNPACK #-} } a

SourceUnpack

    C { {-# UNPACK #-} } a

#### Instances

Instances details

Data SourceUnpackedness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceUnpackedness -> c SourceUnpackedness Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceUnpackedness Source #

toConstr :: SourceUnpackedness -> Constr Source #

dataTypeOf :: SourceUnpackedness -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceUnpackedness) Source #

gmapT :: (forall b. Data b => b -> b) -> SourceUnpackedness -> SourceUnpackedness Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourceUnpackedness -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceUnpackedness -> m SourceUnpackedness Source #

Generic SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceUnpackedness :: Type -> Type Source # Methods from :: SourceUnpackedness -> Rep SourceUnpackedness x Source # to :: Rep SourceUnpackedness x -> SourceUnpackedness Source #
Show SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceUnpackedness -> ShowS Source # show :: SourceUnpackedness -> String Source # showList :: [SourceUnpackedness] -> ShowS Source #
Eq SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #
Ord SourceUnpackedness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source #

(<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

type Rep SourceUnpackedness |
Instance details Defined in Language.Haskell.TH.Syntax type Rep SourceUnpackedness = D1 ('MetaData "SourceUnpackedness" "Language.Haskell.TH.Syntax" "template-haskell" 'False) (C1 ('MetaCons "NoSourceUnpackedness" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SourceNoUnpack" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SourceUnpack" 'PrefixI 'False) (U1 :: Type -> Type)))

type SourceUnpackednessQ = Q SourceUnpackedness Source #

data SourceStrictness Source #

`SourceStrictness` corresponds to strictness annotations found in the source code.

This may not agree with the annotations returned by `reifyConStrictness`. See `reifyConStrictness` for more information.

Constructors

NoSourceStrictness

    C a

SourceLazy

    C {~}a

SourceStrict

    C {!}a

#### Instances

Instances details

Data SourceStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceStrictness Source #

toConstr :: SourceStrictness -> Constr Source #

dataTypeOf :: SourceStrictness -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceStrictness) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceStrictness) Source #

gmapT :: (forall b. Data b => b -> b) -> SourceStrictness -> SourceStrictness Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourceStrictness -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceStrictness -> m SourceStrictness Source #

Generic SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Associated Types type Rep SourceStrictness :: Type -> Type Source # Methods from :: SourceStrictness -> Rep SourceStrictness x Source # to :: Rep SourceStrictness x -> SourceStrictness Source #
Show SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Methods showsPrec :: Int -> SourceStrictness -> ShowS Source # show :: SourceStrictness -> String Source # showList :: [SourceStrictness] -> ShowS Source #
Eq SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceStrictness -> SourceStrictness -> Bool Source # (/=) :: SourceStrictness -> SourceStrictness -> Bool Source #
Ord SourceStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceStrictness -> SourceStrictness -> Ordering Source #

(<) :: SourceStrictness -> SourceStrictness -> Bool Source #

(<=) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>=) :: SourceStrictness -> SourceStrictness -> Bool Source #

max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

type Rep SourceStrictness |
Instance details Defined in Language.Haskell.TH.Syntax type Rep SourceStrictness = D1 ('MetaData "SourceStrictness" "Language.Haskell.TH.Syntax" "template-haskell" 'False) (C1 ('MetaCons "NoSourceStrictness" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SourceLazy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SourceStrict" 'PrefixI 'False) (U1 :: Type -> Type)))

type SourceStrictnessQ = Q SourceStrictness Source #

# Compat functions

bang :: Quote m => m SourceUnpackedness -> m SourceStrictness -> m Bang Source #

bangType :: Quote m => m Bang -> m Type -> m BangType Source #

varBangType :: Quote m => Name -> m BangType -> m VarBangType Source #

noSourceUnpackedness :: Quote m => m SourceUnpackedness Source #

sourceNoUnpack :: Quote m => m SourceUnpackedness Source #

sourceUnpack :: Quote m => m SourceUnpackedness Source #

noSourceStrictness :: Quote m => m SourceStrictness Source #

sourceLazy :: Quote m => m SourceStrictness Source #

sourceStrict :: Quote m => m SourceStrictness Source #