generic-lens-core-2.0.0.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 :: Maybe Type where ... Source #

Equations

HasTotalFieldP field (S1 (MetaSel (Just field) _ _ _) (Rec0 t)) = Just t 
HasTotalFieldP field (l :*: r) = Alt (HasTotalFieldP field l) (HasTotalFieldP field r) 
HasTotalFieldP field (l :+: r) = Both (HasTotalFieldP field l) (HasTotalFieldP field r) 
HasTotalFieldP field (S1 _ _) = Nothing 
HasTotalFieldP field (C1 _ f) = HasTotalFieldP field f 
HasTotalFieldP field (D1 _ f) = HasTotalFieldP field f 
HasTotalFieldP field (K1 _ _) = Nothing 
HasTotalFieldP field U1 = Nothing 
HasTotalFieldP field V1 = Nothing 

type family HasTotalTypeP (typ :: Type) f :: Maybe Type where ... Source #

Equations

HasTotalTypeP typ (S1 _ (K1 _ typ)) = Just typ 
HasTotalTypeP typ (l :*: r) = Alt (HasTotalTypeP typ l) (HasTotalTypeP typ r) 
HasTotalTypeP typ (l :+: r) = Both (HasTotalTypeP typ l) (HasTotalTypeP typ r) 
HasTotalTypeP typ (S1 _ _) = Nothing 
HasTotalTypeP typ (C1 _ f) = HasTotalTypeP typ f 
HasTotalTypeP typ (D1 _ f) = HasTotalTypeP typ f 
HasTotalTypeP typ (K1 _ _) = Nothing 
HasTotalTypeP typ U1 = Nothing 
HasTotalTypeP typ V1 = Nothing 

type family HasTotalPositionP (pos :: Nat) f :: Maybe Type where ... Source #

Equations

HasTotalPositionP pos (S1 _ (K1 (Pos pos) t)) = Just t 
HasTotalPositionP pos (l :*: r) = Alt (HasTotalPositionP pos l) (HasTotalPositionP pos r) 
HasTotalPositionP pos (l :+: r) = Both (HasTotalPositionP pos l) (HasTotalPositionP pos r) 
HasTotalPositionP pos (S1 _ _) = Nothing 
HasTotalPositionP pos (C1 _ f) = HasTotalPositionP pos f 
HasTotalPositionP pos (D1 _ f) = HasTotalPositionP pos f 
HasTotalPositionP pos (K1 _ _) = Nothing 
HasTotalPositionP pos U1 = Nothing 
HasTotalPositionP pos V1 = Nothing 

data Pos (p :: Nat) Source #

type family HasPartialTypeP a f :: Bool where ... Source #

type family HasCtorP (ctor :: Symbol) f :: Bool where ... Source #

Equations

HasCtorP ctor (C1 (MetaCons ctor _ _) _) = True 
HasCtorP ctor (f :+: g) = HasCtorP ctor f || HasCtorP ctor g 
HasCtorP ctor (D1 m f) = HasCtorP ctor f 
HasCtorP ctor _ = False 

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

Equations

GTypes (l :*: r) = GTypes l ++ GTypes r 
GTypes (K1 _ a) = '[a] 
GTypes (M1 _ m a) = GTypes a 
GTypes U1 = '[]