HList-0.5.1.0: Heterogeneous lists
Safe HaskellNone
LanguageHaskell2010

Data.HList.Labelable

Description

A simple problem is being solved here, but unfortunately it is a bit involved. The idea is to use the same haskell identifier for a lens and for other purposes. In other words, get the same behavior as:

x = hLens (Label :: Label "x")
r ^. x

While still being able to extract the symbol "x" from x, so that things like x .=. 123 could be acceptable. In this case we don't overload .=., so instead you have to write x .==. 123.

Elaboration of some ideas from edwardk.

Synopsis

Documentation

class SameLength s t => Labelable (x :: k) (r :: [*] -> *) s t a b | x s -> a, x t -> b, x s b -> t, x t a -> s where Source #

r
is Record, Variant. TIP and TIC also have instances, but generally tipyLens' and ticPrism' are more appropriate.
x
is the label for the field. It tends to have kind Symbol, but others are supported in principle.

Associated Types

type LabelableTy r :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x r s t a b Source #

Instances

Instances details
LabelableTIPCxt x s t a b => Labelable (x :: k) TIP s t a b Source #

make a Lens' (TIP s) a.

tipyLens provides a Lens (TIP s) (TIP t) a b, which tends to need too many type annotations to be practical

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy TIP :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x TIP s t a b Source #

(TICPrism s t a b, Label x ~ Label a, a ~ b, s ~ t, SameLength s t) => Labelable (x :: k) TIC s t a b Source #
hLens' :: Label a -> Prism' (TIC s) a

note that a more general function ticPrism :: Prism (TIC s) (TIC t) a b, cannot have an instance of Labelable

Note: `x :: k` according to the instance head, but the instance body forces the kind variable to be * later on. IE. (k ~ *)

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy TIC :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x TIC s t a b Source #

(HPrism x s t a b, to ~ ((->) :: Type -> Type -> Type)) => Labelable (x :: k) Variant s t a b Source #

make a Prism (Variant s) (Variant t) a b

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy Variant :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x Variant s t a b Source #

HLens x Record s t a b => Labelable (x :: k) Record s t a b Source #

make a Lens (Record s) (Record t) a b

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy Record :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x Record s t a b Source #

LabeledCxt1 s t a b => Labelable (x :: k) LabeledR s t a b Source #

used with toLabel and/or .==.

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy LabeledR :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x LabeledR s t a b Source #

(s ~ t, a ~ b, IArray UArray a, a ~ GetElemTy s, HLensCxt x RecordU s t a b) => Labelable (x :: k) RecordU s t a b Source #

make a Lens' (RecordU s) a

Instance details

Defined in Data.HList.RecordU

Associated Types

type LabelableTy RecordU :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x RecordU s t a b Source #

type LabeledOptic (x :: k) (r :: [*] -> *) (s :: [*]) (t :: [*]) (a :: *) (b :: *) = forall ty to p f. (ty ~ LabelableTy r, LabeledOpticF ty f, LabeledOpticP ty p, LabeledOpticTo ty x to) => (a `p` f b) `to` (r s `p` f (r t)) Source #

This alias is the same as Control.Lens.Optic, except the (->) in Optic is a type parameter to in LabeledOptic.

Depending on the collection type (see instances of LabelableTy), the type variables to, p, f are constrained such that the resulting type is a Lens (r s) (r t) a b, Prism (r s) (r t) a b or a LabeledTo x _ _. The latter can be used to recover the label (x) when used as an argument to .==. or equivalently toLabel.

(.==.) :: forall k x (l :: k) v. EnsureLabel x (Label l) => x -> v -> Tagged l v infixr 4 Source #

modification of .=. which works with the labels from this module, and those from Data.HList.Label6. Note that this is not strictly a generalization of .=., since it does not work with labels like Data.HList.Label3 which have the wrong kind.

multiple lookups

class Projected r s t a b where Source #

Sometimes it may be more convenient to operate on a record/variant that only contains the fields of interest. projected can then be used to apply that function to a record that contains additional elements.

>>> :set -XViewPatterns
>>> import Data.HList.RecordPuns
>>> let f [pun| (x y) |] = case x+y of z -> [pun| z |]
>>> :t f
f :: Num v =>
     Record '[Tagged "x" v, Tagged "y" v] -> Record '[Tagged "z" v]
>>> let r = (let x = 1; y = 2; z = () in [pun| x y z |])
>>> r
Record{x=1,y=2,z=()}
>>> r & sameLabels . projected %~ f
Record{x=1,y=2,z=3}

Methods

projected :: (ty ~ LabelableTy r, LabeledOpticP ty p, LabeledOpticF ty f) => (r a `p` f (r b)) -> r s `p` f (r t) Source #

Instances

Instances details
(H2ProjectByLabels (LabelsOf a) s a_ _s_minus_a, HRLabelSet a_, HRLabelSet a, HRearrange (LabelsOf a) a_ a, HLeftUnion b s bs, HRLabelSet bs, HRearrange (LabelsOf t) bs t, HRLabelSet t) => Projected Record s t a b Source #
Lens rs rt ra rb

where rs ~ Record s, rt ~ Record t, ra ~ Record a, rb ~ Record b

Instance details

Defined in Data.HList.Labelable

Methods

projected :: forall (ty :: LabeledOpticType) p f. (ty ~ LabelableTy Record, LabeledOpticP ty p, LabeledOpticF ty f) => p (Record a) (f (Record b)) -> p (Record s) (f (Record t)) Source #

(ExtendsVariant b t, ProjectVariant s a, ProjectExtendVariant s t, HLeftUnion b s bs, HRLabelSet bs, HRearrange (LabelsOf t) bs t) => Projected Variant s t a b Source #
Prism (Variant s) (Variant t) (Variant a) (Variant b)
Instance details

Defined in Data.HList.Labelable

Methods

projected :: forall (ty :: LabeledOpticType) p f. (ty ~ LabelableTy Variant, LabeledOpticP ty p, LabeledOpticF ty f) => p (Variant a) (f (Variant b)) -> p (Variant s) (f (Variant t)) Source #

projected' :: forall r p f (t :: [Type]) (b :: [Type]). (LabeledOpticP (LabelableTy r) p, LabeledOpticF (LabelableTy r) f, Projected r t t b b) => p (r b) (f (r b)) -> p (r t) (f (r t)) Source #

Lens' (Record s) (Record a)
Prism' (Variant s) (Variant a)

comparison with hLens

Note that passing around variables defined with hLens' doesn't get you exactly the same thing as calling hLens at the call-site:

The following code needs to apply the x for different Functor f =>, so you would have to write a type signature (rank-2) to allow this definition:

-- with the x defined using hLens'
let f x r = let
         a = r ^. x
         b = r & x .~ "6"
       in (a,b)

This alternative won't need a type signature

-- with the x defined as x = Label :: Label "x"
let f x r = let
         a = r ^. hLens x
         b = r & hLens x .~ "7"
       in (a,b)

It may work to use hLens' instead of hLens in the second code, but that is a bit beside the point being made here.

The same points apply to the use of hPrism over hLens'.

likely unneeded (re)exports

type LabeledCxt1 s t a b = (s ~ '[], t ~ '[], a ~ (), b ~ ()) Source #

sets all type variables to dummy values: only the Labeled x part is actually needed

data LabeledTo (x :: k) (a :: *) (b :: *) Source #

Constructors

LabeledTo 

Instances

Instances details
Show (LabeledTo x a b) Source # 
Instance details

Defined in Data.HList.Labelable

Methods

showsPrec :: Int -> LabeledTo x a b -> ShowS #

show :: LabeledTo x a b -> String #

showList :: [LabeledTo x a b] -> ShowS #

data LabeledR (x :: [*]) Source #

Constructors

LabeledR 

Instances

Instances details
LabeledCxt1 s t a b => Labelable (x :: k) LabeledR s t a b Source #

used with toLabel and/or .==.

Instance details

Defined in Data.HList.Labelable

Associated Types

type LabelableTy LabeledR :: LabeledOpticType Source #

Methods

hLens' :: Label x -> LabeledOptic x LabeledR s t a b Source #

type LabelableTy LabeledR Source # 
Instance details

Defined in Data.HList.Labelable

class ToSym label (s :: Symbol) | label -> s Source #

Get the Symbol out of a Label or LabeledTo

Instances

Instances details
ToSym (label x :: k) x Source # 
Instance details

Defined in Data.HList.Labelable

LabeledTo x (p a (f b)) (p (LabeledR s) (f (LabeledR t))) ~ v1 v2 v3 => ToSym (v1 v2 v3 :: Type) x Source # 
Instance details

Defined in Data.HList.Labelable

class EnsureLabel x y | x -> y where Source #

Convert a type to Label :: Label blah

toLabel :: LabeledTo x _ _ -> Label (x :: Symbol)
toLabel (hLens' lx)         = (lx :: Label x)
toLabel :: Label x         -> Label x
toLabel :: Proxy x         -> Label x

Methods

toLabel :: x -> y Source #

Instances

Instances details
ToSym (a b c) x => EnsureLabel (a b c) (Label x) Source #

get the Label out of a LabeledTo (ie. `foobar when using HListPP).

Instance details

Defined in Data.HList.Labelable

Methods

toLabel :: a b c -> Label x Source #

EnsureLabel (Proxy x) (Label x) Source # 
Instance details

Defined in Data.HList.Labelable

Methods

toLabel :: Proxy x -> Label x Source #

EnsureLabel (Label x) (Label x) Source # 
Instance details

Defined in Data.HList.Labelable

Methods

toLabel :: Label x -> Label x Source #

toLabelSym :: forall x1 (x2 :: Symbol). EnsureLabel x1 (Label x2) => x1 -> Label x2 Source #

fix the k kind variable to Symbol

data Identity a #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Instances

Instances details
Monad Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

Functor Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

MonadFix Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mfix :: (a -> Identity a) -> Identity a #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Foldable Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldMap' :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Traversable Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Eq1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool #

Ord1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering #

Read1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Identity a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Identity a] #

Show1 Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS #

Comonad Identity 
Instance details

Defined in Control.Comonad

Methods

extract :: Identity a -> a #

duplicate :: Identity a -> Identity (Identity a) #

extend :: (Identity a -> b) -> Identity a -> Identity b #

ComonadApply Identity 
Instance details

Defined in Control.Comonad

Methods

(<@>) :: Identity (a -> b) -> Identity a -> Identity b #

(@>) :: Identity a -> Identity b -> Identity b #

(<@) :: Identity a -> Identity b -> Identity a #

Bounded a => Bounded (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Enum a => Enum (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Eq a => Eq (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(==) :: Identity a -> Identity a -> Bool #

(/=) :: Identity a -> Identity a -> Bool #

Floating a => Floating (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Fractional a => Fractional (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Integral a => Integral (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Data a => Data (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) #

toConstr :: Identity a -> Constr #

dataTypeOf :: Identity a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) #

gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) #

Num a => Num (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Ord a => Ord (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering #

(<) :: Identity a -> Identity a -> Bool #

(<=) :: Identity a -> Identity a -> Bool #

(>) :: Identity a -> Identity a -> Bool #

(>=) :: Identity a -> Identity a -> Bool #

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Read a => Read (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Real a => Real (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

toRational :: Identity a -> Rational #

RealFloat a => RealFloat (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFrac a => RealFrac (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

properFraction :: Integral b => Identity a -> (b, Identity a) #

truncate :: Integral b => Identity a -> b #

round :: Integral b => Identity a -> b #

ceiling :: Integral b => Identity a -> b #

floor :: Integral b => Identity a -> b #

Show a => Show (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

showsPrec :: Int -> Identity a -> ShowS #

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Ix a => Ix (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Generic (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep (Identity a) :: Type -> Type #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Semigroup a => Semigroup (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Storable a => Storable (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Bits a => Bits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

FiniteBits a => FiniteBits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Generic1 Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep1 Identity :: k -> Type #

Methods

from1 :: forall (a :: k). Identity a -> Rep1 Identity a #

to1 :: forall (a :: k). Rep1 Identity a -> Identity a #

type Rep (Identity a) 
Instance details

Defined in Data.Functor.Identity

type Rep (Identity a) = D1 ('MetaData "Identity" "Data.Functor.Identity" "base" 'True) (C1 ('MetaCons "Identity" 'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 Identity 
Instance details

Defined in Data.Functor.Identity

type Rep1 Identity = D1 ('MetaData "Identity" "Data.Functor.Identity" "base" 'True) (C1 ('MetaCons "Identity" 'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

type LabelableTIPCxt x s t a b = (s ~ t, a ~ b, Label x ~ Label a, HLens x TIP s t a b) Source #

type family LabeledOpticF (ty :: LabeledOpticType) :: (* -> *) -> Constraint Source #

Instances

Instances details
type LabeledOpticF 'LabelableLens Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticF 'LabelablePrism Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticF 'LabelableLabel Source # 
Instance details

Defined in Data.HList.Labelable

type family LabeledOpticP (ty :: LabeledOpticType) :: (* -> * -> *) -> Constraint Source #

Instances

Instances details
type LabeledOpticP 'LabelableLens Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticP 'LabelableLens = (Type -> Type -> Type) ~ ((->) :: Type -> Type -> Type)
type LabeledOpticP 'LabelablePrism Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticP 'LabelableLabel Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticP 'LabelableLabel = (Type -> Type -> Type) ~ ((->) :: Type -> Type -> Type)

type family LabeledOpticTo (ty :: LabeledOpticType) (x :: k) :: (* -> * -> *) -> Constraint Source #

Instances

Instances details
type LabeledOpticTo 'LabelablePrism (x :: k) Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticTo 'LabelablePrism (x :: k) = (Type -> Type -> Type) ~ ((->) :: Type -> Type -> Type)
type LabeledOpticTo 'LabelableLens (x :: k) Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticTo 'LabelableLens (x :: k) = (Type -> Type -> Type) ~ ((->) :: Type -> Type -> Type)
type LabeledOpticTo 'LabelableLabel (x :: k) Source # 
Instance details

Defined in Data.HList.Labelable

type LabeledOpticTo 'LabelableLabel (x :: k) = (Type -> Type -> Type) ~ LabeledTo x

Orphan instances

(to ~ LabeledTo x, ToSym (to p q) x) => HExtend (to p q) (Proxy (Lbl n ns desc ': xs)) Source #

if the proxy has Data.HList.Label3.Lbl, then everything has to be wrapped in Label to make the kinds match up.

Instance details

Associated Types

type HExtendR (to p q) (Proxy (Lbl n ns desc ': xs)) Source #

Methods

(.*.) :: to p q -> Proxy (Lbl n ns desc ': xs) -> HExtendR (to p q) (Proxy (Lbl n ns desc ': xs)) Source #

(to ~ LabeledTo x, ToSym (to p q) x) => HExtend (to p q) (Proxy (x ': xs)) Source # 
Instance details

Associated Types

type HExtendR (to p q) (Proxy (x ': xs)) Source #

Methods

(.*.) :: to p q -> Proxy (x ': xs) -> HExtendR (to p q) (Proxy (x ': xs)) Source #

(to ~ LabeledTo x, ToSym (to p q) x) => HExtend (to p q) (Proxy ('[] :: [Type])) Source #

Together with the instance below, this allows writing

makeLabelable "x y z"
p = x .*. y .*. z .*. emptyProxy

Or with HListPP

p = `x .*. `y .*. `z .*. emptyProxy

instead of

p = Proxy :: Proxy ["x","y","z"]
Instance details

Associated Types

type HExtendR (to p q) (Proxy '[]) Source #

Methods

(.*.) :: to p q -> Proxy '[] -> HExtendR (to p q) (Proxy '[]) Source #