generic-lens-core-2.2.1.0: Generically derive traversals, lenses and prisms.
Copyright(C) 2020 Csongor Kiss
LicenseBSD3
MaintainerCsongor Kiss <kiss.csongor.kiss@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Generics.Internal.Families.Has

Description

 

Documentation

type family HasTotalFieldP (field :: Symbol) (f :: k -> Type) :: Maybe Type where ... #

Equations

HasTotalFieldP field (S1 ('MetaSel ('Just field) _1 _2 _3) (Rec0 t) :: k -> Type) = 'Just t 
HasTotalFieldP field (l :*: r :: k -> Type) = Alt (HasTotalFieldP field l) (HasTotalFieldP field r) 
HasTotalFieldP field (l :+: r :: k -> Type) = Both (HasTotalFieldP field l) (HasTotalFieldP field r) 
HasTotalFieldP field (S1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalFieldP field (C1 _1 f :: k -> Type) = HasTotalFieldP field f 
HasTotalFieldP field (D1 _1 f :: k -> Type) = HasTotalFieldP field f 
HasTotalFieldP field (K1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalFieldP field (U1 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalFieldP field (V1 :: k -> Type) = 'Nothing :: Maybe Type 

type family HasTotalTypeP typ (f :: k -> Type) :: Maybe Type where ... #

Equations

HasTotalTypeP typ (S1 _1 (K1 _2 typ :: k -> Type) :: k -> Type) = 'Just typ 
HasTotalTypeP typ (l :*: r :: k -> Type) = Alt (HasTotalTypeP typ l) (HasTotalTypeP typ r) 
HasTotalTypeP typ (l :+: r :: k -> Type) = Both (HasTotalTypeP typ l) (HasTotalTypeP typ r) 
HasTotalTypeP typ (S1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalTypeP typ (C1 _1 f :: k -> Type) = HasTotalTypeP typ f 
HasTotalTypeP typ (D1 _1 f :: k -> Type) = HasTotalTypeP typ f 
HasTotalTypeP typ (K1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalTypeP typ (U1 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalTypeP typ (V1 :: k -> Type) = 'Nothing :: Maybe Type 

type family HasTotalPositionP (pos :: Nat) (f :: k -> Type) :: Maybe Type where ... #

Equations

HasTotalPositionP pos (S1 _1 (K1 (Pos pos) t :: k -> Type) :: k -> Type) = 'Just t 
HasTotalPositionP pos (l :*: r :: k -> Type) = Alt (HasTotalPositionP pos l) (HasTotalPositionP pos r) 
HasTotalPositionP pos (l :+: r :: k -> Type) = Both (HasTotalPositionP pos l) (HasTotalPositionP pos r) 
HasTotalPositionP pos (S1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalPositionP pos (C1 _1 f :: k -> Type) = HasTotalPositionP pos f 
HasTotalPositionP pos (D1 _1 f :: k -> Type) = HasTotalPositionP pos f 
HasTotalPositionP pos (K1 _1 _2 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalPositionP pos (U1 :: k -> Type) = 'Nothing :: Maybe Type 
HasTotalPositionP pos (V1 :: k -> Type) = 'Nothing :: Maybe Type 

data Pos (p :: Nat) #

type family HasPartialTypeP (a :: [Type]) (f :: Type -> Type) :: Bool where ... #

Equations

HasPartialTypeP t (l :+: r) = HasPartialTypeP t l || HasPartialTypeP t r 
HasPartialTypeP t (C1 m f) = t == GTypes f 
HasPartialTypeP t (M1 _1 _2 f) = HasPartialTypeP t f 
HasPartialTypeP t _1 = 'False 

type family HasCtorP (ctor :: Symbol) (f :: k -> Type) :: Bool where ... #

Equations

HasCtorP ctor (C1 ('MetaCons ctor _1 _2) _3 :: k -> Type) = 'True 
HasCtorP ctor (f :+: g :: k -> Type) = HasCtorP ctor f || HasCtorP ctor g 
HasCtorP ctor (D1 m f :: k -> Type) = HasCtorP ctor f 
HasCtorP ctor (_1 :: k -> Type) = 'False 

type family GTypes (rep :: Type -> Type) :: [Type] where ... #

Equations

GTypes (l :*: r) = GTypes l ++ GTypes r 
GTypes (K1 _1 a :: Type -> Type) = '[a] 
GTypes (M1 _1 m a) = GTypes a 
GTypes (U1 :: Type -> Type) = '[] :: [Type]