{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Language.Haskell.Syntax.Type (
Mult, HsScaled(..),
hsMult, hsScaledThing,
HsArrow(..),
hsLinear, hsUnrestricted,
HsType(..), HsCoreTy, LHsType, HsKind, LHsKind,
HsForAllTelescope(..), HsTyVarBndr(..), LHsTyVarBndr,
LHsQTyVars(..),
HsOuterTyVarBndrs(..), HsOuterFamEqnTyVarBndrs, HsOuterSigTyVarBndrs,
HsWildCardBndrs(..),
HsPatSigType(..), HsPSRn(..),
HsSigType(..), LHsSigType, LHsSigWcType, LHsWcType,
HsTupleSort(..),
HsContext, LHsContext,
HsTyLit(..),
HsIPName(..), hsIPNameFS,
HsArg(..), numVisibleArgs,
LHsTypeArg,
LBangType, BangType,
HsSrcBang(..), HsImplBang(..),
SrcStrictness(..), SrcUnpackedness(..),
ConDeclField(..), LConDeclField,
HsConDetails(..), noTypeArgs,
FieldOcc(..), LFieldOcc,
AmbiguousFieldOcc(..),
mapHsOuterImplicit,
hsQTvExplicit,
isHsKindedTyVar,
hsPatSigType,
) where
#include "HsVersions.h"
import GHC.Prelude
import {-# SOURCE #-} Language.Haskell.Syntax.Expr ( HsSplice )
import Language.Haskell.Syntax.Extension
import GHC.Types.SourceText
import GHC.Types.Name( Name )
import GHC.Types.Name.Reader ( RdrName )
import GHC.Core.DataCon( HsSrcBang(..), HsImplBang(..),
SrcStrictness(..), SrcUnpackedness(..) )
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.Utils.Misc ( count )
import GHC.Parser.Annotation
import Data.Data hiding ( Fixity, Prefix, Infix )
import Data.Void
type LBangType pass = XRec pass (BangType pass)
type BangType pass = HsType pass
type LHsContext pass = XRec pass (HsContext pass)
type HsContext pass = [LHsType pass]
type LHsType pass = XRec pass (HsType pass)
type HsKind pass = HsType pass
type LHsKind pass = XRec pass (HsKind pass)
data HsForAllTelescope pass
= HsForAllVis
{ forall pass. HsForAllTelescope pass -> XHsForAllVis pass
hsf_xvis :: XHsForAllVis pass
, forall pass. HsForAllTelescope pass -> [LHsTyVarBndr () pass]
hsf_vis_bndrs :: [LHsTyVarBndr () pass]
}
| HsForAllInvis
{ forall pass. HsForAllTelescope pass -> XHsForAllInvis pass
hsf_xinvis :: XHsForAllInvis pass
, forall pass.
HsForAllTelescope pass -> [LHsTyVarBndr Specificity pass]
hsf_invis_bndrs :: [LHsTyVarBndr Specificity pass]
}
| XHsForAllTelescope !(XXHsForAllTelescope pass)
type LHsTyVarBndr flag pass = XRec pass (HsTyVarBndr flag pass)
data LHsQTyVars pass
= HsQTvs { forall pass. LHsQTyVars pass -> XHsQTvs pass
hsq_ext :: XHsQTvs pass
, forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit :: [LHsTyVarBndr () pass]
}
| XLHsQTyVars !(XXLHsQTyVars pass)
hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit :: forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsQTvExplicit = LHsQTyVars pass -> [LHsTyVarBndr () pass]
forall pass. LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsq_explicit
data HsOuterTyVarBndrs flag pass
= HsOuterImplicit
{ forall flag pass.
HsOuterTyVarBndrs flag pass -> XHsOuterImplicit pass
hso_ximplicit :: XHsOuterImplicit pass
}
| HsOuterExplicit
{ forall flag pass.
HsOuterTyVarBndrs flag pass -> XHsOuterExplicit pass flag
hso_xexplicit :: XHsOuterExplicit pass flag
, forall flag pass.
HsOuterTyVarBndrs flag pass -> [LHsTyVarBndr flag (NoGhcTc pass)]
hso_bndrs :: [LHsTyVarBndr flag (NoGhcTc pass)]
}
| XHsOuterTyVarBndrs !(XXHsOuterTyVarBndrs pass)
type HsOuterSigTyVarBndrs = HsOuterTyVarBndrs Specificity
type HsOuterFamEqnTyVarBndrs = HsOuterTyVarBndrs ()
data HsWildCardBndrs pass thing
= HsWC { forall pass thing. HsWildCardBndrs pass thing -> XHsWC pass thing
hswc_ext :: XHsWC pass thing
, forall pass thing. HsWildCardBndrs pass thing -> thing
hswc_body :: thing
}
| XHsWildCardBndrs !(XXHsWildCardBndrs pass thing)
data HsPatSigType pass
= HsPS { forall pass. HsPatSigType pass -> XHsPS pass
hsps_ext :: XHsPS pass
, forall 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
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> HsPSRn -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsPSRn -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsPSRn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsPSRn -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
Data
type LHsSigType pass = XRec pass (HsSigType pass)
type LHsWcType pass = HsWildCardBndrs pass (LHsType pass)
type LHsSigWcType pass = HsWildCardBndrs pass (LHsSigType pass)
data HsSigType pass
= HsSig { forall pass. HsSigType pass -> XHsSig pass
sig_ext :: XHsSig pass
, forall pass. HsSigType pass -> HsOuterSigTyVarBndrs pass
sig_bndrs :: HsOuterSigTyVarBndrs pass
, forall pass. HsSigType pass -> LHsType pass
sig_body :: LHsType pass
}
| XHsSigType !(XXHsSigType pass)
hsPatSigType :: HsPatSigType pass -> LHsType pass
hsPatSigType :: forall pass. HsPatSigType pass -> LHsType pass
hsPatSigType = HsPatSigType pass -> LHsType pass
forall pass. HsPatSigType pass -> LHsType pass
hsps_body
mapHsOuterImplicit :: (XHsOuterImplicit pass -> XHsOuterImplicit pass)
-> HsOuterTyVarBndrs flag pass
-> HsOuterTyVarBndrs flag pass
mapHsOuterImplicit :: forall pass flag.
(XHsOuterImplicit pass -> XHsOuterImplicit pass)
-> HsOuterTyVarBndrs flag pass -> HsOuterTyVarBndrs flag pass
mapHsOuterImplicit XHsOuterImplicit pass -> XHsOuterImplicit pass
f (HsOuterImplicit{hso_ximplicit :: forall flag pass.
HsOuterTyVarBndrs flag pass -> XHsOuterImplicit pass
hso_ximplicit = XHsOuterImplicit pass
imp}) =
HsOuterImplicit{hso_ximplicit :: XHsOuterImplicit pass
hso_ximplicit = XHsOuterImplicit pass -> XHsOuterImplicit pass
f XHsOuterImplicit pass
imp}
mapHsOuterImplicit XHsOuterImplicit pass -> XHsOuterImplicit pass
_ hso :: HsOuterTyVarBndrs flag pass
hso@(HsOuterExplicit{}) = HsOuterTyVarBndrs flag pass
hso
mapHsOuterImplicit XHsOuterImplicit pass -> XHsOuterImplicit pass
_ hso :: HsOuterTyVarBndrs flag pass
hso@(XHsOuterTyVarBndrs{}) = HsOuterTyVarBndrs flag pass
hso
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
Eq, Typeable HsIPName
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> HsIPName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsIPName -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsIPName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsIPName -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
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
ppr HsIPName
n
pprInfixOcc :: HsIPName -> SDoc
pprInfixOcc HsIPName
n = HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
ppr HsIPName
n
pprPrefixOcc :: HsIPName -> SDoc
pprPrefixOcc HsIPName
n = HsIPName -> SDoc
forall a. Outputable a => a -> SDoc
ppr HsIPName
n
data HsTyVarBndr flag pass
= UserTyVar
(XUserTyVar pass)
flag
(LIdP pass)
| KindedTyVar
(XKindedTyVar pass)
flag
(LIdP pass)
(LHsKind pass)
| XTyVarBndr
!(XXTyVarBndr pass)
isHsKindedTyVar :: HsTyVarBndr flag pass -> Bool
isHsKindedTyVar :: forall flag pass. HsTyVarBndr flag pass -> Bool
isHsKindedTyVar (UserTyVar {}) = Bool
False
isHsKindedTyVar (KindedTyVar {}) = Bool
True
isHsKindedTyVar (XTyVarBndr {}) = Bool
False
data HsType pass
= HsForAllTy
{ forall pass. HsType pass -> XForAllTy pass
hst_xforall :: XForAllTy pass
, forall pass. HsType pass -> HsForAllTelescope pass
hst_tele :: HsForAllTelescope pass
, forall pass. HsType pass -> LHsType pass
hst_body :: LHsType pass
}
| HsQualTy
{ forall pass. HsType pass -> XQualTy pass
hst_xqual :: XQualTy pass
, forall pass. HsType pass -> Maybe (LHsContext pass)
hst_ctxt :: Maybe (LHsContext pass)
, hst_body :: LHsType pass }
| HsTyVar (XTyVar pass)
PromotionFlag
(LIdP pass)
| HsAppTy (XAppTy pass)
(LHsType pass)
(LHsType pass)
| HsAppKindTy (XAppKindTy pass)
(LHsType pass)
(LHsKind pass)
| HsFunTy (XFunTy pass)
(HsArrow 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) (LIdP pass) (LHsType pass)
| HsParTy (XParTy pass)
(LHsType pass)
| HsIParamTy (XIParamTy pass)
(XRec pass 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)
type HsCoreTy = Type
data HsTyLit
= HsNumTy SourceText Integer
| HsStrTy SourceText FastString
| HsCharTy SourceText Char
deriving Typeable HsTyLit
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> HsTyLit -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsTyLit -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsTyLit -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsTyLit -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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
Data
data HsArrow pass
= HsUnrestrictedArrow IsUnicodeSyntax
| HsLinearArrow IsUnicodeSyntax (Maybe AddEpAnn)
| HsExplicitMult IsUnicodeSyntax (Maybe AddEpAnn) (LHsType pass)
data HsScaled pass a = HsScaled (HsArrow pass) a
hsMult :: HsScaled pass a -> HsArrow pass
hsMult :: forall pass a. HsScaled pass a -> HsArrow pass
hsMult (HsScaled HsArrow pass
m a
_) = HsArrow pass
m
hsScaledThing :: HsScaled pass a -> a
hsScaledThing :: forall pass a. HsScaled pass a -> a
hsScaledThing (HsScaled HsArrow pass
_ a
t) = a
t
hsUnrestricted, hsLinear :: a -> HsScaled pass a
hsUnrestricted :: forall a pass. a -> HsScaled pass a
hsUnrestricted = HsArrow pass -> a -> HsScaled pass a
forall pass a. HsArrow pass -> a -> HsScaled pass a
HsScaled (IsUnicodeSyntax -> HsArrow pass
forall pass. IsUnicodeSyntax -> HsArrow pass
HsUnrestrictedArrow IsUnicodeSyntax
NormalSyntax)
hsLinear :: forall a pass. a -> HsScaled pass a
hsLinear = HsArrow pass -> a -> HsScaled pass a
forall pass a. HsArrow pass -> a -> HsScaled pass a
HsScaled (IsUnicodeSyntax -> Maybe AddEpAnn -> HsArrow pass
forall pass. IsUnicodeSyntax -> Maybe AddEpAnn -> HsArrow pass
HsLinearArrow IsUnicodeSyntax
NormalSyntax Maybe AddEpAnn
forall a. Maybe a
Nothing)
instance Outputable a => Outputable (HsScaled pass a) where
ppr :: HsScaled pass a -> SDoc
ppr (HsScaled HsArrow pass
_cnt a
t) =
a -> SDoc
forall a. Outputable a => a -> SDoc
ppr a
t
data HsTupleSort = HsUnboxedTuple
| HsBoxedOrConstraintTuple
deriving Typeable HsTupleSort
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 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)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
MonadPlus m =>
(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 (m :: * -> *).
Monad m =>
(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 :: forall u. Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HsTupleSort -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> HsTupleSort -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HsTupleSort -> [u]
gmapQr :: forall r r'.
(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 :: forall r r'.
(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 (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(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 (t :: * -> *) (c :: * -> *).
Typeable t =>
(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 (c :: * -> *).
(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 (c :: * -> *).
(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 = XRec pass (ConDeclField pass)
data ConDeclField pass
= ConDeclField { forall pass. ConDeclField pass -> XConDeclField pass
cd_fld_ext :: XConDeclField pass,
forall pass. ConDeclField pass -> [LFieldOcc pass]
cd_fld_names :: [LFieldOcc pass],
forall pass. ConDeclField pass -> LBangType pass
cd_fld_type :: LBangType pass,
forall pass. ConDeclField pass -> Maybe LHsDocString
cd_fld_doc :: Maybe LHsDocString }
| XConDeclField !(XXConDeclField pass)
data HsConDetails tyarg arg rec
= PrefixCon [tyarg] [arg]
| RecCon rec
| InfixCon arg arg
deriving Typeable (HsConDetails tyarg arg rec)
Typeable (HsConDetails tyarg arg rec)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails tyarg arg rec
-> c (HsConDetails tyarg arg rec))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (HsConDetails tyarg arg rec))
-> (HsConDetails tyarg arg rec -> Constr)
-> (HsConDetails tyarg arg rec -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (HsConDetails tyarg arg rec)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails tyarg arg rec)))
-> ((forall b. Data b => b -> b)
-> HsConDetails tyarg arg rec -> HsConDetails tyarg arg rec)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec))
-> Data (HsConDetails tyarg arg rec)
HsConDetails tyarg arg rec -> DataType
HsConDetails tyarg arg rec -> Constr
(forall b. Data b => b -> b)
-> HsConDetails tyarg arg rec -> HsConDetails tyarg 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 tyarg arg rec -> u
forall u.
(forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
forall {tyarg} {arg} {rec}.
(Data tyarg, Data arg, Data rec) =>
Typeable (HsConDetails tyarg arg rec)
forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
HsConDetails tyarg arg rec -> DataType
forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
HsConDetails tyarg arg rec -> Constr
forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
(forall b. Data b => b -> b)
-> HsConDetails tyarg arg rec -> HsConDetails tyarg arg rec
forall tyarg arg rec u.
(Data tyarg, Data arg, Data rec) =>
Int
-> (forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> u
forall tyarg arg rec u.
(Data tyarg, Data arg, Data rec) =>
(forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> [u]
forall tyarg arg rec r r'.
(Data tyarg, Data arg, Data rec) =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
forall tyarg arg rec r r'.
(Data tyarg, Data arg, Data rec) =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
forall tyarg arg rec (m :: * -> *).
(Data tyarg, Data arg, Data rec, Monad m) =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
forall tyarg arg rec (m :: * -> *).
(Data tyarg, Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
forall tyarg arg rec (c :: * -> *).
(Data tyarg, Data arg, Data rec) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails tyarg arg rec)
forall tyarg arg rec (c :: * -> *).
(Data tyarg, Data arg, Data rec) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails tyarg arg rec
-> c (HsConDetails tyarg arg rec)
forall tyarg arg rec (t :: * -> *) (c :: * -> *).
(Data tyarg, Data arg, Data rec, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (HsConDetails tyarg arg rec))
forall tyarg arg rec (t :: * -> * -> *) (c :: * -> *).
(Data tyarg, Data arg, Data rec, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails tyarg arg rec))
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails tyarg arg rec)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails tyarg arg rec
-> c (HsConDetails tyarg arg rec)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (HsConDetails tyarg arg rec))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails tyarg arg rec))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
$cgmapMo :: forall tyarg arg rec (m :: * -> *).
(Data tyarg, Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
$cgmapMp :: forall tyarg arg rec (m :: * -> *).
(Data tyarg, Data arg, Data rec, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
$cgmapM :: forall tyarg arg rec (m :: * -> *).
(Data tyarg, Data arg, Data rec, Monad m) =>
(forall d. Data d => d -> m d)
-> HsConDetails tyarg arg rec -> m (HsConDetails tyarg arg rec)
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> u
$cgmapQi :: forall tyarg arg rec u.
(Data tyarg, Data arg, Data rec) =>
Int
-> (forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> [u]
$cgmapQ :: forall tyarg arg rec u.
(Data tyarg, Data arg, Data rec) =>
(forall d. Data d => d -> u) -> HsConDetails tyarg arg rec -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
$cgmapQr :: forall tyarg arg rec r r'.
(Data tyarg, Data arg, Data rec) =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
$cgmapQl :: forall tyarg arg rec r r'.
(Data tyarg, Data arg, Data rec) =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> HsConDetails tyarg arg rec
-> r
gmapT :: (forall b. Data b => b -> b)
-> HsConDetails tyarg arg rec -> HsConDetails tyarg arg rec
$cgmapT :: forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
(forall b. Data b => b -> b)
-> HsConDetails tyarg arg rec -> HsConDetails tyarg arg rec
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails tyarg arg rec))
$cdataCast2 :: forall tyarg arg rec (t :: * -> * -> *) (c :: * -> *).
(Data tyarg, Data arg, Data rec, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (HsConDetails tyarg arg rec))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (HsConDetails tyarg arg rec))
$cdataCast1 :: forall tyarg arg rec (t :: * -> *) (c :: * -> *).
(Data tyarg, Data arg, Data rec, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (HsConDetails tyarg arg rec))
dataTypeOf :: HsConDetails tyarg arg rec -> DataType
$cdataTypeOf :: forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
HsConDetails tyarg arg rec -> DataType
toConstr :: HsConDetails tyarg arg rec -> Constr
$ctoConstr :: forall tyarg arg rec.
(Data tyarg, Data arg, Data rec) =>
HsConDetails tyarg arg rec -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails tyarg arg rec)
$cgunfold :: forall tyarg arg rec (c :: * -> *).
(Data tyarg, Data arg, Data rec) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (HsConDetails tyarg arg rec)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails tyarg arg rec
-> c (HsConDetails tyarg arg rec)
$cgfoldl :: forall tyarg arg rec (c :: * -> *).
(Data tyarg, Data arg, Data rec) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> HsConDetails tyarg arg rec
-> c (HsConDetails tyarg arg rec)
Data
noTypeArgs :: [Void]
noTypeArgs :: [Void]
noTypeArgs = []
instance (Outputable tyarg, Outputable arg, Outputable rec)
=> Outputable (HsConDetails tyarg arg rec) where
ppr :: HsConDetails tyarg arg rec -> SDoc
ppr (PrefixCon [tyarg]
tyargs [arg]
args) = String -> SDoc
text String
"PrefixCon:" SDoc -> SDoc -> SDoc
<+> [SDoc] -> SDoc
hsep ((tyarg -> SDoc) -> [tyarg] -> [SDoc]
forall a b. (a -> b) -> [a] -> [b]
map (\tyarg
t -> String -> SDoc
text String
"@" SDoc -> SDoc -> SDoc
<> tyarg -> SDoc
forall a. Outputable a => a -> SDoc
ppr tyarg
t) [tyarg]
tyargs) SDoc -> SDoc -> SDoc
<+> [arg] -> SDoc
forall a. Outputable a => a -> SDoc
ppr [arg]
args
ppr (RecCon rec
rec) = String -> SDoc
text String
"RecCon:" SDoc -> SDoc -> SDoc
<+> rec -> SDoc
forall a. Outputable a => a -> SDoc
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
ppr [arg
l, arg
r]
data HsArg tm ty
= HsValArg tm
| HsTypeArg SrcSpan ty
| HsArgPar SrcSpan
numVisibleArgs :: [HsArg tm ty] -> Arity
numVisibleArgs :: forall tm ty. [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
ppr tm
tm
ppr (HsTypeArg SrcSpan
_ ty
ty) = Char -> SDoc
char Char
'@' SDoc -> SDoc -> SDoc
<> ty -> SDoc
forall a. Outputable a => a -> SDoc
ppr ty
ty
ppr (HsArgPar SrcSpan
sp) = String -> SDoc
text String
"HsArgPar" SDoc -> SDoc -> SDoc
<+> SrcSpan -> SDoc
forall a. Outputable a => a -> SDoc
ppr SrcSpan
sp
type LFieldOcc pass = XRec pass (FieldOcc pass)
data FieldOcc pass = FieldOcc { forall pass. FieldOcc pass -> XCFieldOcc pass
extFieldOcc :: XCFieldOcc pass
, forall pass. FieldOcc pass -> LocatedN RdrName
rdrNameFieldOcc :: LocatedN RdrName
}
| XFieldOcc
!(XXFieldOcc pass)
deriving instance (Eq (XCFieldOcc pass), Eq (XXFieldOcc pass)) => Eq (FieldOcc pass)
instance Outputable (FieldOcc pass) where
ppr :: FieldOcc pass -> SDoc
ppr = LocatedN RdrName -> SDoc
forall a. Outputable a => a -> SDoc
ppr (LocatedN RdrName -> SDoc)
-> (FieldOcc pass -> LocatedN RdrName) -> FieldOcc pass -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FieldOcc pass -> LocatedN RdrName
forall pass. FieldOcc pass -> LocatedN RdrName
rdrNameFieldOcc
instance OutputableBndr (FieldOcc pass) where
pprInfixOcc :: FieldOcc pass -> SDoc
pprInfixOcc = RdrName -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprInfixOcc (RdrName -> SDoc)
-> (FieldOcc pass -> RdrName) -> FieldOcc pass -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LocatedN RdrName -> RdrName
forall l e. GenLocated l e -> e
unLoc (LocatedN RdrName -> RdrName)
-> (FieldOcc pass -> LocatedN RdrName) -> FieldOcc pass -> RdrName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FieldOcc pass -> LocatedN RdrName
forall pass. FieldOcc pass -> LocatedN RdrName
rdrNameFieldOcc
pprPrefixOcc :: FieldOcc pass -> SDoc
pprPrefixOcc = RdrName -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprPrefixOcc (RdrName -> SDoc)
-> (FieldOcc pass -> RdrName) -> FieldOcc pass -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LocatedN RdrName -> RdrName
forall l e. GenLocated l e -> e
unLoc (LocatedN RdrName -> RdrName)
-> (FieldOcc pass -> LocatedN RdrName) -> FieldOcc pass -> RdrName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FieldOcc pass -> LocatedN RdrName
forall pass. FieldOcc pass -> LocatedN RdrName
rdrNameFieldOcc
instance OutputableBndr (GenLocated SrcSpan (FieldOcc pass)) where
pprInfixOcc :: GenLocated SrcSpan (FieldOcc pass) -> SDoc
pprInfixOcc = FieldOcc pass -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprInfixOcc (FieldOcc pass -> SDoc)
-> (GenLocated SrcSpan (FieldOcc pass) -> FieldOcc pass)
-> GenLocated SrcSpan (FieldOcc pass)
-> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLocated SrcSpan (FieldOcc pass) -> FieldOcc pass
forall l e. GenLocated l e -> e
unLoc
pprPrefixOcc :: GenLocated SrcSpan (FieldOcc pass) -> SDoc
pprPrefixOcc = FieldOcc pass -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprPrefixOcc (FieldOcc pass -> SDoc)
-> (GenLocated SrcSpan (FieldOcc pass) -> FieldOcc pass)
-> GenLocated SrcSpan (FieldOcc pass)
-> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLocated SrcSpan (FieldOcc pass) -> FieldOcc pass
forall l e. GenLocated l e -> e
unLoc
data AmbiguousFieldOcc pass
= Unambiguous (XUnambiguous pass) (LocatedN RdrName)
| Ambiguous (XAmbiguous pass) (LocatedN RdrName)
| XAmbiguousFieldOcc !(XXAmbiguousFieldOcc pass)
instance Outputable HsTyLit where
ppr :: HsTyLit -> SDoc
ppr = HsTyLit -> SDoc
ppr_tylit
ppr_tylit :: HsTyLit -> SDoc
ppr_tylit :: HsTyLit -> SDoc
ppr_tylit (HsNumTy SourceText
source Integer
i) = SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
source (Integer -> SDoc
integer Integer
i)
ppr_tylit (HsStrTy SourceText
source FastString
s) = SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
source (String -> SDoc
text (FastString -> String
forall a. Show a => a -> String
show FastString
s))
ppr_tylit (HsCharTy SourceText
source Char
c) = SourceText -> SDoc -> SDoc
pprWithSourceText SourceText
source (String -> SDoc
text (Char -> String
forall a. Show a => a -> String
show Char
c))