Modulegeneric-lens-core-2.2.1.0Haskell2010
Data.Generics.Product.Internal.Positions
Derive positional product type getters and setters generically.
- 4 types
- 1 class
- 2 values
- Packagegeneric-lens-core-2.2.1.0
- Exports9
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourcePositions.hs
In-order labeling of the generic tree with the field positions
We replace the (K1 R a) nodes with (K1 (Pos n) a), where n is the position
of the field in question in the data type. This is convenient, because we
can reuse all the existing functions as long as they are polymorphic in the
first parameter of K1.
class
class Context (i :: Nat) (s :: k) (t :: k1) (a :: k2) (b :: k3) | s i -> a, t i -> b, s i b -> t, t i a -> sInstances1Context
(ErrorUnless i s ((Defined in generic-lens-core-2.2.1.0 · Data.Generics.Product.Internal.Positions0
<? i) && (i <=? Size (Rep s))), HasTotalPositionP i (CRep s) ~ 'Just a, HasTotalPositionP i (CRep t) ~ 'Just b, HasTotalPositionP i (CRep (Indexed s)) ~ 'Just a', HasTotalPositionP i (CRep (Indexed t)) ~ 'Just b', t ~ Infer s a' b, s ~ Infer t b' a) => Context i s t a b
type
type Context' (i :: Nat) s a = (Generic s, ErrorUnless i s ((0
<? i) && (i <=? Size (Rep s))), Coercible (Rep s) (CRep s), GLens' (HasTotalPositionPSym i) (CRep s) a, Defined (Rep s) (NoGeneric s '['Text "arising from a generic lens focusing on the field at"
, (((('Text "position "
':<>: QuoteType i) ':<>: 'Text " of type "
) ':<>: QuoteType a) ':<>: 'Text " in "
) ':<>: QuoteType s]) ())type
type Context0 (i :: Nat) s t a b = (Generic s, Generic t, GLens (HasTotalPositionPSym i) (CRep s) (CRep t) a b, Coercible (CRep s) (Rep s), Coercible (CRep t) (Rep t), Defined (Rep s) (NoGeneric s '['Text "arising from a generic lens focusing on the field at"
, (((('Text "position "
':<>: QuoteType i) ':<>: 'Text " of type "
) ':<>: QuoteType a) ':<>: 'Text " in "
) ':<>: QuoteType s]) ())