{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DerivingStrategies #-}
module GHC.Types.GREInfo where
import GHC.Prelude
import GHC.Types.Basic
import GHC.Types.FieldLabel
import GHC.Types.Name
import GHC.Types.Unique
import GHC.Types.Unique.Set
import GHC.Utils.Outputable
import GHC.Utils.Panic
import Control.DeepSeq ( NFData(..), deepseq )
import Data.Data ( Data )
import Data.List.NonEmpty ( NonEmpty )
import qualified Data.List.NonEmpty as NonEmpty
data GREInfo
= Vanilla
| UnboundGRE
| IAmTyCon !(TyConFlavour Name)
| IAmConLike !ConInfo
| IAmRecField !RecFieldInfo
deriving Typeable GREInfo
Typeable GREInfo =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GREInfo -> c GREInfo)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GREInfo)
-> (GREInfo -> Constr)
-> (GREInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GREInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GREInfo))
-> ((forall b. Data b => b -> b) -> GREInfo -> GREInfo)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> GREInfo -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> GREInfo -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo)
-> Data GREInfo
GREInfo -> Constr
GREInfo -> DataType
(forall b. Data b => b -> b) -> GREInfo -> GREInfo
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. Arity -> (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. Arity -> (forall d. Data d => d -> u) -> GREInfo -> u
forall u. (forall d. Data d => d -> u) -> GREInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GREInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GREInfo -> c GREInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GREInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GREInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GREInfo -> c GREInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GREInfo -> c GREInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GREInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GREInfo
$ctoConstr :: GREInfo -> Constr
toConstr :: GREInfo -> Constr
$cdataTypeOf :: GREInfo -> DataType
dataTypeOf :: GREInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GREInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GREInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GREInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GREInfo)
$cgmapT :: (forall b. Data b => b -> b) -> GREInfo -> GREInfo
gmapT :: (forall b. Data b => b -> b) -> GREInfo -> GREInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> GREInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> GREInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> GREInfo -> [u]
$cgmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> GREInfo -> u
gmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> GREInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GREInfo -> m GREInfo
Data
instance NFData GREInfo where
rnf :: GREInfo -> ()
rnf GREInfo
Vanilla = ()
rnf GREInfo
UnboundGRE = ()
rnf (IAmTyCon TyConFlavour Name
tc) = TyConFlavour Name -> ()
forall a. NFData a => a -> ()
rnf TyConFlavour Name
tc
rnf (IAmConLike ConInfo
info) = ConInfo -> ()
forall a. NFData a => a -> ()
rnf ConInfo
info
rnf (IAmRecField RecFieldInfo
info) = RecFieldInfo -> ()
forall a. NFData a => a -> ()
rnf RecFieldInfo
info
plusGREInfo :: GREInfo -> GREInfo -> GREInfo
plusGREInfo :: GREInfo -> GREInfo -> GREInfo
plusGREInfo GREInfo
Vanilla GREInfo
Vanilla = GREInfo
Vanilla
plusGREInfo GREInfo
UnboundGRE GREInfo
UnboundGRE = GREInfo
UnboundGRE
plusGREInfo (IAmTyCon {}) info2 :: GREInfo
info2@(IAmTyCon {}) = GREInfo
info2
plusGREInfo (IAmConLike {}) info2 :: GREInfo
info2@(IAmConLike {}) = GREInfo
info2
plusGREInfo (IAmRecField {}) info2 :: GREInfo
info2@(IAmRecField {}) = GREInfo
info2
plusGREInfo GREInfo
info1 GREInfo
info2 = String -> SDoc -> GREInfo
forall a. HasCallStack => String -> SDoc -> a
pprPanic String
"plusInfo" (SDoc -> GREInfo) -> SDoc -> GREInfo
forall a b. (a -> b) -> a -> b
$
[SDoc] -> SDoc
forall doc. IsDoc doc => [doc] -> doc
vcat [ String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"info1:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> GREInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr GREInfo
info1
, String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"info2:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> GREInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr GREInfo
info2 ]
instance Outputable GREInfo where
ppr :: GREInfo -> SDoc
ppr GREInfo
Vanilla = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"Vanilla"
ppr GREInfo
UnboundGRE = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"UnboundGRE"
ppr (IAmTyCon TyConFlavour Name
flav)
= String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"TyCon" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> TyConFlavour Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr TyConFlavour Name
flav
ppr (IAmConLike ConInfo
info)
= String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConLike" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> ConInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr ConInfo
info
ppr (IAmRecField RecFieldInfo
info)
= String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"RecField" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> RecFieldInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr RecFieldInfo
info
data ConInfo
= ConInfo
{ ConInfo -> ConLikeInfo
conLikeInfo :: !ConLikeInfo
, ConInfo -> ConFieldInfo
conFieldInfo :: !ConFieldInfo
}
deriving stock ConInfo -> ConInfo -> Bool
(ConInfo -> ConInfo -> Bool)
-> (ConInfo -> ConInfo -> Bool) -> Eq ConInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConInfo -> ConInfo -> Bool
== :: ConInfo -> ConInfo -> Bool
$c/= :: ConInfo -> ConInfo -> Bool
/= :: ConInfo -> ConInfo -> Bool
Eq
deriving Typeable ConInfo
Typeable ConInfo =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConInfo -> c ConInfo)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConInfo)
-> (ConInfo -> Constr)
-> (ConInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConInfo))
-> ((forall b. Data b => b -> b) -> ConInfo -> ConInfo)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConInfo -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> ConInfo -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo)
-> Data ConInfo
ConInfo -> Constr
ConInfo -> DataType
(forall b. Data b => b -> b) -> ConInfo -> ConInfo
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. Arity -> (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. Arity -> (forall d. Data d => d -> u) -> ConInfo -> u
forall u. (forall d. Data d => d -> u) -> ConInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConInfo -> c ConInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConInfo -> c ConInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConInfo -> c ConInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConInfo
$ctoConstr :: ConInfo -> Constr
toConstr :: ConInfo -> Constr
$cdataTypeOf :: ConInfo -> DataType
dataTypeOf :: ConInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConInfo)
$cgmapT :: (forall b. Data b => b -> b) -> ConInfo -> ConInfo
gmapT :: (forall b. Data b => b -> b) -> ConInfo -> ConInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ConInfo -> [u]
$cgmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConInfo -> u
gmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConInfo -> m ConInfo
Data
data ConLikeInfo
= ConIsData
{ ConLikeInfo -> [Name]
conLikeDataCons :: [Name]
}
| ConIsPatSyn
deriving stock ConLikeInfo -> ConLikeInfo -> Bool
(ConLikeInfo -> ConLikeInfo -> Bool)
-> (ConLikeInfo -> ConLikeInfo -> Bool) -> Eq ConLikeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConLikeInfo -> ConLikeInfo -> Bool
== :: ConLikeInfo -> ConLikeInfo -> Bool
$c/= :: ConLikeInfo -> ConLikeInfo -> Bool
/= :: ConLikeInfo -> ConLikeInfo -> Bool
Eq
deriving Typeable ConLikeInfo
Typeable ConLikeInfo =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeInfo -> c ConLikeInfo)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeInfo)
-> (ConLikeInfo -> Constr)
-> (ConLikeInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeInfo))
-> ((forall b. Data b => b -> b) -> ConLikeInfo -> ConLikeInfo)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConLikeInfo -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> ConLikeInfo -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo)
-> Data ConLikeInfo
ConLikeInfo -> Constr
ConLikeInfo -> DataType
(forall b. Data b => b -> b) -> ConLikeInfo -> ConLikeInfo
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. Arity -> (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. Arity -> (forall d. Data d => d -> u) -> ConLikeInfo -> u
forall u. (forall d. Data d => d -> u) -> ConLikeInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeInfo -> c ConLikeInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeInfo -> c ConLikeInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeInfo -> c ConLikeInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeInfo
$ctoConstr :: ConLikeInfo -> Constr
toConstr :: ConLikeInfo -> Constr
$cdataTypeOf :: ConLikeInfo -> DataType
dataTypeOf :: ConLikeInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeInfo)
$cgmapT :: (forall b. Data b => b -> b) -> ConLikeInfo -> ConLikeInfo
gmapT :: (forall b. Data b => b -> b) -> ConLikeInfo -> ConLikeInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConLikeInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ConLikeInfo -> [u]
$cgmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConLikeInfo -> u
gmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConLikeInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeInfo -> m ConLikeInfo
Data
instance NFData ConInfo where
rnf :: ConInfo -> ()
rnf (ConInfo ConLikeInfo
a ConFieldInfo
b) = ConLikeInfo -> ()
forall a. NFData a => a -> ()
rnf ConLikeInfo
a () -> () -> ()
forall a b. a -> b -> b
`seq` ConFieldInfo -> ()
forall a. NFData a => a -> ()
rnf ConFieldInfo
b
instance NFData ConLikeInfo where
rnf :: ConLikeInfo -> ()
rnf (ConIsData [Name]
a) = [Name] -> ()
forall a. NFData a => a -> ()
rnf [Name]
a
rnf ConLikeInfo
ConIsPatSyn = ()
data ConFieldInfo
= ConHasRecordFields (NonEmpty FieldLabel)
| ConHasPositionalArgs
| ConIsNullary
deriving stock ConFieldInfo -> ConFieldInfo -> Bool
(ConFieldInfo -> ConFieldInfo -> Bool)
-> (ConFieldInfo -> ConFieldInfo -> Bool) -> Eq ConFieldInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConFieldInfo -> ConFieldInfo -> Bool
== :: ConFieldInfo -> ConFieldInfo -> Bool
$c/= :: ConFieldInfo -> ConFieldInfo -> Bool
/= :: ConFieldInfo -> ConFieldInfo -> Bool
Eq
deriving Typeable ConFieldInfo
Typeable ConFieldInfo =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConFieldInfo -> c ConFieldInfo)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConFieldInfo)
-> (ConFieldInfo -> Constr)
-> (ConFieldInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConFieldInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConFieldInfo))
-> ((forall b. Data b => b -> b) -> ConFieldInfo -> ConFieldInfo)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConFieldInfo -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> ConFieldInfo -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo)
-> Data ConFieldInfo
ConFieldInfo -> Constr
ConFieldInfo -> DataType
(forall b. Data b => b -> b) -> ConFieldInfo -> ConFieldInfo
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. Arity -> (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.
Arity -> (forall d. Data d => d -> u) -> ConFieldInfo -> u
forall u. (forall d. Data d => d -> u) -> ConFieldInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConFieldInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConFieldInfo -> c ConFieldInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConFieldInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConFieldInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConFieldInfo -> c ConFieldInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConFieldInfo -> c ConFieldInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConFieldInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConFieldInfo
$ctoConstr :: ConFieldInfo -> Constr
toConstr :: ConFieldInfo -> Constr
$cdataTypeOf :: ConFieldInfo -> DataType
dataTypeOf :: ConFieldInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConFieldInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConFieldInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConFieldInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConFieldInfo)
$cgmapT :: (forall b. Data b => b -> b) -> ConFieldInfo -> ConFieldInfo
gmapT :: (forall b. Data b => b -> b) -> ConFieldInfo -> ConFieldInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConFieldInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConFieldInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ConFieldInfo -> [u]
$cgmapQi :: forall u.
Arity -> (forall d. Data d => d -> u) -> ConFieldInfo -> u
gmapQi :: forall u.
Arity -> (forall d. Data d => d -> u) -> ConFieldInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConFieldInfo -> m ConFieldInfo
Data
instance NFData ConFieldInfo where
rnf :: ConFieldInfo -> ()
rnf ConFieldInfo
ConIsNullary = ()
rnf ConFieldInfo
ConHasPositionalArgs = ()
rnf (ConHasRecordFields NonEmpty FieldLabel
flds) = NonEmpty FieldLabel -> ()
forall a. NFData a => a -> ()
rnf NonEmpty FieldLabel
flds
mkConInfo :: ConLikeInfo -> Arity -> [FieldLabel] -> ConInfo
mkConInfo :: ConLikeInfo -> Arity -> [FieldLabel] -> ConInfo
mkConInfo ConLikeInfo
con_ty Arity
n [FieldLabel]
flds =
ConInfo { conLikeInfo :: ConLikeInfo
conLikeInfo = ConLikeInfo
con_ty
, conFieldInfo :: ConFieldInfo
conFieldInfo = Arity -> [FieldLabel] -> ConFieldInfo
mkConFieldInfo Arity
n [FieldLabel]
flds }
mkConFieldInfo :: Arity -> [FieldLabel] -> ConFieldInfo
mkConFieldInfo :: Arity -> [FieldLabel] -> ConFieldInfo
mkConFieldInfo Arity
0 [FieldLabel]
_ = ConFieldInfo
ConIsNullary
mkConFieldInfo Arity
_ [FieldLabel]
fields = ConFieldInfo
-> (NonEmpty FieldLabel -> ConFieldInfo)
-> Maybe (NonEmpty FieldLabel)
-> ConFieldInfo
forall b a. b -> (a -> b) -> Maybe a -> b
maybe ConFieldInfo
ConHasPositionalArgs NonEmpty FieldLabel -> ConFieldInfo
ConHasRecordFields
(Maybe (NonEmpty FieldLabel) -> ConFieldInfo)
-> Maybe (NonEmpty FieldLabel) -> ConFieldInfo
forall a b. (a -> b) -> a -> b
$ [FieldLabel] -> Maybe (NonEmpty FieldLabel)
forall a. [a] -> Maybe (NonEmpty a)
NonEmpty.nonEmpty [FieldLabel]
fields
conInfoFields :: ConInfo -> [FieldLabel]
conInfoFields :: ConInfo -> [FieldLabel]
conInfoFields = ConFieldInfo -> [FieldLabel]
conFieldInfoFields (ConFieldInfo -> [FieldLabel])
-> (ConInfo -> ConFieldInfo) -> ConInfo -> [FieldLabel]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConInfo -> ConFieldInfo
conFieldInfo
conFieldInfoFields :: ConFieldInfo -> [FieldLabel]
conFieldInfoFields :: ConFieldInfo -> [FieldLabel]
conFieldInfoFields (ConHasRecordFields NonEmpty FieldLabel
fields) = NonEmpty FieldLabel -> [FieldLabel]
forall a. NonEmpty a -> [a]
NonEmpty.toList NonEmpty FieldLabel
fields
conFieldInfoFields ConFieldInfo
ConHasPositionalArgs = []
conFieldInfoFields ConFieldInfo
ConIsNullary = []
instance Outputable ConInfo where
ppr :: ConInfo -> SDoc
ppr (ConInfo { conLikeInfo :: ConInfo -> ConLikeInfo
conLikeInfo = ConLikeInfo
con_ty, conFieldInfo :: ConInfo -> ConFieldInfo
conFieldInfo = ConFieldInfo
fld_info })
= String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConInfo" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc
braces
(String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"con_ty:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> ConLikeInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr ConLikeInfo
con_ty SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<> SDoc
forall doc. IsLine doc => doc
comma
SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"fields:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> ConFieldInfo -> SDoc
forall a. Outputable a => a -> SDoc
ppr ConFieldInfo
fld_info)
instance Outputable ConLikeInfo where
ppr :: ConLikeInfo -> SDoc
ppr (ConIsData [Name]
cons) = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConIsData" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc
parens ([Name] -> SDoc
forall a. Outputable a => a -> SDoc
ppr [Name]
cons)
ppr ConLikeInfo
ConIsPatSyn = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConIsPatSyn"
instance Outputable ConFieldInfo where
ppr :: ConFieldInfo -> SDoc
ppr ConFieldInfo
ConIsNullary = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConIsNullary"
ppr ConFieldInfo
ConHasPositionalArgs = String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConHasPositionalArgs"
ppr (ConHasRecordFields NonEmpty FieldLabel
fieldLabels) =
String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"ConHasRecordFields" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc
braces (NonEmpty FieldLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr NonEmpty FieldLabel
fieldLabels)
data ConLikeName
= DataConName { ConLikeName -> Name
conLikeName_Name :: !Name }
| PatSynName { conLikeName_Name :: !Name }
deriving (ConLikeName -> ConLikeName -> Bool
(ConLikeName -> ConLikeName -> Bool)
-> (ConLikeName -> ConLikeName -> Bool) -> Eq ConLikeName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConLikeName -> ConLikeName -> Bool
== :: ConLikeName -> ConLikeName -> Bool
$c/= :: ConLikeName -> ConLikeName -> Bool
/= :: ConLikeName -> ConLikeName -> Bool
Eq, Typeable ConLikeName
Typeable ConLikeName =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeName -> c ConLikeName)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeName)
-> (ConLikeName -> Constr)
-> (ConLikeName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeName))
-> ((forall b. Data b => b -> b) -> ConLikeName -> ConLikeName)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConLikeName -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> ConLikeName -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName)
-> Data ConLikeName
ConLikeName -> Constr
ConLikeName -> DataType
(forall b. Data b => b -> b) -> ConLikeName -> ConLikeName
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. Arity -> (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. Arity -> (forall d. Data d => d -> u) -> ConLikeName -> u
forall u. (forall d. Data d => d -> u) -> ConLikeName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeName -> c ConLikeName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeName)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeName -> c ConLikeName
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConLikeName -> c ConLikeName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeName
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConLikeName
$ctoConstr :: ConLikeName -> Constr
toConstr :: ConLikeName -> Constr
$cdataTypeOf :: ConLikeName -> DataType
dataTypeOf :: ConLikeName -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeName)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConLikeName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeName)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConLikeName)
$cgmapT :: (forall b. Data b => b -> b) -> ConLikeName -> ConLikeName
gmapT :: (forall b. Data b => b -> b) -> ConLikeName -> ConLikeName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConLikeName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConLikeName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ConLikeName -> [u]
$cgmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConLikeName -> u
gmapQi :: forall u. Arity -> (forall d. Data d => d -> u) -> ConLikeName -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConLikeName -> m ConLikeName
Data)
instance Outputable ConLikeName where
ppr :: ConLikeName -> SDoc
ppr = Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr (Name -> SDoc) -> (ConLikeName -> Name) -> ConLikeName -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConLikeName -> Name
conLikeName_Name
instance OutputableBndr ConLikeName where
pprInfixOcc :: ConLikeName -> SDoc
pprInfixOcc ConLikeName
con = Name -> SDoc
forall a. (Outputable a, NamedThing a) => a -> SDoc
pprInfixName (ConLikeName -> Name
conLikeName_Name ConLikeName
con)
pprPrefixOcc :: ConLikeName -> SDoc
pprPrefixOcc ConLikeName
con = Name -> SDoc
forall a. NamedThing a => a -> SDoc
pprPrefixName (ConLikeName -> Name
conLikeName_Name ConLikeName
con)
instance Uniquable ConLikeName where
getUnique :: ConLikeName -> Unique
getUnique = Name -> Unique
forall a. Uniquable a => a -> Unique
getUnique (Name -> Unique) -> (ConLikeName -> Name) -> ConLikeName -> Unique
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConLikeName -> Name
conLikeName_Name
instance NFData ConLikeName where
rnf :: ConLikeName -> ()
rnf = Name -> ()
forall a. NFData a => a -> ()
rnf (Name -> ()) -> (ConLikeName -> Name) -> ConLikeName -> ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConLikeName -> Name
conLikeName_Name
data RecFieldInfo
= RecFieldInfo
{ RecFieldInfo -> FieldLabel
recFieldLabel :: !FieldLabel
, RecFieldInfo -> UniqSet ConLikeName
recFieldCons :: !(UniqSet ConLikeName)
}
deriving (RecFieldInfo -> RecFieldInfo -> Bool
(RecFieldInfo -> RecFieldInfo -> Bool)
-> (RecFieldInfo -> RecFieldInfo -> Bool) -> Eq RecFieldInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RecFieldInfo -> RecFieldInfo -> Bool
== :: RecFieldInfo -> RecFieldInfo -> Bool
$c/= :: RecFieldInfo -> RecFieldInfo -> Bool
/= :: RecFieldInfo -> RecFieldInfo -> Bool
Eq, Typeable RecFieldInfo
Typeable RecFieldInfo =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RecFieldInfo -> c RecFieldInfo)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RecFieldInfo)
-> (RecFieldInfo -> Constr)
-> (RecFieldInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RecFieldInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RecFieldInfo))
-> ((forall b. Data b => b -> b) -> RecFieldInfo -> RecFieldInfo)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> RecFieldInfo -> [u])
-> (forall u.
Arity -> (forall d. Data d => d -> u) -> RecFieldInfo -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo)
-> Data RecFieldInfo
RecFieldInfo -> Constr
RecFieldInfo -> DataType
(forall b. Data b => b -> b) -> RecFieldInfo -> RecFieldInfo
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. Arity -> (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.
Arity -> (forall d. Data d => d -> u) -> RecFieldInfo -> u
forall u. (forall d. Data d => d -> u) -> RecFieldInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RecFieldInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RecFieldInfo -> c RecFieldInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RecFieldInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RecFieldInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RecFieldInfo -> c RecFieldInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RecFieldInfo -> c RecFieldInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RecFieldInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RecFieldInfo
$ctoConstr :: RecFieldInfo -> Constr
toConstr :: RecFieldInfo -> Constr
$cdataTypeOf :: RecFieldInfo -> DataType
dataTypeOf :: RecFieldInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RecFieldInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RecFieldInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RecFieldInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RecFieldInfo)
$cgmapT :: (forall b. Data b => b -> b) -> RecFieldInfo -> RecFieldInfo
gmapT :: (forall b. Data b => b -> b) -> RecFieldInfo -> RecFieldInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RecFieldInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RecFieldInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RecFieldInfo -> [u]
$cgmapQi :: forall u.
Arity -> (forall d. Data d => d -> u) -> RecFieldInfo -> u
gmapQi :: forall u.
Arity -> (forall d. Data d => d -> u) -> RecFieldInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RecFieldInfo -> m RecFieldInfo
Data)
instance NFData RecFieldInfo where
rnf :: RecFieldInfo -> ()
rnf (RecFieldInfo FieldLabel
lbl UniqSet ConLikeName
cons)
= FieldLabel -> ()
forall a. NFData a => a -> ()
rnf FieldLabel
lbl () -> () -> ()
forall a b. a -> b -> b
`seq` (ConLikeName -> () -> ()) -> () -> UniqSet ConLikeName -> ()
forall elt a. (elt -> a -> a) -> a -> UniqSet elt -> a
nonDetStrictFoldUniqSet ConLikeName -> () -> ()
forall a b. NFData a => a -> b -> b
deepseq () UniqSet ConLikeName
cons
instance Outputable RecFieldInfo where
ppr :: RecFieldInfo -> SDoc
ppr (RecFieldInfo { recFieldLabel :: RecFieldInfo -> FieldLabel
recFieldLabel = FieldLabel
fl, recFieldCons :: RecFieldInfo -> UniqSet ConLikeName
recFieldCons = UniqSet ConLikeName
cons })
= String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"RecFieldInfo" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc
braces
(String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"recFieldLabel:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> FieldLabel -> SDoc
forall a. Outputable a => a -> SDoc
ppr FieldLabel
fl SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<> SDoc
forall doc. IsLine doc => doc
comma
SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> String -> SDoc
forall doc. IsLine doc => String -> doc
text String
"recFieldCons:" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> (ConLikeName -> SDoc) -> [ConLikeName] -> SDoc
forall a. (a -> SDoc) -> [a] -> SDoc
pprWithCommas ConLikeName -> SDoc
forall a. Outputable a => a -> SDoc
ppr (UniqSet ConLikeName -> [ConLikeName]
forall elt. UniqSet elt -> [elt]
nonDetEltsUniqSet UniqSet ConLikeName
cons))