{-# LANGUAGE CPP, FlexibleContexts, MultiWayIf, FlexibleInstances, DeriveDataTypeable #-}
module Var (
Var, CoVar, Id, NcId, DictId, DFunId, EvVar, EqVar, EvId, IpId, JoinId,
TyVar, TcTyVar, TypeVar, KindVar, TKVar, TyCoVar,
InVar, InCoVar, InId, InTyVar,
OutVar, OutCoVar, OutId, OutTyVar,
varName, varUnique, varType,
setVarName, setVarUnique, setVarType, updateVarType,
updateVarTypeM,
mkGlobalVar, mkLocalVar, mkExportedLocalVar, mkCoVar,
idInfo, idDetails,
lazySetIdInfo, setIdDetails, globaliseId,
setIdExported, setIdNotExported,
isId, isTyVar, isTcTyVar,
isLocalVar, isLocalId, isCoVar, isNonCoVarId, isTyCoVar,
isGlobalId, isExportedId,
mustHaveLocalBinding,
ArgFlag(..), isVisibleArgFlag, isInvisibleArgFlag, sameVis,
AnonArgFlag(..), ForallVisFlag(..), argToForallVisFlag,
VarBndr(..), TyCoVarBinder, TyVarBinder,
binderVar, binderVars, binderArgFlag, binderType,
mkTyCoVarBinder, mkTyCoVarBinders,
mkTyVarBinder, mkTyVarBinders,
isTyVarBinder,
mkTyVar, mkTcTyVar,
tyVarName, tyVarKind, tcTyVarDetails, setTcTyVarDetails,
setTyVarName, setTyVarUnique, setTyVarKind, updateTyVarKind,
updateTyVarKindM,
nonDetCmpVar
) where
#include "GhclibHsVersions.h"
import GhcPrelude
import {-# SOURCE #-} TyCoRep( Type, Kind )
import {-# SOURCE #-} TyCoPpr( pprKind )
import {-# SOURCE #-} TcType( TcTyVarDetails, pprTcTyVarDetails, vanillaSkolemTv )
import {-# SOURCE #-} IdInfo( IdDetails, IdInfo, coVarDetails, isCoVarDetails,
vanillaIdInfo, pprIdDetails )
import Name hiding (varName)
import Unique ( Uniquable, Unique, getKey, getUnique
, mkUniqueGrimily, nonDetCmpUnique )
import Util
import Binary
import DynFlags
import Outputable
import Data.Data
type Id = Var
type CoVar = Id
type NcId = Id
type TyVar = Var
type TKVar = Var
type TcTyVar = Var
type TypeVar = Var
type KindVar = Var
type EvId = Id
type EvVar = EvId
type DFunId = Id
type DictId = EvId
type IpId = EvId
type EqVar = EvId
type JoinId = Id
type TyCoVar = Id
type InVar = Var
type InTyVar = TyVar
type InCoVar = CoVar
type InId = Id
type OutVar = Var
type OutTyVar = TyVar
type OutCoVar = CoVar
type OutId = Id
data Var
= TyVar {
Var -> Name
varName :: !Name,
Var -> Int
realUnique :: {-# UNPACK #-} !Int,
Var -> Kind
varType :: Kind
}
| TcTyVar {
varName :: !Name,
realUnique :: {-# UNPACK #-} !Int,
varType :: Kind,
Var -> TcTyVarDetails
tc_tv_details :: TcTyVarDetails
}
| Id {
varName :: !Name,
realUnique :: {-# UNPACK #-} !Int,
varType :: Type,
Var -> IdScope
idScope :: IdScope,
Var -> IdDetails
id_details :: IdDetails,
Var -> IdInfo
id_info :: IdInfo }
data IdScope
= GlobalId
| LocalId ExportFlag
data ExportFlag
= NotExported
| Exported
instance Outputable Var where
ppr :: Var -> SDoc
ppr Var
var = (DynFlags -> SDoc) -> SDoc
sdocWithDynFlags ((DynFlags -> SDoc) -> SDoc) -> (DynFlags -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \DynFlags
dflags ->
(PprStyle -> SDoc) -> SDoc
getPprStyle ((PprStyle -> SDoc) -> SDoc) -> (PprStyle -> SDoc) -> SDoc
forall a b. (a -> b) -> a -> b
$ \PprStyle
ppr_style ->
if | PprStyle -> Bool
debugStyle PprStyle
ppr_style Bool -> Bool -> Bool
&& (Bool -> Bool
not (GeneralFlag -> DynFlags -> Bool
gopt GeneralFlag
Opt_SuppressVarKinds DynFlags
dflags))
-> SDoc -> SDoc
parens (Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr (Var -> Name
varName Var
var) SDoc -> SDoc -> SDoc
<+> Var -> PprStyle -> SDoc
ppr_debug Var
var PprStyle
ppr_style SDoc -> SDoc -> SDoc
<+>
SDoc
dcolon SDoc -> SDoc -> SDoc
<+> Kind -> SDoc
pprKind (Var -> Kind
tyVarKind Var
var))
| Bool
otherwise
-> Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr (Var -> Name
varName Var
var) SDoc -> SDoc -> SDoc
<> Var -> PprStyle -> SDoc
ppr_debug Var
var PprStyle
ppr_style
ppr_debug :: Var -> PprStyle -> SDoc
ppr_debug :: Var -> PprStyle -> SDoc
ppr_debug (TyVar {}) PprStyle
sty
| PprStyle -> Bool
debugStyle PprStyle
sty = SDoc -> SDoc
brackets (String -> SDoc
text String
"tv")
ppr_debug (TcTyVar {tc_tv_details :: Var -> TcTyVarDetails
tc_tv_details = TcTyVarDetails
d}) PprStyle
sty
| PprStyle -> Bool
dumpStyle PprStyle
sty Bool -> Bool -> Bool
|| PprStyle -> Bool
debugStyle PprStyle
sty = SDoc -> SDoc
brackets (TcTyVarDetails -> SDoc
pprTcTyVarDetails TcTyVarDetails
d)
ppr_debug (Id { idScope :: Var -> IdScope
idScope = IdScope
s, id_details :: Var -> IdDetails
id_details = IdDetails
d }) PprStyle
sty
| PprStyle -> Bool
debugStyle PprStyle
sty = SDoc -> SDoc
brackets (IdScope -> SDoc
ppr_id_scope IdScope
s SDoc -> SDoc -> SDoc
<> IdDetails -> SDoc
pprIdDetails IdDetails
d)
ppr_debug Var
_ PprStyle
_ = SDoc
empty
ppr_id_scope :: IdScope -> SDoc
ppr_id_scope :: IdScope -> SDoc
ppr_id_scope IdScope
GlobalId = String -> SDoc
text String
"gid"
ppr_id_scope (LocalId ExportFlag
Exported) = String -> SDoc
text String
"lidx"
ppr_id_scope (LocalId ExportFlag
NotExported) = String -> SDoc
text String
"lid"
instance NamedThing Var where
getName :: Var -> Name
getName = Var -> Name
varName
instance Uniquable Var where
getUnique :: Var -> Unique
getUnique = Var -> Unique
varUnique
instance Eq Var where
Var
a == :: Var -> Var -> Bool
== Var
b = Var -> Int
realUnique Var
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Var -> Int
realUnique Var
b
instance Ord Var where
Var
a <= :: Var -> Var -> Bool
<= Var
b = Var -> Int
realUnique Var
a Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Var -> Int
realUnique Var
b
Var
a < :: Var -> Var -> Bool
< Var
b = Var -> Int
realUnique Var
a Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Var -> Int
realUnique Var
b
Var
a >= :: Var -> Var -> Bool
>= Var
b = Var -> Int
realUnique Var
a Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Var -> Int
realUnique Var
b
Var
a > :: Var -> Var -> Bool
> Var
b = Var -> Int
realUnique Var
a Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Var -> Int
realUnique Var
b
Var
a compare :: Var -> Var -> Ordering
`compare` Var
b = Var
a Var -> Var -> Ordering
`nonDetCmpVar` Var
b
nonDetCmpVar :: Var -> Var -> Ordering
nonDetCmpVar :: Var -> Var -> Ordering
nonDetCmpVar Var
a Var
b = Var -> Unique
varUnique Var
a Unique -> Unique -> Ordering
`nonDetCmpUnique` Var -> Unique
varUnique Var
b
instance Data Var where
toConstr :: Var -> Constr
toConstr Var
_ = String -> Constr
abstractConstr String
"Var"
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Var
gunfold forall b r. Data b => c (b -> r) -> c r
_ forall r. r -> c r
_ = String -> Constr -> c Var
forall a. HasCallStack => String -> a
error String
"gunfold"
dataTypeOf :: Var -> DataType
dataTypeOf Var
_ = String -> DataType
mkNoRepType String
"Var"
instance HasOccName Var where
occName :: Var -> OccName
occName = Name -> OccName
nameOccName (Name -> OccName) -> (Var -> Name) -> Var -> OccName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Var -> Name
varName
varUnique :: Var -> Unique
varUnique :: Var -> Unique
varUnique Var
var = Int -> Unique
mkUniqueGrimily (Var -> Int
realUnique Var
var)
setVarUnique :: Var -> Unique -> Var
setVarUnique :: Var -> Unique -> Var
setVarUnique Var
var Unique
uniq
= Var
var { realUnique :: Int
realUnique = Unique -> Int
getKey Unique
uniq,
varName :: Name
varName = Name -> Unique -> Name
setNameUnique (Var -> Name
varName Var
var) Unique
uniq }
setVarName :: Var -> Name -> Var
setVarName :: Var -> Name -> Var
setVarName Var
var Name
new_name
= Var
var { realUnique :: Int
realUnique = Unique -> Int
getKey (Name -> Unique
forall a. Uniquable a => a -> Unique
getUnique Name
new_name),
varName :: Name
varName = Name
new_name }
setVarType :: Id -> Type -> Id
setVarType :: Var -> Kind -> Var
setVarType Var
id Kind
ty = Var
id { varType :: Kind
varType = Kind
ty }
updateVarType :: (Type -> Type) -> Id -> Id
updateVarType :: (Kind -> Kind) -> Var -> Var
updateVarType Kind -> Kind
f Var
id = Var
id { varType :: Kind
varType = Kind -> Kind
f (Var -> Kind
varType Var
id) }
updateVarTypeM :: Monad m => (Type -> m Type) -> Id -> m Id
updateVarTypeM :: (Kind -> m Kind) -> Var -> m Var
updateVarTypeM Kind -> m Kind
f Var
id = do { Kind
ty' <- Kind -> m Kind
f (Var -> Kind
varType Var
id)
; Var -> m Var
forall (m :: * -> *) a. Monad m => a -> m a
return (Var
id { varType :: Kind
varType = Kind
ty' }) }
data ArgFlag = Inferred | Specified | Required
deriving (ArgFlag -> ArgFlag -> Bool
(ArgFlag -> ArgFlag -> Bool)
-> (ArgFlag -> ArgFlag -> Bool) -> Eq ArgFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArgFlag -> ArgFlag -> Bool
$c/= :: ArgFlag -> ArgFlag -> Bool
== :: ArgFlag -> ArgFlag -> Bool
$c== :: ArgFlag -> ArgFlag -> Bool
Eq, Eq ArgFlag
Eq ArgFlag
-> (ArgFlag -> ArgFlag -> Ordering)
-> (ArgFlag -> ArgFlag -> Bool)
-> (ArgFlag -> ArgFlag -> Bool)
-> (ArgFlag -> ArgFlag -> Bool)
-> (ArgFlag -> ArgFlag -> Bool)
-> (ArgFlag -> ArgFlag -> ArgFlag)
-> (ArgFlag -> ArgFlag -> ArgFlag)
-> Ord ArgFlag
ArgFlag -> ArgFlag -> Bool
ArgFlag -> ArgFlag -> Ordering
ArgFlag -> ArgFlag -> ArgFlag
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ArgFlag -> ArgFlag -> ArgFlag
$cmin :: ArgFlag -> ArgFlag -> ArgFlag
max :: ArgFlag -> ArgFlag -> ArgFlag
$cmax :: ArgFlag -> ArgFlag -> ArgFlag
>= :: ArgFlag -> ArgFlag -> Bool
$c>= :: ArgFlag -> ArgFlag -> Bool
> :: ArgFlag -> ArgFlag -> Bool
$c> :: ArgFlag -> ArgFlag -> Bool
<= :: ArgFlag -> ArgFlag -> Bool
$c<= :: ArgFlag -> ArgFlag -> Bool
< :: ArgFlag -> ArgFlag -> Bool
$c< :: ArgFlag -> ArgFlag -> Bool
compare :: ArgFlag -> ArgFlag -> Ordering
$ccompare :: ArgFlag -> ArgFlag -> Ordering
$cp1Ord :: Eq ArgFlag
Ord, Typeable ArgFlag
DataType
Constr
Typeable ArgFlag
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ArgFlag -> c ArgFlag)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ArgFlag)
-> (ArgFlag -> Constr)
-> (ArgFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ArgFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag))
-> ((forall b. Data b => b -> b) -> ArgFlag -> ArgFlag)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> ArgFlag -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ArgFlag -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag)
-> Data ArgFlag
ArgFlag -> DataType
ArgFlag -> Constr
(forall b. Data b => b -> b) -> ArgFlag -> ArgFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ArgFlag -> c ArgFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ArgFlag
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) -> ArgFlag -> u
forall u. (forall d. Data d => d -> u) -> ArgFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ArgFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ArgFlag -> c ArgFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ArgFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag)
$cRequired :: Constr
$cSpecified :: Constr
$cInferred :: Constr
$tArgFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
gmapMp :: (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
gmapM :: (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ArgFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> ArgFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ArgFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ArgFlag -> r
gmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag
$cgmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ArgFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ArgFlag)
dataTypeOf :: ArgFlag -> DataType
$cdataTypeOf :: ArgFlag -> DataType
toConstr :: ArgFlag -> Constr
$ctoConstr :: ArgFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ArgFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ArgFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ArgFlag -> c ArgFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ArgFlag -> c ArgFlag
$cp1Data :: Typeable ArgFlag
Data)
isVisibleArgFlag :: ArgFlag -> Bool
isVisibleArgFlag :: ArgFlag -> Bool
isVisibleArgFlag ArgFlag
Required = Bool
True
isVisibleArgFlag ArgFlag
_ = Bool
False
isInvisibleArgFlag :: ArgFlag -> Bool
isInvisibleArgFlag :: ArgFlag -> Bool
isInvisibleArgFlag = Bool -> Bool
not (Bool -> Bool) -> (ArgFlag -> Bool) -> ArgFlag -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArgFlag -> Bool
isVisibleArgFlag
sameVis :: ArgFlag -> ArgFlag -> Bool
sameVis :: ArgFlag -> ArgFlag -> Bool
sameVis ArgFlag
Required ArgFlag
Required = Bool
True
sameVis ArgFlag
Required ArgFlag
_ = Bool
False
sameVis ArgFlag
_ ArgFlag
Required = Bool
False
sameVis ArgFlag
_ ArgFlag
_ = Bool
True
instance Outputable ArgFlag where
ppr :: ArgFlag -> SDoc
ppr ArgFlag
Required = String -> SDoc
text String
"[req]"
ppr ArgFlag
Specified = String -> SDoc
text String
"[spec]"
ppr ArgFlag
Inferred = String -> SDoc
text String
"[infrd]"
instance Binary ArgFlag where
put_ :: BinHandle -> ArgFlag -> IO ()
put_ BinHandle
bh ArgFlag
Required = BinHandle -> Word8 -> IO ()
putByte BinHandle
bh Word8
0
put_ BinHandle
bh ArgFlag
Specified = BinHandle -> Word8 -> IO ()
putByte BinHandle
bh Word8
1
put_ BinHandle
bh ArgFlag
Inferred = BinHandle -> Word8 -> IO ()
putByte BinHandle
bh Word8
2
get :: BinHandle -> IO ArgFlag
get BinHandle
bh = do
Word8
h <- BinHandle -> IO Word8
getByte BinHandle
bh
case Word8
h of
Word8
0 -> ArgFlag -> IO ArgFlag
forall (m :: * -> *) a. Monad m => a -> m a
return ArgFlag
Required
Word8
1 -> ArgFlag -> IO ArgFlag
forall (m :: * -> *) a. Monad m => a -> m a
return ArgFlag
Specified
Word8
_ -> ArgFlag -> IO ArgFlag
forall (m :: * -> *) a. Monad m => a -> m a
return ArgFlag
Inferred
data AnonArgFlag
= VisArg
| InvisArg
deriving (AnonArgFlag -> AnonArgFlag -> Bool
(AnonArgFlag -> AnonArgFlag -> Bool)
-> (AnonArgFlag -> AnonArgFlag -> Bool) -> Eq AnonArgFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnonArgFlag -> AnonArgFlag -> Bool
$c/= :: AnonArgFlag -> AnonArgFlag -> Bool
== :: AnonArgFlag -> AnonArgFlag -> Bool
$c== :: AnonArgFlag -> AnonArgFlag -> Bool
Eq, Eq AnonArgFlag
Eq AnonArgFlag
-> (AnonArgFlag -> AnonArgFlag -> Ordering)
-> (AnonArgFlag -> AnonArgFlag -> Bool)
-> (AnonArgFlag -> AnonArgFlag -> Bool)
-> (AnonArgFlag -> AnonArgFlag -> Bool)
-> (AnonArgFlag -> AnonArgFlag -> Bool)
-> (AnonArgFlag -> AnonArgFlag -> AnonArgFlag)
-> (AnonArgFlag -> AnonArgFlag -> AnonArgFlag)
-> Ord AnonArgFlag
AnonArgFlag -> AnonArgFlag -> Bool
AnonArgFlag -> AnonArgFlag -> Ordering
AnonArgFlag -> AnonArgFlag -> AnonArgFlag
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag
$cmin :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag
max :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag
$cmax :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag
>= :: AnonArgFlag -> AnonArgFlag -> Bool
$c>= :: AnonArgFlag -> AnonArgFlag -> Bool
> :: AnonArgFlag -> AnonArgFlag -> Bool
$c> :: AnonArgFlag -> AnonArgFlag -> Bool
<= :: AnonArgFlag -> AnonArgFlag -> Bool
$c<= :: AnonArgFlag -> AnonArgFlag -> Bool
< :: AnonArgFlag -> AnonArgFlag -> Bool
$c< :: AnonArgFlag -> AnonArgFlag -> Bool
compare :: AnonArgFlag -> AnonArgFlag -> Ordering
$ccompare :: AnonArgFlag -> AnonArgFlag -> Ordering
$cp1Ord :: Eq AnonArgFlag
Ord, Typeable AnonArgFlag
DataType
Constr
Typeable AnonArgFlag
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnonArgFlag)
-> (AnonArgFlag -> Constr)
-> (AnonArgFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnonArgFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnonArgFlag))
-> ((forall b. Data b => b -> b) -> AnonArgFlag -> AnonArgFlag)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> AnonArgFlag -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> AnonArgFlag -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag)
-> Data AnonArgFlag
AnonArgFlag -> DataType
AnonArgFlag -> Constr
(forall b. Data b => b -> b) -> AnonArgFlag -> AnonArgFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnonArgFlag
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) -> AnonArgFlag -> u
forall u. (forall d. Data d => d -> u) -> AnonArgFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnonArgFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnonArgFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnonArgFlag)
$cInvisArg :: Constr
$cVisArg :: Constr
$tAnonArgFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
gmapMp :: (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
gmapM :: (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> AnonArgFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnonArgFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> AnonArgFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> AnonArgFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r
gmapT :: (forall b. Data b => b -> b) -> AnonArgFlag -> AnonArgFlag
$cgmapT :: (forall b. Data b => b -> b) -> AnonArgFlag -> AnonArgFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnonArgFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c AnonArgFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c AnonArgFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnonArgFlag)
dataTypeOf :: AnonArgFlag -> DataType
$cdataTypeOf :: AnonArgFlag -> DataType
toConstr :: AnonArgFlag -> Constr
$ctoConstr :: AnonArgFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnonArgFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnonArgFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag
$cp1Data :: Typeable AnonArgFlag
Data)
instance Outputable AnonArgFlag where
ppr :: AnonArgFlag -> SDoc
ppr AnonArgFlag
VisArg = String -> SDoc
text String
"[vis]"
ppr AnonArgFlag
InvisArg = String -> SDoc
text String
"[invis]"
instance Binary AnonArgFlag where
put_ :: BinHandle -> AnonArgFlag -> IO ()
put_ BinHandle
bh AnonArgFlag
VisArg = BinHandle -> Word8 -> IO ()
putByte BinHandle
bh Word8
0
put_ BinHandle
bh AnonArgFlag
InvisArg = BinHandle -> Word8 -> IO ()
putByte BinHandle
bh Word8
1
get :: BinHandle -> IO AnonArgFlag
get BinHandle
bh = do
Word8
h <- BinHandle -> IO Word8
getByte BinHandle
bh
case Word8
h of
Word8
0 -> AnonArgFlag -> IO AnonArgFlag
forall (m :: * -> *) a. Monad m => a -> m a
return AnonArgFlag
VisArg
Word8
_ -> AnonArgFlag -> IO AnonArgFlag
forall (m :: * -> *) a. Monad m => a -> m a
return AnonArgFlag
InvisArg
data ForallVisFlag
= ForallVis
| ForallInvis
deriving (ForallVisFlag -> ForallVisFlag -> Bool
(ForallVisFlag -> ForallVisFlag -> Bool)
-> (ForallVisFlag -> ForallVisFlag -> Bool) -> Eq ForallVisFlag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ForallVisFlag -> ForallVisFlag -> Bool
$c/= :: ForallVisFlag -> ForallVisFlag -> Bool
== :: ForallVisFlag -> ForallVisFlag -> Bool
$c== :: ForallVisFlag -> ForallVisFlag -> Bool
Eq, Eq ForallVisFlag
Eq ForallVisFlag
-> (ForallVisFlag -> ForallVisFlag -> Ordering)
-> (ForallVisFlag -> ForallVisFlag -> Bool)
-> (ForallVisFlag -> ForallVisFlag -> Bool)
-> (ForallVisFlag -> ForallVisFlag -> Bool)
-> (ForallVisFlag -> ForallVisFlag -> Bool)
-> (ForallVisFlag -> ForallVisFlag -> ForallVisFlag)
-> (ForallVisFlag -> ForallVisFlag -> ForallVisFlag)
-> Ord ForallVisFlag
ForallVisFlag -> ForallVisFlag -> Bool
ForallVisFlag -> ForallVisFlag -> Ordering
ForallVisFlag -> ForallVisFlag -> ForallVisFlag
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ForallVisFlag -> ForallVisFlag -> ForallVisFlag
$cmin :: ForallVisFlag -> ForallVisFlag -> ForallVisFlag
max :: ForallVisFlag -> ForallVisFlag -> ForallVisFlag
$cmax :: ForallVisFlag -> ForallVisFlag -> ForallVisFlag
>= :: ForallVisFlag -> ForallVisFlag -> Bool
$c>= :: ForallVisFlag -> ForallVisFlag -> Bool
> :: ForallVisFlag -> ForallVisFlag -> Bool
$c> :: ForallVisFlag -> ForallVisFlag -> Bool
<= :: ForallVisFlag -> ForallVisFlag -> Bool
$c<= :: ForallVisFlag -> ForallVisFlag -> Bool
< :: ForallVisFlag -> ForallVisFlag -> Bool
$c< :: ForallVisFlag -> ForallVisFlag -> Bool
compare :: ForallVisFlag -> ForallVisFlag -> Ordering
$ccompare :: ForallVisFlag -> ForallVisFlag -> Ordering
$cp1Ord :: Eq ForallVisFlag
Ord, Typeable ForallVisFlag
DataType
Constr
Typeable ForallVisFlag
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForallVisFlag -> c ForallVisFlag)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForallVisFlag)
-> (ForallVisFlag -> Constr)
-> (ForallVisFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForallVisFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForallVisFlag))
-> ((forall b. Data b => b -> b) -> ForallVisFlag -> ForallVisFlag)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> ForallVisFlag -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ForallVisFlag -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag)
-> Data ForallVisFlag
ForallVisFlag -> DataType
ForallVisFlag -> Constr
(forall b. Data b => b -> b) -> ForallVisFlag -> ForallVisFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForallVisFlag -> c ForallVisFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForallVisFlag
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) -> ForallVisFlag -> u
forall u. (forall d. Data d => d -> u) -> ForallVisFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForallVisFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForallVisFlag -> c ForallVisFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForallVisFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForallVisFlag)
$cForallInvis :: Constr
$cForallVis :: Constr
$tForallVisFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
gmapMp :: (forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
gmapM :: (forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ForallVisFlag -> m ForallVisFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> ForallVisFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ForallVisFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> ForallVisFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ForallVisFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ForallVisFlag -> r
gmapT :: (forall b. Data b => b -> b) -> ForallVisFlag -> ForallVisFlag
$cgmapT :: (forall b. Data b => b -> b) -> ForallVisFlag -> ForallVisFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForallVisFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ForallVisFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ForallVisFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ForallVisFlag)
dataTypeOf :: ForallVisFlag -> DataType
$cdataTypeOf :: ForallVisFlag -> DataType
toConstr :: ForallVisFlag -> Constr
$ctoConstr :: ForallVisFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForallVisFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ForallVisFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForallVisFlag -> c ForallVisFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ForallVisFlag -> c ForallVisFlag
$cp1Data :: Typeable ForallVisFlag
Data)
instance Outputable ForallVisFlag where
ppr :: ForallVisFlag -> SDoc
ppr ForallVisFlag
f = String -> SDoc
text (String -> SDoc) -> String -> SDoc
forall a b. (a -> b) -> a -> b
$ case ForallVisFlag
f of
ForallVisFlag
ForallVis -> String
"ForallVis"
ForallVisFlag
ForallInvis -> String
"ForallInvis"
argToForallVisFlag :: ArgFlag -> ForallVisFlag
argToForallVisFlag :: ArgFlag -> ForallVisFlag
argToForallVisFlag ArgFlag
Required = ForallVisFlag
ForallVis
argToForallVisFlag ArgFlag
Specified = ForallVisFlag
ForallInvis
argToForallVisFlag ArgFlag
Inferred = ForallVisFlag
ForallInvis
data VarBndr var argf = Bndr var argf
deriving( Typeable (VarBndr var argf)
DataType
Constr
Typeable (VarBndr var argf)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> VarBndr var argf
-> c (VarBndr var argf))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf))
-> (VarBndr var argf -> Constr)
-> (VarBndr var argf -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (VarBndr var argf)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf)))
-> ((forall b. Data b => b -> b)
-> VarBndr var argf -> VarBndr var argf)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r)
-> (forall u.
(forall d. Data d => d -> u) -> VarBndr var argf -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> VarBndr var argf -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf))
-> Data (VarBndr var argf)
VarBndr var argf -> DataType
VarBndr var argf -> Constr
(forall b. Data b => b -> b)
-> VarBndr var argf -> VarBndr var argf
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> VarBndr var argf -> c (VarBndr var argf)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf)
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf))
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) -> VarBndr var argf -> u
forall u. (forall d. Data d => d -> u) -> VarBndr var argf -> [u]
forall var argf.
(Data var, Data argf) =>
Typeable (VarBndr var argf)
forall var argf.
(Data var, Data argf) =>
VarBndr var argf -> DataType
forall var argf.
(Data var, Data argf) =>
VarBndr var argf -> Constr
forall var argf.
(Data var, Data argf) =>
(forall b. Data b => b -> b)
-> VarBndr var argf -> VarBndr var argf
forall var argf u.
(Data var, Data argf) =>
Int -> (forall d. Data d => d -> u) -> VarBndr var argf -> u
forall var argf u.
(Data var, Data argf) =>
(forall d. Data d => d -> u) -> VarBndr var argf -> [u]
forall var argf r r'.
(Data var, Data argf) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
forall var argf r r'.
(Data var, Data argf) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
forall var argf (m :: * -> *).
(Data var, Data argf, Monad m) =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
forall var argf (m :: * -> *).
(Data var, Data argf, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
forall var argf (c :: * -> *).
(Data var, Data argf) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf)
forall var argf (c :: * -> *).
(Data var, Data argf) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> VarBndr var argf -> c (VarBndr var argf)
forall var argf (t :: * -> *) (c :: * -> *).
(Data var, Data argf, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (VarBndr var argf))
forall var argf (t :: * -> * -> *) (c :: * -> *).
(Data var, Data argf, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> VarBndr var argf -> c (VarBndr var argf)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (VarBndr var argf))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf))
$cBndr :: Constr
$tVarBndr :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
$cgmapMo :: forall var argf (m :: * -> *).
(Data var, Data argf, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
gmapMp :: (forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
$cgmapMp :: forall var argf (m :: * -> *).
(Data var, Data argf, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
gmapM :: (forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
$cgmapM :: forall var argf (m :: * -> *).
(Data var, Data argf, Monad m) =>
(forall d. Data d => d -> m d)
-> VarBndr var argf -> m (VarBndr var argf)
gmapQi :: Int -> (forall d. Data d => d -> u) -> VarBndr var argf -> u
$cgmapQi :: forall var argf u.
(Data var, Data argf) =>
Int -> (forall d. Data d => d -> u) -> VarBndr var argf -> u
gmapQ :: (forall d. Data d => d -> u) -> VarBndr var argf -> [u]
$cgmapQ :: forall var argf u.
(Data var, Data argf) =>
(forall d. Data d => d -> u) -> VarBndr var argf -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
$cgmapQr :: forall var argf r r'.
(Data var, Data argf) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
$cgmapQl :: forall var argf r r'.
(Data var, Data argf) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> VarBndr var argf -> r
gmapT :: (forall b. Data b => b -> b)
-> VarBndr var argf -> VarBndr var argf
$cgmapT :: forall var argf.
(Data var, Data argf) =>
(forall b. Data b => b -> b)
-> VarBndr var argf -> VarBndr var argf
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf))
$cdataCast2 :: forall var argf (t :: * -> * -> *) (c :: * -> *).
(Data var, Data argf, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (VarBndr var argf))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (VarBndr var argf))
$cdataCast1 :: forall var argf (t :: * -> *) (c :: * -> *).
(Data var, Data argf, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (VarBndr var argf))
dataTypeOf :: VarBndr var argf -> DataType
$cdataTypeOf :: forall var argf.
(Data var, Data argf) =>
VarBndr var argf -> DataType
toConstr :: VarBndr var argf -> Constr
$ctoConstr :: forall var argf.
(Data var, Data argf) =>
VarBndr var argf -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf)
$cgunfold :: forall var argf (c :: * -> *).
(Data var, Data argf) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (VarBndr var argf)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> VarBndr var argf -> c (VarBndr var argf)
$cgfoldl :: forall var argf (c :: * -> *).
(Data var, Data argf) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> VarBndr var argf -> c (VarBndr var argf)
$cp1Data :: forall var argf.
(Data var, Data argf) =>
Typeable (VarBndr var argf)
Data )
type TyCoVarBinder = VarBndr TyCoVar ArgFlag
type TyVarBinder = VarBndr TyVar ArgFlag
binderVar :: VarBndr tv argf -> tv
binderVar :: VarBndr tv argf -> tv
binderVar (Bndr tv
v argf
_) = tv
v
binderVars :: [VarBndr tv argf] -> [tv]
binderVars :: [VarBndr tv argf] -> [tv]
binderVars [VarBndr tv argf]
tvbs = (VarBndr tv argf -> tv) -> [VarBndr tv argf] -> [tv]
forall a b. (a -> b) -> [a] -> [b]
map VarBndr tv argf -> tv
forall tv argf. VarBndr tv argf -> tv
binderVar [VarBndr tv argf]
tvbs
binderArgFlag :: VarBndr tv argf -> argf
binderArgFlag :: VarBndr tv argf -> argf
binderArgFlag (Bndr tv
_ argf
argf) = argf
argf
binderType :: VarBndr TyCoVar argf -> Type
binderType :: VarBndr Var argf -> Kind
binderType (Bndr Var
tv argf
_) = Var -> Kind
varType Var
tv
mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder
mkTyCoVarBinder :: ArgFlag -> Var -> TyCoVarBinder
mkTyCoVarBinder ArgFlag
vis Var
var = Var -> ArgFlag -> TyCoVarBinder
forall var argf. var -> argf -> VarBndr var argf
Bndr Var
var ArgFlag
vis
mkTyVarBinder :: ArgFlag -> TyVar -> TyVarBinder
mkTyVarBinder :: ArgFlag -> Var -> TyCoVarBinder
mkTyVarBinder ArgFlag
vis Var
var
= ASSERT( isTyVar var )
Var -> ArgFlag -> TyCoVarBinder
forall var argf. var -> argf -> VarBndr var argf
Bndr Var
var ArgFlag
vis
mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder]
mkTyCoVarBinders :: ArgFlag -> [Var] -> [TyCoVarBinder]
mkTyCoVarBinders ArgFlag
vis = (Var -> TyCoVarBinder) -> [Var] -> [TyCoVarBinder]
forall a b. (a -> b) -> [a] -> [b]
map (ArgFlag -> Var -> TyCoVarBinder
mkTyCoVarBinder ArgFlag
vis)
mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder]
mkTyVarBinders :: ArgFlag -> [Var] -> [TyCoVarBinder]
mkTyVarBinders ArgFlag
vis = (Var -> TyCoVarBinder) -> [Var] -> [TyCoVarBinder]
forall a b. (a -> b) -> [a] -> [b]
map (ArgFlag -> Var -> TyCoVarBinder
mkTyVarBinder ArgFlag
vis)
isTyVarBinder :: TyCoVarBinder -> Bool
isTyVarBinder :: TyCoVarBinder -> Bool
isTyVarBinder (Bndr Var
v ArgFlag
_) = Var -> Bool
isTyVar Var
v
instance Outputable tv => Outputable (VarBndr tv ArgFlag) where
ppr :: VarBndr tv ArgFlag -> SDoc
ppr (Bndr tv
v ArgFlag
Required) = tv -> SDoc
forall a. Outputable a => a -> SDoc
ppr tv
v
ppr (Bndr tv
v ArgFlag
Specified) = Char -> SDoc
char Char
'@' SDoc -> SDoc -> SDoc
<> tv -> SDoc
forall a. Outputable a => a -> SDoc
ppr tv
v
ppr (Bndr tv
v ArgFlag
Inferred) = SDoc -> SDoc
braces (tv -> SDoc
forall a. Outputable a => a -> SDoc
ppr tv
v)
instance (Binary tv, Binary vis) => Binary (VarBndr tv vis) where
put_ :: BinHandle -> VarBndr tv vis -> IO ()
put_ BinHandle
bh (Bndr tv
tv vis
vis) = do { BinHandle -> tv -> IO ()
forall a. Binary a => BinHandle -> a -> IO ()
put_ BinHandle
bh tv
tv; BinHandle -> vis -> IO ()
forall a. Binary a => BinHandle -> a -> IO ()
put_ BinHandle
bh vis
vis }
get :: BinHandle -> IO (VarBndr tv vis)
get BinHandle
bh = do { tv
tv <- BinHandle -> IO tv
forall a. Binary a => BinHandle -> IO a
get BinHandle
bh; vis
vis <- BinHandle -> IO vis
forall a. Binary a => BinHandle -> IO a
get BinHandle
bh; VarBndr tv vis -> IO (VarBndr tv vis)
forall (m :: * -> *) a. Monad m => a -> m a
return (tv -> vis -> VarBndr tv vis
forall var argf. var -> argf -> VarBndr var argf
Bndr tv
tv vis
vis) }
instance NamedThing tv => NamedThing (VarBndr tv flag) where
getName :: VarBndr tv flag -> Name
getName (Bndr tv
tv flag
_) = tv -> Name
forall a. NamedThing a => a -> Name
getName tv
tv
tyVarName :: TyVar -> Name
tyVarName :: Var -> Name
tyVarName = Var -> Name
varName
tyVarKind :: TyVar -> Kind
tyVarKind :: Var -> Kind
tyVarKind = Var -> Kind
varType
setTyVarUnique :: TyVar -> Unique -> TyVar
setTyVarUnique :: Var -> Unique -> Var
setTyVarUnique = Var -> Unique -> Var
setVarUnique
setTyVarName :: TyVar -> Name -> TyVar
setTyVarName :: Var -> Name -> Var
setTyVarName = Var -> Name -> Var
setVarName
setTyVarKind :: TyVar -> Kind -> TyVar
setTyVarKind :: Var -> Kind -> Var
setTyVarKind Var
tv Kind
k = Var
tv {varType :: Kind
varType = Kind
k}
updateTyVarKind :: (Kind -> Kind) -> TyVar -> TyVar
updateTyVarKind :: (Kind -> Kind) -> Var -> Var
updateTyVarKind Kind -> Kind
update Var
tv = Var
tv {varType :: Kind
varType = Kind -> Kind
update (Var -> Kind
tyVarKind Var
tv)}
updateTyVarKindM :: (Monad m) => (Kind -> m Kind) -> TyVar -> m TyVar
updateTyVarKindM :: (Kind -> m Kind) -> Var -> m Var
updateTyVarKindM Kind -> m Kind
update Var
tv
= do { Kind
k' <- Kind -> m Kind
update (Var -> Kind
tyVarKind Var
tv)
; Var -> m Var
forall (m :: * -> *) a. Monad m => a -> m a
return (Var -> m Var) -> Var -> m Var
forall a b. (a -> b) -> a -> b
$ Var
tv {varType :: Kind
varType = Kind
k'} }
mkTyVar :: Name -> Kind -> TyVar
mkTyVar :: Name -> Kind -> Var
mkTyVar Name
name Kind
kind = TyVar :: Name -> Int -> Kind -> Var
TyVar { varName :: Name
varName = Name
name
, realUnique :: Int
realUnique = Unique -> Int
getKey (Name -> Unique
nameUnique Name
name)
, varType :: Kind
varType = Kind
kind
}
mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> TyVar
mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> Var
mkTcTyVar Name
name Kind
kind TcTyVarDetails
details
=
TcTyVar :: Name -> Int -> Kind -> TcTyVarDetails -> Var
TcTyVar { varName :: Name
varName = Name
name,
realUnique :: Int
realUnique = Unique -> Int
getKey (Name -> Unique
nameUnique Name
name),
varType :: Kind
varType = Kind
kind,
tc_tv_details :: TcTyVarDetails
tc_tv_details = TcTyVarDetails
details
}
tcTyVarDetails :: TyVar -> TcTyVarDetails
tcTyVarDetails :: Var -> TcTyVarDetails
tcTyVarDetails (TcTyVar { tc_tv_details :: Var -> TcTyVarDetails
tc_tv_details = TcTyVarDetails
details }) = TcTyVarDetails
details
tcTyVarDetails (TyVar {}) = TcTyVarDetails
vanillaSkolemTv
tcTyVarDetails Var
var = String -> SDoc -> TcTyVarDetails
forall a. HasCallStack => String -> SDoc -> a
pprPanic String
"tcTyVarDetails" (Var -> SDoc
forall a. Outputable a => a -> SDoc
ppr Var
var SDoc -> SDoc -> SDoc
<+> SDoc
dcolon SDoc -> SDoc -> SDoc
<+> Kind -> SDoc
pprKind (Var -> Kind
tyVarKind Var
var))
setTcTyVarDetails :: TyVar -> TcTyVarDetails -> TyVar
setTcTyVarDetails :: Var -> TcTyVarDetails -> Var
setTcTyVarDetails Var
tv TcTyVarDetails
details = Var
tv { tc_tv_details :: TcTyVarDetails
tc_tv_details = TcTyVarDetails
details }
idInfo :: HasDebugCallStack => Id -> IdInfo
idInfo :: Var -> IdInfo
idInfo (Id { id_info :: Var -> IdInfo
id_info = IdInfo
info }) = IdInfo
info
idInfo Var
other = String -> SDoc -> IdInfo
forall a. HasCallStack => String -> SDoc -> a
pprPanic String
"idInfo" (Var -> SDoc
forall a. Outputable a => a -> SDoc
ppr Var
other)
idDetails :: Id -> IdDetails
idDetails :: Var -> IdDetails
idDetails (Id { id_details :: Var -> IdDetails
id_details = IdDetails
details }) = IdDetails
details
idDetails Var
other = String -> SDoc -> IdDetails
forall a. HasCallStack => String -> SDoc -> a
pprPanic String
"idDetails" (Var -> SDoc
forall a. Outputable a => a -> SDoc
ppr Var
other)
mkGlobalVar :: IdDetails -> Name -> Type -> IdInfo -> Id
mkGlobalVar :: IdDetails -> Name -> Kind -> IdInfo -> Var
mkGlobalVar IdDetails
details Name
name Kind
ty IdInfo
info
= Name -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
mk_id Name
name Kind
ty IdScope
GlobalId IdDetails
details IdInfo
info
mkLocalVar :: IdDetails -> Name -> Type -> IdInfo -> Id
mkLocalVar :: IdDetails -> Name -> Kind -> IdInfo -> Var
mkLocalVar IdDetails
details Name
name Kind
ty IdInfo
info
= Name -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
mk_id Name
name Kind
ty (ExportFlag -> IdScope
LocalId ExportFlag
NotExported) IdDetails
details IdInfo
info
mkCoVar :: Name -> Type -> CoVar
mkCoVar :: Name -> Kind -> Var
mkCoVar Name
name Kind
ty = Name -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
mk_id Name
name Kind
ty (ExportFlag -> IdScope
LocalId ExportFlag
NotExported) IdDetails
coVarDetails IdInfo
vanillaIdInfo
mkExportedLocalVar :: IdDetails -> Name -> Type -> IdInfo -> Id
mkExportedLocalVar :: IdDetails -> Name -> Kind -> IdInfo -> Var
mkExportedLocalVar IdDetails
details Name
name Kind
ty IdInfo
info
= Name -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
mk_id Name
name Kind
ty (ExportFlag -> IdScope
LocalId ExportFlag
Exported) IdDetails
details IdInfo
info
mk_id :: Name -> Type -> IdScope -> IdDetails -> IdInfo -> Id
mk_id :: Name -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
mk_id Name
name Kind
ty IdScope
scope IdDetails
details IdInfo
info
= Id :: Name -> Int -> Kind -> IdScope -> IdDetails -> IdInfo -> Var
Id { varName :: Name
varName = Name
name,
realUnique :: Int
realUnique = Unique -> Int
getKey (Name -> Unique
nameUnique Name
name),
varType :: Kind
varType = Kind
ty,
idScope :: IdScope
idScope = IdScope
scope,
id_details :: IdDetails
id_details = IdDetails
details,
id_info :: IdInfo
id_info = IdInfo
info }
lazySetIdInfo :: Id -> IdInfo -> Var
lazySetIdInfo :: Var -> IdInfo -> Var
lazySetIdInfo Var
id IdInfo
info = Var
id { id_info :: IdInfo
id_info = IdInfo
info }
setIdDetails :: Id -> IdDetails -> Id
setIdDetails :: Var -> IdDetails -> Var
setIdDetails Var
id IdDetails
details = Var
id { id_details :: IdDetails
id_details = IdDetails
details }
globaliseId :: Id -> Id
globaliseId :: Var -> Var
globaliseId Var
id = Var
id { idScope :: IdScope
idScope = IdScope
GlobalId }
setIdExported :: Id -> Id
setIdExported :: Var -> Var
setIdExported id :: Var
id@(Id { idScope :: Var -> IdScope
idScope = LocalId {} }) = Var
id { idScope :: IdScope
idScope = ExportFlag -> IdScope
LocalId ExportFlag
Exported }
setIdExported id :: Var
id@(Id { idScope :: Var -> IdScope
idScope = IdScope
GlobalId }) = Var
id
setIdExported Var
tv = String -> SDoc -> Var
forall a. HasCallStack => String -> SDoc -> a
pprPanic String
"setIdExported" (Var -> SDoc
forall a. Outputable a => a -> SDoc
ppr Var
tv)
setIdNotExported :: Id -> Id
setIdNotExported :: Var -> Var
setIdNotExported Var
id = ASSERT( isLocalId id )
Var
id { idScope :: IdScope
idScope = ExportFlag -> IdScope
LocalId ExportFlag
NotExported }
isTyVar :: Var -> Bool
isTyVar :: Var -> Bool
isTyVar (TyVar {}) = Bool
True
isTyVar (TcTyVar {}) = Bool
True
isTyVar Var
_ = Bool
False
isTcTyVar :: Var -> Bool
isTcTyVar :: Var -> Bool
isTcTyVar (TcTyVar {}) = Bool
True
isTcTyVar Var
_ = Bool
False
isTyCoVar :: Var -> Bool
isTyCoVar :: Var -> Bool
isTyCoVar Var
v = Var -> Bool
isTyVar Var
v Bool -> Bool -> Bool
|| Var -> Bool
isCoVar Var
v
isId :: Var -> Bool
isId :: Var -> Bool
isId (Id {}) = Bool
True
isId Var
_ = Bool
False
isCoVar :: Var -> Bool
isCoVar :: Var -> Bool
isCoVar (Id { id_details :: Var -> IdDetails
id_details = IdDetails
details }) = IdDetails -> Bool
isCoVarDetails IdDetails
details
isCoVar Var
_ = Bool
False
isNonCoVarId :: Var -> Bool
isNonCoVarId :: Var -> Bool
isNonCoVarId (Id { id_details :: Var -> IdDetails
id_details = IdDetails
details }) = Bool -> Bool
not (IdDetails -> Bool
isCoVarDetails IdDetails
details)
isNonCoVarId Var
_ = Bool
False
isLocalId :: Var -> Bool
isLocalId :: Var -> Bool
isLocalId (Id { idScope :: Var -> IdScope
idScope = LocalId ExportFlag
_ }) = Bool
True
isLocalId Var
_ = Bool
False
isLocalVar :: Var -> Bool
isLocalVar :: Var -> Bool
isLocalVar Var
v = Bool -> Bool
not (Var -> Bool
isGlobalId Var
v)
isGlobalId :: Var -> Bool
isGlobalId :: Var -> Bool
isGlobalId (Id { idScope :: Var -> IdScope
idScope = IdScope
GlobalId }) = Bool
True
isGlobalId Var
_ = Bool
False
mustHaveLocalBinding :: Var -> Bool
mustHaveLocalBinding :: Var -> Bool
mustHaveLocalBinding Var
var = Var -> Bool
isLocalVar Var
var
isExportedId :: Var -> Bool
isExportedId :: Var -> Bool
isExportedId (Id { idScope :: Var -> IdScope
idScope = IdScope
GlobalId }) = Bool
True
isExportedId (Id { idScope :: Var -> IdScope
idScope = LocalId ExportFlag
Exported}) = Bool
True
isExportedId Var
_ = Bool
False