module Language.Haskell.TH.Compat.Data.V210 (
dataD', unDataD,
newtypeD', unNewtypeD,
dataInstD', unDataInstD,
newtypeInstD', unNewtypeInstD,
unInstanceD,
) where
import Language.Haskell.TH
(CxtQ, ConQ, TypeQ, DecQ,
Cxt, Con, Type (ConT), Name, TyVarBndr, Kind,
Dec (DataD, NewtypeD, DataInstD, NewtypeInstD, InstanceD),
dataD, newtypeD, dataInstD, newtypeInstD)
dataD' :: CxtQ -> Name -> [TyVarBndr] -> [ConQ] -> [Name]
-> DecQ
dataD' = dataD
unDataD :: Dec -> Maybe (Cxt, Name, [TyVarBndr], Maybe Kind, [Con], [Type])
unDataD (DataD cxt n bs cs ds) = Just (cxt, n, bs, Nothing, cs, map ConT ds)
unDataD _ = Nothing
newtypeD' :: CxtQ -> Name -> [TyVarBndr] -> ConQ -> [Name]
-> DecQ
newtypeD' = newtypeD
unNewtypeD :: Dec -> Maybe (Cxt, Name, [TyVarBndr], Maybe Kind, Con, [Type])
unNewtypeD (NewtypeD cxt n bs c ds) = Just (cxt, n, bs, Nothing, c, map ConT ds)
unNewtypeD _ = Nothing
dataInstD' :: CxtQ -> Name -> [TypeQ] -> [ConQ] -> [Name]
-> DecQ
dataInstD' = dataInstD
unDataInstD :: Dec -> Maybe (Cxt, Name, [Type], Maybe Kind, [Con], [Type])
unDataInstD (DataInstD cxt n as cs ds) = Just (cxt, n, as, Nothing, cs, map ConT ds)
unDataInstD _ = Nothing
newtypeInstD' :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name]
-> DecQ
newtypeInstD' = newtypeInstD
unNewtypeInstD :: Dec -> Maybe (Cxt, Name, [Type], Maybe Kind, Con, [Type])
unNewtypeInstD (NewtypeInstD cxt n as c ds) = Just (cxt, n, as, Nothing, c, map ConT ds)
unNewtypeInstD _ = Nothing
unInstanceD :: Dec -> Maybe (Cxt, Type, [Dec])
unInstanceD (InstanceD cxt ty decs) = Just (cxt, ty, decs)
unInstanceD _ = Nothing