{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
module GHC.Hs.Type (
HsType(..), NewHsTypeX(..), LHsType, HsKind, LHsKind,
HsTyVarBndr(..), LHsTyVarBndr, ForallVisFlag(..),
LHsQTyVars(..),
HsImplicitBndrs(..),
HsWildCardBndrs(..),
HsPatSigType(..), HsPSRn(..),
LHsSigType, LHsSigWcType, LHsWcType,
HsTupleSort(..),
HsContext, LHsContext, noLHsContext,
HsTyLit(..),
HsIPName(..), hsIPNameFS,
HsArg(..), numVisibleArgs,
LHsTypeArg,
OutputableBndrFlag,
LBangType, BangType,
HsSrcBang(..), HsImplBang(..),
SrcStrictness(..), SrcUnpackedness(..),
getBangType, getBangStrictness,
ConDeclField(..), LConDeclField, pprConDeclFields,
HsConDetails(..),
FieldOcc(..), LFieldOcc, mkFieldOcc,
AmbiguousFieldOcc(..), mkAmbiguousFieldOcc,
rdrNameAmbiguousFieldOcc, selectorAmbiguousFieldOcc,
unambiguousFieldOcc, ambiguousFieldOcc,
mkAnonWildCardTy, pprAnonWildCard,
mkHsImplicitBndrs, mkHsWildCardBndrs, mkHsPatSigType, hsImplicitBody,
mkEmptyImplicitBndrs, mkEmptyWildCardBndrs,
mkHsQTvs, hsQTvExplicit, emptyLHsQTvs,
isHsKindedTyVar, hsTvbAllKinded, isLHsForAllTy,
hsScopedTvs, hsWcScopedTvs, dropWildCards,
hsTyVarName, hsAllLTyVarNames, hsLTyVarLocNames,
hsLTyVarName, hsLTyVarNames, hsLTyVarLocName, hsExplicitLTyVarNames,
splitLHsInstDeclTy, getLHsInstDeclHead, getLHsInstDeclClass_maybe,
splitLHsPatSynTy,
splitLHsForAllTyInvis, splitLHsQualTy, splitLHsSigmaTyInvis,
splitHsFunType, hsTyGetAppHead_maybe,
mkHsOpTy, mkHsAppTy, mkHsAppTys, mkHsAppKindTy,
ignoreParens, hsSigType, hsSigWcType, hsPatSigType,
hsTyKindSig,
hsConDetailsArgs,
setHsTyVarBndrFlag, hsTyVarBndrFlag,
pprHsType, pprHsForAll, pprHsForAllExtra, pprHsExplicitForAll,
pprLHsContext,
hsTypeNeedsParens, parenthesizeHsType, parenthesizeHsContext
) where
#include "HsVersions.h"
import GHC.Prelude
import {-# SOURCE #-} GHC.Hs.Expr ( HsSplice, pprSplice )
import GHC.Hs.Extension
import GHC.Types.Id ( Id )
import GHC.Types.Name( Name, NamedThing(getName) )
import GHC.Types.Name.Reader ( RdrName )
import GHC.Core.DataCon( HsSrcBang(..), HsImplBang(..),
SrcStrictness(..), SrcUnpackedness(..) )
import GHC.Builtin.Types( mkTupleStr )
import GHC.Core.Type
import GHC.Hs.Doc
import GHC.Types.Basic
import GHC.Types.SrcLoc
import GHC.Utils.Outputable
import GHC.Data.FastString
import GHC.Data.Maybe( isJust )
import GHC.Utils.Misc ( count )
import Data.Data hiding ( Fixity, Prefix, Infix )
type LBangType pass = Located (BangType pass)
type BangType pass = HsType pass
getBangType :: LHsType a -> LHsType a
getBangType :: LHsType a -> LHsType a
getBangType (L SrcSpan
_ (HsBangTy XBangTy a
_ HsSrcBang
_ LHsType a
lty)) = LHsType a
lty
getBangType (L SrcSpan
_ (HsDocTy XDocTy a
x (L SrcSpan
_ (HsBangTy XBangTy a
_ HsSrcBang
_ LHsType a
lty)) LHsDocString
lds)) =
LHsType a -> LHsDocString -> HsType a -> LHsType a
forall a b c. Located a -> Located b -> c -> Located c
addCLoc LHsType a
lty LHsDocString
lds (XDocTy a -> LHsType a -> LHsDocString -> HsType a
forall pass.
XDocTy pass -> LHsType pass -> LHsDocString -> HsType pass
HsDocTy XDocTy a
x LHsType a
lty LHsDocString
lds)
getBangType LHsType a
lty = LHsType a
lty
getBangStrictness :: LHsType a -> HsSrcBang
getBangStrictness :: LHsType a -> HsSrcBang
getBangStrictness (L SrcSpan
_ (HsBangTy XBangTy a
_ HsSrcBang
s LHsType a
_)) = HsSrcBang
s
getBangStrictness (L SrcSpan
_ (HsDocTy XDocTy a
_ (L SrcSpan
_ (HsBangTy XBangTy a
_ HsSrcBang
s LHsType a
_)) LHsDocString
_)) = HsSrcBang
s
getBangStrictness LHsType a
_ = (SourceText -> SrcUnpackedness -> SrcStrictness -> HsSrcBang
HsSrcBang SourceText
NoSourceText SrcUnpackedness
NoSrcUnpack SrcStrictness
NoSrcStrict)
type LHsContext pass = Located (HsContext pass)
noLHsContext :: LHsContext pass
noLHsContext :: LHsContext pass
noLHsContext = [LHsType pass] -> LHsContext pass
forall e. e -> Located e
noLoc []
type HsContext pass = [LHsType pass]
type LHsType pass = Located (HsType pass)
type HsKind pass = HsType pass
type LHsKind pass = Located (HsKind pass)
type LHsTyVarBndr flag pass = Located (HsTyVarBndr flag pass)
data LHsQTyVars pass
= HsQTvs { LHsQTyVars pass -> XHsQTvs pass
hsq_ext :: XHsQTvs pass
, LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit :: [LHsTyVarBndr () pass]
}
| XLHsQTyVars !(XXLHsQTyVars pass)
type HsQTvsRn = [Name]
type instance XHsQTvs GhcPs = NoExtField
type instance XHsQTvs GhcRn = HsQTvsRn
type instance XHsQTvs GhcTc = HsQTvsRn
type instance XXLHsQTyVars (GhcPass _) = NoExtCon
mkHsQTvs :: [LHsTyVarBndr () GhcPs] -> LHsQTyVars GhcPs
mkHsQTvs :: [LHsTyVarBndr () GhcPs] -> LHsQTyVars GhcPs
mkHsQTvs [LHsTyVarBndr () GhcPs]
tvs = HsQTvs :: forall pass.
XHsQTvs pass -> [LHsTyVarBndr () pass] -> LHsQTyVars pass
HsQTvs { hsq_ext :: XHsQTvs GhcPs
hsq_ext = XHsQTvs GhcPs
NoExtField
noExtField, hsq_explicit :: [LHsTyVarBndr () GhcPs]
hsq_explicit = [LHsTyVarBndr () GhcPs]
tvs }
hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit = LHsQTyVars pass -> [LHsTyVarBndr () pass]
forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit
emptyLHsQTvs :: LHsQTyVars GhcRn
emptyLHsQTvs :: LHsQTyVars GhcRn
emptyLHsQTvs = HsQTvs :: forall pass.
XHsQTvs pass -> [LHsTyVarBndr () pass] -> LHsQTyVars pass
HsQTvs { hsq_ext :: XHsQTvs GhcRn
hsq_ext = [], hsq_explicit :: [LHsTyVarBndr () GhcRn]
hsq_explicit = [] }
data HsImplicitBndrs pass thing
= HsIB { HsImplicitBndrs pass thing -> XHsIB pass thing
hsib_ext :: XHsIB pass thing
, HsImplicitBndrs pass thing -> thing
hsib_body :: thing
}
| XHsImplicitBndrs !(XXHsImplicitBndrs pass thing)
type instance XHsIB GhcPs _ = NoExtField
type instance XHsIB GhcRn _ = [Name]
type instance XHsIB GhcTc _ = [Name]
type instance XXHsImplicitBndrs (GhcPass _) _ = NoExtCon
data HsWildCardBndrs pass thing
= HsWC { HsWildCardBndrs pass thing -> XHsWC pass thing
hswc_ext :: XHsWC pass thing
, HsWildCardBndrs pass thing -> thing
hswc_body :: thing
}
| XHsWildCardBndrs !(XXHsWildCardBndrs pass thing)
type instance XHsWC GhcPs b = NoExtField
type instance XHsWC GhcRn b = [Name]
type instance XHsWC GhcTc b = [Name]
type instance XXHsWildCardBndrs (GhcPass _) b = NoExtCon
data HsPatSigType pass
= HsPS { HsPatSigType pass -> XHsPS pass
hsps_ext :: XHsPS pass
, HsPatSigType pass -> LHsType pass
hsps_body :: LHsType pass
}
| XHsPatSigType !(XXHsPatSigType pass)
data HsPSRn = HsPSRn
{ HsPSRn -> [Name]
hsps_nwcs :: [Name]
, HsPSRn -> [Name]
hsps_imp_tvs :: [Name]
}
deriving Typeable HsPSRn
DataType
Constr
Typeable HsPSRn
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsPSRn -> c HsPSRn)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsPSRn)
-> (HsPSRn -> Constr)
-> (HsPSRn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsPSRn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsPSRn))
-> ((forall b. Data b => b -> b) -> HsPSRn -> HsPSRn)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsPSRn -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsPSRn -> r)
-> (forall u. (forall d. Data d => d -> u) -> HsPSRn -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> HsPSRn -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn)
-> Data HsPSRn
HsPSRn -> DataType
HsPSRn -> Constr
(forall b. Data b => b -> b) -> HsPSRn -> HsPSRn
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsPSRn -> c HsPSRn
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsPSRn
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HsPSRn -> u
forall u. (forall d. Data d => d -> u) -> HsPSRn -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsPSRn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsPSRn -> c HsPSRn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsPSRn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsPSRn)
$cHsPSRn :: Constr
$tHsPSRn :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
gmapMp :: (forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
gmapM :: (forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsPSRn -> m HsPSRn
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsPSRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsPSRn -> u
gmapQ :: (forall d. Data d => d -> u) -> HsPSRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsPSRn -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsPSRn -> r
gmapT :: (forall b. Data b => b -> b) -> HsPSRn -> HsPSRn
$cgmapT :: (forall b. Data b => b -> b) -> HsPSRn -> HsPSRn
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsPSRn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsPSRn)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HsPSRn)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsPSRn)
dataTypeOf :: HsPSRn -> DataType
$cdataTypeOf :: HsPSRn -> DataType
toConstr :: HsPSRn -> Constr
$ctoConstr :: HsPSRn -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsPSRn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsPSRn
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsPSRn -> c HsPSRn
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsPSRn -> c HsPSRn
External instance of the constraint type Data Name
External instance of the constraint type Data Name
External instance of the constraint type forall a. Data a => Data [a]
External instance of the constraint type Data Name
External instance of the constraint type Data Name
External instance of the constraint type forall a. Data a => Data [a]
External instance of the constraint type forall a. Data a => Data [a]
External instance of the constraint type Data Name
Data
type instance XHsPS GhcPs = NoExtField
type instance XHsPS GhcRn = HsPSRn
type instance XHsPS GhcTc = HsPSRn
type instance XXHsPatSigType (GhcPass _) = NoExtCon
type LHsSigType pass = HsImplicitBndrs pass (LHsType pass)
type LHsWcType pass = HsWildCardBndrs pass (LHsType pass)
type LHsSigWcType pass = HsWildCardBndrs pass (LHsSigType pass)
hsImplicitBody :: HsImplicitBndrs (GhcPass p) thing -> thing
hsImplicitBody :: HsImplicitBndrs (GhcPass p) thing -> thing
hsImplicitBody (HsIB { hsib_body :: forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body = thing
body }) = thing
body
hsSigType :: LHsSigType (GhcPass p) -> LHsType (GhcPass p)
hsSigType :: LHsSigType (GhcPass p) -> LHsType (GhcPass p)
hsSigType = LHsSigType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass) thing.
HsImplicitBndrs (GhcPass p) thing -> thing
hsImplicitBody
hsSigWcType :: LHsSigWcType pass -> LHsType pass
hsSigWcType :: LHsSigWcType pass -> LHsType pass
hsSigWcType LHsSigWcType pass
sig_ty = HsImplicitBndrs pass (LHsType pass) -> LHsType pass
forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body (LHsSigWcType pass -> HsImplicitBndrs pass (LHsType pass)
forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body LHsSigWcType pass
sig_ty)
hsPatSigType :: HsPatSigType pass -> LHsType pass
hsPatSigType :: HsPatSigType pass -> LHsType pass
hsPatSigType = HsPatSigType pass -> LHsType pass
forall pass. HsPatSigType pass -> LHsType pass
hsps_body
dropWildCards :: LHsSigWcType pass -> LHsSigType pass
dropWildCards :: LHsSigWcType pass -> LHsSigType pass
dropWildCards LHsSigWcType pass
sig_ty = LHsSigWcType pass -> LHsSigType pass
forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body LHsSigWcType pass
sig_ty
mkHsImplicitBndrs :: thing -> HsImplicitBndrs GhcPs thing
mkHsImplicitBndrs :: thing -> HsImplicitBndrs GhcPs thing
mkHsImplicitBndrs thing
x = HsIB :: forall pass thing.
XHsIB pass thing -> thing -> HsImplicitBndrs pass thing
HsIB { hsib_ext :: XHsIB GhcPs thing
hsib_ext = XHsIB GhcPs thing
NoExtField
noExtField
, hsib_body :: thing
hsib_body = thing
x }
mkHsWildCardBndrs :: thing -> HsWildCardBndrs GhcPs thing
mkHsWildCardBndrs :: thing -> HsWildCardBndrs GhcPs thing
mkHsWildCardBndrs thing
x = HsWC :: forall pass thing.
XHsWC pass thing -> thing -> HsWildCardBndrs pass thing
HsWC { hswc_body :: thing
hswc_body = thing
x
, hswc_ext :: XHsWC GhcPs thing
hswc_ext = XHsWC GhcPs thing
NoExtField
noExtField }
mkHsPatSigType :: LHsType GhcPs -> HsPatSigType GhcPs
mkHsPatSigType :: LHsType GhcPs -> HsPatSigType GhcPs
mkHsPatSigType LHsType GhcPs
x = HsPS :: forall pass. XHsPS pass -> LHsType pass -> HsPatSigType pass
HsPS { hsps_ext :: XHsPS GhcPs
hsps_ext = XHsPS GhcPs
NoExtField
noExtField
, hsps_body :: LHsType GhcPs
hsps_body = LHsType GhcPs
x }
mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs GhcRn thing
mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs GhcRn thing
mkEmptyImplicitBndrs thing
x = HsIB :: forall pass thing.
XHsIB pass thing -> thing -> HsImplicitBndrs pass thing
HsIB { hsib_ext :: XHsIB GhcRn thing
hsib_ext = []
, hsib_body :: thing
hsib_body = thing
x }
mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs GhcRn thing
mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs GhcRn thing
mkEmptyWildCardBndrs thing
x = HsWC :: forall pass thing.
XHsWC pass thing -> thing -> HsWildCardBndrs pass thing
HsWC { hswc_body :: thing
hswc_body = thing
x
, hswc_ext :: XHsWC GhcRn thing
hswc_ext = [] }
newtype HsIPName = HsIPName FastString
deriving( HsIPName -> HsIPName -> Bool
(HsIPName -> HsIPName -> Bool)
-> (HsIPName -> HsIPName -> Bool) -> Eq HsIPName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HsIPName -> HsIPName -> Bool
$c/= :: HsIPName -> HsIPName -> Bool
== :: HsIPName -> HsIPName -> Bool
$c== :: HsIPName -> HsIPName -> Bool
External instance of the constraint type Eq FastString
Eq, Typeable HsIPName
DataType
Constr
Typeable HsIPName
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsIPName -> c HsIPName)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsIPName)
-> (HsIPName -> Constr)
-> (HsIPName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsIPName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsIPName))
-> ((forall b. Data b => b -> b) -> HsIPName -> HsIPName)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r)
-> (forall u. (forall d. Data d => d -> u) -> HsIPName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> HsIPName -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName)
-> Data HsIPName
HsIPName -> DataType
HsIPName -> Constr
(forall b. Data b => b -> b) -> HsIPName -> HsIPName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsIPName -> c HsIPName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsIPName
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HsIPName -> u
forall u. (forall d. Data d => d -> u) -> HsIPName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsIPName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsIPName -> c HsIPName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsIPName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsIPName)
$cHsIPName :: Constr
$tHsIPName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
gmapMp :: (forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
gmapM :: (forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsIPName -> m HsIPName
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsIPName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsIPName -> u
gmapQ :: (forall d. Data d => d -> u) -> HsIPName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsIPName -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsIPName -> r
gmapT :: (forall b. Data b => b -> b) -> HsIPName -> HsIPName
$cgmapT :: (forall b. Data b => b -> b) -> HsIPName -> HsIPName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsIPName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsIPName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HsIPName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsIPName)
dataTypeOf :: HsIPName -> DataType
$cdataTypeOf :: HsIPName -> DataType
toConstr :: HsIPName -> Constr
$ctoConstr :: HsIPName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsIPName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsIPName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsIPName -> c HsIPName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsIPName -> c HsIPName
External instance of the constraint type Data FastString
Data )
hsIPNameFS :: HsIPName -> FastString
hsIPNameFS :: HsIPName -> FastString
hsIPNameFS (HsIPName FastString
n) = FastString
n
instance Outputable HsIPName where
ppr :: HsIPName -> SDoc
ppr (HsIPName FastString
n) = Char -> SDoc
char Char
'?' SDoc -> SDoc -> SDoc
<> FastString -> SDoc
ftext FastString
n
instance OutputableBndr HsIPName where
pprBndr :: BindingSite -> HsIPName -> SDoc
pprBndr BindingSite
_ HsIPName
n = HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
Instance of class: Outputable of the constraint type Outputable HsIPName
ppr HsIPName
n
pprInfixOcc :: HsIPName -> SDoc
pprInfixOcc HsIPName
n = HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
Instance of class: Outputable of the constraint type Outputable HsIPName
ppr HsIPName
n
pprPrefixOcc :: HsIPName -> SDoc
pprPrefixOcc HsIPName
n = HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
Instance of class: Outputable of the constraint type Outputable HsIPName
ppr HsIPName
n
data HsTyVarBndr flag pass
= UserTyVar
(XUserTyVar pass)
flag
(Located (IdP pass))
| KindedTyVar
(XKindedTyVar pass)
flag
(Located (IdP pass))
(LHsKind pass)
| XTyVarBndr
!(XXTyVarBndr pass)
type instance XUserTyVar (GhcPass _) = NoExtField
type instance XKindedTyVar (GhcPass _) = NoExtField
type instance XXTyVarBndr (GhcPass _) = NoExtCon
hsTyVarBndrFlag :: HsTyVarBndr flag (GhcPass pass) -> flag
hsTyVarBndrFlag :: HsTyVarBndr flag (GhcPass pass) -> flag
hsTyVarBndrFlag (UserTyVar XUserTyVar (GhcPass pass)
_ flag
fl Located (IdP (GhcPass pass))
_) = flag
fl
hsTyVarBndrFlag (KindedTyVar XKindedTyVar (GhcPass pass)
_ flag
fl Located (IdP (GhcPass pass))
_ LHsKind (GhcPass pass)
_) = flag
fl
setHsTyVarBndrFlag :: flag -> HsTyVarBndr flag' (GhcPass pass)
-> HsTyVarBndr flag (GhcPass pass)
setHsTyVarBndrFlag :: flag
-> HsTyVarBndr flag' (GhcPass pass)
-> HsTyVarBndr flag (GhcPass pass)
setHsTyVarBndrFlag flag
f (UserTyVar XUserTyVar (GhcPass pass)
x flag'
_ Located (IdP (GhcPass pass))
l) = XUserTyVar (GhcPass pass)
-> flag
-> Located (IdP (GhcPass pass))
-> HsTyVarBndr flag (GhcPass pass)
forall flag pass.
XUserTyVar pass
-> flag -> Located (IdP pass) -> HsTyVarBndr flag pass
UserTyVar XUserTyVar (GhcPass pass)
x flag
f Located (IdP (GhcPass pass))
l
setHsTyVarBndrFlag flag
f (KindedTyVar XKindedTyVar (GhcPass pass)
x flag'
_ Located (IdP (GhcPass pass))
l LHsKind (GhcPass pass)
k) = XKindedTyVar (GhcPass pass)
-> flag
-> Located (IdP (GhcPass pass))
-> LHsKind (GhcPass pass)
-> HsTyVarBndr flag (GhcPass pass)
forall flag pass.
XKindedTyVar pass
-> flag
-> Located (IdP pass)
-> LHsKind pass
-> HsTyVarBndr flag pass
KindedTyVar XKindedTyVar (GhcPass pass)
x flag
f Located (IdP (GhcPass pass))
l LHsKind (GhcPass pass)
k
isHsKindedTyVar :: HsTyVarBndr flag pass -> Bool
isHsKindedTyVar :: HsTyVarBndr flag pass -> Bool
isHsKindedTyVar (UserTyVar {}) = Bool
False
isHsKindedTyVar (KindedTyVar {}) = Bool
True
isHsKindedTyVar (XTyVarBndr {}) = Bool
False
hsTvbAllKinded :: LHsQTyVars pass -> Bool
hsTvbAllKinded :: LHsQTyVars pass -> Bool
hsTvbAllKinded = (GenLocated SrcSpan (HsTyVarBndr () pass) -> Bool)
-> [GenLocated SrcSpan (HsTyVarBndr () pass)] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
External instance of the constraint type Foldable []
all (HsTyVarBndr () pass -> Bool
forall flag pass. HsTyVarBndr flag pass -> Bool
isHsKindedTyVar (HsTyVarBndr () pass -> Bool)
-> (GenLocated SrcSpan (HsTyVarBndr () pass)
-> HsTyVarBndr () pass)
-> GenLocated SrcSpan (HsTyVarBndr () pass)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLocated SrcSpan (HsTyVarBndr () pass) -> HsTyVarBndr () pass
forall l e. GenLocated l e -> e
unLoc) ([GenLocated SrcSpan (HsTyVarBndr () pass)] -> Bool)
-> (LHsQTyVars pass -> [GenLocated SrcSpan (HsTyVarBndr () pass)])
-> LHsQTyVars pass
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LHsQTyVars pass -> [GenLocated SrcSpan (HsTyVarBndr () pass)]
forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit
instance NamedThing (HsTyVarBndr flag GhcRn) where
getName :: HsTyVarBndr flag GhcRn -> Name
getName (UserTyVar XUserTyVar GhcRn
_ flag
_ Located (IdP GhcRn)
v) = GenLocated SrcSpan Name -> Name
forall l e. GenLocated l e -> e
unLoc GenLocated SrcSpan Name
Located (IdP GhcRn)
v
getName (KindedTyVar XKindedTyVar GhcRn
_ flag
_ Located (IdP GhcRn)
v LHsKind GhcRn
_) = GenLocated SrcSpan Name -> Name
forall l e. GenLocated l e -> e
unLoc GenLocated SrcSpan Name
Located (IdP GhcRn)
v
data HsType pass
= HsForAllTy
{ HsType pass -> XForAllTy pass
hst_xforall :: XForAllTy pass
, HsType pass -> ForallVisFlag
hst_fvf :: ForallVisFlag
, HsType pass -> [LHsTyVarBndr Specificity pass]
hst_bndrs :: [LHsTyVarBndr Specificity pass]
, HsType pass -> LHsType pass
hst_body :: LHsType pass
}
| HsQualTy
{ HsType pass -> XQualTy pass
hst_xqual :: XQualTy pass
, HsType pass -> LHsContext pass
hst_ctxt :: LHsContext pass
, hst_body :: LHsType pass }
| HsTyVar (XTyVar pass)
PromotionFlag
(Located (IdP pass))
| HsAppTy (XAppTy pass)
(LHsType pass)
(LHsType pass)
| HsAppKindTy (XAppKindTy pass)
(LHsType pass)
(LHsKind pass)
| HsFunTy (XFunTy pass)
(LHsType pass)
(LHsType pass)
| HsListTy (XListTy pass)
(LHsType pass)
| HsTupleTy (XTupleTy pass)
HsTupleSort
[LHsType pass]
| HsSumTy (XSumTy pass)
[LHsType pass]
| HsOpTy (XOpTy pass)
(LHsType pass) (Located (IdP pass)) (LHsType pass)
| HsParTy (XParTy pass)
(LHsType pass)
| HsIParamTy (XIParamTy pass)
(Located HsIPName)
(LHsType pass)
| HsStarTy (XStarTy pass)
Bool
| HsKindSig (XKindSig pass)
(LHsType pass)
(LHsKind pass)
| HsSpliceTy (XSpliceTy pass)
(HsSplice pass)
| HsDocTy (XDocTy pass)
(LHsType pass) LHsDocString
| HsBangTy (XBangTy pass)
HsSrcBang (LHsType pass)
| HsRecTy (XRecTy pass)
[LConDeclField pass]
| HsExplicitListTy
(XExplicitListTy pass)
PromotionFlag
[LHsType pass]
| HsExplicitTupleTy
(XExplicitTupleTy pass)
[LHsType pass]
| HsTyLit (XTyLit pass) HsTyLit
| HsWildCardTy (XWildCardTy pass)
| XHsType
(XXType pass)
data NewHsTypeX
= NHsCoreTy Type
deriving Data
instance Outputable NewHsTypeX where
ppr :: NewHsTypeX -> SDoc
ppr (NHsCoreTy Type
ty) = Type -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type Outputable Type
ppr Type
ty
type instance XForAllTy (GhcPass _) = NoExtField
type instance XQualTy (GhcPass _) = NoExtField
type instance XTyVar (GhcPass _) = NoExtField
type instance XAppTy (GhcPass _) = NoExtField
type instance XFunTy (GhcPass _) = NoExtField
type instance XListTy (GhcPass _) = NoExtField
type instance XTupleTy (GhcPass _) = NoExtField
type instance XSumTy (GhcPass _) = NoExtField
type instance XOpTy (GhcPass _) = NoExtField
type instance XParTy (GhcPass _) = NoExtField
type instance XIParamTy (GhcPass _) = NoExtField
type instance XStarTy (GhcPass _) = NoExtField
type instance XKindSig (GhcPass _) = NoExtField
type instance XAppKindTy (GhcPass _) = SrcSpan
type instance XSpliceTy GhcPs = NoExtField
type instance XSpliceTy GhcRn = NoExtField
type instance XSpliceTy GhcTc = Kind
type instance XDocTy (GhcPass _) = NoExtField
type instance XBangTy (GhcPass _) = NoExtField
type instance XRecTy (GhcPass _) = NoExtField
type instance XExplicitListTy GhcPs = NoExtField
type instance XExplicitListTy GhcRn = NoExtField
type instance XExplicitListTy GhcTc = Kind
type instance XExplicitTupleTy GhcPs = NoExtField
type instance XExplicitTupleTy GhcRn = NoExtField
type instance XExplicitTupleTy GhcTc = [Kind]
type instance XTyLit (GhcPass _) = NoExtField
type instance XWildCardTy (GhcPass _) = NoExtField
type instance XXType (GhcPass _) = NewHsTypeX
data HsTyLit
= HsNumTy SourceText Integer
| HsStrTy SourceText FastString
deriving Typeable HsTyLit
DataType
Constr
Typeable HsTyLit
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTyLit -> c HsTyLit)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTyLit)
-> (HsTyLit -> Constr)
-> (HsTyLit -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTyLit))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsTyLit))
-> ((forall b. Data b => b -> b) -> HsTyLit -> HsTyLit)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r)
-> (forall u. (forall d. Data d => d -> u) -> HsTyLit -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> HsTyLit -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit)
-> Data HsTyLit
HsTyLit -> DataType
HsTyLit -> Constr
(forall b. Data b => b -> b) -> HsTyLit -> HsTyLit
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTyLit -> c HsTyLit
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTyLit
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HsTyLit -> u
forall u. (forall d. Data d => d -> u) -> HsTyLit -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTyLit
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTyLit -> c HsTyLit
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTyLit)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsTyLit)
$cHsStrTy :: Constr
$cHsNumTy :: Constr
$tHsTyLit :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
gmapMp :: (forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
gmapM :: (forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTyLit -> m HsTyLit
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsTyLit -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsTyLit -> u
gmapQ :: (forall d. Data d => d -> u) -> HsTyLit -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsTyLit -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTyLit -> r
gmapT :: (forall b. Data b => b -> b) -> HsTyLit -> HsTyLit
$cgmapT :: (forall b. Data b => b -> b) -> HsTyLit -> HsTyLit
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsTyLit)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsTyLit)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HsTyLit)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTyLit)
dataTypeOf :: HsTyLit -> DataType
$cdataTypeOf :: HsTyLit -> DataType
toConstr :: HsTyLit -> Constr
$ctoConstr :: HsTyLit -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTyLit
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTyLit
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTyLit -> c HsTyLit
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTyLit -> c HsTyLit
External instance of the constraint type Data SourceText
External instance of the constraint type Data SourceText
External instance of the constraint type Data SourceText
External instance of the constraint type Data Integer
External instance of the constraint type Data FastString
Data
data HsTupleSort = HsUnboxedTuple
| HsBoxedTuple
| HsConstraintTuple
| HsBoxedOrConstraintTuple
deriving Typeable HsTupleSort
DataType
Constr
Typeable HsTupleSort
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTupleSort -> c HsTupleSort)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTupleSort)
-> (HsTupleSort -> Constr)
-> (HsTupleSort -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTupleSort))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsTupleSort))
-> ((forall b. Data b => b -> b) -> HsTupleSort -> HsTupleSort)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r)
-> (forall u. (forall d. Data d => d -> u) -> HsTupleSort -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort)
-> Data HsTupleSort
HsTupleSort -> DataType
HsTupleSort -> Constr
(forall b. Data b => b -> b) -> HsTupleSort -> HsTupleSort
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTupleSort -> c HsTupleSort
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTupleSort
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u
forall u. (forall d. Data d => d -> u) -> HsTupleSort -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTupleSort
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTupleSort -> c HsTupleSort
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTupleSort)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsTupleSort)
$cHsBoxedOrConstraintTuple :: Constr
$cHsConstraintTuple :: Constr
$cHsBoxedTuple :: Constr
$cHsUnboxedTuple :: Constr
$tHsTupleSort :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
gmapMp :: (forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
gmapM :: (forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HsTupleSort -> m HsTupleSort
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u
gmapQ :: (forall d. Data d => d -> u) -> HsTupleSort -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsTupleSort -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsTupleSort -> r
gmapT :: (forall b. Data b => b -> b) -> HsTupleSort -> HsTupleSort
$cgmapT :: (forall b. Data b => b -> b) -> HsTupleSort -> HsTupleSort
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsTupleSort)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HsTupleSort)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HsTupleSort)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HsTupleSort)
dataTypeOf :: HsTupleSort -> DataType
$cdataTypeOf :: HsTupleSort -> DataType
toConstr :: HsTupleSort -> Constr
$ctoConstr :: HsTupleSort -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTupleSort
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HsTupleSort
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTupleSort -> c HsTupleSort
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HsTupleSort -> c HsTupleSort
Data
type LConDeclField pass = Located (ConDeclField pass)
data ConDeclField pass
= ConDeclField { ConDeclField pass -> XConDeclField pass
cd_fld_ext :: XConDeclField pass,
ConDeclField pass -> [LFieldOcc pass]
cd_fld_names :: [LFieldOcc pass],
ConDeclField pass -> LBangType pass
cd_fld_type :: LBangType pass,
ConDeclField pass -> Maybe LHsDocString
cd_fld_doc :: Maybe LHsDocString }
| XConDeclField !(XXConDeclField pass)
type instance XConDeclField (GhcPass _) = NoExtField
type instance XXConDeclField (GhcPass _) = NoExtCon
instance OutputableBndrId p
=> Outputable (ConDeclField (GhcPass p)) where
ppr :: ConDeclField (GhcPass p) -> SDoc
ppr (ConDeclField XConDeclField (GhcPass p)
_ [LFieldOcc (GhcPass p)]
fld_n LBangType (GhcPass p)
fld_ty Maybe LHsDocString
_) = [LFieldOcc (GhcPass p)] -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall a. Outputable a => Outputable [a]
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall pass. Outputable (FieldOcc pass)
ppr [LFieldOcc (GhcPass p)]
fld_n SDoc -> SDoc -> SDoc
<+> SDoc
dcolon SDoc -> SDoc -> SDoc
<+> LBangType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LBangType (GhcPass p)
fld_ty
data HsConDetails arg rec
= PrefixCon [arg]
| RecCon rec
| InfixCon arg arg
deriving Typeable (HsConDetails arg rec)
DataType
Constr
Typeable (HsConDetails arg rec)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec))
-> (HsConDetails arg rec -> Constr)
-> (HsConDetails arg rec -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (HsConDetails arg rec)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec)))
-> ((forall b. Data b => b -> b)
-> HsConDetails arg rec -> HsConDetails arg rec)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r)
-> (forall u.
(forall d. Data d => d -> u) -> HsConDetails arg rec -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> HsConDetails arg rec -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec))
-> Data (HsConDetails arg rec)
HsConDetails arg rec -> DataType
HsConDetails arg rec -> Constr
(forall b. Data b => b -> b)
-> HsConDetails arg rec -> HsConDetails arg rec
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec)
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> HsConDetails arg rec -> u
forall u.
(forall d. Data d => d -> u) -> HsConDetails arg rec -> [u]
forall {arg} {rec}.
(Data arg, Data rec) =>
Typeable (HsConDetails arg rec)
forall arg rec.
(Data arg, Data rec) =>
HsConDetails arg rec -> DataType
forall arg rec.
(Data arg, Data rec) =>
HsConDetails arg rec -> Constr
forall arg rec.
(Data arg, Data rec) =>
(forall b. Data b => b -> b)
-> HsConDetails arg rec -> HsConDetails arg rec
forall arg rec u.
(Data arg, Data rec) =>
Int -> (forall d. Data d => d -> u) -> HsConDetails arg rec -> u
forall arg rec u.
(Data arg, Data rec) =>
(forall d. Data d => d -> u) -> HsConDetails arg rec -> [u]
forall arg rec r r'.
(Data arg, Data rec) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
forall arg rec r r'.
(Data arg, Data rec) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
forall arg rec (m :: * -> *).
(Data arg, Data rec, Monad m) =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
forall arg rec (m :: * -> *).
(Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
forall arg rec (c :: * -> *).
(Data arg, Data rec) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec)
forall arg rec (c :: * -> *).
(Data arg, Data rec) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec)
forall arg rec (t :: * -> *) (c :: * -> *).
(Data arg, Data rec, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (HsConDetails arg rec))
forall arg rec (t :: * -> * -> *) (c :: * -> *).
(Data arg, Data rec, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (HsConDetails arg rec))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec))
$cInfixCon :: Constr
$cRecCon :: Constr
$cPrefixCon :: Constr
$tHsConDetails :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
$cgmapMo :: forall arg rec (m :: * -> *).
(Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
gmapMp :: (forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
$cgmapMp :: forall arg rec (m :: * -> *).
(Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
gmapM :: (forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
$cgmapM :: forall arg rec (m :: * -> *).
(Data arg, Data rec, Monad m) =>
(forall d. Data d => d -> m d)
-> HsConDetails arg rec -> m (HsConDetails arg rec)
gmapQi :: Int -> (forall d. Data d => d -> u) -> HsConDetails arg rec -> u
$cgmapQi :: forall arg rec u.
(Data arg, Data rec) =>
Int -> (forall d. Data d => d -> u) -> HsConDetails arg rec -> u
gmapQ :: (forall d. Data d => d -> u) -> HsConDetails arg rec -> [u]
$cgmapQ :: forall arg rec u.
(Data arg, Data rec) =>
(forall d. Data d => d -> u) -> HsConDetails arg rec -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
$cgmapQr :: forall arg rec r r'.
(Data arg, Data rec) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
$cgmapQl :: forall arg rec r r'.
(Data arg, Data rec) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HsConDetails arg rec -> r
gmapT :: (forall b. Data b => b -> b)
-> HsConDetails arg rec -> HsConDetails arg rec
$cgmapT :: forall arg rec.
(Data arg, Data rec) =>
(forall b. Data b => b -> b)
-> HsConDetails arg rec -> HsConDetails arg rec
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec))
$cdataCast2 :: forall arg rec (t :: * -> * -> *) (c :: * -> *).
(Data arg, Data rec, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails arg rec))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (HsConDetails arg rec))
$cdataCast1 :: forall arg rec (t :: * -> *) (c :: * -> *).
(Data arg, Data rec, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (HsConDetails arg rec))
dataTypeOf :: HsConDetails arg rec -> DataType
$cdataTypeOf :: forall arg rec.
(Data arg, Data rec) =>
HsConDetails arg rec -> DataType
toConstr :: HsConDetails arg rec -> Constr
$ctoConstr :: forall arg rec.
(Data arg, Data rec) =>
HsConDetails arg rec -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec)
$cgunfold :: forall arg rec (c :: * -> *).
(Data arg, Data rec) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails arg rec)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec)
$cgfoldl :: forall arg rec (c :: * -> *).
(Data arg, Data rec) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails arg rec
-> c (HsConDetails arg rec)
Evidence bound by a type signature of the constraint type Typeable t
External instance of the constraint type forall a. Data a => Typeable a
Evidence bound by a type signature of the constraint type Data arg
External instance of the constraint type forall a. Data a => Typeable a
Evidence bound by a type signature of the constraint type Data arg
External instance of the constraint type forall a. Data a => Typeable a
Evidence bound by a type signature of the constraint type Data rec
External instance of the constraint type forall a. Data a => Data [a]
External instance of the constraint type forall a. Data a => Typeable a
Evidence bound by a type signature of the constraint type Data rec
External instance of the constraint type forall a. Data a => Typeable a
External instance of the constraint type forall a. Data a => Typeable a
Evidence bound by a type signature of the constraint type Data arg
Evidence bound by a type signature of the constraint type Data rec
Evidence bound by a type signature of the constraint type Data arg
Data
instance (Outputable arg, Outputable rec)
=> Outputable (HsConDetails arg rec) where
ppr :: HsConDetails arg rec -> SDoc
ppr (PrefixCon [arg]
args) = String -> SDoc
text String
"PrefixCon" SDoc -> SDoc -> SDoc
<+> [arg] -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall a. Outputable a => Outputable [a]
Evidence bound by a type signature of the constraint type Outputable arg
ppr [arg]
args
ppr (RecCon rec
rec) = String -> SDoc
text String
"RecCon:" SDoc -> SDoc -> SDoc
<+> rec -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable rec
ppr rec
rec
ppr (InfixCon arg
l arg
r) = String -> SDoc
text String
"InfixCon:" SDoc -> SDoc -> SDoc
<+> [arg] -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall a. Outputable a => Outputable [a]
Evidence bound by a type signature of the constraint type Outputable arg
ppr [arg
l, arg
r]
hsConDetailsArgs ::
HsConDetails (LHsType a) (Located [LConDeclField a])
-> [LHsType a]
hsConDetailsArgs :: HsConDetails (LHsType a) (Located [LConDeclField a]) -> [LHsType a]
hsConDetailsArgs HsConDetails (LHsType a) (Located [LConDeclField a])
details = case HsConDetails (LHsType a) (Located [LConDeclField a])
details of
InfixCon LHsType a
a LHsType a
b -> [LHsType a
a,LHsType a
b]
PrefixCon [LHsType a]
xs -> [LHsType a]
xs
RecCon Located [LConDeclField a]
r -> (LConDeclField a -> LHsType a) -> [LConDeclField a] -> [LHsType a]
forall a b. (a -> b) -> [a] -> [b]
map (ConDeclField a -> LHsType a
forall pass. ConDeclField pass -> LBangType pass
cd_fld_type (ConDeclField a -> LHsType a)
-> (LConDeclField a -> ConDeclField a)
-> LConDeclField a
-> LHsType a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LConDeclField a -> ConDeclField a
forall l e. GenLocated l e -> e
unLoc) (Located [LConDeclField a] -> [LConDeclField a]
forall l e. GenLocated l e -> e
unLoc Located [LConDeclField a]
r)
hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
hsWcScopedTvs LHsSigWcType GhcRn
sig_ty
| HsWC { hswc_ext :: forall pass thing. HsWildCardBndrs pass thing -> XHsWC pass thing
hswc_ext = XHsWC GhcRn (LHsSigType GhcRn)
nwcs, hswc_body :: forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body = LHsSigType GhcRn
sig_ty1 } <- LHsSigWcType GhcRn
sig_ty
, HsIB { hsib_ext :: forall pass thing. HsImplicitBndrs pass thing -> XHsIB pass thing
hsib_ext = XHsIB GhcRn (LHsKind GhcRn)
vars
, hsib_body :: forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body = LHsKind GhcRn
sig_ty2 } <- LHsSigType GhcRn
sig_ty1
= case LHsKind GhcRn
sig_ty2 of
L SrcSpan
_ (HsForAllTy { hst_fvf :: forall pass. HsType pass -> ForallVisFlag
hst_fvf = ForallVisFlag
ForallInvis
, hst_bndrs :: forall pass. HsType pass -> [LHsTyVarBndr Specificity pass]
hst_bndrs = [LHsTyVarBndr Specificity GhcRn]
tvs }) ->
[Name]
XHsIB GhcRn (LHsKind GhcRn)
vars [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [Name]
XHsWC GhcRn (LHsSigType GhcRn)
nwcs [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [LHsTyVarBndr Specificity GhcRn] -> [IdP GhcRn]
forall flag (p :: Pass).
[LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames [LHsTyVarBndr Specificity GhcRn]
tvs
LHsKind GhcRn
_ -> [Name]
XHsWC GhcRn (LHsSigType GhcRn)
nwcs
hsScopedTvs :: LHsSigType GhcRn -> [Name]
hsScopedTvs :: LHsSigType GhcRn -> [Name]
hsScopedTvs LHsSigType GhcRn
sig_ty
| HsIB { hsib_ext :: forall pass thing. HsImplicitBndrs pass thing -> XHsIB pass thing
hsib_ext = XHsIB GhcRn (LHsKind GhcRn)
vars
, hsib_body :: forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body = LHsKind GhcRn
sig_ty2 } <- LHsSigType GhcRn
sig_ty
, L SrcSpan
_ (HsForAllTy { hst_fvf :: forall pass. HsType pass -> ForallVisFlag
hst_fvf = ForallVisFlag
ForallInvis
, hst_bndrs :: forall pass. HsType pass -> [LHsTyVarBndr Specificity pass]
hst_bndrs = [LHsTyVarBndr Specificity GhcRn]
tvs }) <- LHsKind GhcRn
sig_ty2
= [Name]
XHsIB GhcRn (LHsKind GhcRn)
vars [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [LHsTyVarBndr Specificity GhcRn] -> [IdP GhcRn]
forall flag (p :: Pass).
[LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames [LHsTyVarBndr Specificity GhcRn]
tvs
| Bool
otherwise
= []
hsTyVarName :: HsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsTyVarName :: HsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsTyVarName (UserTyVar XUserTyVar (GhcPass p)
_ flag
_ (L SrcSpan
_ IdP (GhcPass p)
n)) = IdP (GhcPass p)
n
hsTyVarName (KindedTyVar XKindedTyVar (GhcPass p)
_ flag
_ (L SrcSpan
_ IdP (GhcPass p)
n) LHsKind (GhcPass p)
_) = IdP (GhcPass p)
n
hsLTyVarName :: LHsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsLTyVarName :: LHsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsLTyVarName = HsTyVarBndr flag (GhcPass p) -> IdGhcP p
forall flag (p :: Pass).
HsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsTyVarName (HsTyVarBndr flag (GhcPass p) -> IdGhcP p)
-> (LHsTyVarBndr flag (GhcPass p) -> HsTyVarBndr flag (GhcPass p))
-> LHsTyVarBndr flag (GhcPass p)
-> IdGhcP p
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LHsTyVarBndr flag (GhcPass p) -> HsTyVarBndr flag (GhcPass p)
forall l e. GenLocated l e -> e
unLoc
hsLTyVarNames :: [LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames :: [LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames = (LHsTyVarBndr flag (GhcPass p) -> IdGhcP p)
-> [LHsTyVarBndr flag (GhcPass p)] -> [IdGhcP p]
forall a b. (a -> b) -> [a] -> [b]
map LHsTyVarBndr flag (GhcPass p) -> IdGhcP p
forall flag (p :: Pass).
LHsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsLTyVarName
hsExplicitLTyVarNames :: LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
hsExplicitLTyVarNames :: LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
hsExplicitLTyVarNames LHsQTyVars (GhcPass p)
qtvs = (LHsTyVarBndr () (GhcPass p) -> IdGhcP p)
-> [LHsTyVarBndr () (GhcPass p)] -> [IdGhcP p]
forall a b. (a -> b) -> [a] -> [b]
map LHsTyVarBndr () (GhcPass p) -> IdGhcP p
forall flag (p :: Pass).
LHsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsLTyVarName (LHsQTyVars (GhcPass p) -> [LHsTyVarBndr () (GhcPass p)]
forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit LHsQTyVars (GhcPass p)
qtvs)
hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
hsAllLTyVarNames (HsQTvs { hsq_ext :: forall pass. LHsQTyVars pass -> XHsQTvs pass
hsq_ext = XHsQTvs GhcRn
kvs
, hsq_explicit :: forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit = [LHsTyVarBndr () GhcRn]
tvs })
= [Name]
XHsQTvs GhcRn
kvs [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [LHsTyVarBndr () GhcRn] -> [IdP GhcRn]
forall flag (p :: Pass).
[LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames [LHsTyVarBndr () GhcRn]
tvs
hsLTyVarLocName :: LHsTyVarBndr flag (GhcPass p) -> Located (IdP (GhcPass p))
hsLTyVarLocName :: LHsTyVarBndr flag (GhcPass p) -> Located (IdP (GhcPass p))
hsLTyVarLocName = (HsTyVarBndr flag (GhcPass p) -> IdGhcP p)
-> LHsTyVarBndr flag (GhcPass p) -> GenLocated SrcSpan (IdGhcP p)
forall a b l. (a -> b) -> GenLocated l a -> GenLocated l b
mapLoc HsTyVarBndr flag (GhcPass p) -> IdGhcP p
forall flag (p :: Pass).
HsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsTyVarName
hsLTyVarLocNames :: LHsQTyVars (GhcPass p) -> [Located (IdP (GhcPass p))]
hsLTyVarLocNames :: LHsQTyVars (GhcPass p) -> [Located (IdP (GhcPass p))]
hsLTyVarLocNames LHsQTyVars (GhcPass p)
qtvs = (LHsTyVarBndr () (GhcPass p) -> Located (IdGhcP p))
-> [LHsTyVarBndr () (GhcPass p)] -> [Located (IdGhcP p)]
forall a b. (a -> b) -> [a] -> [b]
map LHsTyVarBndr () (GhcPass p) -> Located (IdGhcP p)
forall flag (p :: Pass).
LHsTyVarBndr flag (GhcPass p) -> Located (IdP (GhcPass p))
hsLTyVarLocName (LHsQTyVars (GhcPass p) -> [LHsTyVarBndr () (GhcPass p)]
forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit LHsQTyVars (GhcPass p)
qtvs)
hsTyKindSig :: LHsType pass -> Maybe (LHsKind pass)
hsTyKindSig :: LHsType pass -> Maybe (LHsType pass)
hsTyKindSig LHsType pass
lty =
case LHsType pass -> HsType pass
forall l e. GenLocated l e -> e
unLoc LHsType pass
lty of
HsParTy XParTy pass
_ LHsType pass
lty' -> LHsType pass -> Maybe (LHsType pass)
forall pass. LHsType pass -> Maybe (LHsType pass)
hsTyKindSig LHsType pass
lty'
HsKindSig XKindSig pass
_ LHsType pass
_ LHsType pass
k -> LHsType pass -> Maybe (LHsType pass)
forall a. a -> Maybe a
Just LHsType pass
k
HsType pass
_ -> Maybe (LHsType pass)
forall a. Maybe a
Nothing
ignoreParens :: LHsType pass -> LHsType pass
ignoreParens :: LHsType pass -> LHsType pass
ignoreParens (L SrcSpan
_ (HsParTy XParTy pass
_ LHsType pass
ty)) = LHsType pass -> LHsType pass
forall pass. LHsType pass -> LHsType pass
ignoreParens LHsType pass
ty
ignoreParens LHsType pass
ty = LHsType pass
ty
isLHsForAllTy :: LHsType p -> Bool
isLHsForAllTy :: LHsType p -> Bool
isLHsForAllTy (L SrcSpan
_ (HsForAllTy {})) = Bool
True
isLHsForAllTy LHsType p
_ = Bool
False
mkAnonWildCardTy :: HsType GhcPs
mkAnonWildCardTy :: HsType GhcPs
mkAnonWildCardTy = XWildCardTy GhcPs -> HsType GhcPs
forall pass. XWildCardTy pass -> HsType pass
HsWildCardTy XWildCardTy GhcPs
NoExtField
noExtField
mkHsOpTy :: LHsType (GhcPass p) -> Located (IdP (GhcPass p))
-> LHsType (GhcPass p) -> HsType (GhcPass p)
mkHsOpTy :: LHsType (GhcPass p)
-> Located (IdP (GhcPass p))
-> LHsType (GhcPass p)
-> HsType (GhcPass p)
mkHsOpTy LHsType (GhcPass p)
ty1 Located (IdP (GhcPass p))
op LHsType (GhcPass p)
ty2 = XOpTy (GhcPass p)
-> LHsType (GhcPass p)
-> Located (IdP (GhcPass p))
-> LHsType (GhcPass p)
-> HsType (GhcPass p)
forall pass.
XOpTy pass
-> LHsType pass
-> Located (IdP pass)
-> LHsType pass
-> HsType pass
HsOpTy XOpTy (GhcPass p)
NoExtField
noExtField LHsType (GhcPass p)
ty1 Located (IdP (GhcPass p))
op LHsType (GhcPass p)
ty2
mkHsAppTy :: LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkHsAppTy :: LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkHsAppTy LHsType (GhcPass p)
t1 LHsType (GhcPass p)
t2
= LHsType (GhcPass p)
-> LHsType (GhcPass p) -> HsType (GhcPass p) -> LHsType (GhcPass p)
forall a b c. Located a -> Located b -> c -> Located c
addCLoc LHsType (GhcPass p)
t1 LHsType (GhcPass p)
t2 (XAppTy (GhcPass p)
-> LHsType (GhcPass p) -> LHsType (GhcPass p) -> HsType (GhcPass p)
forall pass.
XAppTy pass -> LHsType pass -> LHsType pass -> HsType pass
HsAppTy XAppTy (GhcPass p)
NoExtField
noExtField LHsType (GhcPass p)
t1 (PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass).
PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
parenthesizeHsType PprPrec
appPrec LHsType (GhcPass p)
t2))
mkHsAppTys :: LHsType (GhcPass p) -> [LHsType (GhcPass p)]
-> LHsType (GhcPass p)
mkHsAppTys :: LHsType (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
mkHsAppTys = (LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p))
-> LHsType (GhcPass p)
-> [LHsType (GhcPass p)]
-> LHsType (GhcPass p)
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
External instance of the constraint type Foldable []
foldl' LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass).
LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkHsAppTy
mkHsAppKindTy :: XAppKindTy (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
-> LHsType (GhcPass p)
mkHsAppKindTy :: XAppKindTy (GhcPass p)
-> LHsType (GhcPass p)
-> LHsType (GhcPass p)
-> LHsType (GhcPass p)
mkHsAppKindTy XAppKindTy (GhcPass p)
ext LHsType (GhcPass p)
ty LHsType (GhcPass p)
k
= LHsType (GhcPass p)
-> LHsType (GhcPass p) -> HsType (GhcPass p) -> LHsType (GhcPass p)
forall a b c. Located a -> Located b -> c -> Located c
addCLoc LHsType (GhcPass p)
ty LHsType (GhcPass p)
k (XAppKindTy (GhcPass p)
-> LHsType (GhcPass p) -> LHsType (GhcPass p) -> HsType (GhcPass p)
forall pass.
XAppKindTy pass -> LHsType pass -> LHsType pass -> HsType pass
HsAppKindTy XAppKindTy (GhcPass p)
ext LHsType (GhcPass p)
ty LHsType (GhcPass p)
k)
splitHsFunType :: LHsType GhcRn -> ([LHsType GhcRn], LHsType GhcRn)
splitHsFunType :: LHsKind GhcRn -> ([LHsKind GhcRn], LHsKind GhcRn)
splitHsFunType (L SrcSpan
_ (HsParTy XParTy GhcRn
_ LHsKind GhcRn
ty))
= LHsKind GhcRn -> ([LHsKind GhcRn], LHsKind GhcRn)
splitHsFunType LHsKind GhcRn
ty
splitHsFunType (L SrcSpan
_ (HsFunTy XFunTy GhcRn
_ LHsKind GhcRn
x LHsKind GhcRn
y))
| ([LHsKind GhcRn]
args, LHsKind GhcRn
res) <- LHsKind GhcRn -> ([LHsKind GhcRn], LHsKind GhcRn)
splitHsFunType LHsKind GhcRn
y
= (LHsKind GhcRn
xLHsKind GhcRn -> [LHsKind GhcRn] -> [LHsKind GhcRn]
forall a. a -> [a] -> [a]
:[LHsKind GhcRn]
args, LHsKind GhcRn
res)
splitHsFunType LHsKind GhcRn
other = ([], LHsKind GhcRn
other)
hsTyGetAppHead_maybe :: LHsType (GhcPass p)
-> Maybe (Located (IdP (GhcPass p)))
hsTyGetAppHead_maybe :: LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
hsTyGetAppHead_maybe = LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
forall {pass}.
LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go
where
go :: LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go (L SrcSpan
_ (HsTyVar XTyVar pass
_ PromotionFlag
_ GenLocated SrcSpan (IdP pass)
ln)) = GenLocated SrcSpan (IdP pass)
-> Maybe (GenLocated SrcSpan (IdP pass))
forall a. a -> Maybe a
Just GenLocated SrcSpan (IdP pass)
ln
go (L SrcSpan
_ (HsAppTy XAppTy pass
_ LHsType pass
l LHsType pass
_)) = LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go LHsType pass
l
go (L SrcSpan
_ (HsAppKindTy XAppKindTy pass
_ LHsType pass
t LHsType pass
_)) = LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go LHsType pass
t
go (L SrcSpan
_ (HsOpTy XOpTy pass
_ LHsType pass
_ (L SrcSpan
loc IdP pass
n) LHsType pass
_)) = GenLocated SrcSpan (IdP pass)
-> Maybe (GenLocated SrcSpan (IdP pass))
forall a. a -> Maybe a
Just (SrcSpan -> IdP pass -> GenLocated SrcSpan (IdP pass)
forall l e. l -> e -> GenLocated l e
L SrcSpan
loc IdP pass
n)
go (L SrcSpan
_ (HsParTy XParTy pass
_ LHsType pass
t)) = LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go LHsType pass
t
go (L SrcSpan
_ (HsKindSig XKindSig pass
_ LHsType pass
t LHsType pass
_)) = LHsType pass -> Maybe (GenLocated SrcSpan (IdP pass))
go LHsType pass
t
go LHsType pass
_ = Maybe (GenLocated SrcSpan (IdP pass))
forall a. Maybe a
Nothing
data HsArg tm ty
= HsValArg tm
| HsTypeArg SrcSpan ty
| HsArgPar SrcSpan
numVisibleArgs :: [HsArg tm ty] -> Arity
numVisibleArgs :: [HsArg tm ty] -> Int
numVisibleArgs = (HsArg tm ty -> Bool) -> [HsArg tm ty] -> Int
forall a. (a -> Bool) -> [a] -> Int
count HsArg tm ty -> Bool
forall {tm} {ty}. HsArg tm ty -> Bool
is_vis
where is_vis :: HsArg tm ty -> Bool
is_vis (HsValArg tm
_) = Bool
True
is_vis HsArg tm ty
_ = Bool
False
type LHsTypeArg p = HsArg (LHsType p) (LHsKind p)
instance (Outputable tm, Outputable ty) => Outputable (HsArg tm ty) where
ppr :: HsArg tm ty -> SDoc
ppr (HsValArg tm
tm) = tm -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable tm
ppr tm
tm
ppr (HsTypeArg SrcSpan
_ ty
ty) = Char -> SDoc
char Char
'@' SDoc -> SDoc -> SDoc
<> ty -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable ty
ppr ty
ty
ppr (HsArgPar SrcSpan
sp) = String -> SDoc
text String
"HsArgPar" SDoc -> SDoc -> SDoc
<+> SrcSpan -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type Outputable SrcSpan
ppr SrcSpan
sp
splitLHsPatSynTy :: LHsType pass
-> ( [LHsTyVarBndr Specificity pass]
, LHsContext pass
, [LHsTyVarBndr Specificity pass]
, LHsContext pass
, LHsType pass)
splitLHsPatSynTy :: LHsType pass
-> ([LHsTyVarBndr Specificity pass], LHsContext pass,
[LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
splitLHsPatSynTy LHsType pass
ty = ([LHsTyVarBndr Specificity pass]
univs, LHsContext pass
reqs, [LHsTyVarBndr Specificity pass]
exis, LHsContext pass
provs, LHsType pass
ty4)
where
([LHsTyVarBndr Specificity pass]
univs, LHsType pass
ty1) = LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
forall pass.
LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis LHsType pass
ty
(LHsContext pass
reqs, LHsType pass
ty2) = LHsType pass -> (LHsContext pass, LHsType pass)
forall pass. LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy LHsType pass
ty1
([LHsTyVarBndr Specificity pass]
exis, LHsType pass
ty3) = LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
forall pass.
LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis LHsType pass
ty2
(LHsContext pass
provs, LHsType pass
ty4) = LHsType pass -> (LHsContext pass, LHsType pass)
forall pass. LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy LHsType pass
ty3
splitLHsSigmaTyInvis :: LHsType pass
-> ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
splitLHsSigmaTyInvis :: LHsType pass
-> ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
splitLHsSigmaTyInvis LHsType pass
ty
| ([LHsTyVarBndr Specificity pass]
tvs, LHsType pass
ty1) <- LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
forall pass.
LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis LHsType pass
ty
, (LHsContext pass
ctxt, LHsType pass
ty2) <- LHsType pass -> (LHsContext pass, LHsType pass)
forall pass. LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy LHsType pass
ty1
= ([LHsTyVarBndr Specificity pass]
tvs, LHsContext pass
ctxt, LHsType pass
ty2)
splitLHsForAllTyInvis :: LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis :: LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis lty :: LHsType pass
lty@(L SrcSpan
_ HsType pass
ty) =
case HsType pass
ty of
HsParTy XParTy pass
_ LHsType pass
ty' -> LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
forall pass.
LHsType pass -> ([LHsTyVarBndr Specificity pass], LHsType pass)
splitLHsForAllTyInvis LHsType pass
ty'
HsForAllTy { hst_fvf :: forall pass. HsType pass -> ForallVisFlag
hst_fvf = ForallVisFlag
fvf', hst_bndrs :: forall pass. HsType pass -> [LHsTyVarBndr Specificity pass]
hst_bndrs = [LHsTyVarBndr Specificity pass]
tvs', hst_body :: forall pass. HsType pass -> LHsType pass
hst_body = LHsType pass
body' }
| ForallVisFlag
fvf' ForallVisFlag -> ForallVisFlag -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type Eq ForallVisFlag
== ForallVisFlag
ForallInvis
-> ([LHsTyVarBndr Specificity pass]
tvs', LHsType pass
body')
HsType pass
_ -> ([], LHsType pass
lty)
splitLHsQualTy :: LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy :: LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy (L SrcSpan
_ (HsParTy XParTy pass
_ LHsType pass
ty)) = LHsType pass -> (LHsContext pass, LHsType pass)
forall pass. LHsType pass -> (LHsContext pass, LHsType pass)
splitLHsQualTy LHsType pass
ty
splitLHsQualTy (L SrcSpan
_ (HsQualTy { hst_ctxt :: forall pass. HsType pass -> LHsContext pass
hst_ctxt = LHsContext pass
ctxt, hst_body :: forall pass. HsType pass -> LHsType pass
hst_body = LHsType pass
body })) = (LHsContext pass
ctxt, LHsType pass
body)
splitLHsQualTy LHsType pass
body = (LHsContext pass
forall pass. LHsContext pass
noLHsContext, LHsType pass
body)
splitLHsInstDeclTy :: LHsSigType GhcRn
-> ([Name], LHsContext GhcRn, LHsType GhcRn)
splitLHsInstDeclTy :: LHsSigType GhcRn -> ([Name], LHsContext GhcRn, LHsKind GhcRn)
splitLHsInstDeclTy (HsIB { hsib_ext :: forall pass thing. HsImplicitBndrs pass thing -> XHsIB pass thing
hsib_ext = XHsIB GhcRn (LHsKind GhcRn)
itkvs
, hsib_body :: forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body = LHsKind GhcRn
inst_ty })
| ([LHsTyVarBndr Specificity GhcRn]
tvs, LHsContext GhcRn
cxt, LHsKind GhcRn
body_ty) <- LHsKind GhcRn
-> ([LHsTyVarBndr Specificity GhcRn], LHsContext GhcRn,
LHsKind GhcRn)
forall pass.
LHsType pass
-> ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
splitLHsSigmaTyInvis LHsKind GhcRn
inst_ty
= ([Name]
XHsIB GhcRn (LHsKind GhcRn)
itkvs [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [LHsTyVarBndr Specificity GhcRn] -> [IdP GhcRn]
forall flag (p :: Pass).
[LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames [LHsTyVarBndr Specificity GhcRn]
tvs, LHsContext GhcRn
cxt, LHsKind GhcRn
body_ty)
getLHsInstDeclHead :: LHsSigType (GhcPass p) -> LHsType (GhcPass p)
getLHsInstDeclHead :: LHsSigType (GhcPass p) -> LHsType (GhcPass p)
getLHsInstDeclHead LHsSigType (GhcPass p)
inst_ty
| ([LHsTyVarBndr Specificity (GhcPass p)]
_tvs, LHsContext (GhcPass p)
_cxt, LHsType (GhcPass p)
body_ty) <- LHsType (GhcPass p)
-> ([LHsTyVarBndr Specificity (GhcPass p)], LHsContext (GhcPass p),
LHsType (GhcPass p))
forall pass.
LHsType pass
-> ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
splitLHsSigmaTyInvis (LHsSigType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
hsSigType LHsSigType (GhcPass p)
inst_ty)
= LHsType (GhcPass p)
body_ty
getLHsInstDeclClass_maybe :: LHsSigType (GhcPass p)
-> Maybe (Located (IdP (GhcPass p)))
getLHsInstDeclClass_maybe :: LHsSigType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
getLHsInstDeclClass_maybe LHsSigType (GhcPass p)
inst_ty
= do { let head_ty :: LHsType (GhcPass p)
head_ty = LHsSigType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
getLHsInstDeclHead LHsSigType (GhcPass p)
inst_ty
; Located (IdGhcP p)
cls <- LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
forall (p :: Pass).
LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
hsTyGetAppHead_maybe LHsType (GhcPass p)
head_ty
; Located (IdGhcP p) -> Maybe (Located (IdGhcP p))
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad Maybe
return Located (IdGhcP p)
cls }
type LFieldOcc pass = Located (FieldOcc pass)
data FieldOcc pass = FieldOcc { FieldOcc pass -> XCFieldOcc pass
extFieldOcc :: XCFieldOcc pass
, FieldOcc pass -> Located RdrName
rdrNameFieldOcc :: Located RdrName
}
| XFieldOcc
!(XXFieldOcc pass)
deriving instance Eq (XCFieldOcc (GhcPass p)) => Eq (FieldOcc (GhcPass p))
type instance XCFieldOcc GhcPs = NoExtField
type instance XCFieldOcc GhcRn = Name
type instance XCFieldOcc GhcTc = Id
type instance XXFieldOcc (GhcPass _) = NoExtCon
instance Outputable (FieldOcc pass) where
ppr :: FieldOcc pass -> SDoc
ppr = Located RdrName -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type Outputable RdrName
ppr (Located RdrName -> SDoc)
-> (FieldOcc pass -> Located RdrName) -> FieldOcc pass -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FieldOcc pass -> Located RdrName
forall pass. FieldOcc pass -> Located RdrName
rdrNameFieldOcc
mkFieldOcc :: Located RdrName -> FieldOcc GhcPs
mkFieldOcc :: Located RdrName -> FieldOcc GhcPs
mkFieldOcc Located RdrName
rdr = XCFieldOcc GhcPs -> Located RdrName -> FieldOcc GhcPs
forall pass. XCFieldOcc pass -> Located RdrName -> FieldOcc pass
FieldOcc XCFieldOcc GhcPs
NoExtField
noExtField Located RdrName
rdr
data AmbiguousFieldOcc pass
= Unambiguous (XUnambiguous pass) (Located RdrName)
| Ambiguous (XAmbiguous pass) (Located RdrName)
| XAmbiguousFieldOcc !(XXAmbiguousFieldOcc pass)
type instance XUnambiguous GhcPs = NoExtField
type instance XUnambiguous GhcRn = Name
type instance XUnambiguous GhcTc = Id
type instance XAmbiguous GhcPs = NoExtField
type instance XAmbiguous GhcRn = NoExtField
type instance XAmbiguous GhcTc = Id
type instance XXAmbiguousFieldOcc (GhcPass _) = NoExtCon
instance Outputable (AmbiguousFieldOcc (GhcPass p)) where
ppr :: AmbiguousFieldOcc (GhcPass p) -> SDoc
ppr = RdrName -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type Outputable RdrName
ppr (RdrName -> SDoc)
-> (AmbiguousFieldOcc (GhcPass p) -> RdrName)
-> AmbiguousFieldOcc (GhcPass p)
-> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AmbiguousFieldOcc (GhcPass p) -> RdrName
forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
rdrNameAmbiguousFieldOcc
instance OutputableBndr (AmbiguousFieldOcc (GhcPass p)) where
pprInfixOcc :: AmbiguousFieldOcc (GhcPass p) -> SDoc
pprInfixOcc = RdrName -> SDoc
forall a. OutputableBndr a => a -> SDoc
External instance of the constraint type OutputableBndr RdrName
pprInfixOcc (RdrName -> SDoc)
-> (AmbiguousFieldOcc (GhcPass p) -> RdrName)
-> AmbiguousFieldOcc (GhcPass p)
-> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AmbiguousFieldOcc (GhcPass p) -> RdrName
forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
rdrNameAmbiguousFieldOcc
pprPrefixOcc :: AmbiguousFieldOcc (GhcPass p) -> SDoc
pprPrefixOcc = RdrName -> SDoc
forall a. OutputableBndr a => a -> SDoc
External instance of the constraint type OutputableBndr RdrName
pprPrefixOcc (RdrName -> SDoc)
-> (AmbiguousFieldOcc (GhcPass p) -> RdrName)
-> AmbiguousFieldOcc (GhcPass p)
-> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AmbiguousFieldOcc (GhcPass p) -> RdrName
forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
rdrNameAmbiguousFieldOcc
mkAmbiguousFieldOcc :: Located RdrName -> AmbiguousFieldOcc GhcPs
mkAmbiguousFieldOcc :: Located RdrName -> AmbiguousFieldOcc GhcPs
mkAmbiguousFieldOcc Located RdrName
rdr = XUnambiguous GhcPs -> Located RdrName -> AmbiguousFieldOcc GhcPs
forall pass.
XUnambiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
Unambiguous XUnambiguous GhcPs
NoExtField
noExtField Located RdrName
rdr
rdrNameAmbiguousFieldOcc :: AmbiguousFieldOcc (GhcPass p) -> RdrName
rdrNameAmbiguousFieldOcc :: AmbiguousFieldOcc (GhcPass p) -> RdrName
rdrNameAmbiguousFieldOcc (Unambiguous XUnambiguous (GhcPass p)
_ (L SrcSpan
_ RdrName
rdr)) = RdrName
rdr
rdrNameAmbiguousFieldOcc (Ambiguous XAmbiguous (GhcPass p)
_ (L SrcSpan
_ RdrName
rdr)) = RdrName
rdr
selectorAmbiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> Id
selectorAmbiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> Id
selectorAmbiguousFieldOcc (Unambiguous XUnambiguous GhcTc
sel Located RdrName
_) = Id
XUnambiguous GhcTc
sel
selectorAmbiguousFieldOcc (Ambiguous XAmbiguous GhcTc
sel Located RdrName
_) = Id
XAmbiguous GhcTc
sel
unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
unambiguousFieldOcc (Unambiguous XUnambiguous GhcTc
rdr Located RdrName
sel) = XCFieldOcc GhcTc -> Located RdrName -> FieldOcc GhcTc
forall pass. XCFieldOcc pass -> Located RdrName -> FieldOcc pass
FieldOcc XCFieldOcc GhcTc
XUnambiguous GhcTc
rdr Located RdrName
sel
unambiguousFieldOcc (Ambiguous XAmbiguous GhcTc
rdr Located RdrName
sel) = XCFieldOcc GhcTc -> Located RdrName -> FieldOcc GhcTc
forall pass. XCFieldOcc pass -> Located RdrName -> FieldOcc pass
FieldOcc XCFieldOcc GhcTc
XAmbiguous GhcTc
rdr Located RdrName
sel
ambiguousFieldOcc :: FieldOcc GhcTc -> AmbiguousFieldOcc GhcTc
ambiguousFieldOcc :: FieldOcc GhcTc -> AmbiguousFieldOcc GhcTc
ambiguousFieldOcc (FieldOcc XCFieldOcc GhcTc
sel Located RdrName
rdr) = XUnambiguous GhcTc -> Located RdrName -> AmbiguousFieldOcc GhcTc
forall pass.
XUnambiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
Unambiguous XCFieldOcc GhcTc
XUnambiguous GhcTc
sel Located RdrName
rdr
class OutputableBndrFlag flag where
pprTyVarBndr :: OutputableBndrId p => HsTyVarBndr flag (GhcPass p) -> SDoc
instance OutputableBndrFlag () where
pprTyVarBndr :: HsTyVarBndr () (GhcPass p) -> SDoc
pprTyVarBndr (UserTyVar XUserTyVar (GhcPass p)
_ ()
_ Located (IdP (GhcPass p))
n) = Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n
pprTyVarBndr (KindedTyVar XKindedTyVar (GhcPass p)
_ ()
_ Located (IdP (GhcPass p))
n LHsKind (GhcPass p)
k) = SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [SDoc] -> SDoc
hsep [Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n, SDoc
dcolon, LHsKind (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LHsKind (GhcPass p)
k]
instance OutputableBndrFlag Specificity where
pprTyVarBndr :: HsTyVarBndr Specificity (GhcPass p) -> SDoc
pprTyVarBndr (UserTyVar XUserTyVar (GhcPass p)
_ Specificity
SpecifiedSpec Located (IdP (GhcPass p))
n) = Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n
pprTyVarBndr (UserTyVar XUserTyVar (GhcPass p)
_ Specificity
InferredSpec Located (IdP (GhcPass p))
n) = SDoc -> SDoc
braces (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n
pprTyVarBndr (KindedTyVar XKindedTyVar (GhcPass p)
_ Specificity
SpecifiedSpec Located (IdP (GhcPass p))
n LHsKind (GhcPass p)
k) = SDoc -> SDoc
parens (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [SDoc] -> SDoc
hsep [Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n, SDoc
dcolon, LHsKind (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LHsKind (GhcPass p)
k]
pprTyVarBndr (KindedTyVar XKindedTyVar (GhcPass p)
_ Specificity
InferredSpec Located (IdP (GhcPass p))
n LHsKind (GhcPass p)
k) = SDoc -> SDoc
braces (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [SDoc] -> SDoc
hsep [Located (IdGhcP p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
External instance of the constraint type forall a. OutputableBndr a => Outputable a
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr Located (IdGhcP p)
Located (IdP (GhcPass p))
n, SDoc
dcolon, LHsKind (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LHsKind (GhcPass p)
k]
instance OutputableBndrId p => Outputable (HsType (GhcPass p)) where
ppr :: HsType (GhcPass p) -> SDoc
ppr HsType (GhcPass p)
ty = HsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
HsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprHsType HsType (GhcPass p)
ty
instance Outputable HsTyLit where
ppr :: HsTyLit -> SDoc
ppr = HsTyLit -> SDoc
ppr_tylit
instance OutputableBndrId p
=> Outputable (LHsQTyVars (GhcPass p)) where
ppr :: LHsQTyVars (GhcPass p) -> SDoc
ppr (HsQTvs { hsq_explicit :: forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit = [LHsTyVarBndr () (GhcPass p)]
tvs }) = [LHsTyVarBndr () (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass) flag.
(OutputableBndrId p, OutputableBndrFlag flag) =>
Outputable (HsTyVarBndr flag (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
Instance of class: OutputableBndrFlag of the constraint type OutputableBndrFlag ()
interppSP [LHsTyVarBndr () (GhcPass p)]
tvs
instance (OutputableBndrId p, OutputableBndrFlag flag)
=> Outputable (HsTyVarBndr flag (GhcPass p)) where
ppr :: HsTyVarBndr flag (GhcPass p) -> SDoc
ppr = HsTyVarBndr flag (GhcPass p) -> SDoc
forall flag (p :: Pass).
(OutputableBndrFlag flag, OutputableBndrId p) =>
HsTyVarBndr flag (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
Evidence bound by a type signature of the constraint type OutputableBndrFlag flag
pprTyVarBndr
instance Outputable thing
=> Outputable (HsImplicitBndrs (GhcPass p) thing) where
ppr :: HsImplicitBndrs (GhcPass p) thing -> SDoc
ppr (HsIB { hsib_body :: forall pass thing. HsImplicitBndrs pass thing -> thing
hsib_body = thing
ty }) = thing -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable thing
ppr thing
ty
instance Outputable thing
=> Outputable (HsWildCardBndrs (GhcPass p) thing) where
ppr :: HsWildCardBndrs (GhcPass p) thing -> SDoc
ppr (HsWC { hswc_body :: forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body = thing
ty }) = thing -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable thing
ppr thing
ty
instance OutputableBndrId p
=> Outputable (HsPatSigType (GhcPass p)) where
ppr :: HsPatSigType (GhcPass p) -> SDoc
ppr (HsPS { hsps_body :: forall pass. HsPatSigType pass -> LHsType pass
hsps_body = LHsType (GhcPass p)
ty }) = LHsType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LHsType (GhcPass p)
ty
pprAnonWildCard :: SDoc
pprAnonWildCard :: SDoc
pprAnonWildCard = Char -> SDoc
char Char
'_'
pprHsForAll :: (OutputableBndrId p, OutputableBndrFlag flag)
=> ForallVisFlag -> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p) -> SDoc
pprHsForAll :: ForallVisFlag
-> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p)
-> SDoc
pprHsForAll = Maybe SrcSpan
-> ForallVisFlag
-> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p)
-> SDoc
forall (p :: Pass) flag.
(OutputableBndrId p, OutputableBndrFlag flag) =>
Maybe SrcSpan
-> ForallVisFlag
-> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p)
-> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrFlag flag
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprHsForAllExtra Maybe SrcSpan
forall a. Maybe a
Nothing
pprHsForAllExtra :: (OutputableBndrId p, OutputableBndrFlag flag)
=> Maybe SrcSpan -> ForallVisFlag
-> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p) -> SDoc
Maybe SrcSpan
extra ForallVisFlag
fvf [LHsTyVarBndr flag (GhcPass p)]
qtvs LHsContext (GhcPass p)
cxt
= SDoc
pp_forall SDoc -> SDoc -> SDoc
<+> Bool -> LHsContext (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
Bool -> LHsContext (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprLHsContextExtra (Maybe SrcSpan -> Bool
forall a. Maybe a -> Bool
isJust Maybe SrcSpan
extra) LHsContext (GhcPass p)
cxt
where
pp_forall :: SDoc
pp_forall | [LHsTyVarBndr flag (GhcPass p)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
External instance of the constraint type Foldable []
null [LHsTyVarBndr flag (GhcPass p)]
qtvs = SDoc -> SDoc
whenPprDebug (SDoc
forAllLit SDoc -> SDoc -> SDoc
<> SDoc
separator)
| Bool
otherwise = SDoc
forAllLit SDoc -> SDoc -> SDoc
<+> [LHsTyVarBndr flag (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass) flag.
(OutputableBndrId p, OutputableBndrFlag flag) =>
Outputable (HsTyVarBndr flag (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
Evidence bound by a type signature of the constraint type OutputableBndrFlag flag
interppSP [LHsTyVarBndr flag (GhcPass p)]
qtvs SDoc -> SDoc -> SDoc
<> SDoc
separator
separator :: SDoc
separator = ForallVisFlag -> SDoc
ppr_forall_separator ForallVisFlag
fvf
pprHsExplicitForAll :: (OutputableBndrId p)
=> ForallVisFlag
-> Maybe [LHsTyVarBndr () (GhcPass p)] -> SDoc
pprHsExplicitForAll :: ForallVisFlag -> Maybe [LHsTyVarBndr () (GhcPass p)] -> SDoc
pprHsExplicitForAll ForallVisFlag
fvf (Just [LHsTyVarBndr () (GhcPass p)]
qtvs) = SDoc
forAllLit SDoc -> SDoc -> SDoc
<+> [LHsTyVarBndr () (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass) flag.
(OutputableBndrId p, OutputableBndrFlag flag) =>
Outputable (HsTyVarBndr flag (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
Instance of class: OutputableBndrFlag of the constraint type OutputableBndrFlag ()
interppSP [LHsTyVarBndr () (GhcPass p)]
qtvs
SDoc -> SDoc -> SDoc
<> ForallVisFlag -> SDoc
ppr_forall_separator ForallVisFlag
fvf
pprHsExplicitForAll ForallVisFlag
_ Maybe [LHsTyVarBndr () (GhcPass p)]
Nothing = SDoc
empty
ppr_forall_separator :: ForallVisFlag -> SDoc
ppr_forall_separator :: ForallVisFlag -> SDoc
ppr_forall_separator ForallVisFlag
ForallVis = SDoc
space SDoc -> SDoc -> SDoc
<> SDoc
arrow
ppr_forall_separator ForallVisFlag
ForallInvis = SDoc
dot
pprLHsContext :: (OutputableBndrId p)
=> LHsContext (GhcPass p) -> SDoc
pprLHsContext :: LHsContext (GhcPass p) -> SDoc
pprLHsContext LHsContext (GhcPass p)
lctxt
| [LHsType (GhcPass p)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
External instance of the constraint type Foldable []
null (LHsContext (GhcPass p) -> [LHsType (GhcPass p)]
forall l e. GenLocated l e -> e
unLoc LHsContext (GhcPass p)
lctxt) = SDoc
empty
| Bool
otherwise = LHsContext (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsContext (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprLHsContextAlways LHsContext (GhcPass p)
lctxt
pprLHsContextAlways :: (OutputableBndrId p)
=> LHsContext (GhcPass p) -> SDoc
pprLHsContextAlways :: LHsContext (GhcPass p) -> SDoc
pprLHsContextAlways (L SrcSpan
_ HsContext (GhcPass p)
ctxt)
= case HsContext (GhcPass p)
ctxt of
[] -> SDoc -> SDoc
parens SDoc
empty SDoc -> SDoc -> SDoc
<+> SDoc
darrow
[L SrcSpan
_ HsType (GhcPass p)
ty] -> HsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
HsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_ty HsType (GhcPass p)
ty SDoc -> SDoc -> SDoc
<+> SDoc
darrow
HsContext (GhcPass p)
_ -> SDoc -> SDoc
parens (HsContext (GhcPass p) -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
interpp'SP HsContext (GhcPass p)
ctxt) SDoc -> SDoc -> SDoc
<+> SDoc
darrow
pprLHsContextExtra :: (OutputableBndrId p)
=> Bool -> LHsContext (GhcPass p) -> SDoc
Bool
show_extra lctxt :: LHsContext (GhcPass p)
lctxt@(L SrcSpan
_ HsContext (GhcPass p)
ctxt)
| Bool -> Bool
not Bool
show_extra = LHsContext (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsContext (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprLHsContext LHsContext (GhcPass p)
lctxt
| HsContext (GhcPass p) -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
External instance of the constraint type Foldable []
null HsContext (GhcPass p)
ctxt = Char -> SDoc
char Char
'_' SDoc -> SDoc -> SDoc
<+> SDoc
darrow
| Bool
otherwise = SDoc -> SDoc
parens ([SDoc] -> SDoc
sep (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
comma [SDoc]
ctxt')) SDoc -> SDoc -> SDoc
<+> SDoc
darrow
where
ctxt' :: [SDoc]
ctxt' = (LHsType (GhcPass p) -> SDoc) -> HsContext (GhcPass p) -> [SDoc]
forall a b. (a -> b) -> [a] -> [b]
map LHsType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr HsContext (GhcPass p)
ctxt [SDoc] -> [SDoc] -> [SDoc]
forall a. [a] -> [a] -> [a]
++ [Char -> SDoc
char Char
'_']
pprConDeclFields :: (OutputableBndrId p)
=> [LConDeclField (GhcPass p)] -> SDoc
pprConDeclFields :: [LConDeclField (GhcPass p)] -> SDoc
pprConDeclFields [LConDeclField (GhcPass p)]
fields = SDoc -> SDoc
braces ([SDoc] -> SDoc
sep (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
comma ((LConDeclField (GhcPass p) -> SDoc)
-> [LConDeclField (GhcPass p)] -> [SDoc]
forall a b. (a -> b) -> [a] -> [b]
map LConDeclField (GhcPass p) -> SDoc
forall {pass} {l}.
(Outputable (XXConDeclField pass), Outputable (HsType pass)) =>
GenLocated l (ConDeclField pass) -> SDoc
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
External instance of the constraint type Outputable NoExtCon
ppr_fld [LConDeclField (GhcPass p)]
fields)))
where
ppr_fld :: GenLocated l (ConDeclField pass) -> SDoc
ppr_fld (L l
_ (ConDeclField { cd_fld_names :: forall pass. ConDeclField pass -> [LFieldOcc pass]
cd_fld_names = [LFieldOcc pass]
ns, cd_fld_type :: forall pass. ConDeclField pass -> LBangType pass
cd_fld_type = LBangType pass
ty,
cd_fld_doc :: forall pass. ConDeclField pass -> Maybe LHsDocString
cd_fld_doc = Maybe LHsDocString
doc }))
= [LFieldOcc pass] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall pass. Outputable (FieldOcc pass)
ppr_names [LFieldOcc pass]
ns SDoc -> SDoc -> SDoc
<+> SDoc
dcolon SDoc -> SDoc -> SDoc
<+> LBangType pass -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Evidence bound by a type signature of the constraint type Outputable (HsType pass)
ppr LBangType pass
ty SDoc -> SDoc -> SDoc
<+> Maybe LHsDocString -> SDoc
ppr_mbDoc Maybe LHsDocString
doc
ppr_fld (L l
_ (XConDeclField XXConDeclField pass
x)) = XXConDeclField pass -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable (XXConDeclField pass)
ppr XXConDeclField pass
x
ppr_names :: [a] -> SDoc
ppr_names [a
n] = a -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable a
ppr a
n
ppr_names [a]
ns = [SDoc] -> SDoc
sep (SDoc -> [SDoc] -> [SDoc]
punctuate SDoc
comma ((a -> SDoc) -> [a] -> [SDoc]
forall a b. (a -> b) -> [a] -> [b]
map a -> SDoc
forall a. Outputable a => a -> SDoc
Evidence bound by a type signature of the constraint type Outputable a
ppr [a]
ns))
pprHsType :: (OutputableBndrId p) => HsType (GhcPass p) -> SDoc
pprHsType :: HsType (GhcPass p) -> SDoc
pprHsType HsType (GhcPass p)
ty = HsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
HsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_ty HsType (GhcPass p)
ty
ppr_mono_lty :: (OutputableBndrId p) => LHsType (GhcPass p) -> SDoc
ppr_mono_lty :: LHsType (GhcPass p) -> SDoc
ppr_mono_lty LHsType (GhcPass p)
ty = HsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
HsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_ty (LHsType (GhcPass p) -> HsType (GhcPass p)
forall l e. GenLocated l e -> e
unLoc LHsType (GhcPass p)
ty)
ppr_mono_ty :: (OutputableBndrId p) => HsType (GhcPass p) -> SDoc
ppr_mono_ty :: HsType (GhcPass p) -> SDoc
ppr_mono_ty (HsForAllTy { hst_fvf :: forall pass. HsType pass -> ForallVisFlag
hst_fvf = ForallVisFlag
fvf, hst_bndrs :: forall pass. HsType pass -> [LHsTyVarBndr Specificity pass]
hst_bndrs = [LHsTyVarBndr Specificity (GhcPass p)]
tvs, hst_body :: forall pass. HsType pass -> LHsType pass
hst_body = LHsType (GhcPass p)
ty })
= [SDoc] -> SDoc
sep [ForallVisFlag
-> [LHsTyVarBndr Specificity (GhcPass p)]
-> LHsContext (GhcPass p)
-> SDoc
forall (p :: Pass) flag.
(OutputableBndrId p, OutputableBndrFlag flag) =>
ForallVisFlag
-> [LHsTyVarBndr flag (GhcPass p)]
-> LHsContext (GhcPass p)
-> SDoc
Instance of class: OutputableBndrFlag of the constraint type OutputableBndrFlag Specificity
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprHsForAll ForallVisFlag
fvf [LHsTyVarBndr Specificity (GhcPass p)]
tvs LHsContext (GhcPass p)
forall pass. LHsContext pass
noLHsContext, LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty]
ppr_mono_ty (HsQualTy { hst_ctxt :: forall pass. HsType pass -> LHsContext pass
hst_ctxt = LHsContext (GhcPass p)
ctxt, hst_body :: forall pass. HsType pass -> LHsType pass
hst_body = LHsType (GhcPass p)
ty })
= [SDoc] -> SDoc
sep [LHsContext (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsContext (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprLHsContextAlways LHsContext (GhcPass p)
ctxt, LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty]
ppr_mono_ty (HsBangTy XBangTy (GhcPass p)
_ HsSrcBang
b LHsType (GhcPass p)
ty) = HsSrcBang -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type Outputable HsSrcBang
ppr HsSrcBang
b SDoc -> SDoc -> SDoc
<> LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty
ppr_mono_ty (HsRecTy XRecTy (GhcPass p)
_ [LConDeclField (GhcPass p)]
flds) = [LConDeclField (GhcPass p)] -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
[LConDeclField (GhcPass p)] -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprConDeclFields [LConDeclField (GhcPass p)]
flds
ppr_mono_ty (HsTyVar XTyVar (GhcPass p)
_ PromotionFlag
prom (L SrcSpan
_ IdP (GhcPass p)
name))
| PromotionFlag -> Bool
isPromoted PromotionFlag
prom = SDoc -> SDoc
quote (IdGhcP p -> SDoc
forall a. OutputableBndr a => a -> SDoc
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprPrefixOcc IdGhcP p
IdP (GhcPass p)
name)
| Bool
otherwise = IdGhcP p -> SDoc
forall a. OutputableBndr a => a -> SDoc
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprPrefixOcc IdGhcP p
IdP (GhcPass p)
name
ppr_mono_ty (HsFunTy XFunTy (GhcPass p)
_ LHsType (GhcPass p)
ty1 LHsType (GhcPass p)
ty2) = LHsType (GhcPass p) -> LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_fun_ty LHsType (GhcPass p)
ty1 LHsType (GhcPass p)
ty2
ppr_mono_ty (HsTupleTy XTupleTy (GhcPass p)
_ HsTupleSort
con [LHsType (GhcPass p)]
tys)
| [LHsType (GhcPass p)
ty] <- [LHsType (GhcPass p)]
tys
, TupleSort
BoxedTuple <- TupleSort
std_con
= [SDoc] -> SDoc
sep [String -> SDoc
text (Boxity -> Int -> String
mkTupleStr Boxity
Boxed Int
1), LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty]
| Bool
otherwise
= TupleSort -> SDoc -> SDoc
tupleParens TupleSort
std_con ((LHsType (GhcPass p) -> SDoc) -> [LHsType (GhcPass p)] -> SDoc
forall a. (a -> SDoc) -> [a] -> SDoc
pprWithCommas LHsType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr [LHsType (GhcPass p)]
tys)
where std_con :: TupleSort
std_con = case HsTupleSort
con of
HsTupleSort
HsUnboxedTuple -> TupleSort
UnboxedTuple
HsTupleSort
_ -> TupleSort
BoxedTuple
ppr_mono_ty (HsSumTy XSumTy (GhcPass p)
_ [LHsType (GhcPass p)]
tys)
= TupleSort -> SDoc -> SDoc
tupleParens TupleSort
UnboxedTuple ((LHsType (GhcPass p) -> SDoc) -> [LHsType (GhcPass p)] -> SDoc
forall a. (a -> SDoc) -> [a] -> SDoc
pprWithBars LHsType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr [LHsType (GhcPass p)]
tys)
ppr_mono_ty (HsKindSig XKindSig (GhcPass p)
_ LHsType (GhcPass p)
ty LHsType (GhcPass p)
kind)
= LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty SDoc -> SDoc -> SDoc
<+> SDoc
dcolon SDoc -> SDoc -> SDoc
<+> LHsType (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr LHsType (GhcPass p)
kind
ppr_mono_ty (HsListTy XListTy (GhcPass p)
_ LHsType (GhcPass p)
ty) = SDoc -> SDoc
brackets (LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty)
ppr_mono_ty (HsIParamTy XIParamTy (GhcPass p)
_ Located HsIPName
n LHsType (GhcPass p)
ty) = (Located HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type Outputable HsIPName
ppr Located HsIPName
n SDoc -> SDoc -> SDoc
<+> SDoc
dcolon SDoc -> SDoc -> SDoc
<+> LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty)
ppr_mono_ty (HsSpliceTy XSpliceTy (GhcPass p)
_ HsSplice (GhcPass p)
s) = HsSplice (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
HsSplice (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprSplice HsSplice (GhcPass p)
s
ppr_mono_ty (HsExplicitListTy XExplicitListTy (GhcPass p)
_ PromotionFlag
prom [LHsType (GhcPass p)]
tys)
| PromotionFlag -> Bool
isPromoted PromotionFlag
prom = SDoc -> SDoc
quote (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ SDoc -> SDoc
brackets ([LHsType (GhcPass p)] -> SDoc -> SDoc
forall pass. [LHsType pass] -> SDoc -> SDoc
maybeAddSpace [LHsType (GhcPass p)]
tys (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [LHsType (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
interpp'SP [LHsType (GhcPass p)]
tys)
| Bool
otherwise = SDoc -> SDoc
brackets ([LHsType (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
interpp'SP [LHsType (GhcPass p)]
tys)
ppr_mono_ty (HsExplicitTupleTy XExplicitTupleTy (GhcPass p)
_ [LHsType (GhcPass p)]
tys)
| [LHsType (GhcPass p)
ty] <- [LHsType (GhcPass p)]
tys
= SDoc -> SDoc
quote (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [SDoc] -> SDoc
sep [String -> SDoc
text (Boxity -> Int -> String
mkTupleStr Boxity
Boxed Int
1), LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty]
| Bool
otherwise
= SDoc -> SDoc
quote (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ SDoc -> SDoc
parens ([LHsType (GhcPass p)] -> SDoc -> SDoc
forall pass. [LHsType pass] -> SDoc -> SDoc
maybeAddSpace [LHsType (GhcPass p)]
tys (SDoc -> SDoc) -> SDoc -> SDoc
forall a b. (a -> b) -> a -> b
$ [LHsType (GhcPass p)] -> SDoc
forall a. Outputable a => [a] -> SDoc
External instance of the constraint type forall l e.
(Outputable l, Outputable e) =>
Outputable (GenLocated l e)
External instance of the constraint type Outputable SrcSpan
Instance of class: Outputable of the constraint type forall (p :: Pass).
OutputableBndrId p =>
Outputable (HsType (GhcPass p))
Evidence bound by a type signature of the constraint type OutputableBndrId p
interpp'SP [LHsType (GhcPass p)]
tys)
ppr_mono_ty (HsTyLit XTyLit (GhcPass p)
_ HsTyLit
t) = HsTyLit -> SDoc
ppr_tylit HsTyLit
t
ppr_mono_ty (HsWildCardTy {}) = Char -> SDoc
char Char
'_'
ppr_mono_ty (HsStarTy XStarTy (GhcPass p)
_ Bool
isUni) = Char -> SDoc
char (if Bool
isUni then Char
'★' else Char
'*')
ppr_mono_ty (HsAppTy XAppTy (GhcPass p)
_ LHsType (GhcPass p)
fun_ty LHsType (GhcPass p)
arg_ty)
= [SDoc] -> SDoc
hsep [LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
fun_ty, LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
arg_ty]
ppr_mono_ty (HsAppKindTy XAppKindTy (GhcPass p)
_ LHsType (GhcPass p)
ty LHsType (GhcPass p)
k)
= LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty SDoc -> SDoc -> SDoc
<+> Char -> SDoc
char Char
'@' SDoc -> SDoc -> SDoc
<> LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
k
ppr_mono_ty (HsOpTy XOpTy (GhcPass p)
_ LHsType (GhcPass p)
ty1 (L SrcSpan
_ IdP (GhcPass p)
op) LHsType (GhcPass p)
ty2)
= [SDoc] -> SDoc
sep [ LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty1
, [SDoc] -> SDoc
sep [IdGhcP p -> SDoc
forall a. OutputableBndr a => a -> SDoc
External instance of the constraint type forall (c1 :: Constraint) (c2 :: Constraint) (c3 :: Constraint).
(c1, c2, c3) =>
c1
Evidence bound by a type signature of the constraint type OutputableBndrId p
pprInfixOcc IdGhcP p
IdP (GhcPass p)
op, LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty2 ] ]
ppr_mono_ty (HsParTy XParTy (GhcPass p)
_ LHsType (GhcPass p)
ty)
= SDoc -> SDoc
parens (LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty)
ppr_mono_ty (HsDocTy XDocTy (GhcPass p)
_ LHsType (GhcPass p)
ty LHsDocString
doc)
= LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty SDoc -> SDoc -> SDoc
<+> HsDocString -> SDoc
forall a. Outputable a => a -> SDoc
External instance of the constraint type Outputable HsDocString
ppr (LHsDocString -> HsDocString
forall l e. GenLocated l e -> e
unLoc LHsDocString
doc)
ppr_mono_ty (XHsType XXType (GhcPass p)
t) = NewHsTypeX -> SDoc
forall a. Outputable a => a -> SDoc
Instance of class: Outputable of the constraint type Outputable NewHsTypeX
ppr XXType (GhcPass p)
NewHsTypeX
t
ppr_fun_ty :: (OutputableBndrId p)
=> LHsType (GhcPass p) -> LHsType (GhcPass p) -> SDoc
ppr_fun_ty :: LHsType (GhcPass p) -> LHsType (GhcPass p) -> SDoc
ppr_fun_ty LHsType (GhcPass p)
ty1 LHsType (GhcPass p)
ty2
= let p1 :: SDoc
p1 = LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty1
p2 :: SDoc
p2 = LHsType (GhcPass p) -> SDoc
forall (p :: Pass).
OutputableBndrId p =>
LHsType (GhcPass p) -> SDoc
Evidence bound by a type signature of the constraint type OutputableBndrId p
ppr_mono_lty LHsType (GhcPass p)
ty2
in
[SDoc] -> SDoc
sep [SDoc
p1, SDoc
arrow SDoc -> SDoc -> SDoc
<+> SDoc
p2]
ppr_tylit :: HsTyLit -> SDoc
ppr_tylit :: HsTyLit -> SDoc
ppr_tylit (HsNumTy SourceText
_ Integer
i) = Integer -> SDoc
integer Integer
i
ppr_tylit (HsStrTy SourceText
_ FastString
s) = String -> SDoc
text (FastString -> String
forall a. Show a => a -> String
External instance of the constraint type Show FastString
show FastString
s)
hsTypeNeedsParens :: PprPrec -> HsType pass -> Bool
hsTypeNeedsParens :: PprPrec -> HsType pass -> Bool
hsTypeNeedsParens PprPrec
p = HsType pass -> Bool
go
where
go :: HsType pass -> Bool
go (HsForAllTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
funPrec
go (HsQualTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
funPrec
go (HsBangTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
> PprPrec
topPrec
go (HsRecTy{}) = Bool
False
go (HsTyVar{}) = Bool
False
go (HsFunTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
funPrec
go (HsTupleTy{}) = Bool
False
go (HsSumTy{}) = Bool
False
go (HsKindSig{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
sigPrec
go (HsListTy{}) = Bool
False
go (HsIParamTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
> PprPrec
topPrec
go (HsSpliceTy{}) = Bool
False
go (HsExplicitListTy{}) = Bool
False
go (HsExplicitTupleTy{}) = Bool
False
go (HsTyLit{}) = Bool
False
go (HsWildCardTy{}) = Bool
False
go (HsStarTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
starPrec
go (HsAppTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
appPrec
go (HsAppKindTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
appPrec
go (HsOpTy{}) = PprPrec
p PprPrec -> PprPrec -> Bool
forall a. Ord a => a -> a -> Bool
External instance of the constraint type Ord PprPrec
>= PprPrec
opPrec
go (HsParTy{}) = Bool
False
go (HsDocTy XDocTy pass
_ (L SrcSpan
_ HsType pass
t) LHsDocString
_) = HsType pass -> Bool
go HsType pass
t
go (XHsType{}) = Bool
False
maybeAddSpace :: [LHsType pass] -> SDoc -> SDoc
maybeAddSpace :: [LHsType pass] -> SDoc -> SDoc
maybeAddSpace [LHsType pass]
tys SDoc
doc
| (LHsType pass
ty : [LHsType pass]
_) <- [LHsType pass]
tys
, LHsType pass -> Bool
forall pass. LHsType pass -> Bool
lhsTypeHasLeadingPromotionQuote LHsType pass
ty = SDoc
space SDoc -> SDoc -> SDoc
<> SDoc
doc
| Bool
otherwise = SDoc
doc
lhsTypeHasLeadingPromotionQuote :: LHsType pass -> Bool
lhsTypeHasLeadingPromotionQuote :: LHsType pass -> Bool
lhsTypeHasLeadingPromotionQuote LHsType pass
ty
= LHsType pass -> Bool
forall pass. LHsType pass -> Bool
goL LHsType pass
ty
where
goL :: GenLocated SrcSpan (HsType pass) -> Bool
goL (L SrcSpan
_ HsType pass
ty) = HsType pass -> Bool
go HsType pass
ty
go :: HsType pass -> Bool
go (HsForAllTy{}) = Bool
False
go (HsQualTy{ hst_ctxt :: forall pass. HsType pass -> LHsContext pass
hst_ctxt = LHsContext pass
ctxt, hst_body :: forall pass. HsType pass -> LHsType pass
hst_body = GenLocated SrcSpan (HsType pass)
body})
| L SrcSpan
_ (GenLocated SrcSpan (HsType pass)
c:[GenLocated SrcSpan (HsType pass)]
_) <- LHsContext pass
ctxt = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
c
| Bool
otherwise = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
body
go (HsBangTy{}) = Bool
False
go (HsRecTy{}) = Bool
False
go (HsTyVar XTyVar pass
_ PromotionFlag
p Located (IdP pass)
_) = PromotionFlag -> Bool
isPromoted PromotionFlag
p
go (HsFunTy XFunTy pass
_ GenLocated SrcSpan (HsType pass)
arg GenLocated SrcSpan (HsType pass)
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
arg
go (HsListTy{}) = Bool
False
go (HsTupleTy{}) = Bool
False
go (HsSumTy{}) = Bool
False
go (HsOpTy XOpTy pass
_ GenLocated SrcSpan (HsType pass)
t1 Located (IdP pass)
_ GenLocated SrcSpan (HsType pass)
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
t1
go (HsKindSig XKindSig pass
_ GenLocated SrcSpan (HsType pass)
t GenLocated SrcSpan (HsType pass)
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
t
go (HsIParamTy{}) = Bool
False
go (HsSpliceTy{}) = Bool
False
go (HsExplicitListTy XExplicitListTy pass
_ PromotionFlag
p [GenLocated SrcSpan (HsType pass)]
_) = PromotionFlag -> Bool
isPromoted PromotionFlag
p
go (HsExplicitTupleTy{}) = Bool
True
go (HsTyLit{}) = Bool
False
go (HsWildCardTy{}) = Bool
False
go (HsStarTy{}) = Bool
False
go (HsAppTy XAppTy pass
_ GenLocated SrcSpan (HsType pass)
t GenLocated SrcSpan (HsType pass)
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
t
go (HsAppKindTy XAppKindTy pass
_ GenLocated SrcSpan (HsType pass)
t GenLocated SrcSpan (HsType pass)
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
t
go (HsParTy{}) = Bool
False
go (HsDocTy XDocTy pass
_ GenLocated SrcSpan (HsType pass)
t LHsDocString
_) = GenLocated SrcSpan (HsType pass) -> Bool
goL GenLocated SrcSpan (HsType pass)
t
go (XHsType{}) = Bool
False
parenthesizeHsType :: PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
parenthesizeHsType :: PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
parenthesizeHsType PprPrec
p lty :: LHsType (GhcPass p)
lty@(L SrcSpan
loc HsType (GhcPass p)
ty)
| PprPrec -> HsType (GhcPass p) -> Bool
forall pass. PprPrec -> HsType pass -> Bool
hsTypeNeedsParens PprPrec
p HsType (GhcPass p)
ty = SrcSpan -> HsType (GhcPass p) -> LHsType (GhcPass p)
forall l e. l -> e -> GenLocated l e
L SrcSpan
loc (XParTy (GhcPass p) -> LHsType (GhcPass p) -> HsType (GhcPass p)
forall pass. XParTy pass -> LHsType pass -> HsType pass
HsParTy XParTy (GhcPass p)
NoExtField
noExtField LHsType (GhcPass p)
lty)
| Bool
otherwise = LHsType (GhcPass p)
lty
parenthesizeHsContext :: PprPrec
-> LHsContext (GhcPass p) -> LHsContext (GhcPass p)
parenthesizeHsContext :: PprPrec -> LHsContext (GhcPass p) -> LHsContext (GhcPass p)
parenthesizeHsContext PprPrec
p lctxt :: LHsContext (GhcPass p)
lctxt@(L SrcSpan
loc HsContext (GhcPass p)
ctxt) =
case HsContext (GhcPass p)
ctxt of
[LHsType (GhcPass p)
c] -> SrcSpan -> HsContext (GhcPass p) -> LHsContext (GhcPass p)
forall l e. l -> e -> GenLocated l e
L SrcSpan
loc [PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
forall (p :: Pass).
PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
parenthesizeHsType PprPrec
p LHsType (GhcPass p)
c]
HsContext (GhcPass p)
_ -> LHsContext (GhcPass p)
lctxt